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 · 16 comments
Open

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

christophercutajar opened this issue Mar 4, 2024 · 16 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

@nimarezainia
Copy link
Contributor

@kpollich I think we are blocked here until the RFC is complete.

@jeramysoucy I was wondering if there are any updates on the RFC you created?

@jeramysoucy
Copy link
Contributor

I was wondering if there are any updates on the RFC you created?

@nimarezainia This task is in our backlog, but we have not scheduled it yet. Could you give us a sense of the level of urgency of your issue? Is this directly impacting customers?

@nimarezainia
Copy link
Contributor

I was wondering if there are any updates on the RFC you created?

@nimarezainia This task is in our backlog, but we have not scheduled it yet. Could you give us a sense of the level of urgency of your issue? Is this directly impacting customers?

Please see the comments above, it's a sub-optimal UX as it makes sense for users wanting to know what changed at a granular level.

@jeramysoucy
Copy link
Contributor

Is this issue essentially describing the same request? #152711

@kpollich
Copy link
Member

Is this issue essentially describing the same request? #152711

Yes I would say that is accurate

@jeramysoucy
Copy link
Contributor

@kpollich Can we close that one as a duplicate of this one?

@nicpenning
Copy link

👀

@nicpenning
Copy link

nicpenning commented Sep 19, 2024

Just checking in on the status of this. Is there any audit logs happening today per user?

These are some of the questions we want to answer:

Who upgraded what agents (and when)?
Who upgraded integrations (and when)?
Who modified and integration and what was changed in the integration (and when)?
Who moved an agent to what policy (and when)?

@jeramysoucy
Copy link
Contributor

jeramysoucy commented Sep 20, 2024

@nicpenning

Just checking in on the status of this. Is there any audit logs happening today per user?

If audit logs are enabled, they will contain logs for any actions requested for saved objects and will include the user ID that issued the action.

These are some of the questions we want to answer:
Who upgraded what agents (and when)?
Who upgraded integrations (and when)?

You should be able to determine this now with existing audit logs, given that there is a specific action and specific saved object that correlates to an agent or integration upgrade. The logs are timestamped and include the action, ID of the saved object, and ID of the user.

Who modified and integration and what was changed in the integration (and when)?
Who moved an agent to what policy (and when)?

Audit logs do not include the specific granular changes made to saved object attributes. The audit logger provides a security function in Kibana - its purpose is to log access/actions to objects/data to provide authorization traceability.

A change log feature has been in discussion for some time (with the @elastic/appex-sharedux team and now also in AppEx Platform Security), and would server higher-level purposes compared to the audit logger. It requires additional context and encompasses a much broader scope. We had been looking what changes to the audit logger might make a subset of these capabilities possible, but determined that it may not be the right tool for the job. @bitzandeb has been compiling the needs for change logging, and how/where it would be utilized so that we can determine an appropriate solution. Let's make sure Fleet is involved in this discussion.

cc @legrego to keep me honest here

@nicpenning
Copy link

Okay, great to hear some of this has been implemented! Could you point me in the direction of the docs to.setup audit logging? I am unsure if this is Elasticsearch, Kibana or other parts of the stack auditing.

@kpollich
Copy link
Member

@nicpenning - https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-settings + https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html should cover setting up audit logging, and detail the available fields that are logged.

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

7 participants