meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:security [2026/06/11 16:17] – created titannet | linux:security [2026/06/12 07:56] (current) – titannet | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| auditreport | auditreport | ||
| - | / | + | / |
| / | / | ||
| Line 21: | Line 21: | ||
| <code bash> | <code bash> | ||
| - | # basic audit system parameters | + | # Delete all previous rules |
| -D | -D | ||
| + | # Set buffer size | ||
| -b 8192 | -b 8192 | ||
| - | -f 1 | + | # Make the configuration immutable |
| - | -e 1 | + | -e 2 |
| + | # Panic when a failure occurs | ||
| + | -f 2 | ||
| + | # Generate at most 100 audit messages per second | ||
| + | -r 100 | ||
| + | # Make login UID immutable once it is set (may break containers) | ||
| + | --loginuid-immutable | ||
| + | |||
| + | -w /etc/passwd -p wa -k passwd_changes | ||
| + | -w / | ||
| + | -w / | ||
| # some file and directory watches with keys | # some file and directory watches with keys | ||
| Line 37: | Line 48: | ||
| -a entry, | -a entry, | ||
| </ | </ | ||
| + | |||
| + | ===== Sysmon for linux ===== | ||
| + | |||
| + | * Linux port of sysmon | ||
| + | * Uses eBPF instead of kernel hooks | ||
| + | * extended Berkley Packet Filter | ||
| + | * Creates events instead of log entries (?) | ||
| + | |||
| + | <code bash> | ||
| + | sudo ./sysmon -accepteula | ||
| + | sudo ./sysmon -i | ||
| + | |||
| + | systemctl status sysmon | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | <file xml all_in_one.xml> | ||
| + | all-in-one.xml | ||
| + | <Sysmon schemaversion=" | ||
| + | < | ||
| + | <!-- Event ID 1 == ProcessCreate. Log all newly created processes --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!-- Event ID 3 == NetworkConnect Detected. Log all network connections --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!-- Event ID 5 == ProcessTerminate. Log all processes terminated --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!-- Event ID 9 == RawAccessRead. Log all raw access read --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!-- Event ID 10 == ProcessAccess. Log all open process operations --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!-- Event ID 11 == FileCreate. Log every file creation --> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | sudo ./sysmon -c all-in-one.xml | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | sudo tail -f / | ||
| + | |||
| + | sudo tail -f / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== SELinux ===== | ||
| + | |||
| + | * Mandatory access control | ||
| + | * (" | ||
| + | * -> Mandatory: generic profile rules | ||
| + | * Each process has domain (label) and each file has label | ||
| + | |||
| + | |||
| + | <code bash> | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||