07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 14.4<br />

Automatic transitions between domains<br />

IN PRACTICE<br />

Finding the security context<br />

To find the security context of a given process, you should use the Z option of<br />

ps.<br />

$ ps axZ | grep vstfpd<br />

system_u:system_r:ftpd_t:s0 2094 ? Ss 0:00 /usr/sbin/vsftpd<br />

The first field contains the identity, the role, the domain and the MCS level,<br />

separated by colons. The MCS level (Multi-Category Security) is a parameter<br />

that intervenes in the setup of a confidentiality protection policy, which regulates<br />

the access to files based on their sensitivity. This feature will not be<br />

explained in this book.<br />

To find the current security context in a shell, you should call id -Z.<br />

$ id -Z<br />

unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023<br />

Finally, to find the type assigned to a file, you can use ls -Z.<br />

$ ls -Z test /usr/bin/ssh<br />

unconfined_u:object_r:user_home_t:s0 test<br />

system_u:object_r:ssh_exec_t:s0 /usr/bin/ssh<br />

It is worth noting that the identity and role assigned to a file bear no special<br />

importance (they are never used), but for the sake of uniformity, all objects<br />

get assigned a complete security context.<br />

14.4.2. Seing Up SELinux<br />

SELinux support is built into the standard kernels provided by Debian. The core Unix tools<br />

support SELinux without any modifications. It is thus relatively easy to enable SELinux.<br />

390 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!