-
Notifications
You must be signed in to change notification settings - Fork 905
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
Update falco_rules.yaml (CVE-2021-3156) #1543
Conversation
Welcome @darryk5! It looks like this is your first PR to falcosecurity/falco 🎉 |
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.
Moved %container.info at the end as suggested by @Kaizhe
@darryk5 please sign your commits and update release notes with the following fomrat:
|
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, thanks! Please address my other comments in the thread
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.
Needs some refinements IMHO, but thanks for submitting it
CHANGELOG.md
Outdated
@@ -43,6 +43,7 @@ Released on 2021-01-18 | |||
|
|||
### Rule Changes | |||
|
|||
* rule(Sudo Potential Privilege Escalation (CVE-2021-3156)): new rule created to detect CVE-2021-3156[[#1543](https://github.com/falcosecurity/falco/pull/1543)] - [@darryk5](https://github.com/darryk5) |
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.
Changelog must not be changed manually.
It gets automatically compiled from the release-notes
block in the PR template.
rules/falco_rules.yaml
Outdated
@@ -3114,7 +3114,17 @@ | |||
output: Container launched with root user privilege (uid=%user.uid container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) | |||
priority: INFO | |||
tags: [container, process] | |||
|
|||
- rule: Sudo Potential Privilege Escalation (CVE-2021-3156) |
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.
- rule: Sudo Potential Privilege Escalation (CVE-2021-3156) | |
// This rule helps detect CVE-2021-3156: | |
// A privilege escalation to root through heap-based buffer overflow | |
- rule: Sudo Potential Privilege Escalation |
Would you please accept my suggestion here?
rules/falco_rules.yaml
Outdated
@@ -3114,7 +3114,17 @@ | |||
output: Container launched with root user privilege (uid=%user.uid container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag) | |||
priority: INFO | |||
tags: [container, process] | |||
|
|||
- rule: Sudo Potential Privilege Escalation (CVE-2021-3156) | |||
desc: Privilege escalation vulnerability affected sudo. Executing sudo using sudoedit -s or sudoedit -t command from an unprivileged user it's possible to elevate the user privileges to root. |
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.
Not totally correct.
To happen
desc: Privilege escalation vulnerability affected sudo. Executing sudo using sudoedit -s or sudoedit -t command from an unprivileged user it's possible to elevate the user privileges to root. | |
desc: Privilege escalation vulnerability affecting sudo (<= 1.9.5p2). Executing sudo using sudoedit -s or sudoedit -i command with command-line argument that ends with a single backslash character from an unprivileged user it's possible to elevate the user privileges to root. |
Would you also accept my suggestion here
|
||
- rule: Sudo Potential Privilege Escalation (CVE-2021-3156) | ||
desc: Privilege escalation vulnerability affected sudo. Executing sudo using sudoedit -s or sudoedit -t command from an unprivileged user it's possible to elevate the user privileges to root. | ||
condition: spawned_process and user.uid!= 0 and proc.name=sudoedit and (proc.args contains -s or proc.args contains -i) and (proc.args contains "\ " or proc.args endswith \) |
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.
Is the space in "\ " wanted here?
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.
Since filter proc.args, it concatenate all the arguments together as a single string and separated by space character with "\ ", we cover the arguments ending with \ in the middle.
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.
CHANGELOG.md
Outdated
@@ -43,6 +43,7 @@ Released on 2021-01-18 | |||
|
|||
### Rule Changes | |||
|
|||
* rule(Sudo Potential Privilege Escalation (CVE-2021-3156)): new rule created to detect CVE-2021-3156[[#1543](https://github.com/falcosecurity/falco/pull/1543)] - [@darryk5](https://github.com/darryk5) |
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.
* rule(Sudo Potential Privilege Escalation (CVE-2021-3156)): new rule created to detect CVE-2021-3156[[#1543](https://github.com/falcosecurity/falco/pull/1543)] - [@darryk5](https://github.com/darryk5) |
This patch will be not included in 0.27.0. Most important, do not modify the CHANGELOG.md manually, please.
The changelog will be updated in the release process as described here
rules/falco_rules.yaml
Outdated
- rule: Sudo Potential Privilege Escalation (CVE-2021-3156) | ||
desc: Privilege escalation vulnerability affected sudo. Executing sudo using sudoedit -s or sudoedit -t command from an unprivileged user it's possible to elevate the user privileges to root. | ||
condition: spawned_process and user.uid!= 0 and proc.name=sudoedit and (proc.args contains -s or proc.args contains -i) and (proc.args contains "\ " or proc.args endswith \) | ||
output: "Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) (user=%user.name parent=%proc.pname cmdline=%proc.cmdline %container.info)" |
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.
output: "Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) (user=%user.name parent=%proc.pname cmdline=%proc.cmdline %container.info)" | |
output: "Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) (user=%user.name parent=%proc.pname cmdline=%proc.cmdline %container.info)" |
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.
Unnecessary space here.
rules/falco_rules.yaml
Outdated
|
||
|
||
|
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.
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.
Unnecessary newlines.
See #1540 Signed-off-by: darryk5 <stefano.chierici@sysdig.com> Co-authored-by: Lorenzo Fontana <lo@linux.com>
…lation Signed-off-by: darryk5 <stefano.chierici@sysdig.com> Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com> Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
I agree with @leogr, would you please squash the commits into a single one? |
/milestone 0.28.0 |
LGTM label has been added. Git tree hash: 8b85842ff2e1ac9f68e864c059d9573a0628dbce
|
/cc @Kaizhe |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Kaizhe, leodido, leogr 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 |
Added Rule Sudo Potential Privilege Escalation (CVE-2021-3156)
Open Issue #1540
Signed-off-by: darryk5 stefano.chierici@sysdig.com
What type of PR is this?
/kind rule-create
Any specific area of the project related to this PR?
/area rules
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1540
Special notes for your reviewer:
Does this PR introduce a user-facing change?: