####Firewall Management (firewall-cmd, firewalld, iptables)
- Configure firewall settings using firewall-config, firewall-cmd, or iptables
firewall-cmd --permanent <cmd>
- must add--permanent
for changes to persistfirewall-cmd --list-all
- list configurationfirewall-cmd --list-services --zone=<zone|default>
- list added services to default or specific zonefirewall-cmd --get-services
- available services to enablefirewall-cmd --add-service=<service>
- enable service in default zonefirewall-cmd --add-port=<port/protocol>
- add a port if not definedfirewall-cmd --reload
- reload changesfirewall-cmd --get-default-zone
- see context of default zone
####Diagnose and address routine SELinux policy violations
sestatus
- show statussetenforce Enforcing (or 1)
- set SELinux to enforcing modevi /etc/selinux/config
- config file to set perm statechcon -t <type_t> <file>
- test changing type label contextsetsebool -P <boolean> 1|0
- turn an SELinux boolean on or offausearch -m avc
- audit failures and reviewgrep AVC /var/log/audit/audit.log
- secondary way to get errorsaudit2allow -wa
- generate steps to make the AVC failure allowedaudit2allow -aM <name>.local
- create a new module/policy packagerestorecon <file>
- restore contexts:/etc/selinux/targeted/contexts/files/
semanage fcontext -l
- view all file contexts (grep if needbe)yum install -y settroubleshoot-server
- install SELinux troubleshooting toolssealert -a /var/log/audit/audit.log
- displays SELinux policy violations