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

Emit trace.id into audit logs #82849

Merged
merged 11 commits into from
Jan 25, 2022
Merged

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Jan 20, 2022

since #74210 ES is emitting trace.id into its logs, but it did not emit it into audit logs.
This commit adds trace.id into audit logging.

@pgomulka pgomulka added >enhancement :Core/Infra/Logging Log management and logging utilities :Security/Audit X-Pack Audit logging v8.0.0 v8.1.0 v7.17.0 labels Jan 20, 2022
@pgomulka pgomulka self-assigned this Jan 20, 2022
@elasticmachine elasticmachine added Team:Security Meta label for security team Team:Core/Infra Meta label for core/infra team labels Jan 20, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@pgomulka
Copy link
Contributor Author

this can be considered a >bug rather than >enhancement as we clearly forgot about this

@elasticsearchmachine
Copy link
Collaborator

Hi @pgomulka, I've created a changelog YAML for you.

@pgomulka pgomulka removed the :Core/Infra/Logging Log management and logging utilities label Jan 20, 2022
@elasticmachine elasticmachine removed the Team:Core/Infra Meta label for core/infra team label Jan 20, 2022
@pgomulka pgomulka added the :Core/Infra/Logging Log management and logging utilities label Jan 20, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jan 20, 2022
@pgomulka pgomulka removed the :Core/Infra/Logging Log management and logging utilities label Jan 20, 2022
@elasticmachine elasticmachine removed the Team:Core/Infra Meta label for core/infra team label Jan 20, 2022
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@albertzaharovits albertzaharovits left a comment

Choose a reason for hiding this comment

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

LGTM Thanks for the Security contrib!

Ideally we should add to the docs in x-pack/docs/en/security/auditing/event-types.asciidoc to describe the new field (also drop a line in log4j2.properties with a short description as well).

Also, reviewing this I noticed that the response, http tracer and search slowlog (and possibly other places as well), do not contain a trace.id. It might be worth a ES-wide review of where the trace.id should show up.

@pgomulka pgomulka added the auto-backport Automatically create backport pull requests when merged label Jan 25, 2022
@pgomulka pgomulka merged commit 533f6e0 into elastic:master Jan 25, 2022
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Jan 25, 2022
since elastic#74210 ES is emitting trace.id into its logs, but it did not emit it into audit logs.
This commit adds trace.id into audit logging.
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.0
7.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 82849

pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Jan 25, 2022
since elastic#74210 ES is emitting trace.id into its logs, but it did not emit it into audit logs.
This commit adds trace.id into audit logging.
pgomulka added a commit that referenced this pull request Jan 25, 2022
Backports the following commits to 8.0:

Emit trace.id into audit logs (Emit trace.id into audit logs #82849)
pgomulka added a commit that referenced this pull request Jan 25, 2022
since #74210 ES is emitting trace.id into its logs, but it did not emit it into audit logs.
This commit adds trace.id into audit logging.
backport #82849
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Jan 26, 2022
* upstream/master: (762 commits)
  [DOCS] Add note to that log4j customization is outside the support scope (elastic#82668)
  Batch Index Settings Update Requests (elastic#82896)
  [DOCS] Delete pipeline containing stored script (elastic#83102)
  Try again to fix changelog areas after reorg (elastic#83100)
  Bind to non-localhost for transport in some cases (elastic#82973)
  [DOCS] Reuse multi-level `join` warning (elastic#82976)
  Remove unnecessary CopyOnWriteHashMap class (elastic#83040)
  Adjust changelog categories after reorg (elastic#83087)
  [DOCS] Fix typo in `action.destructive_requires_name` breaking change (elastic#83085)
  Stack Monitoring: Add Enterprise Search monitoring index templates (elastic#82743)
  [DOCS] Fix stored script example snippet (elastic#83056)
  [DOCS] Re-add network traffic para to `term` query (elastic#83047)
  [DOCS] Rename example stored script (elastic#83054)
  [ML][DOCS] Add Trained model APIs to the REST APIs index (elastic#82791)
  [ML] Update running process when global calendar changes (elastic#83044)
  [Transform] Fix condition on which the transform stops processing buckets (elastic#82852)
  [DOCS] Fixes field names in ML sum functions. (elastic#83048)
  [ML] fix NLP tokenization never_split handling around punctuation (elastic#82982)
  Construct dynamic updates directly via object builders (elastic#81449)
  Emit trace.id into audit logs (elastic#82849)
  ...

# Conflicts:
#	client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java
#	client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ILMDocumentationIT.java
#	server/src/main/java/org/elasticsearch/action/admin/indices/rollover/Condition.java
#	server/src/test/java/org/elasticsearch/action/admin/indices/rollover/ConditionTests.java
#	x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java
#	x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleTypeTests.java
#	x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >enhancement :Security/Audit X-Pack Audit logging Team:Security Meta label for security team v7.17.0 v8.0.0-rc2 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants