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

VAULT-26466: audit - include correlation ID headers by default #26777

Merged
merged 4 commits into from
May 8, 2024

Conversation

peteski22
Copy link

@peteski22 peteski22 commented May 2, 2024

Summary

This PR changes the behavior of Vault such that when an audit device attempts to log an incoming request which contains the following headers:

  • Correlation-ID
  • X-Correlation-ID

The headers, by default will appear in the audit log without being HMAC'ed.

Docs

Docs PR: #26778 (covers how this feature works and how to HMAC the values if required).

Manual testing

using /sys/config/auditing/request-headers/ endpoint:

No setting for x-correlation-id or correlation-id headers

Test Expected Result
other headers in request nothing shown
correlation-id in request correlation-id shown in audit log raw
x-correlation-id in request x-correlation-id shown in audit log raw

Setting for x-correlation-id and correlation-id headers (no HMAC setting - defaults to false)

Test Expected Result
other headers in request nothing shown
correlation-id in request correlation-id shown in audit log raw
x-correlation-id in request x-correlation-id shown in audit log raw

Setting for x-correlation-id and correlation-id headers (HMAC setting: true)

Test Expected Result
other headers in request nothing shown
correlation-id in request correlation-id shown in audit log HMAC'ed
x-correlation-id in request x-correlation-id shown in audit log HMAC'ed

Setting for x-correlation-id and correlation-id headers (HMAC setting: false)

Test Expected Result
other headers in request nothing shown
correlation-id in request correlation-id shown in audit log raw
x-correlation-id in request x-correlation-id shown in audit log raw

Example:

curl -H "X-Correlation-ID: 123-i-am-a-correlation-id-abc" -H "X-Vault-Token: hvs.du7qkklexGO3A4Ya1LjfLjJ9" http://127.0.0.1:8200/v1/sys/config/auditing/request-headers/x-correlation-id --data '{ "hmac": false }'

image

@peteski22 peteski22 added core/audit hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed labels May 2, 2024
@peteski22 peteski22 modified the milestones: 1.17.0, 1.17.0-rc May 2, 2024
Copy link

github-actions bot commented May 2, 2024

CI Results:
All Go tests succeeded! ✅

@peteski22 peteski22 changed the title VAULT-26466: audit - Include correlation ID headers by default for audit VAULT-26466: audit - Include correlation ID headers by default May 2, 2024
@peteski22 peteski22 changed the title VAULT-26466: audit - Include correlation ID headers by default VAULT-26466: audit - include correlation ID headers by default May 3, 2024
@peteski22 peteski22 marked this pull request as ready for review May 3, 2024 13:37
Copy link

github-actions bot commented May 3, 2024

Build Results:
All builds succeeded! ✅

audit/headers.go Outdated Show resolved Hide resolved
@@ -0,0 +1,4 @@
```release-note:change
audit: breaking change - Vault now allows audit logs to contain 'correlation-id' and 'x-correlation-id' headers when they
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ What is the user impact given the breaking change?

Copy link
Author

Choose a reason for hiding this comment

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

There's a corresponding docs PR that tries to call out the change: #26778.

The Vercel deployment currently lives here: https://vault-n5poe4e19-hashicorp.vercel.app/vault/docs/audit#audit-request-headers but could change if there are any more pushes to that branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for the clarification!

@peteski22 peteski22 merged commit d66461e into main May 8, 2024
83 checks passed
@peteski22 peteski22 deleted the peteski22/VAULT-26466/audit/x-correlation-id branch May 8, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/audit hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants