Interview Prep/Linux/Security, hardening and incident response

A developer says "SELinux keeps breaking my app, can we just disable it?" How do you respond and what do you do?

IntermediateScenarioSecurity, hardening and incident response
Answer

Situation read → Fix the policy issue, don't remove the protection.

What I'd do →

  1. Find the denial:
sudo ausearch -m AVC -ts recent
sudo sealert -a /var/log/audit/audit.log      # setroubleshoot
  1. Usually it's a label or boolean: restorecon -Rv /srv/app, semanage fcontext -a -t httpd_sys_content_t '/srv/app(/.*)?', setsebool -P httpd_can_network_connect on.
  2. Only if nothing fits, build a small local module: audit2allow -M myapp and review it before loading.
  3. If needed during debugging, make only that domain permissive: semanage permissive -a httpd_t.

Why → SELinux contains exploits; most "breakage" is a missing label after files were moved.

Interview tip → "setenforce 0 is a diagnostic, not a fix" is the line to say.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response