-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement OWASP security logging. #6689
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
Closed
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8a42221
feat: add OSWAP security event logging for user creation and system r…
blackboxsw e4fd5a9
doc: document security_log_file base config setting
blackboxsw 9b7790b
feat: define decorators for sec_log_* and apply to distro methods
blackboxsw 5b4eb29
fix: route SECURITY logs exclusively to /var/log/cloud-init-output.log
blackboxsw 65bf5b0
chore: revert unnecessary changes to cloudinit.util
blackboxsw e1efd72
feat: add _get_host_ip helper to report host_ip in security logs
blackboxsw 1a56972
fix: security_event_log setup should only be added when absent from l…
blackboxsw 46d59b5
feat: sec log groups, sudo and doas
blackboxsw 9a1b589
feat: sec log groups, sudo and doas
blackboxsw 97a816f
chore: mypy warnings and prevent subclassing for create_user and shut…
blackboxsw e91cc58
fix: ignore down nics, support chpasswd logging
blackboxsw 6d59281
chore: generalize Distro.add_user refactor subclass overrides
blackboxsw cf12e89
refactor: move get_host_ip from securtiy_event_log to netinfo
blackboxsw 5233396
fix: provide mode and delay values in shutdown sec events
blackboxsw 2032bd3
fix: address mypy and ai review comments
blackboxsw 967ebbd
fix: mypy errors for @final Distro methods
blackboxsw 8eafe51
fix: pylint issues
blackboxsw 9aebc9b
fix: mypy
blackboxsw 45bc3c7
test: add assertion on expeted host_ip
blackboxsw 476f0c5
chore: drop host_ip from owasp logs use hostname for identity instead
blackboxsw 310cac1
comments: typing on add_user*, decorators to use mandatory positional…
blackboxsw db03c52
chore: refactor Distros.shutdown_command
blackboxsw 573d590
chore: correct _build_shutdown command call signature
blackboxsw 289f2af
fix: incorrect naming alpine._build_shutdown_cmd
blackboxsw 46291ca
chore: add SecurityFormatter to add datetime to sec logs from record.…
blackboxsw 56d70f9
refactor: add helper method to process groups in kwargs
blackboxsw b1192a1
chore: drop _build_event_string and fold into _log_security_event
blackboxsw e076eec
chore: type hints for plist_in
blackboxsw 95ab64c
chore: default insert cloud-init a main event actor. Remove stray dhc…
blackboxsw 064ba63
chore: typing of name and doc log file correction
blackboxsw a18a102
refactor: add _get_elevated_roles and wire to sec_log_user_created
blackboxsw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Can we add
@finalhere too?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.
Also migrated the sec_log_user_created decorator to
add_userandadd_snap_useras that is actually where a user gets created. Added@finaldecorators to both of those methods.Refactored subclasses of add_user behavior into
_add_user_preprocess_kwargs,_build_add_user_cmdand_post_add_usermethods.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.
This is still overridden in a child class.
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.
This is in distros/bsd.py, but bsd directly calls set_passwd for each name in plist_in. So BSD will still be logging separate OWASP events for each user, just as our @sec_log_password_changed_batch will.
As a result, I don't want to decorate chpasswd with
@finaland I also don't want to decorate cloudinit.distros.bsd.Disto.chpasswd with@sec_log passwd_changed_batch