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

Read-only root file system check broken if the container.security_context not defined #45

Open
alen-caljuksic opened this issue Aug 21, 2023 · 2 comments

Comments

@alen-caljuksic
Copy link

It seems to me pod should be added to an offender list when container.security_context not defined:
https://github.com/aws-samples/hardeneks/blob/main/hardeneks/namespace_based/security/pod_security.py#L146

@dorukozturk
Copy link
Contributor

hi, thank you for creating an issue. Can you elaborate a little bit? In the linked scenario if security_context does not have the read_only_root_filesystem attribute it gets added to the list of offenders. Is there a different check that you are looking for?

@za
Copy link
Contributor

za commented Jul 23, 2024

Hi @dorukozturk

what if the container doesn't have this parameter?

securityContext:
  readOnlyRootFilesystem: true

I can see, that is not added to offender list, which is wrong. CMIIW.

Maybe this is what @alen-caljuksic meant:

pod should be added to an offender list when container.security_context not defined

It works fine when I have this parameter:

securityContext:
  readOnlyRootFilesystem: false

Screenshot 2024-07-23 170940

za added a commit to za/hardeneks that referenced this issue Jul 23, 2024
…ilesystem config

Because when there's no declaration:
```
securityContext:
  readOnlyRootFilesystem: true
```

it should be added to offenders list.

Issue aws-samples#45
aws-samples#45
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

No branches or pull requests

3 participants