* intermediary between "identity" and "domain/type" * the roles that can be entered determine which domains can be entered : ultimately, this controls which object types can be accessedan identity can have multiple roles
_t/var/log/audit(/.*)? all files system_u:object_r:auditd_log_t
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
regexp matching class context to apply to
dir + files matching objects
see /etc/selinux/targeted/contexts/files/*
| mode | can deny access ? | warn ? | log ? | details |
|---|---|---|---|---|
| enforcing | yes | yes | yes | |
| permissive | no | yes | yes | used mostly for troubleshooting |
| disabled | no | no | no |
Enforcing
SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33
Everything is forbidden unless explicitly authorized).
who + what + how
subject → access → objectrelationships
processes with the label user_tfiles with the label bin_tProcesses with the label user_t can execute regular files labeled bin_tallow cat cat_chow:food eat;
allow dog dog_chow:food eat;
^^^ ^^^^^^^^^^^^^ ^^^
subject object access
cat can access cat_chow:food for action eatdog can access dog_chow:food for action eatFido_dogFido_dog_chowSpot_dogSpot_dog_chow| type | object | example |
|---|---|---|
httpd_exec_t |
binary file | /usr/sbin/httpd |
httpd_config_t |
configuration directory | /etc/httpd |
httpd_log_t |
logfile directory | /var/log/httpd |
httpd_sys_content_t |
content directory | /var/www/html |
httpd_unit_file_d |
startup script | /usr/lib/systemd/system/httpd.service |
httpd_t |
process | /usr/sbin/httpd -DFOREGROUND |
httpd_t, http_port_t |
ports | 80/tcp, 443/tcp |
httpd_t context may interact with an object with the httpd_something_t label.