Debian 13 trixie

Elastic Stack : Install Auditbeat2025/10/16

 

Install Auditbeat that can monitor Audit actions.

[1] Install Auditbeat. Configure Elasticsearch repository before it.
root@dlp:~#
apt -y install auditbeat
[2] Configure basic settings and start Auditbeat.
root@dlp:~#
vi /etc/auditbeat/auditbeat.yml
# line 13 : set Audit action (writing rules is the same with auditctl)

- module: auditd
  audit_rules: |
    ## Define audit rules here.
    ## Create file watches (-w) or syscall audits (-a or -A). Uncomment these
    ## examples or add your own rules.

    ## If you are on a 64 bit platform, everything should be running
    ## in 64 bit mode. This rule will detect any use of the 32 bit syscalls
    ## because this might be a sign of someone exploiting a hole in the 32
    ## bit API.
    #-a always,exit -F arch=b32 -S all -F key=32bit-abi

    ## Executions.
    #-a always,exit -F arch=b64 -S execve,execveat -k exec

    ## External access (warning: these can be expensive to audit).
    #-a always,exit -F arch=b64 -S accept,bind,connect -F key=external-access

    ## Identity changes.
    #-w /etc/group -p wa -k identity
    #-w /etc/passwd -p wa -k identity
    #-w /etc/gshadow -p wa -k identity

.....
.....

# line 122 : if use Kibana, uncomment and specify output host
# if SSL is enabled on Kibana, hostname should be the same with the hostname in certs
# [username] and [password] is the admin user's one
# if using self-signed certificate, specify [ssl.verification_mode: none]

setup.kibana:
.....
  host: "https://dlp.srv.world:5601"
  protocol: "https"
  username: "elastic"
  password: "password"
  ssl.enabled: true
  ssl.verification_mode: none

# line 154 : specify output of Elasticsearch
# [username] and [password] is the admin user's one
# [ssl.certificate_authorities] is the cacert generated by Elasticsearch installation

output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://dlp.srv.world:9200"]

  protocol: "https"
  #api_key: "id:api_key"
  username: "elastic"
  password: "password"
  ssl.certificate_authorities: "/etc/elasticsearch/certs/http_ca.crt"

.....
.....

root@dlp:~#
vi /etc/auditbeat/auditbeat.reference.yml
# line 34 : basic settings for auditd module

- module: auditd
  resolve_ids: true
  failure_mode: silent
  backlog_limit: 8196
  rate_limit: 0
  include_raw_message: false
  include_warnings: false
  audit_rules: |

.....
.....

# line 1472 : if use Kibana, uncomment and specify output host
# if SSL is enabled on Kibana, uncomment ssl related lines
# [username] and [password] is the admin user's one
# if using self-signed certificate, specify [ssl.verification_mode: none]
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "https://dlp.srv.world:5601"

  # Optional protocol and basic auth credentials.
  protocol: "https"
  username: "elastic"
  password: "password"

  # Optional HTTP Path
  #path: ""

  # Use SSL settings for HTTPS. Default is true.
  ssl.enabled: true

.....
.....

  # after very careful consideration. It is primarily intended as a temporary
  # diagnostic mechanism when attempting to resolve TLS errors; its use in
  # production environments is strongly discouraged.
  # The default value is full.
  ssl.verification_mode: none

root@dlp:~#
systemctl enable --now auditbeat
[3] Verify status the data has been collected normally.
# index list

root@dlp:~#
curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/_cat/indices?v

health status index                                                              uuid                   pri rep docs.count docs.deleted store.size pri.store.size dataset.size
green  open   .internal.alerts-transform.health.alerts-default-000001            WYIrcziPSB61k_EjlRvNWA   1   0          0            0       249b           249b         249b
yellow open   .ds-metricbeat-9.1.5-2025.10.16-000001                             iFHmlkWqQYuxJeK9LM5nNA   1   1       2838            0      3.2mb          3.2mb        3.2mb
green  open   .internal.alerts-observability.logs.alerts-default-000001          AWecw7NwQuGi6NSUH8d5hA   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-observability.uptime.alerts-default-000001        B69GpuDOTteviBM8maoY9w   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-ml.anomaly-detection.alerts-default-000001        kB22vDWkRsiGMn2uwjz7pQ   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-observability.slo.alerts-default-000001           RdloOOlgTq-xz9iaWKTYXw   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-default.alerts-default-000001                     O3rAr2zSQR-cwJcyFUTRBw   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-streams.alerts-default-000001                     TmcpmlgvTACt9RLIO3ewjA   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-observability.apm.alerts-default-000001           Bb2-R3ctRw-DR0UX3ohWgw   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-security.attack.discovery.alerts-default-000001   Zr0KNzeVRLyRyhu4FIsmfg   1   0          0            0       249b           249b         249b
yellow open   .ds-packetbeat-9.1.5-2025.10.16-000001                             JG5URGXZSz65riuKhGU02A   1   1       4549            0      1.8mb          1.8mb        1.8mb
green  open   .internal.alerts-observability.metrics.alerts-default-000001       s9kwcco-SKKkQUElzx0sDw   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-ml.anomaly-detection-health.alerts-default-000001 EtkLfH1fTP2AdYngE3dH8Q   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-observability.threshold.alerts-default-000001     I576fuZFQ-We6AT7DOjrIQ   1   0          0            0       249b           249b         249b
yellow open   .ds-auditbeat-9.1.5-2025.10.16-000001                              irj-0ECMSty5i6-GyOg94g   1   1       1472            0    815.5kb        815.5kb      815.5kb
green  open   .internal.alerts-security.alerts-default-000001                    HfszRaZ5TtafW3W9kDH5Ow   1   0          0            0       249b           249b         249b
green  open   .internal.alerts-dataset.quality.alerts-default-000001             9SiuGdcAQnCl6DI-HRLowg   1   0          0            0       249b           249b         249b
yellow open   test_index                                                         9JxiZ5C7QXq2fC1UliIOCA   1   1          1            0      6.7kb          6.7kb        6.7kb
green  open   .internal.alerts-stack.alerts-default-000001                       x0vSiLWjSPSdiKgDj1WEBA   1   0          0            0       249b           249b         249b

# document list on the index

root@dlp:~#
curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200/.ds-auditbeat-9.1.5-2025.10.16-000001/_search?pretty

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1521,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : ".ds-auditbeat-9.1.5-2025.10.16-000001",
        "_id" : "njN66pkBV9tUpIIAglwT",
        "_score" : 1.0,
        "_source" : {
          "@timestamp" : "2025-10-16T00:45:11.286Z",
          "client" : {
            "domain" : "dlp.srv.world",
            "ip" : "10.0.0.30",
            "port" : 39996,
            "packets" : 1,
            "bytes" : 70
          },
          "destination" : {
.....
.....
[4] If Kibana is running, it's possible to import data to sample Dashboards.
root@dlp:~#
auditbeat setup --dashboards

Loading dashboards (Kibana must be running and reachable)
Loaded dashboards

Matched Content