Skip to content

Conversation

@xTeixeira
Copy link
Collaborator

If the audit daemon PID is not set, register our own PID as audit daemon.

Fixes syslog getting flooded with audit events when auditd is not running.

If the audit daemon PID is not set, register our own PID as audit daemon.
Copy link

@djoreilly djoreilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the mock client needs the method too

$ go test -v ./vql/linux/audit
# www.velocidex.com/golang/velociraptor/vql/linux/audit [www.velocidex.com/golang/velociraptor/vql/linux/audit.test]
vql/linux/audit/audit_service_test.go:136:77: cannot use self.client (variable of type *mockCommandClient) as commandClient value in argument to newAuditService: *mockCommandClient does not implement commandClient (missing method SetPID)
FAIL	www.velocidex.com/golang/velociraptor/vql/linux/audit [build failed]
FAIL

@jeffmahoney
Copy link
Member

There’s more going on here. If you claim the audit pid, you own the unicast socket, which is preferable to the multicast socket. The unicast socket, in the kernel, has all the logic to queue and report dropped events. The multicast socket is lossy.

You need to switch to the unicast socket if it’s available, switch back if it’s not, catch reconfiguration events to detect these changes. It may need architectural changes.

That’s why it was a reach goal. It’s not as simple as claiming to be the audit pid.

@xTeixeira xTeixeira marked this pull request as draft February 2, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants