rottweiler: add credential validation#882
Open
bcressey wants to merge 4 commits into
Open
Conversation
Split "generate-key" into "generate key" so that all commands follow the same `rottweiler <verb> <noun>` pattern. Modify callers to use the new invocation. Use a shared enum for state in the checks for directory and block device encryption. Derive FromStr from Deserialize and Display from Serialize, to reduce some boilerplate. Signed-off-by: Ben Cressey <bcressey@amazon.com>
c746925 to
96802fe
Compare
added 3 commits
March 26, 2026 23:16
Add a module to parse the on-disk format used by systemd-creds to persist credentials. This relies on internal implementation details of `systemd` which are intentionally not part of its public documented interface. However, it's useful to be able to introspect credential files in order to assert that they are well-formed and of the expected type. Signed-off-by: Ben Cressey <bcressey@amazon.com>
Add a helper command to load and print the credential files created by `systemd-creds`. Signed-off-by: Ben Cressey <bcressey@amazon.com>
Prior to using any credential file, ensure that it's in the expected format. Signed-off-by: Ben Cressey <bcressey@amazon.com>
96802fe to
b6483b6
Compare
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.
Issue number:
Related: bottlerocket-os/bottlerocket#4680
Description of changes:
Extend
rottweilerwith the ability to parsesystemd-credscredential files, so that they can be dumped (for debugging purposes) or vetted prior to use to ensure they meet the expected parameters.Refactor the CLI so that all commands follow the same
rw [verb] [noun] ...pattern -generate-keywas an exception to the rule, and I wanted to fix that rather than adddump-keyas another exception.Add another "check" subcommand to check whether directories are locked or unlocked. Currently this is only useful for debugging, but in the future we might want to populate a PCR differently based on whether or not the datastore is locked.
Testing done:
rottweiler dump
rottweiler check directory ... locked
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.