303-300 · Question #77
Which of the following commands defines an audit rule that monitors read and write operations to the file/ etc/firewall/rules and associates the rule with the name firewall?
The correct answer is C. auditctl -w /etc/firewall/rules -p rw -k firewall. Option C uses the correct auditctl syntax: -w specifies the watched file path, -p rw sets the permission filter to monitor both read and write operations, and -k firewall assigns a key (label) named "firewall" for filtering audit logs later with ausearch -k firewall. A is wrong…
Question
Which of the following commands defines an audit rule that monitors read and write operations to the file/ etc/firewall/rules and associates the rule with the name firewall?
Options
- Aauditctl -N firewall -r r: /etc/firewall/rules -r w: etc/firewall/rules
- Bauditctl -A -f /etc/firewall/rules -o r -o w -l firewall
- Cauditctl -w /etc/firewall/rules -p rw -k firewall
- Dauditctl --read /etc/firewall/rules --write /etc/firewall/rules --label firewall
- Eecho "n: firewall r:/etc/firewall/rules: w:/etc/firewall/rules:" | auditctl ~
How the community answered
(56 responses)- A7% (4)
- B2% (1)
- C89% (50)
- D2% (1)
Explanation
Option C uses the correct auditctl syntax: -w specifies the watched file path, -p rw sets the permission filter to monitor both read and write operations, and -k firewall assigns a key (label) named "firewall" for filtering audit logs later with ausearch -k firewall.
- A is wrong because
-N,-r r:, and-r w:are not validauditctlflags - this syntax is entirely fabricated. - B is wrong because
-Aappends syscall rules (not file watches),-fsets the failure mode, and-o/-lare not valid flags for this purpose. - D is wrong because
auditctldoes not support GNU-style long options like--read,--write, or--label. - E is wrong because piping a custom string format into
auditctlis not how the tool works - this syntax is invented.
Memory tip: Use the mnemonic "Watch Permissions, Key name" → -w (watch file), -p (permissions: r, w, x, a), -k (key/label). These three flags together are the standard pattern for any auditctl file-watch rule.
Topics
Community Discussion
No community discussion yet for this question.