Question 179 of 997
Falco Rule: Detect Reading /etc/shadow in Container
This CKS practice question tests your understanding of monitoring, logging and runtime security. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A security team wants to detect any attempt to read the /etc/shadow file inside a container. Which Falco rule condition would trigger an alert for such an event?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
evt.type=open and fd.name=/etc/shadow and evt.arg.flags contains O_RDONLY
Option D is correct because reading /etc/shadow requires the open syscall with the O_RDONLY flag. Falco's rule condition `evt.type=open and fd.name=/etc/shadow and evt.arg.flags contains O_RDONLY` precisely matches an attempt to open the file for reading, which is the event that should trigger an alert for unauthorized read access.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The CKS exam often tests the distinction between read and write flags in syscall arguments, and candidates mistakenly choose O_WRONLY (option C) thinking any access to /etc/shadow is malicious, but the question specifically asks for read attempts.
Detailed technical explanation
How to think about this question
Falco uses kernel eBPF or a kernel module to intercept system calls. The `evt.arg.flags` field for the `open` syscall contains the bitmask of flags passed to the syscall (e.g., O_RDONLY = 0, O_WRONLY = 1, O_RDWR = 2). Falco's `contains` operator checks if the flag string representation includes 'O_RDONLY'. In practice, containers often run with a read-only root filesystem, but /etc/shadow may still be mounted from the host; detecting O_RDONLY on this file is a key indicator of an attempt to exfiltrate password hashes.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A practitioner preparing for the CKS exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Monitoring, Logging and Runtime Security — study guide chapter
Learn the concepts, then practise the questions
- →
Monitoring, Logging and Runtime Security practice questions
Targeted practice on this topic area only
- →
All CKS questions
997 questions across all exam domains
- →
Certified Kubernetes Security Specialist CKS study guide
Full concept coverage aligned to exam objectives
- →
CKS practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related CKS practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Monitoring Logging and Runtime Security practice questions
Practise CKS questions linked to Monitoring Logging and Runtime Security.
Cluster Setup and Hardening practice questions
Practise CKS questions linked to Cluster Setup and Hardening.
System Hardening practice questions
Practise CKS questions linked to System Hardening.
Minimize Microservice Vulnerabilities practice questions
Practise CKS questions linked to Minimize Microservice Vulnerabilities.
Supply Chain Security practice questions
Practise CKS questions linked to Supply Chain Security.
Monitoring, Logging and Runtime Security practice questions
Practise CKS questions linked to Monitoring, Logging and Runtime Security.
Cluster Setup practice questions
Practise CKS questions linked to Cluster Setup.
Cluster Hardening practice questions
Practise CKS questions linked to Cluster Hardening.
CKS fundamentals practice questions
Practise CKS questions linked to CKS fundamentals.
CKS scenario practice questions
Practise CKS questions linked to CKS scenario.
CKS troubleshooting practice questions
Practise CKS questions linked to CKS troubleshooting.
Practice this exam
Start a free CKS practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this CKS question test?
Monitoring, Logging and Runtime Security — This question tests Monitoring, Logging and Runtime Security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: evt.type=open and fd.name=/etc/shadow and evt.arg.flags contains O_RDONLY — Option D is correct because reading /etc/shadow requires the open syscall with the O_RDONLY flag. Falco's rule condition `evt.type=open and fd.name=/etc/shadow and evt.arg.flags contains O_RDONLY` precisely matches an attempt to open the file for reading, which is the event that should trigger an alert for unauthorized read access.
What should I do if I get this CKS question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
5 more ways this is tested on CKS
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You need to detect any attempt to read /etc/shadow inside a container using Falco. Which macro would you use in the condition?
medium- A.open_write and fd.name=/etc/shadow
- ✓ B.open_read and fd.name=/etc/shadow
- C.syscall.type=open and fd.name=/etc/shadow
- D.spawned_process and proc.name=cat
Why B: The 'open_read' macro matches open syscalls with read access. The 'fd.name' field matches the file path. Combining them detects reads to /etc/shadow.
Variation 2. A security team wants to detect any attempt to open /etc/shadow in a container. Which Falco rule condition field is MOST appropriate?
easy- A.proc.name contains 'shadow'
- B.container.id != host and fd.name=/etc/shadow
- ✓ C.evt.type in (open, openat) and fd.name=/etc/shadow
- D.evt.type=read and fd.name=/etc/shadow
Why C: Option C is correct because Falco rules detect system calls, and opening /etc/shadow requires either the `open` or `openat` syscall. By specifying `evt.type in (open, openat)` combined with `fd.name=/etc/shadow`, the rule precisely matches the syscall event that opens the file, which is the most direct way to detect an attempt to access it. This avoids false positives from other syscalls like `read` that might occur after the file is already opened.
Variation 3. A security team wants to detect any attempt to read the /etc/shadow file inside a container. Which Falco rule condition would detect this syscall?
medium- ✓ A.evt.type in (open, openat) and fd.name=/etc/shadow
- B.evt.type=read and fd.name=/etc/shadow
- C.evt.type=open and fd.name contains /etc/shadow
- D.proc.name=cat and fd.name=/etc/shadow
Why A: Option A is correct because Falco rules for file access typically use the 'open' or 'openat' syscall events. The 'evt.type in (open, openat)' matches both syscalls, and 'fd.name=/etc/shadow' exactly matches the target file. Option B is incorrect because a 'read' syscall alone doesn't indicate opening a file; the file descriptor is already open. Option C is invalid because 'contains' is not a valid operator in Falco conditions. Option D is too narrow because it only triggers when the command is 'cat', missing other tools like 'less' or 'vim'.
Variation 4. A security team wants to detect any attempt to read /etc/shadow from within a container using Falco. Which condition in a Falco rule would match this behavior?
hard- A.proc.name contains "shadow" and evt.type=read
- B.evt.type=read and fd.name contains "shadow"
- ✓ C.evt.type=open and fd.name=/etc/shadow
- D.container and fd.name=/etc/shadow
Why C: Option C is correct because reading /etc/shadow from a container requires opening the file first, so the Falco rule must match the `open` system call (evt.type=open) and the exact file path (fd.name=/etc/shadow). The `open` syscall is the entry point for file access, and Falco captures it before any read or write occurs, making it the appropriate event type to detect an attempt to read the shadow file.
Variation 5. A security team wants to detect attempts to read /etc/shadow inside containers. Which Falco rule condition would trigger on a container reading that file?
easy- A.evt.type=connect and fd.name=/etc/shadow
- B.evt.type=execve and proc.name=cat
- C.evt.type=open and container.id exists
- ✓ D.evt.type=open and fd.name=/etc/shadow
Why D: Option D is correct because Falco uses system call events to monitor file access. The condition `evt.type=open` captures file open operations, and `fd.name=/etc/shadow` filters for the specific file path. This triggers when any process inside a container opens /etc/shadow for reading, which is a classic indicator of an attempt to access sensitive host data.
Keep practising
More CKS practice questions
- Which flag is used to restrict the kubelet's ability to modify node status and pods?
- A Falco rule has priority `WARNING` and output: `Sensitive file opened (user=%user.name command=%proc.cmdline file=%fd.n…
- Falco detects a shell being opened inside a container. Which Falco rule field is used to specify the syscall condition f…
- A security audit reveals that a ServiceAccount named 'monitor' has a ClusterRoleBinding to the cluster-admin role. What…
- Match each Kubernetes security component to its description.
- Match each Kubernetes certificate type to its usage.
Last reviewed: Jul 4, 2026
This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.