-
Notifications
You must be signed in to change notification settings - Fork 912
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(rules/Set Setuid or Setgid bit): use chmod syscalls instead of chmod command #765
Conversation
@Kaizhe I noticed that the previous rule used a macro |
e9e7cf2
to
2b44bca
Compare
I would also increment the required engine version, as you depend on the changes in draios/sysdig#1472 to be effective. Once the sysdig PR is merged you’ll have to increment the falco engine and checksum anyway. |
@fntlnz good changes, couple requests here:
|
…mod command Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
e0e47f4
to
d586ec5
Compare
Here is the outputs @Kaizhe Rule output exampleschmodSyscall
Output
fchmodatSyscall
Output
fchmod
Syscall
|
/lgtm |
LGTM label has been added. Git tree hash: ed88949aef039cf5a7a9463e3af82a935a69718a
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Kaizhe, leodido 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 |
Signed-off-by: Lorenzo Fontana lo@linux.com
What type of PR is this?
/kind bug
/kind rule-update
Any specific area of the project related to this PR?
/area rules
What this PR does / why we need it:
The "Set Setuid or Setgid bit" rule is using a check on the invocation of the
chmod
command in order to check if a suid or sgid flag is applied to a file.That method is ineffective because anyone using the raw syscall or glibc can bypass that.
For example:
This PR uses the newly added
fchmod, chmod, fchmodat
syscalls (to sysdig)in order to avoid that.
Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
Only works if sysdig PR draios/sysdig#1472 is merged. It adds support to the chmod syscalls we are using here.
Does this PR introduce a user-facing change?: