Podcast
Questions and Answers
What is the default SELinux policy that protects specific services?
What is the default SELinux policy that protects specific services?
Which command would you use to check the current SELinux mode?
Which command would you use to check the current SELinux mode?
Which command can you use to modify SELinux file contexts?
Which command can you use to modify SELinux file contexts?
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?
Signup and view all the answers
Which of the following statements about SELinux is accurate?
Which of the following statements about SELinux is accurate?
Signup and view all the answers
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?
Signup and view all the answers
What output can you expect when you run the command getenforce
?
What output can you expect when you run the command getenforce
?
Signup and view all the answers
In a high-security environment, which SELinux policy would be most appropriate?
In a high-security environment, which SELinux policy would be most appropriate?
Signup and view all the answers
What is the primary function of SELinux in a Linux system?
What is the primary function of SELinux in a Linux system?
Signup and view all the answers
Which mode of SELinux actively blocks actions that are not explicitly allowed?
Which mode of SELinux actively blocks actions that are not explicitly allowed?
Signup and view all the answers
What does the security context in SELinux indicate?
What does the security context in SELinux indicate?
Signup and view all the answers
How does the Permissive mode of SELinux operate?
How does the Permissive mode of SELinux operate?
Signup and view all the answers
Which statement best describes the Disabled mode of SELinux?
Which statement best describes the Disabled mode of SELinux?
Signup and view all the answers
What potential risk does SELinux help mitigate on a Linux server?
What potential risk does SELinux help mitigate on a Linux server?
Signup and view all the answers
What role does SELinux play in the context of a compromised application?
What role does SELinux play in the context of a compromised application?
Signup and view all the answers
SELinux policies primarily control which of the following aspects?
SELinux policies primarily control which of the following aspects?
Signup and view all the answers
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.