Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

sealert

Explain SELinux denials in plain text, with the likely cause and the commands that fix it.

Niveau
Dagelijks Linux
Groep
SELinux en beveiliging
Root nodig
Ja
Pakket
setroubleshoot-server

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

With setroubleshoot-server installed, every AVC denial is analyzed. sealert -a /var/log/audit/audit.log prints a report per problem: what was blocked, why, and suggestions ("you need to change the label…", "turn on boolean…", "allow the port…"). Short messages also go to the journal (journalctl -t setroubleshoot) with an ID for sealert -l ID.

Zo schrijf je het

sealert -a FILE
sealert -l ID | -l "*"
sealert -b

Opties 9

Meest gebruikt

-a, --analyze FILE
Analyze a log file (like audit.log).
-l, --lookupid ID
Show the report of one alert ID (* = all).
-b, --browser
Open the GUI browser.
-s, --service
Start as a D-Bus service.
-S, --noservice
Do not use the service.
-u, --user
User mode.
-p, --printer
Print to the terminal.
-e, --emacs
Emacs format.
-h, --help
Show help.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Install it

    dnf install -y setroubleshoot-server

    Restart auditd or reboot so it gets the events.

  2. 2Analyze the whole audit log

    sealert -a /var/log/audit/audit.log | less

    One block per kind of denial, with fixes.

  3. 3Short messages in the journal

    journalctl -t setroubleshoot --since -1h
    setroubleshoot[2310]: SELinux is preventing /usr/sbin/httpd from read access on the file index.html. For complete SELinux messages run: sealert -l 3f6a…

    Copy the ID.

  4. 4Full report for one alert

    sealert -l 3f6a2b1c-…

    Cause and suggestions.

  5. 5All alerts

    sealert -l "*"

    Every stored alert.

  6. 6Typical suggestion: wrong label

    sealert -a /var/log/audit/audit.log | grep -A3 'restorecon'

    Run the restorecon it shows.

  7. 7Typical suggestion: boolean

    sealert -a /var/log/audit/audit.log | grep setsebool

    Use the boolean it names (with -P).

  8. 8Do not just follow audit2allow advice (security)

    sealert -a /var/log/audit/audit.log | grep -B2 audit2allow

    The last suggestion is often "make a module" — only if nothing else fits.

  9. 9Analyze an old log

    sealert -a /var/log/audit/audit.log.1

    Rotated logs.

  10. 10Check the service

    systemctl status setroubleshootd

    Runs on demand through D-Bus.

Exitcodes

0Done.
1Error.