[Kubernetes STIG v1r10] pod-files rule: add check for 242467 rule#60
Merged
dimityrmirchev merged 4 commits intogardener:mainfrom Nov 21, 2023
Merged
Conversation
dimityrmirchev
requested changes
Nov 20, 2023
Member
dimityrmirchev
left a comment
There was a problem hiding this comment.
Some minor requests from my side
| Name string | ||
| Label string | ||
| Value string | ||
| Num int |
Member
There was a problem hiding this comment.
Let's remove the Num field and again use a map[string]component
Member
Author
There was a problem hiding this comment.
We cannot use the old method of removing a found component from the map, since a mandatory component can have more than 1 pod and we want to make the key file checks for every single pod of that component. Using the old logic we would know only for the first pod of the component that we need to check the key files.
I suggest I change the Num int filed to Found bool
Member
There was a problem hiding this comment.
Ok then. Lets change "Num" to "found"
| ]` | ||
| compliantStats = `600 0 0 /destination/file1.txt | ||
| 644 0 65532 /destination/bar/file2.txt` | ||
| keyFileStats = `600 0 0 /destination/file1.key |
Member
There was a problem hiding this comment.
Suggested change
| keyFileStats = `600 0 0 /destination/file1.key | |
| keyFileStats = `640 0 0 /destination/file1.key |
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.
What this PR does / why we need it:
This PR improves the *.key files checks required from
242467rule inpod-filesrule. *.key files in mandatory components are required to have max privilege of640. We do not enforce600because k8s does not provide a way to easily change the owner of a file and containers are expected to run as nonroot.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: