getenforce tips — authorized SELinux-mode literacy

Last updated: · By the BinBench editorial team · Stars and releases checked via the GitHub API
Quick answer

getenforce helps authorized labs sample SELinux mode literacy on hosts they own. Pair with selinux-tips, apparmor-tips, ausearch-tips, auditctl-tips, aureport-tips. Prefer lab VMs — never disable or probe SELinux on foreign hosts without permission.

Snapshot

FieldValue
Surfacegetenforce tip checklist (Enforcing / Permissive / Disabled)
JobAuthorized SELinux-mode literacy
Peerselinux-tips
Peerapparmor-tips
Peerausearch-tips
Peeraureport-tips

Tip checklist (authorized only)

  1. Confirm you may run getenforce on the lab host (syllabus box you own or were given access to).
  2. Prefer documenting who / why / ticket before any MAC-mode drill — never change production SELinux mode without change control.
  3. Record short factual notes; quote short Evidence (Enforcing/Permissive/Disabled — never secrets or foreign policy dumps).
  4. Optional: broader SELinux peer → selinux-tips.
  5. Optional: AppArmor peer → apparmor-tips.
  6. Prefer disposable lab VMs for mode drills; quote non-secret mode labels afterward as Evidence.
  7. Prefer read-only getenforce / sestatus for most Evidence binders — refuse unauthorized setenforce 0 / disable cookbooks.
  8. Stop at literacy — no attack or unauthorized MAC-bypass cookbooks.

Allowed framing

  • Classroom labs reviewing getenforce and Enforcing/Permissive/Disabled read-backs on authorized disposable hosts.
  • Binding short factual notes as Evidence (mode label — no secrets).
  • Documenting expected vs observed SELinux mode for authorized inventory notes.
  • Comparing getenforce ↔ selinux / AppArmor / ausearch / aureport peer tip pages under one binder.
  • Testing syllabus-approved permissive-mode labs only when change control authorizes that drill on lab resources.

Scope we will not cover

  • No crack/pirate/keygen via getenforce.
  • No intentional unauthorized SELinux disable against foreign hosts.
  • No secret-theft or policy/AVC credential harvesting against hosts you do not own.
  • No cookbooks that weaken SELinux for attack without authorization.
  • No setenforce 0 framed as an exploit step.

Beginner path (authorized only)

  1. Obtain one syllabus-approved disposable lab host with SELinux tooling available.
  2. Prefer a throwaway lab VM before any mode-change drill.
  3. With authorization, run getenforce; quote the mode label (Enforcing/Permissive/Disabled) as Evidence.
  4. Optional: peer tip pages above when the syllabus asks.
  5. Stop at literacy — no attack or unauthorized disable cookbooks.

Practical notes for authorized labs

  • getenforce reports the current SELinux mode — keep Evidence labels distinct from selinux-tips broader policy drills.
  • Pair with ausearch-tips / aureport-tips when the syllabus zooms on AVC audit follow-up.
  • Policy dumps may embed sensitive contexts — never paste secrets into notes or git.
  • Prefer documenting mode labels the syllabus authorized without dumping full privileged policy JSON.
  • Never commit SELinux policy dumps with secrets to git — even for labs.

FAQ-aligned refusals (quick)

  • Foreign-host SELinux disable / probe → refuse.
  • Unauthorized MAC-bypass / setenforce 0 attack cookbooks → refuse.
  • Attack/credential-theft framing → refuse.
Which to pick
  • Prefer authorized, redacted, secret-free Evidence.
  • Use selinux / AppArmor / ausearch / aureport peer tip pages when the syllabus asks.
  • No crack or unauthorized-access framing.

For legal, authorized and educational use only.

FAQ

What is a "getenforce tip" page in BinBench framing?

A checklist for authorized SELinux mode Evidence (getenforce, Enforcing/Permissive/Disabled read-backs on lab hosts) on hosts you own or were given syllabus access to — not a cookbook for disabling SELinux on foreign servers.

How does this relate to selinux-tips / apparmor-tips / ausearch-tips / aureport-tips?

selinux-tips covers broader SELinux literacy; apparmor-tips covers AppArmor MAC; ausearch-tips and aureport-tips cover audit search/report. This page zooms on a getenforce tip checklist — it does not overwrite those pages.

Can I run getenforce against hosts I do not own?

No. Authorization first. BinBench will not publish unauthorized SELinux mode probes against foreign hosts.

Does this teach attack or SELinux-bypass PoCs via getenforce?

No. Mentions of attack/bypass appear only as refusals. Authorized literacy only — prefer lab VMs and redacted samples. Never teach setenforce 0 as an attack step.

Does this teach secret theft via getenforce?

No. Never paste SELinux policy dumps with secrets, foreign host contexts, or credential-bearing AVC messages into notes. Prefer documenting mode labels (Enforcing/Permissive/Disabled) only.

Sources