-
Notifications
You must be signed in to change notification settings - Fork 146
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
Ensure Akri's Helm templates use the most restrictive settings suggested by Snyk report #547
Conversation
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to open up the Agent as it needs privileged access. This requires running this workflow locally and inspecting kubelet logs for errors journalctl -fu kubelet
deployment/helm/values.yaml
Outdated
# ensures container doesn't run with unnecessary priviledges | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing because tests are writing a file in the agent pod:
Line 106 in 47b4258
os.system('sudo {} exec -i {} -- /bin/sh -c "echo "OFFLINE" > /tmp/debug-echo-availability.txt"'.format(kubectl_cmd, shared_test_code.agent_pod_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Maybe we add that file as a volume mount for the Pod during the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the securityContext and removed readOnlyRootFilesystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure i understand how this was resolved. Looks like readOnlyRootFilesystem: true
still exists which is ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the above highlight is outdated? Here shows the updated security context for akri agent. I removed setting readOnlyRootFilesystem to true (followed what nvidia gpu device plugin did)
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: Harrison Tin <harrisontin@microsoft.com>
Signed-off-by: harrison <harrisontin@microsoft.com>
Signed-off-by: harrison <harrisontin@microsoft.com>
Signed-off-by: harrisontin <harrisontin@microsoft.com>
Signed-off-by: harrisontin <harrisontin@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together! We may want to do a round two at some point with the discovery handlers. If you pull in the latest from main, tests should pass. We may need to bump version depending on whether this goes in before #556
What this PR does / why we need it:
This PR explicitly sets more SecurityContext rather than using default in the helm templates, using Akri's Snyk report for guidance. The templates changed are:
Special notes for your reviewer:
If applicable:
cargo fmt
)cargo build
)cargo clippy
)cargo test
)cargo doc
)