SELinux Flashcards

1
Q

What are the modes for SELinux?

A

Enabled
Passive
Disabled

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

Where is SELinux configured?

A

/etc/sysconfig/selinux

/etc/selinux/config

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

What is a boolean in SELinux?

A

A runtime configuration modification of the context SELinux policy

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

What are useful man pages for SELinux?

A

booleans
selinux
getsebool

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

How do you get SELinux status?

A

setatus

getenforce

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

How do you set SELinux so permissive mode via command line?

A

setenforce 0

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

How do you set SELinux to enforcing mode via command line?

A

setenforce 1

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

How do you do a listing with SELinux contexts?

A

ls -Z

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

How do you view SELinux contexts?

A

semanage fcontext -l

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

How do you view processes will their SELinux contexts?

A

ps -auxZ

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

How do you restore an SELinux context inheriting the parent directory?

A

restorecon

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

How do you relabel the filesystem for SELinux?

A

touch /.autorelabel
Reboot
*this is done also when SELinux is enabled for first time

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

How do you apply an SELinux context to a directory with inheritance?

A

semanage fcontext -a -t ‘/directory(/.*)?’

restorecon -Rv /directory

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

How do you remove an SELinux context from a directory with inheritance?

A

semanage fcontext -d ‘/directory(/.*)?’

restorecon -Rv /directory

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

How do you list the current status of boolean values on a system?

A

getsebool -a

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

How do you list the default status of boolean values used on the system?

A

semanage boolean -l

17
Q

What is SELinux?

A

It provides Mandatory Access Control on a system through contexts as a way of prioritising access control over Discretionary Access Control