Skip to content

feat: add object storage archival docs for audit logs - #4992

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
07-07-docs_object_storage_for_audit_logs_docs
Jul 9, 2026
Merged

feat: add object storage archival docs for audit logs#4992
Pratham-Mishra04 merged 1 commit into
devfrom
07-07-docs_object_storage_for_audit_logs_docs

Conversation

@impoiler

@impoiler impoiler commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents the new object storage archival feature for audit logs, which enables continuous mirroring of audit events to S3-compatible buckets (S3, GCS, MinIO, R2) for long-term, off-box, compliance-grade retention alongside the existing database store.

Changes

  • Added object_storage to the audit log configuration table, with a clarifying note that retention_days only governs database retention and does not affect archived objects.
  • Added a new "Object storage archival" capability row to the feature overview table.
  • Added a full "Archiving to Object Storage" section covering:
    • The dual-write model (database remains source of truth; object storage is a complete mirror, not an offload).
    • A comparison table distinguishing database vs. object storage roles, retention, and population behavior.
    • Object key structure ({prefix}/audit-logs/{YYYY}/{MM}/{DD}/{HH}/{batchID}.jsonl.gz) with per-segment explanations.
    • Durability guarantees: uploads are synchronous within the flush, failures are logged but never block request handling or database writes.
    • Tabbed configuration examples for S3/MinIO/R2 and GCS.
    • A full field reference table for all object_storage sub-fields, including credential chain behavior and MinIO path-style requirements.
    • A note distinguishing this from Log Exports, where object storage offloads payload data rather than mirroring it.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Review the rendered documentation to confirm:

  • The new "Archiving to Object Storage" section renders correctly with tabs, tables, notes, and info callouts.
  • The object_storage field appears in the configuration table with a working anchor link to the new section.
  • The retention_days description correctly references the archiving section.
  • Tab groups for S3 and GCS configuration examples display and switch correctly.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

Configuration examples demonstrate use of env. prefixes for secrets (AUDIT_HMAC_KEY, AUDIT_S3_SECRET, AUDIT_GCS_CREDENTIALS), reinforcing that credentials should never be hardcoded in config files. The archival bucket can be configured as write-once/WORM via S3 Object Lock for tamper-evident compliance retention.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fdf8a93-2209-4fff-81fe-fd3a2a0f16c9

📥 Commits

Reviewing files that changed from the base of the PR and between 8c11aeb and 5522720.

📒 Files selected for processing (1)
  • docs/enterprise/audit-logs.mdx
📝 Walkthrough

Walkthrough

This PR updates the audit logs documentation to describe object storage archival for audit events. It adds feature and configuration references, explains dual-write archival behavior, and documents backend examples plus supported object_storage fields.

Changes

Object Storage Archival Documentation

Layer / File(s) Summary
Feature overview and config field intro
docs/enterprise/audit-logs.mdx
Adds a Key Features row for object storage archival and clarifies retention_days scope alongside the new optional object_storage field.
Archival behavior and mechanics
docs/enterprise/audit-logs.mdx
Documents database/object storage roles, dual-write archival flow, batching, gzip JSONL object creation, key naming, and best-effort upload failure handling.
Configuration examples and fields reference
docs/enterprise/audit-logs.mdx
Adds S3/MinIO/R2 and GCS examples, supported object_storage fields, overlap guidance, and startup behavior when object storage is unavailable.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding object storage archival documentation for audit logs.
Description check ✅ Passed The description matches the template well and includes summary, changes, type, affected areas, testing, breaking changes, security, and checklist.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-07-docs_object_storage_for_audit_logs_docs

Comment @coderabbitai help to get the list of available commands.

@impoiler impoiler self-assigned this Jul 7, 2026
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch from 084ae00 to f8b9147 Compare July 8, 2026 10:06
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from b7ffb52 to 32efb42 Compare July 8, 2026 10:06
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch from f8b9147 to d570383 Compare July 9, 2026 05:10
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 32efb42 to f7cfc27 Compare July 9, 2026 05:10
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch from d570383 to adda25b Compare July 9, 2026 05:25
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from f7cfc27 to ab24984 Compare July 9, 2026 05:25
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from ab24984 to 7df7227 Compare July 9, 2026 06:30
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch 2 times, most recently from 98750cd to ef9f232 Compare July 9, 2026 07:22
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 7df7227 to 8c146d6 Compare July 9, 2026 07:22
@impoiler
impoiler marked this pull request as ready for review July 9, 2026 07:22
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 8c146d6 to 2165d26 Compare July 9, 2026 07:23
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch from ef9f232 to c8214e9 Compare July 9, 2026 07:23
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

