Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auditbeat] Allow flushing of auditd rules #8280

Closed
kholia opened this issue Sep 11, 2018 · 6 comments
Closed

[Auditbeat] Allow flushing of auditd rules #8280

kholia opened this issue Sep 11, 2018 · 6 comments

Comments

@kholia
Copy link

kholia commented Sep 11, 2018

Auditbeat doesn't flush auditd rules upon daemon exit. This leads to /var/log/kern.log getting flooded with all the audit messages.

Furthermore, it seems that auditbeat doesn't have a CLI option to flush the auditd rules.

It seems that auditd too doesn't flush rules on daemon exit.

# systemctl start auditd

# auditctl -l
No rules

# auditctl -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time_change
# auditctl -l
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=time_change

# systemctl stop auditd

# auditctl -l
-a always,exit -F arch=b64 -S adjtimex,settimeofday -F key=time_change

If flushing rules on daemon exit is not appropriate, then the auditbeat CLI shoould at least provide a way to flush the rules manually.

Details,

  • Version: Auditbeat 6.4.0
  • Operating System: Ubuntu 16.04 LTS / 18.04 LTS
@kholia
Copy link
Author

kholia commented Sep 11, 2018

Minimal configuration file,

#==========================  Modules configuration =============================
auditbeat.modules:

- module: auditd
  # Load audit rules from separate files. Same format as audit.rules(7).
  # audit_rule_files: [ '${path.config}/audit.rules.d/*.conf' ]
  audit_rules: |
    ## Executions.
    -a always,exit -F arch=b64 -S execve,execveat -k exec

#==================== Elasticsearch template setting ==========================
setup.template.settings:
  index.number_of_shards: 3
  #index.codec: best_compression
  #_source.enabled: false

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
  1. Start auditbeat with this configuration.

  2. Stop auditbeat.

  3. Run sudo ./auditbeat show auditd-rules, which shows

    -a never,exit -S all -F pid=31859
    -a always,exit -F arch=b64 -S execve,execveat -F key=exec
    

@urso
Copy link

urso commented Jan 3, 2020

@andrewkroh any idea?

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@andrewkroh
Copy link
Member

I think this would be a good option to add to Auditbeat. And also add a subcommand to clear the rules (#11825).

@rbabyuk-vs
Copy link

we faced this problem as well, this caused huge problems. I vote for mechanism to flush rules by using AB itself.

@botelastic
Copy link

botelastic bot commented Jan 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Jan 27, 2022
@botelastic botelastic bot closed this as completed Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants