RHCSA SELinux Administration Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 14 | Questions: 20 | Updated: Aug 16, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. Which SELinux policy type is the default on Red Hat Enterprise Linux?

Explanation

Targeted is the default SELinux policy on Red Hat Enterprise Linux. It applies security controls to selected services and processes, while most other processes run without SELinux confinement.

Submit
Please wait...
About This Quiz
RHCSA Selinux Administration Quiz - Quiz

This quiz evaluates your understanding of SELinux administration within RHCSA certification. It covers security contexts, file labeling, boolean settings, policy enforcement modes, and troubleshooting common SELinux issues. Essential for system administrators managing Red Hat Enterprise Linux security policies and access controls.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Which directory typically contains SELinux policy files and modules?

Explanation

SELinux files are stored in several locations depending on their purpose. `/etc/selinux/` commonly holds configuration and policy-related files, `/usr/share/selinux/` may contain policy packages and modules supplied by software, and `/var/lib/selinux/` typically stores the active policy store and related data. Thus, all three directories can contain SELinux policy files or modules.

Submit

3. How do you temporarily disable SELinux without rebooting?

Explanation

`setenforce 0` switches SELinux to permissive mode immediately, without rebooting. SELinux continues to monitor policy violations but does not block them. This change is temporary and typically reverts to the configured mode after a reboot. You generally need root privileges to run the command.

Submit

4. What command displays all SELinux policy modules currently loaded?

Explanation

`semodule -l` lists the SELinux policy modules installed in the policy store, along with details such as their versions and priorities. This lets an administrator inspect which modules are available to the active policy. The other commands serve different purposes: `getsebool -a` lists booleans, and `sestatus` reports SELinux status.

Submit

5. Which SELinux user typically represents standard system users?

Explanation

In SELinux, `user_u` is typically assigned to standard, unprivileged users. It provides a basic user identity with limited permissions. By contrast, `system_u` is commonly used for system processes, while `staff_u` and `sysadm_u` are associated with users who may have additional administrative privileges.

Submit

6. What is the difference between 'audit2allow -a' and 'audit2allow -a -M policy_name'?

Explanation

`audit2allow -a` reads audit log entries and displays suggested SELinux allow rules. Adding `-M policy_name` packages those rules into a loadable policy module, typically creating module files named from `policy_name`, rather than merely printing the rules.

Submit

7. Which tool can generate SELinux policy recommendations from audit logs?

Explanation

audit2allow analyzes SELinux AVC denial messages recorded in audit logs and translates them into candidate allow rules or policy modules. Administrators can review these recommendations and add appropriate rules to a local policy when access is legitimate. It should not be applied blindly, since broad permissions can weaken SELinux protections. audit2why explains denials; auditctl configures auditing.

Submit

8. What does the audit daemon (auditd) do in relation to SELinux?

Explanation

The audit daemon records security-related events, including SELinux policy violations and access denials, in audit logs. These records help administrators investigate blocked actions and monitor system security. SELinux itself enforces policies; auditd logs relevant events rather than compiling policies or managing SELinux user accounts.

Submit

9. When troubleshooting SELinux denials, which log file should you consult?

Explanation

SELinux records access-control violations as AVC (Access Vector Cache) denial events. These audit records are typically written by the audit daemon to `/var/log/audit/audit.log`, where tools such as `ausearch` or `sealert` can help filter and interpret them. Other system logs may contain general messages but are not the primary source for SELinux denial details.

Submit

10. What command is used to add a custom file context rule to SELinux?

Explanation

`semanage fcontext -a` adds a persistent custom file-context rule to SELinux’s policy mapping. The rule defines the security context to assign to matching files, and `restorecon` can then apply it. In contrast, `chcon` changes labels directly, while `restorecon` and `fixfiles check` are used to restore or check labels.

Submit

11. What command displays the current SELinux enforcement mode on a system?

Explanation