This is close, but I would fix the docs before merging.

  • The archive is still described as complete before the same section explains that failed uploads leave bucket gaps.
  • The S3 credential table still omits required pairing rules that the config schema enforces at startup.

docs/enterprise/audit-logs.mdx

Important Files Changed

Filename Overview
docs/enterprise/audit-logs.mdx Adds the audit-log object-storage archival guide, but the archive completeness and credential dependency wording still need fixes.

Reviews (5): Last reviewed commit: "docs: object storage for audit logs docs" | Re-trigger Greptile

Comment thread docs/enterprise/audit-logs.mdx
Comment thread docs/enterprise/audit-logs.mdx
Comment thread docs/enterprise/audit-logs.mdx
@impoiler
impoiler force-pushed the 07-07-feat_object_storage_for_audit_logs branch from 354a812 to 40b27ee Compare July 9, 2026 07:50
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 2165d26 to 4e49611 Compare July 9, 2026 07:50
Comment thread docs/enterprise/audit-logs.mdx Outdated
Comment thread docs/enterprise/audit-logs.mdx
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 9, 2026
@impoiler
impoiler force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 4e49611 to 040fedc Compare July 9, 2026 08:06
Comment thread docs/enterprise/audit-logs.mdx
Comment on lines +186 to +187
| `secret_access_key` | string | No | AWS secret access key. Supports `env.` references. |
| `session_token` | string | No | STS temporary session token. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Credential Dependencies Missing

The table still makes secret_access_key and session_token look independently optional. The config schema requires secret_access_key to be paired with access_key_id, and requires session_token to be paired with both static credential fields. With the current wording, an operator can set only secret_access_key, or only session_token, and get a config validation failure at startup even though the table does not warn about that dependency.

Suggested change
| `secret_access_key` | string | No | AWS secret access key. Supports `env.` references. |
| `session_token` | string | No | STS temporary session token. |
| `secret_access_key` | string | No | AWS secret access key. Supports `env.` references. Requires `access_key_id`. |
| `session_token` | string | No | STS temporary session token. Requires both `access_key_id` and `secret_access_key`. |

Rule Used: transports/config.schema.json is the source of tru... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Pratham-Mishra04 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Jul 9, 12:16 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 9, 12:43 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 9, 12:44 PM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 07-07-feat_object_storage_for_audit_logs to graphite-base/4992 July 9, 2026 12:39
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/4992 to dev July 9, 2026 12:42
@Pratham-Mishra04
Pratham-Mishra04 dismissed coderabbitai[bot]’s stale review July 9, 2026 12:42

The base branch was changed.

@Pratham-Mishra04
Pratham-Mishra04 requested a review from a team as a code owner July 9, 2026 12:42
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-07-docs_object_storage_for_audit_logs_docs branch from 8c11aeb to 5522720 Compare July 9, 2026 12:42
@Pratham-Mishra04
Pratham-Mishra04 merged commit c1dc9bf into dev Jul 9, 2026
10 of 13 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 07-07-docs_object_storage_for_audit_logs_docs branch July 9, 2026 12:44

By default, audit events live only in the database, which is the source of truth for everything you see in the dashboard (viewing, filtering, HMAC verification, and export). Databases, however, are not ideal for multi-year compliance retention or off-box durability.

When you configure `object_storage`, Bifrost **additionally** writes every audit event to an S3-compatible bucket (S3, GCS, MinIO, R2) as it is recorded. This is a dual-write, not an offload: the full event goes to **both** the database and object storage, so each store holds a complete, independent copy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Archive Completeness Overstated
This still describes object storage as a complete independent copy, but the callout below says failed uploads are only logged and the batch is missing from the bucket. An operator can rely on this paragraph for complete long-term retention, then lose a bucket batch during a transient S3/GCS failure while the database write still succeeds. Please qualify this sentence with the best-effort behavior so the completeness guarantee matches the documented failure path.

