-
Notifications
You must be signed in to change notification settings - Fork 686
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
SLES-15-030730 'Record Unsuccessul Delete Attempts to Files - renameat2' #6826
Merged
vojtapolasek
merged 7 commits into
ComplianceAsCode:master
from
yarunachalam:SLES-15-030730
Apr 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3ec5497
SLES-15-030730 'Record Unsuccessul Delete Attempts to Files - renameat2'
yarunachalam 6c9128a
Update 30-ospp-v42-4-delete-failed.rules
yarunachalam a80962b
Update 30-ospp-v42-4-delete-success.rules
yarunachalam 49a9a0b
Delete e2e.yml
yarunachalam 34afdc8
Update rule.yml
yarunachalam 11f43f3
Added test scritp
yarunachalam 68713c5
Updated fail script syntax error
yarunachalam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...les/audit_file_modification/audit_rules_unsuccessful_file_modification_renameat2/rule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
documentation_complete: true | ||
|
||
prodtype: sle15 | ||
|
||
title: 'Record Unsuccessul Delete Attempts to Files - renameat2' | ||
|
||
description: |- | ||
The audit system should collect unsuccessful file deletion | ||
attempts for all users and root. If the <tt>auditd</tt> daemon is configured | ||
to use the <tt>augenrules</tt> program to read audit rules during daemon | ||
startup (the default), add the following lines to a file with suffix | ||
<tt>.rules</tt> in the directory <tt>/etc/audit/rules.d</tt>. | ||
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt> | ||
utility to read audit rules during daemon startup, add the following lines to | ||
<tt>/etc/audit/audit.rules</tt> file. | ||
<pre>-a always,exit -F arch=b32 -S renameat2 -F exit=-EACCES -F auid>={{{ auid }}} -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b32 -S renameat2 -F exit=-EPERM -F auid>={{{ auid }}} -F auid!=unset -F key=unsuccessful-delete</pre> | ||
If the system is 64 bit then also add the following lines: | ||
<pre> | ||
-a always,exit -F arch=b64 -S renameat2 -F exit=-EACCES -F auid>={{{ auid }}} -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b64 -S renameat2 -F exit=-EPERM -F auid>={{{ auid }}} -F auid!=unset -F key=unsuccessful-delete</pre> | ||
|
||
rationale: |- | ||
Unsuccessful attempts to delete files could be an indicator of malicious activity on a system. Auditing | ||
these events could serve as evidence of potential system compromise. | ||
|
||
severity: medium | ||
|
||
identifiers: | ||
cce@sle15: CCE-85719-3 | ||
|
||
references: | ||
disa@sle15: CCI-000172 | ||
nist@sle15: AU-12(c),AU-12.1(iv) | ||
srg@sle15: SRG-OS-000468-GPOS-00212 | ||
stigid@sle15: SLES-15-030730 | ||
|
||
{{{ complete_ocil_entry_audit_syscall(syscall="renameat2") }}} | ||
|
||
warnings: | ||
- general: |- | ||
Note that these rules can be configured in a | ||
number of ways while still achieving the desired effect. Here the system calls | ||
have been placed independent of other system calls. Grouping system calls related | ||
to the same event is more efficient. See the following example: | ||
<pre>-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,renameat2 -F exit=-EACCES -F auid>={{{ auid }}} -F auid!=unset -F key=unsuccesful-delete</pre> | ||
|
||
template: | ||
name: audit_rules_unsuccessful_file_modification | ||
vars: | ||
name: renameat2 |
3 changes: 3 additions & 0 deletions
3
...file_modification/audit_rules_unsuccessful_file_modification_renameat2/tests/ocp4/e2e.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
yarunachalam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
default_result: FAIL | ||
result_after_remediation: PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## Unsuccessful file delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
yarunachalam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,renameat2 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,renameat2 -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,renameat2 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete | ||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,renameat2 -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Successful file delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete | ||
yarunachalam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete | ||
-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,renameat2 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete | ||
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,renameat2 -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-delete |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note that this template has hardcoded a different audit rule key. It adds
at the end istead of
which is specified in your rule description.
It depends if it is a problem for you as keys can be arbitrary values, they are more for humans than for computers.
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.
@vojtapolasek The key difference is not an issue. Our rule notes that the key maybe different and looking at other rules that use this template I saw that in most cases the keys in the description were not access.