Auditbeat无法在CentO 7中接收身份验证事件

时间:2019-01-17 11:44:16

标签: elasticsearch elastic-stack elastic-beats

我正在尝试将与CentOS 7有关的身份验证发送给Elasticsearch。奇怪的是,我没有收到任何身份验证事件。

当我运行 debug命令 auditbeat -c auditbeat.conf -d -e "*"时,发现如下内容:

 {
      "@timestamp": "2019-01-15T11:54:37.246Z",
      "@metadata": {
        "beat": "auditbeat",
        "type": "doc",
        "version": "6.4.0"
      },
      "error": {
        "message": "failed to set audit PID. An audit process is already running (PID 68504)"
      },
      "beat": {
        "name": "env-cs-westus-devtest-66-csos-logs-es-master-0",
        "hostname": "env-cs-westus-devtest-66-csos-logs-es-master-0",
        "version": "6.4.0"
      },
      "host": {
        "name": "env-cs-westus-devtest-66-csos-logs-es-master-0"
      },
      "event": {
        "module": "auditd"
      }
    }

还存在如下错误行:

Failure receiving audit events {"error": "failed to set audit PID. An audit process is already running (PID 68504)"}

机器详细信息

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Audibeat配置文件

#================================ General ======================================
fields_under_root: False
queue:
  mem:
    events: 4096
    flush:
      min_events: 2048
      timeout: 1s
max_procs: 1
max_start_delay: 10s
#================================= Paths ======================================
path:
  home: "/usr/share/auditbeat"
  config: "/etc/auditbeat"
  data: "/var/lib/auditbeat"
  logs: "/var/log/auditbeat/auditbeat.log"
#============================  Config Reloading ================================
config:
  modules:
    path: ${path.config}/conf.d/*.yml
    reload:
      period: 10s
      enabled: False
#==========================  Modules configuration =============================
auditbeat.modules:
#----------------------------- Auditd module -----------------------------------
- module: auditd
  resolve_ids: True
  failure_mode: silent
  backlog_limit: 8196
  rate_limit: 0
  include_raw_message: True
  include_warnings: True
  audit_rules: |
    -w /etc/group -p wa -k identity
    -w /etc/passwd -p wa -k identity
    -w /etc/gshadow -p wa -k identity
    -w /etc/shadow -p wa -k identity
    -w /etc/security/opasswd -p wa -k identity
    -a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EACCES -k access
    -a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EPERM -k access
    -a always,exit -F dir=/home -F uid=0 -F auid>=1000 -F auid!=4294967295 -C auid!=obj_uid -F key=power-abuse
    -a always,exit -F arch=b64 -S setuid -F a0=0 -F exe=/usr/bin/su -F key=elevated-privs
    -a always,exit -F arch=b32 -S setuid -F a0=0 -F exe=/usr/bin/su -F key=elevated-privs
    -a always,exit -F arch=b64 -S setresuid -F a0=0 -F exe=/usr/bin/sudo -F key=elevated-privs
    -a always,exit -F arch=b32 -S setresuid -F a0=0 -F exe=/usr/bin/sudo -F key=elevated-privs
    -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -F key=elevated-privs
    -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -F key=elevated-privs
#----------------------------- File Integrity module -----------------------------------
- module: file_integrity
  paths:
    - /bin
    - /usr/bin
    - /sbin
    - /usr/sbin
    - /etc
    - /home/jenkins
  exclude_files:
    - (?i)\.sw[nop]$
    - ~$
    - /\.git($|/)
  scan_at_start: True
  scan_rate_per_sec: 50 MiB
  max_file_size: 100 MiB
  hash_types: [sha1]
  recursive: False
#================================ Outputs ======================================
#-------------------------- Elasticsearch output -------------------------------
output.elasticsearch:
  enabled: True
  hosts:
    - x.x.x:9200
  compression_level: 0
  protocol: "http"
  worker: 1
  bulk_max_size: 50
  timeout: 90
#================================ Logging ======================================
logging:
  level: "info"
  selectors: ["*"]
  to_syslog: False
  to_eventlog: False
  metrics:
    enabled: True
    period: 30s
  to_files: True
  files:
    path: /var/log/auditbeat
    name: "auditbeat"
    rotateeverybytes: 10485760
    keepfiles: 7
    permissions: 0600
  json: False

Auditbeat版本 auditbeat版本6.4.0(amd64),libbeat 6.4.0

有人遇到过类似的问题并得到了解决吗?

注意:此用于Auditbeat的配置成功捕获了Ubuntu的身份验证事件

1 个答案:

答案 0 :(得分:0)

因此,我在Elastic Beats论坛上发布了相同的内容,并找到了解决方案。您可以找到相同的here

根据他们的建议,关闭审核的服务将使Audibeat捕获审核事件。我尝试了同样的方法,它为我工作。但是我不确定关闭审计的含义。因此,我可能会切换到基于Filebeat的解决方案。