5) SELINUX Flashcards

1
Q

Which packages have restorecon & semanage commands?

A

policycoreutils & policycoreutils-python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you show SELINUX file context?

A

$ semanage fcontext -l

$ ls -Zd /virtual

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you temporarily change SELINUX file context?

A

chcon -t httpd_sys_content_t /virtual

returns to default if restorecon is run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the expression (/.*)? mean

A

optionally, match a / followed by any nubmer of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define a SELinux file context rule that defines httpd_sys_content_t for /custom recursively

A
# semanage fcontext -a -t httpd_sys_content_t '/custom(/.*)?'
# restorecon -Rv /custom
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do SELinux booleans do?

A

booleans are switches that change the behavior of SELinux policy. They are rule that can be disabled or enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Show SELinux boolean settings

A

$ getsebool -a

$ getsebool httpd_enable_homedirs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Enable httpd hosting within home directories using SELinux. Make it persistent across reboot.

A

$ setsebool -P httpd_enable_homedirs on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Compare SELinux file context of /moo to /moocow

A

ls -dZ /moo /moocow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly