Skip to content

Commit a0735eb

Browse files
write-ups_unpublished: SELinux add small details on domains, macros
1 parent b574c90 commit a0735eb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

write-ups_unpublished/LSM_apparmor_selinux.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,20 @@ For instance, the file 'file_contexts' holds regex to file(s) and the default co
103103
Example: \
104104
The boolean 'allow_ftpd_anon_write'[3] modifies the policy for ftpd to allow so-called anonymous users to write to disk. This is achieved with the _type_ 'public_content_rw_t' (to put it simply: like a special file permission), which is applied to files or directories that the anonymous user should have access to.
105105
As the application (ftpd) itself is not aware of SELinux, SELinux bases this on the process and file _types_. _**TODO:** question, how does SELinux correctly identify that the FTP user writing is anonymous?_
106-
- **Domain**:
106+
- **Domain**: processes (to put it simply: processes run in domains and are thereby separated from each other and can be granted different permissions)
107+
- **Macros**: ...similar to macros in programming...
107108

108109
¹ See Multi-Level Security (**MLS**) and Multi-Category Security (**MCS**): _<https://selinuxproject.org/page/MLSStatements>, <https://selinuxproject.org/page/MultiCategorySecurity>, <https://www.redhat.com/en/blog/why-you-should-be-using-multi-category-security-your-linux-containers>_
109110

110111
**Example of file types and names:**
111112
- Booleans: `booleans.local` (persistent config of which booleans should be on)
112-
- Policy: `policy.30` (all the compiled rules that will be used by SELinux system-wide, `.30` is simply the policy version). \
113+
- Policy: `policy.30` `sepolicy/*` (the compiled rules that will be used by SELinux system-wide, `.30` is simply the policy version). \
113114
It may for instance be viewed with `seinfo policy.30 --all`
114115
- Contexts: e.g. `file_contexts`, `file_context*`, (for _file_ system objects), this specifies the default contexts (labels) for different files and directories on disk.
115116
Files may be deviate from this default (e.g. if it's simply moved there or was manually changed), it can optionally be restored with `restorecon`. \
116117
Example line: `/var/ftp(/.*)? system_u:object_r:ftpd_anon_rw_t:s0`
117118
- Policy module: binary `localpolicy.pp`, source `localpolicy.te` (monolithic policies vs individual loadable policies [5])
119+
- Macros: `*macros`, `*.m4`
118120

119121
**To build binary policy, some relevant files [4][5]:** policy source `policy.conf`, loadable modules `*.te` (monolithic policies will be included in policy, individual loadable policies compiled to separate binary `*.pp`), contexts `*_context*` `contexts/*`, users and roles `seusers` `users` `roles`, makefile `makefile` \
120122
**Runtime config:** e.g. booleans `booleans*` \

0 commit comments

Comments
 (0)