Podcast
Questions and Answers
What is the default SELinux policy that protects specific services?
What is the default SELinux policy that protects specific services?
- Custom Policy
- Strict Policy
- Targeted Policy (correct)
- MLS Policy
Which command would you use to check the current SELinux mode?
Which command would you use to check the current SELinux mode?
- ls -Z
- semanage
- setenforce
- getenforce (correct)
Which command can you use to modify SELinux file contexts?
Which command can you use to modify SELinux file contexts?
- semanage (correct)
- ausearch
- restorecon
- getenforce
If a web server cannot access a custom directory, what is the first step to troubleshoot the issue?
If a web server cannot access a custom directory, what is the first step to troubleshoot the issue?
Which of the following statements about SELinux is accurate?
Which of the following statements about SELinux is accurate?
What should you do after adjusting a SELinux policy to allow access to a directory?
What should you do after adjusting a SELinux policy to allow access to a directory?
What output can you expect when you run the command getenforce
?
What output can you expect when you run the command getenforce
?
In a high-security environment, which SELinux policy would be most appropriate?
In a high-security environment, which SELinux policy would be most appropriate?
What is the primary function of SELinux in a Linux system?
What is the primary function of SELinux in a Linux system?
Which mode of SELinux actively blocks actions that are not explicitly allowed?
Which mode of SELinux actively blocks actions that are not explicitly allowed?
What does the security context in SELinux indicate?
What does the security context in SELinux indicate?
How does the Permissive mode of SELinux operate?
How does the Permissive mode of SELinux operate?
Which statement best describes the Disabled mode of SELinux?
Which statement best describes the Disabled mode of SELinux?
What potential risk does SELinux help mitigate on a Linux server?
What potential risk does SELinux help mitigate on a Linux server?
What role does SELinux play in the context of a compromised application?
What role does SELinux play in the context of a compromised application?
SELinux policies primarily control which of the following aspects?
SELinux policies primarily control which of the following aspects?
Flashcards
SELinux
SELinux
A system that enforces security policies on Linux systems.
SELinux Policies
SELinux Policies
The rules SELinux uses to enforce security.
Targeted Policy
Targeted Policy
This policy protects specific services, like web servers and databases.
MLS Policy
MLS Policy
Signup and view all the flashcards
Enforcing Mode
Enforcing Mode
Signup and view all the flashcards
Permissive Mode
Permissive Mode
Signup and view all the flashcards
getenforce
getenforce
Signup and view all the flashcards
setenforce
setenforce
Signup and view all the flashcards
What is SELinux?
What is SELinux?
Signup and view all the flashcards
Why do we need SELinux?
Why do we need SELinux?
Signup and view all the flashcards
How does SELinux work?
How does SELinux work?
Signup and view all the flashcards
Enforcing mode in SELinux
Enforcing mode in SELinux
Signup and view all the flashcards
Permissive mode in SELinux
Permissive mode in SELinux
Signup and view all the flashcards
Disabled mode in SELinux
Disabled mode in SELinux
Signup and view all the flashcards
What are SELinux contexts?
What are SELinux contexts?
Signup and view all the flashcards
How to view SELinux contexts?
How to view SELinux contexts?
Signup and view all the flashcards
Study Notes
SELinux Overview
- SELinux (Security-Enhanced Linux) is a Linux kernel security module
- It's a bouncer at the Linux system, controlling access. Only allowing actions that are explicitly permitted.
SELinux Purpose
- Acts as an internal security system for Linux servers, preventing unauthorized access to files & resources.
- Prevents unauthorized use of system resources by processes.
- Protects against malicious processes & escalated privileges.
- Prevents web servers from accessing sensitive system directories.
SELinux Functionality
- Uses policies to control what processes can do.
- Defines who (user/process) can access, what (read, write, execute), and where (files/directories).
SELinux Modes
- Enforcing: Active, blocks unauthorized actions.
- Permissive: Watches but doesn’t block, logs violations for later analysis.
- Disabled: Insecure, no protection.
SELinux Contexts
- Every file, process, and user has a security context (name tag).
- This context specifies a user, role, type, and security level. Example:
httpd_sys_content_t
type context for web server content.
SELinux Policies
- Targeted Policy: Protects specific services.
- MLS Policy (Multi-Level Security): High-security environments.
SELinux Commands
getenforce
: Checks current SELinux mode.setenforce 0
: Sets SELinux to permissive mode.setenforce 1
: Sets SELinux to enforcing mode.ls -Z /path/to/file
: Lists file contexts.restorecon -v /path/to/file
: Restores default file contexts.semanage
: Used to manage SELinux policies (e.g.,semanage fcontext
,restorecon
).ausearch -m avc -ts recent
orjournalctl | grep SELinux
: Examining log for SELinux events.
SELinux Troubleshooting
- Logs: Examine audit logs (
ausearch
) or system logs (journalctl
). - Policies: Adjust or create policies using
semanage
to allow required access. - Restoring Contexts: Using
restorecon
for default configurations.
Real-World Analogy
- SELinux functions like guards inside a castle (Linux system).
- The firewall is the castle itself, keeping bad guys out (external security).
- SELinux is the castle workforce, preventing wrong access.
Important Note
- Disabling SELinux weakens security, leading to potentially significant risks.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
This quiz covers the principles of SELinux, an essential security feature of Linux systems. Learn about its purpose, functionality, different modes, and how security contexts are implemented to control access to resources effectively. Test your knowledge on how SELinux enhances security for Linux servers.