Skip to content

Audit log entry stale username field #52314

Open
@albertzaharovits

Description

@albertzaharovits

The username audit field, which is present in most audit entries, might not reflect the authentication status when the entry is recorded.

Actions are first authenticated, and then continue execution (after authorization) using the point-in-time authentication. This is not a problem for one-off short lived actions.

But there are two broad situation where this behavior is confusing:

  • when ML datafeed and watcher search input (possibly other, eg rollup) background jobs are audited, the username field reflects the authentication that has been performed when the job has been created.
  • audited actions when using API keys, will show up with the username that created the API key.

These cases are confusing because the authenticating users might change (have a different set of roles) or might even be deleted, yet they still show up in the audit log as active.

Auditing the user roles, see #30032, and documenting this limitation might be enough?

Otherwise, I think, the "best" fix is to audit the creation of background jobs and API keys, attribute them an username-like identifier (which is included in the audit entry for the job/key creation), and use that identifier in all subsequent actions associated with the job/key. But there are more details we need to has out, for example the username (unlike the username-like identifier) allows for easiest attribution (when the authentication is not stale), so maybe keeping the field and signaling in some other way that the user might have changed is a better way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions