-
Notifications
You must be signed in to change notification settings - Fork 420
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
Add new flag set-read-only-root-filesystem to set readOnlyRootFilesys… #1742
Conversation
Hi @kristofferchr. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind feature |
Unsure if this should have docs. Could not find docs for flag |
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.
/ok-to-test
1623b5d
to
c2adf62
Compare
@khrm and/or @savitaashture does any of you have time to spare to review this? |
I would review this tomorrow. Sorry for the delay. |
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.
@savitaashture Let's review this. |
Hi @kristofferchr 👋 |
Hi 😃 great! |
if *c.SetReadOnlyRootFilesystem { | ||
containerSecurityContext.ReadOnlyRootFilesystem = ptr.Bool(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.
can we move this under SetSecurityContext
block itself
I mean if SetSecurityContext
if *c.SetSecurityContext {
if *c.SetReadOnlyRootFilesystem {
containerSecurityContext.ReadOnlyRootFilesystem = ptr.Bool(true)
}
containerSecurityContext = corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.Bool(false),
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
},
RunAsNonRoot: ptr.Bool(cfg.Defaults.DefaultRunAsNonRoot),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
}
}
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.
Fine by me. I will update the flag docs to note that the flag can only be used when el-security-context is set.
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 @savitaashture
…em for EventListener Add new flag set-read-only-root-filesystem. Sets container securityContext readOnlyRootFilesystem to true when new flag is set to true Prior to this it was not possible to set readOnlyRootFilesystem for EventListener container. Aligns security towards azure aks best practices and industry
c2adf62
to
5311d75
Compare
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.
Thank you @kristofferchr
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: savitaashture The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@khrm can you do lgtm again |
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.
/lgtm
Solves: #1741
Support to set readOnlyRootFilesystem for EventListener container
Changes
Add new flag set-read-only-root-filesystem.
Sets container securityContext readOnlyRootFilesystem to true when new flag is set to true
Prior to this it was not possible to set readOnlyRootFilesystem for EventListener container. Aligns security towards azure aks best practices and industry
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes