-
Notifications
You must be signed in to change notification settings - Fork 3
fix(audit): rename audit events #1611
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
Conversation
Reviewer's GuideThis PR refactors audit event naming to more descriptive messages including VM names and users, adds filters to ignore events from system service accounts, updates tests to align with new behavior, and adjusts server log levels. Class diagram for updated audit event handlingclassDiagram
class VMAccess {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes VM name, connection stage, subresource, and user
- IsMatched: ignores system service accounts except d8-service-accounts
}
class IntegrityCheckVM {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes VM name
- IsMatched: ignores system service accounts except d8-service-accounts
}
class VMOPControl {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes VM name and user for all actions (start, stop, restart, migrate, evict)
- IsMatched: ignores system service accounts except d8-service-accounts
}
class VMControl {
+Fill() error
- eventLog.Name: now includes VM name for OS stop/restart, abnormal kill includes user
- Fill: ignores system service accounts except d8-service-accounts
}
class VMManage {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes VM name and user for create, update, delete
- IsMatched: ignores system service accounts except d8-service-accounts
}
class ModuleComponentControl {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes component name and user for create/delete
- IsMatched: ignores system service accounts except d8-service-accounts
}
class Forbid {
+IsMatched() bool
+Fill() error
- eventLog.Name: now includes user, verb, and resource in forbidden operation
- IsMatched: ignores system service accounts except d8-service-accounts
}
class ModuleControl {
+IsMatched() bool
- IsMatched: ignores system service accounts except d8-service-accounts
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The system user/serviceaccount filtering logic is duplicated in multiple matchers—consider extracting it into a shared helper so you don’t risk inconsistent behavior across event types.
- Verify that your whitelist for serviceaccounts (only allowing “system:serviceaccount:d8-service-accounts”) actually covers all legitimate accounts (like “d8-virtualization” in your tests) so you don’t accidentally filter out valid audit events.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The system user/serviceaccount filtering logic is duplicated in multiple matchers—consider extracting it into a shared helper so you don’t risk inconsistent behavior across event types.
- Verify that your whitelist for serviceaccounts (only allowing “system:serviceaccount:d8-service-accounts”) actually covers all legitimate accounts (like “d8-virtualization” in your tests) so you don’t accidentally filter out valid audit events.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> move username checks to each event Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> fix names Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> add quotes Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> update name Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> fix tests Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> fix Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> fix test Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
5552fd8
to
98d95dc
Compare
Description Improving audit events names. Also add ignoring system service acconts. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Description Improving audit events names. Also add ignoring system service acconts. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
fix(audit): rename audit events (#1611) Description Improving audit events names. Also add ignoring system service acconts. Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Description
Improving audit events names. Also add ignoring system service acconts.
Checklist
Changelog entries