Comment on lines +186 to +187
| `secret_access_key` | string | No | AWS secret access key. Supports `env.` references. |
| `session_token` | string | No | STS temporary session token. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Credential Pairing Missing
These rows still make secret_access_key and session_token look independently optional. The config schema requires secret_access_key to be paired with access_key_id, and requires session_token to be paired with both static credential fields. A user can follow this table, set only secret_access_key or only session_token, and hit config validation failure at startup even though the dependency was not documented on the row they used.

Rule Used: transports/config.schema.json is the source of tru... (source)

akshaydeo pushed a commit that referenced this pull request Jul 14, 2026
## Summary

Documents the new object storage archival feature for audit logs, which enables continuous mirroring of audit events to S3-compatible buckets (S3, GCS, MinIO, R2) for long-term, off-box, compliance-grade retention alongside the existing database store.

## Changes

- Added `object_storage` to the audit log configuration table, with a clarifying note that `retention_days` only governs database retention and does not affect archived objects.
- Added a new "Object storage archival" capability row to the feature overview table.
- Added a full "Archiving to Object Storage" section covering:
  - The dual-write model (database remains source of truth; object storage is a complete mirror, not an offload).
  - A comparison table distinguishing database vs. object storage roles, retention, and population behavior.
  - Object key structure (`{prefix}/audit-logs/{YYYY}/{MM}/{DD}/{HH}/{batchID}.jsonl.gz`) with per-segment explanations.
  - Durability guarantees: uploads are synchronous within the flush, failures are logged but never block request handling or database writes.
  - Tabbed configuration examples for S3/MinIO/R2 and GCS.
  - A full field reference table for all `object_storage` sub-fields, including credential chain behavior and MinIO path-style requirements.
  - A note distinguishing this from Log Exports, where object storage offloads payload data rather than mirroring it.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Review the rendered documentation to confirm:
- The new "Archiving to Object Storage" section renders correctly with tabs, tables, notes, and info callouts.
- The `object_storage` field appears in the configuration table with a working anchor link to the new section.
- The `retention_days` description correctly references the archiving section.
- Tab groups for S3 and GCS configuration examples display and switch correctly.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

Configuration examples demonstrate use of `env.` prefixes for secrets (`AUDIT_HMAC_KEY`, `AUDIT_S3_SECRET`, `AUDIT_GCS_CREDENTIALS`), reinforcing that credentials should never be hardcoded in config files. The archival bucket can be configured as write-once/WORM via S3 Object Lock for tamper-evident compliance retention.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## Summary

Documents the new object storage archival feature for audit logs, which enables continuous mirroring of audit events to S3-compatible buckets (S3, GCS, MinIO, R2) for long-term, off-box, compliance-grade retention alongside the existing database store.

## Changes

- Added `object_storage` to the audit log configuration table, with a clarifying note that `retention_days` only governs database retention and does not affect archived objects.
- Added a new "Object storage archival" capability row to the feature overview table.
- Added a full "Archiving to Object Storage" section covering:
  - The dual-write model (database remains source of truth; object storage is a complete mirror, not an offload).
  - A comparison table distinguishing database vs. object storage roles, retention, and population behavior.
  - Object key structure (`{prefix}/audit-logs/{YYYY}/{MM}/{DD}/{HH}/{batchID}.jsonl.gz`) with per-segment explanations.
  - Durability guarantees: uploads are synchronous within the flush, failures are logged but never block request handling or database writes.
  - Tabbed configuration examples for S3/MinIO/R2 and GCS.
  - A full field reference table for all `object_storage` sub-fields, including credential chain behavior and MinIO path-style requirements.
  - A note distinguishing this from Log Exports, where object storage offloads payload data rather than mirroring it.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Review the rendered documentation to confirm:
- The new "Archiving to Object Storage" section renders correctly with tabs, tables, notes, and info callouts.
- The `object_storage` field appears in the configuration table with a working anchor link to the new section.
- The `retention_days` description correctly references the archiving section.
- Tab groups for S3 and GCS configuration examples display and switch correctly.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

Configuration examples demonstrate use of `env.` prefixes for secrets (`AUDIT_HMAC_KEY`, `AUDIT_S3_SECRET`, `AUDIT_GCS_CREDENTIALS`), reinforcing that credentials should never be hardcoded in config files. The archival bucket can be configured as write-once/WORM via S3 Object Lock for tamper-evident compliance retention.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants