feat: add SEC0045 OWASP security event logging#208
Draft
tonyandrewmeyer wants to merge 2 commits into
Draft
Conversation
Concierge runs as root to provision charm dev/test machines, so it performs security-relevant actions: executing privileged commands, installing snaps and debs, writing cloud credentials, and changing filesystem ownership. SEC0045 requires these to be recorded using the OWASP Application Logging Vocabulary. Add an internal/securitylog package that emits security events as structured JSON to stderr, with the vocabulary's recommended fields (datetime, level, type=security, appid, event, description), mirroring the approach taken for the operator framework in canonical/operator#1905. Instrument the events concierge produces: - sys_startup / sys_shutdown: machine provisioning start and restore. - authz_admin: every privileged (non-read-only) command execution, and writing the Juju cloud credentials file. - privilege_permissions_changed: recursive filesystem ownership changes. Structured JSON is used rather than OTLP via owasp-logger because concierge is a short-lived CLI with no existing telemetry pipeline. Jira: CHARMTECH-875
Contributor
Author
|
I hate this 😂: I need to figure out how to get this out of the regular output but still be compliant. |
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
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.
Concierge runs as root to provision charm dev/test machines, so it performs security-relevant actions: executing privileged commands, installing snaps and debs, writing cloud credentials, and changing filesystem ownership. SEC0045 requires these to be recorded using the OWASP Application Logging Vocabulary.
The PR adds an internal/securitylog package that emits security events as structured JSON to stderr, with the vocabulary's recommended fields (datetime, level, type=security, appid, event, description), mirroring the approach taken for the operator framework in canonical/operator#1905.
Instrument the events concierge produces:
Structured JSON is used rather than OTLP via owasp-logger because concierge is a short-lived CLI with no existing telemetry pipeline.