Skip to main content
🎤 Luca Berton is speaking at Red Hat Summit & KubeCon EU 2026!Learn more →
Back to Blog

SELinux Booleans Explained

SELinux booleans let you toggle common service behaviors without writing custom policy. Learn getsebool, setsebool, and the most useful httpd booleans.

Luca BertonMarch 21, 20261 min read

What Are SELinux Booleans?

Booleans are policy switches that enable or disable common service behaviors without writing custom policy modules. They're the safest way to adjust SELinux behavior.

Listing Booleans

getsebool -a | grep httpd

Shows booleans like:

httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_enable_homedirs --> off
httpd_can_sendmail --> off
Related Course

Master this topic with hands-on labs

Go beyond reading — build real projects in sandboxed environments with expert video guidance.

Browse Courses →

Changing Booleans

Runtime only (lost on reboot):

setsebool httpd_can_network_connect on

Persistent (survives reboot):

setsebool -P httpd_can_network_connect on

Always use -P for production.

Essential httpd Booleans

BooleanPurpose
httpd_can_network_connectOutbound TCP connections
httpd_can_network_connect_dbDatabase connections
httpd_enable_homedirsServe user home dirs
httpd_can_sendmailSend emails
httpd_use_nfsServe NFS content
Stay Updated

Get weekly IT automation tips

Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.

Subscribe Free →

Real-World Example: PHP-FPM over TCP

Apache connecting to PHP-FPM on 127.0.0.1:9000:

curl http://localhost/index.php
# 503 Service Unavailable

AVC log shows name_connect denied. Fix:

setsebool -P httpd_can_network_connect on

Boolean Discovery Workflow

  1. Hit a denial → check AVC logs
  2. Run audit2allow → see if it suggests a boolean
  3. Verify with getsebool boolean_name
  4. Enable with setsebool -P boolean_name on
  5. Verify the service works

Learn to use booleans in our SELinux for System Admins course.

---

Ready to go deeper? Check out our hands-on course: SELinux for System Admins — practical exercises you can follow along on your own machine.

Ready to learn by doing?

Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.

Share this article
LB
Luca Berton

Docker Captain, IT automation expert, Red Hat Summit & KubeCon speaker. Building hands-on education for DevOps engineers at CopyPasteLearn.

Related Articles

Explore topics

Browse more articles on the topics covered here.