`getenforce` displays the system’s current SELinux mode: `Enforcing`, `Permissive`, or `Disabled`. It reports the active enforcement state without changing it. `setstatus` and `getpolicy` are not the standard commands for this purpose.

Submit

12. How do you persistently change an SELinux boolean setting?

Explanation

The `-P` option makes the boolean change persistent by updating the SELinux policy configuration, so the setting remains enabled after a reboot. Without `-P`, `setsebool boolean_name on` changes the value only until the system restarts. Use the boolean’s actual name in place of `boolean_name`.

Submit

13. Which command lists all available SELinux booleans and their current status?

Explanation

Both commands display SELinux booleans and their enabled or disabled status. `getsebool -a` prints the current state of every boolean, while `semanage boolean -l` lists booleans with their descriptions and current state. They provide different output formats, but either command can be used to review available booleans and their status.

Submit

14. What is the purpose of SELinux booleans in policy management?

Explanation

SELinux booleans are switches that let administrators turn specific policy behaviors on or off at runtime. This provides flexibility to adjust access controls without rebuilding or reloading the entire SELinux policy.

Submit

15. Which command displays the SELinux context of a file?

Explanation

Each command can show a file’s SELinux label through a different interface. `ls -Z` prints the context alongside the file listing, `stat -c %C` formats the context in `stat` output, and `getfattr -n security.selinux` reads the SELinux extended attribute directly. Thus, all three are valid ways to inspect it.

Submit

16. In SELinux, a security context consists of three primary components. Which is NOT one of them?

Explanation

An SELinux security context typically identifies a subject or object by its user identity, role, and type (often written user:role:type). In policies using Multi-Level Security, a sensitivity level may also appear, but this is not a priority setting. SELinux access decisions are based on labels and policy rules, not a “priority level” component.

Submit

17. What does SELinux stand for?

Explanation

SELinux stands for Security-Enhanced Linux. It is a Linux security feature that enforces access-control policies, helping limit what users and processes can do on a system.

Submit

18. Which tool is used to restore default SELinux file contexts across the filesystem?

Explanation

Both `restorecon` and `fixfiles` can restore SELinux file contexts. `restorecon` resets contexts on specified files or directories according to policy, while `fixfiles` provides system-wide context restoration and related relabeling operations. Therefore, either tool can be used to return file labels to their policy-defined defaults.

Submit

19. What is the correct syntax to change a file's SELinux context using chcon?

Explanation

The `chcon` command can modify individual parts of a file’s SELinux security context. The `-u` option sets the SELinux user, `-r` sets the role, and `-t` sets the type. Each shown command uses valid syntax for changing that component on `file.txt`, so all three options are correct.

Submit

20. Which SELinux mode allows policy rules to be checked but violations are only logged, not enforced?

Explanation

Permissive mode evaluates system activity against SELinux policy rules and records policy violations in the audit logs, but it does not block the actions. This makes it useful for troubleshooting and testing policies before enforcement. In enforcing mode, violations are blocked; in disabled mode, SELinux policy checks are not active.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which SELinux policy type is the default on Red Hat Enterprise Linux?
Which directory typically contains SELinux policy files and modules?
How do you temporarily disable SELinux without rebooting?
What command displays all SELinux policy modules currently loaded?
Which SELinux user typically represents standard system users?
What is the difference between 'audit2allow -a' and 'audit2allow -a -M...
Which tool can generate SELinux policy recommendations from audit...
What does the audit daemon (auditd) do in relation to SELinux?
When troubleshooting SELinux denials, which log file should you...
What command is used to add a custom file context rule to SELinux?
What command displays the current SELinux enforcement mode on a...
How do you persistently change an SELinux boolean setting?
Which command lists all available SELinux booleans and their current...
What is the purpose of SELinux booleans in policy management?
Which command displays the SELinux context of a file?
In SELinux, a security context consists of three primary components....
What does SELinux stand for?
Which tool is used to restore default SELinux file contexts across the...
What is the correct syntax to change a file's SELinux context using...
Which SELinux mode allows policy rules to be checked but violations...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!