Skip to content

RFC: audit logging - #68384

Open
vshankar wants to merge 5 commits into
ceph:mainfrom
vshankar:wip-audit-logs
Open

vshankar wants to merge 5 commits into
ceph:mainfrom
vshankar:wip-audit-logs

Conversation

@vshankar

@vshankar vshankar commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

The mon -> mgr audit message is now structured so that the mgr does not have to parse the audit string for things like entity, from, return value, state, etc. The auditman module provides interfaces to query the audit records and (for now) handles the ingestion of mon audit messages to sqlite.

RFC since there is more work to do in terms of subscribing to log-info starting from the last recorded paxos version (epoch). I also haven't worried about scale for now.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@gregsfortytwo gregsfortytwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs documentation — from skimming, is the idea that this module logs to both sql and the monitor’s central log? If so, what’s the point of putting it in the manager at all when the monitor is fully durable?

I think there’s a tracker ticket, but it’s not linked and this seems far afield from the last time I looked at it. :D

Comment thread src/mon/LogMonitor.cc
}
if (!num_new) {
dout(10) << " nothing new" << dendl;
goto done;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this is redundant, but it’s also safe against future mutations (and probably optimizes into no bytecode at all) — I think you should leave it alone.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair enough.

@vshankar

Copy link
Copy Markdown
Contributor Author

This needs documentation

aye -- I am writing one.

— from skimming, is the idea that this module logs to both sql and the monitor’s central log? If so, what’s the point of putting it in the manager at all when the monitor is fully durable?

Yes, that's correct. The audit logs for daemons (mon, mgr to start with) are to be persisted in RADOS (via sqlite vfs). The mon store is periodically trimmed and to debug a broken cluster (say a broken file system), it would be nice to have a fairly larger (queryable) history of what specific commands were executed.

I think there’s a tracker ticket, but it’s not linked and this seems far afield from the last time I looked at it. :D

There is one, yes. I will link that up in my next push w/ documentation. I don't think this swayed from the initial proposal a whole lot.

@vshankar vshankar mentioned this pull request Apr 17, 2026
4 of 14 tasks

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this all looks pretty reasonable as a starting point. I don't have much besides a small nit I happened to see. I didn't delve into the details much.

Is the plan to have this collect everything that already goes to the audit log for now or do you want to plumb in e.g. the disaster recovery commands too?

Comment thread src/common/LogClient.cc
void LogChannel::_do_log(LogEntry &&e) {
std::lock_guard l(channel_lock);

if (!e.has_logmsg()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reverse if/else so you can do if (e.has_logmsg())

@vshankar

Copy link
Copy Markdown
Contributor Author

this all looks pretty reasonable as a starting point. I don't have much besides a small nit I happened to see. I didn't delve into the details much.

Is the plan to have this collect everything that already goes to the audit log for now or do you want to plumb in e.g. the disaster recovery commands too?

Thanks for taking a look @batrick

I will be splitting this change into the monitor parts that change the audit messages to use structure encoding, the mgr side changes and the manager module.

@vshankar

Copy link
Copy Markdown
Contributor Author

Is the plan to have this collect everything that already goes to the audit log for now or do you want to plumb in e.g. the disaster recovery commands too?

@dparmar18 is doing the disaster recovery change to audit log those. Those logs will be directly written to the sqlite database rather then relaying it through the monitor.

@vshankar

Copy link
Copy Markdown
Contributor Author

Split out the monitor change into a separate change: #69052

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jul 25, 2026
@dparmar18 dparmar18 removed the stale label Jul 25, 2026
ishaanjain0205 pushed a commit to ishaanjain0205/ceph that referenced this pull request Aug 14, 2026
ishaanjain0205 pushed a commit to ishaanjain0205/ceph that referenced this pull request Aug 14, 2026
…ing venky's pr ceph#68384 for new AuditDB schema, note: very messy as I was still experimenting around this time

Signed-off-by: Ishaan Jain <[email protected]>
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Sep 23, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Oct 23, 2026
@vshankar vshankar reopened this Dec 2, 2026
@vshankar
vshankar requested a review from a team as a code owner December 2, 2026 12:40
@github-actions github-actions Bot removed the stale label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants