Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pages/linux/matchpathcon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# matchpathcon

> Lookup the persistent SELinux security context setting of a path.
> See also: `semanage-fcontext`, `secon`, `chcon`, `restorecon`.
> More information: <https://manned.org/man/matchpathcon.8>.

- Lookup the persistent security context setting of an absolute path:

`matchpathcon {{/path/to/file}}`

- Restrict lookup to settings on a specific file type:

`matchpathcon -m {{file|dir|pipe|chr_file|blk_file|lnk_file|sock_file}} {{/path/to/file}}`

- [V]erify that the persistent and current security context of a path agree:

`matchpathcon -V {{/path/to/file}}`
25 changes: 25 additions & 0 deletions pages/linux/secon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# secon

> Get the SELinux security context of a file, pid, current execution context, or a context specification.
> See also: `semanage`, `runcon`, `chcon`.
> More information: <https://manned.org/man/secon>.

- Get the security context of the current execution context:

`secon`

- Get the current security context of a process:

`secon --pid {{1}}`

- Get the current security context of a file, resolving all intermediate symlinks:

`secon --file {{path/to/file_or_directory}}`

- Get the current security context of a symlink itself (i.e. do not resolve):

`secon --link {{path/to/symlink}}`

- Parse and explain a context specification:

`secon {{system_u:system_r:container_t:s0:c899,c900}}`