-
Notifications
You must be signed in to change notification settings - Fork 321
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
fix(query): Show privilege_escalation_allowed k8s alert also in case no securityContext is defined #4885
fix(query): Show privilege_escalation_allowed k8s alert also in case no securityContext is defined #4885
Conversation
…no securityContext is defined
Scan submitted to Checkmarx |
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.
Another great observation and refactor, @Churro 🚀 Thank you!
I have two request changes:
Co-authored-by: Rafaela Soares <[email protected]>
Co-authored-by: Rafaela Soares <[email protected]>
Scan not submitted to Checkmarx due to existing Active scan for the same project. |
1 similar comment
Scan not submitted to Checkmarx due to existing Active scan for the same project. |
Suggestions applied, thank you for the thorough review @rafaela-soares! 👍 |
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.
Hi @Churro, everything looks good to me, the only thing I would like to request here is the use of the searchLine
Thank you for your great contributions
Hi @joaoReigota1, thank you for the review. I've now added |
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 🚀
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 🚀
Problem
The
privilege_escalation_allowed
rule is rated high and, indeed, represents a very security-relevant setting. Currently, the rule does not trigger an alert in case nosecurityContext
is defined with a container. There is a separate rule to check whethersecurityContext
exists but the severity rating is low. Hence, alerts for a rule with high severity are only shown if a user acts upon a low severity rule.Therefore, I suggest to change the rule to always show the alert, regardless of the existence of
securityContext
. This is important since a report otherwise does not provide a full picture of issues that demand for action.Proposed Changes
securityContext
optional, such that an alert is also shown in casecontainer.securityContext
is undefinedI submit this contribution under the Apache-2.0 license.