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

hardening: Enable setting templated file permissions #2921

Merged
merged 2 commits into from
May 4, 2023

Conversation

stmcginnis
Copy link
Contributor

Issue number:

N/A

Description of changes:

This adds the ability to specify the permission mode of files created from a template. This enables the ability to have file-by-file control for sensitive files to enforce more restrictive permissions.

Note that Bottlerocket is not a multiuser system and this is just extra precaution to change the permissions on these files. It does happen from time to time that security tools meant for more general purpose Linux distributions are run against Bottlerocket and report issues based on the default file permissions, so this is partly a cosmetic change to prevent these tools from report false errors.

Testing done:

Built and deployed EKS cluster. Verified that the file permissions on the modified template files were set to the correct permissions and that the system operated as expected.

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.

Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

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

Looks good to me overall, just one suggestion.

sources/api/thar-be-settings/src/config.rs Outdated Show resolved Hide resolved
@stmcginnis
Copy link
Contributor Author

Rebased to address Release.toml conflict due to 1.13.3.

@stmcginnis
Copy link
Contributor Author

Force push to resolve merge conflict.

This adds the ability to specify the permission mode of files created
from a template. This enables the ability to have file-by-file control
for sensitive files to enforce more restrictive permissions.

Signed-off-by: Sean McGinnis <stmcg@amazon.com>
sources/api/thar-be-settings/src/config.rs Outdated Show resolved Hide resolved
This adds a migration for the addition of the mode property for a few of
the Kubernetes template files.

Signed-off-by: Sean McGinnis <stmcg@amazon.com>
@stmcginnis stmcginnis merged commit 5d7c1cd into bottlerocket-os:develop May 4, 2023
@stmcginnis stmcginnis deleted the template-mode branch May 4, 2023 15:01
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.

4 participants