File: rule.yml

package info (click to toggle)
scap-security-guide 0.1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 110,644 kB
  • sloc: xml: 241,883; sh: 73,777; python: 32,527; makefile: 27
file content (55 lines) | stat: -rw-r--r-- 2,564 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
documentation_complete: true


title: 'Configure auditing of unsuccessful file accesses (AArch64)'

{{% set file_contents_audit_access_failed =
"## Unsuccessful file access (any other opens) This has to go last.
-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=" ~ uid_min ~ " -F auid!=unset -F key=unsuccessful-access
-a always,exit -F arch=b64 -S openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=" ~ uid_min ~ " -F auid!=unset -F key=unsuccessful-access
-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=" ~ uid_min ~ " -F auid!=unset -F key=unsuccessful-access
-a always,exit -F arch=b64 -S openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=" ~ uid_min ~ " -F auid!=unset -F key=unsuccessful-access" %}}

description: |-
    Ensure that unsuccessful attempts to access a file are audited.

    The following rules configure audit as described above:
    <pre>{{{ file_contents_audit_access_failed|indent }}}    </pre>

    Load new Audit rules into kernel by running:
    <pre>augenrules --load</pre>

    Note: This rule uses a special set of Audit rules to comply with OSPP 4.2.1. You may reuse this rule in different profiles. If you decide to do so, it is recommended that you inspect contents of the file closely and make sure that they are alligned with your needs.

rationale: |-
    Unsuccessful attempts to access a file might be signs of malicious activity happening within the system. Auditing of such activities helps in their monitoring and investigation.

severity: medium

platforms:
    - aarch64_arch

identifiers:
    cce@rhel9: CCE-85922-3
    cce@rhel10: CCE-87749-8

references:
    ism: 0582,0584,05885,0586,0846,0957
    nist: AU-2(a)
    ospp: FAU_GEN.1.1.c
    srg: SRG-OS-000458-GPOS-00203,SRG-OS-000474-GPOS-00219,SRG-OS-000475-GPOS-00220,SRG-OS-000463-GPOS-00207,SRG-OS-000465-GPOS-00209,SRG-OS-000461-GPOS-00205

ocil_clause: 'the file does not exist or the content differs'

ocil: |-
    To verify that the <tt>Audit</tt> is correctly configured according to recommended rules, check the content of the file with the following command:
    <pre>cat /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules</pre>
    The output has to be exactly as follows:
    <pre>{{{ file_contents_audit_access_failed|indent }}}    </pre>

template:
    name: audit_file_contents
    vars:
        filepath: /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
        contents: |-
            {{{ file_contents_audit_access_failed|indent(12) }}}