Skip to content
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

Settings: log set operations #3194

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

stmcginnis
Copy link
Contributor

Issue number:

Related #2640

Description of changes:

This adds info level logging to capture some trace of setting updates in the system log at the default logging level. This is to help capture a record of system changes being made.

This is only a baby step towards addressing #2640, but it is a very minor change that can be done now until a more comprehensive plan can be put in place.

This logs updates to individual keys, even if a set of values are being updated in one call. This does cause a slew of log messages on system start up as the initial datastore is being created. This is relatively small though, and is useful in seeing what all initial settings are being set on initial boot. After that point, only individually set values should show up in the logs, and it is easy to see when settings changes have been made.

A more comprehensive audit log should be put in place, but that will require handling to make sure no sensitive data (private keys, passwords, etc) make it to the log. There are also likely other operations besides set_setting that should be captured. But this is a trivial change that at least gets some breadcrumbs to be able to monitor for changes.

Testing done:

Deployed an instance and verified updates were reflected in the system log.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Comment on lines 154 to 156
_ => {
trace!("Updating data key {}", key.name());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the Committed enum is used to describe the state of a transaction rather than whether or not the write is a set/update. Is this right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You probably know our datastore operations better than I do. Are there any cases where we would be committing something that would not be a set/update?

@cbgbt cbgbt assigned cbgbt and unassigned cbgbt Jul 1, 2023
This adds info level logging to capture some trace of setting updates in
the system log at the default logging level. This is to help capture a
record of system changes being made.

This is only a baby step towards getting better system modification
auditing in place, but it is a very minor change that can be done now
until a more comprehensive plan can be put in place.

Signed-off-by: Sean McGinnis <[email protected]>
@stmcginnis stmcginnis merged commit 34c79f1 into bottlerocket-os:develop Jul 12, 2023
38 checks passed
@stmcginnis stmcginnis deleted the settings-log branch July 12, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants