-
Notifications
You must be signed in to change notification settings - Fork 58
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
Basic audit trails via logging #3317
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Donny Peeters <[email protected]>
…nals' into feature/basic-audit-trails # Conflicts: # rocky/rocky/apps.py # rocky/rocky/signals.py
# Conflicts: # rocky/rocky/apps.py # rocky/rocky/signals.py
dekkers
reviewed
Aug 7, 2024
Checklist for QA:
What works:Looks good. I see various events in the logs. Not observing anything weird, like error messages. Onboarding works and boefjes can be started and complete. What doesn't work:n/a Bug or feature?:n/a |
underdarknl
approved these changes
Aug 8, 2024
jpbruinsslot
added a commit
that referenced
this pull request
Aug 8, 2024
jpbruinsslot
added a commit
that referenced
this pull request
Aug 8, 2024
* feature/mula/refactor-queue: Fix poetry Updates according to code review Basic audit trails via logging (#3317) Raw upload with Scan OOIS (#3169) Fix Garbage collection and disappearing ports issue (#3214) Formatting Formatting Fix formatting Updated `Django` and `opentelemetry` packages (#3324) Restructure scheduler development scripts (#3293) Change report flow to POST requests (#3174)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This PR implements some more audit trails via logging:
Most of the other logging related to models have been implemented in #3314 and merged into this branch.
Also implemented basic event codes for specific ORM record trails. This is a very basic implementation to get things started. I also considered using a tuple for the event codes (an element for each CRUDE action), but since there's probably still room for improvement and development around the audit trails I used a dict for now for flexibility.
Ideally we'd use more descriptive codes (using alphanumerics) when possible. In both cases, whether we use alphanumeric or numeric codes, we should work towards automatically labeling them as much as possible.
Issue link
Partially closes #3043
QA notes
You should see more logging on certain actions, such as creating an object or enabling a plugin. On certain model changes (such as an organization or organization tags), you should also see an
event_code
variable in the log record.Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.