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

[Fleet] Lack of Fleet Policy Change Audit Logs #177972

Open
christophercutajar opened this issue Mar 4, 2024 · 5 comments
Open

[Fleet] Lack of Fleet Policy Change Audit Logs #177972

christophercutajar opened this issue Mar 4, 2024 · 5 comments
Labels
Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@christophercutajar
Copy link

Describe the feature:

Currently, fleet logs audit logs when a fleet policy is updated and when that policy is deployed to an agent. However, the logs lack in highlighting what the user has changed if any changes were done and who was the user.

Describe a specific use case for the feature:

My use-case is a security use-case whereby a malicious user has managed to gain fleet access and the user disables agent tamper protection

@christophercutajar christophercutajar added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 4, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kpollich
Copy link
Member

kpollich commented Mar 5, 2024

The Fleet audit logging implementation is aligned with Kibana's core audit logging implementation. Fleet doesn't include granular change sets for change operations because no other Kibana audit logs do so. We could implement this for Fleet, but it'd be better to consult @elastic/kibana-security here, I think.

I know Elasticsearch audit logs allow for a change property that contains information about the specific change set for a given request. Perhaps we could consider supporting the same field for Kibana audit logs. Doing this for just Fleet though would introduce inconsistency, so we'd probably want to take on the large effort of updating all of Kibana's audit logging to include granular change sets if this is something we want to pursue. This would have substantial ramification on log file size, as well.

@user-987654321
Copy link

This feature is sooo badly needed - its impossible to track who updated a Policy. If a team of Fleet admins is looking after the environment no auditing is captured for the admin who created, updated a policy etc

@jeramysoucy
Copy link
Contributor

"However, the logs lack in highlighting what the user has changed if any changes were done and who was the user."

Fleet doesn't include granular change sets for change operations because no other Kibana audit logs do so

@kpollich @christophercutajar As far as I know this is correct. Kibana audit logs do not include a change set, however do include the session ID for the user that executed the change. I can bring this issue up with the team during our sync to see what the general feedback is.

@jeramysoucy
Copy link
Contributor

jeramysoucy commented Apr 29, 2024

@kpollich @christophercutajar I discussed this with the team. Being able to log a change set would add overhead to each CRUD operation - we'd need to retrieve the previous version of an object and perform a diff with the updated version. In addition, if concurrent writes are being executed on the same object we cannot be sure that the previous version retrieved is accurate (see optimistic concurrency). Pushing audit logging down to Elasticsearch might alleviate these issues, but Elasticsearch has zero context from which to create meaningful Kibana audit events.

We think a reasonable compromise could be to include the latest version, or subset thereof, of an object when an operation is audited. By tracing the audit logs, one would be able to generate the change set for each operation if needed. Due to the potentially large size of some saved objects, we thought of 3 ways to preventing runaway log file entry sizes:

  • A per-object size cap: SO's that exceed this limit would be truncated. This would be a global setting in the audit logging system.
  • SO type opt-in: the audit logger would only record the value of SO types that opt in. This would be settable during SO type registration.
  • SO type field opt-in: the audit logger would only record a subset of SO fields for a type. This would be settable during SO type registration.

I have opened an issue for our team to draft an RFC for this concept: #181946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

No branches or pull requests

5 participants