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

Trivy recommended hardening #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jcpunk
Copy link

@jcpunk jcpunk commented Apr 20, 2023

These hardening bits were recommended by the trivy scanner.

https://github.com/aquasecurity/trivy
https://github.com/aquasecurity/trivy-operator

@derekbit
Copy link
Member

@jcpunk
Thanks for your contribution.
Could you please link me to a reference for the feature? Thank you.

@derekbit
Copy link
Member

BTW, could you help resolve the conflict? Thank you.

@jcpunk
Copy link
Author

jcpunk commented Jul 18, 2023

I've added links to the trivy tooling and resolved the conflicts.

Just to verify, can this container run with any of the following security settings?

runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
   drop: ["ALL"]
runAsUser: 65534
runAsGroup: 65534
readOnlyRootFilesystem: true

Their existence in the values.yaml even as comments seems incorrect if they are incompatible.

If the pod requires run as root with some capabilities, that should probably be noted somewhere...

@derekbit
Copy link
Member

Not sure if the hardening can introduce side effect?
I think we can gray the block out and leave a comment here. Users can enable it by updating the values.yaml.
@jcpunk WDYT?

@jcpunk
Copy link
Author

jcpunk commented Nov 27, 2023

I'd prefer the defaults to have the most hardening that is safe to apply. I'm not super familiar with what the code actually needs...

In prod I'm running with the sandbox enabled (what is actually in the patch) and that seems to work.

I'd love to have these too:

runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
   drop: ["ALL"]
runAsUser: 65534
runAsGroup: 65534
readOnlyRootFilesystem: true

but I don't have a place to test them at this point. Do you know if any of these are workable?

Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Jun 10, 2024
@jcpunk
Copy link
Author

jcpunk commented Jun 10, 2024

I'd still like to see some version of this.

@derekbit
Copy link
Member

derekbit commented Jun 10, 2024

Let's make it in v0.0.28.

Let's make it in v0.0.29.

@github-actions github-actions bot removed the stale label Jun 11, 2024
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.

None yet

2 participants