■ Inform
ation A ssurance R esearch G roup ■
1
M eeting Critical Security Objectives with Security-Enhanced Linux - - PowerPoint PPT Presentation
M eeting Critical Security Objectives with Security-Enhanced Linux Peter A. Loscocco Information Assurance Research G roup National Security Agency Co-author: Stephen D. Smalley, NAI Labs 1 roup Inform ation A ssurance R esearch G
■ Inform
ation A ssurance R esearch G roup ■
1
■ Inform
ation A ssurance R esearch G roup ■
2
■ Inform
ation A ssurance R esearch G roup ■
3
– Adm inistratively-set security policy – Control over all subjects and objects in system – Decisions based on all security-relevant inform ation
■ Inform
ation A ssurance R esearch G roup ■
4
■ Inform
ation A ssurance R esearch G roup ■
5
■ Inform
ation A ssurance R esearch G roup ■
6
– M
ultilevel Security – Address integrity, least privilege, separation of duty issues – Com plete control using needed security relevant inform ation – Control relationships between subjects and code
– One size does not fit all! – Ability to change the m
– Ability to express different policies within given m
– Separation of policy from enforcem ent
■ Inform
ation A ssurance R esearch G roup ■
7
– Establishing Legal Restrictions on data – Restrictions to classified/com partm ented data
– Restricting web server access to authorized data – M inim izing dam age from viruses and other m alicious code
– Protecting applications from m
– Preventing unauthorized m
– Guaranteeing that data is processed as required – Enforcing encryption policies
■ Inform
ation A ssurance R esearch G roup ■
8
– Can safely run code of uncertain pedigree – Constrains code inserted via buffer overflow attacks – Lim its virus propagation
– Root no longer all powerful – Lim its each root function to needed privilege – Elim inates m
– Servers need not run with com plete access – Servers and needed resources can be isolated – Separate protections for system logs
■ Inform
ation A ssurance R esearch G roup ■
9
■ Inform
ation A ssurance R esearch G roup ■
10
■ Inform
ation A ssurance R esearch G roup ■
11
Subject, object, class, requested
Object Manager Policy Enforcement Object/SID Mapping Security Server Policy Decisions SID/Context Mapping Access Vector Cache
Yes/no Access vector
■ Inform
ation A ssurance R esearch G roup ■
12
■ Inform
ation A ssurance R esearch G roup ■
13
■ Inform
ation A ssurance R esearch G roup ■
14
– Process: code execution, transitions, entrypoints, signals, wait, ptrace, capabilities, etc. – File: fd inheritance and transfer, accesses to files, directories, file system s – Socket: accesses to sockets, m essages, network interfaces, hosts – System V IPC: accesses to sem aphores, m essage queues, shared m em
– Security: accesses to security server services
■ Inform
ation A ssurance R esearch G roup ■
15
– Request SID to label a new object
– Exam ple of usage for new file label
■ Inform
ation A ssurance R esearch G roup ■
16
– Request Access Vector for a given object class/perm ission
pute_av(ssid, tsid, tclass, requested, *allowed, *decided, *seqno);
– Ignores access vectors for auditing and requests of notifications of com pleted operations
■ Inform
ation A ssurance R esearch G roup ■
17
– security_com pute_av() called indirectly through AVC
_ref(ssid, tsid, tclass, requested, *aeref, *auditdata)
– aeref is hint to cache entry. If invalid then security_com pute_av() is called
– int dentry_m ac_perm ission(struct dentry *d, access_vector_t av )
■ Inform
ation A ssurance R esearch G roup ■
18
error = dentry_m ac_perm ision(dentry, FILE_UNLINK); if (error) return error; – Additional directory-based checks for search and rem
e perm issions
lock_sock(sk); ret = avc_has_perm _ref(current->sid,sk->sid,sk->sclass, SOCKET_BIND &sk->avcr); release_sock(sk); if (ret) return ret;
■ Inform
ation A ssurance R esearch G roup ■
19
fs/exec.c:prepare_binprm ()
if (!bprm
retval = security_transition_sid(current->sid, inode->i_sid, S EC C LA SS _PR O C ES S, & bprm
if (retval) return retval;} if (current->sid != bprm
& !bprm
retval = A VC _H AS _PE R M _A U D IT(current->sid, bprm
P R O C E SS , TR A N SITIO N , &ad); if (retval) return retval; retval = process_file_m ac_perm ission(bprm
P R O C E SS _EN TR YP O IN T); if (retval) return retval;} retval = process_file_m ac_perm ission(bprm
P R O C E SS _EX EC U TE); if (retval) return retval;
■ Inform
ation A ssurance R esearch G roup ■
20
■ Inform
ation A ssurance R esearch G roup ■
21
■ Inform
ation A ssurance R esearch G roup ■
22
■ Inform
ation A ssurance R esearch G roup ■
23
init_exec_t
getty_exec_t
login_exec_t
shell_exec_t
netscape_exec_t
initrc_exec_t
sendm ail_exec_t
klogd_exec_t
■ Inform
ation A ssurance R esearch G roup ■
24
root_t
bin_t
var_t
var_log_t
wtm p_t
login_exec_t
m em
device_t
■ Inform
ation A ssurance R esearch G roup ■
25
■ Inform
ation A ssurance R esearch G roup ■
26
■ Inform
ation A ssurance R esearch G roup ■
27
■ Inform
ation A ssurance R esearch G roup ■
28
■ Inform
ation A ssurance R esearch G roup ■
29
allow fsadm _t fsadm _exec_t:process { entrypoint execute }; allow fsadm _t fixed_disk_device_t:blk_file { read write }; allow initrc_t fsadm _t:process transition; allow sysadm _t fsadm _t:process transition;
■ Inform
ation A ssurance R esearch G roup ■
30
allow klogd_t klogd_exec_t:process { entrypoint execute }; allow klogd_t m em
{ read write }; allow initrc_t klogd_t:process transition;
■ Inform
ation A ssurance R esearch G roup ■
31
allow initrc_t boot_t:dir { read search add_nam e rem
e }; allow initrc_t boot_runtim e_t:file { create write unlink }; type_transition initrc_t boot_t:file boot_runtim e_t;
■ Inform
ation A ssurance R esearch G roup ■
32
allow sysadm _t insm
s; allow sysadm _t insm
allow insm
{ entrypoint execute }; allow insm
_t:fd inherit_fd_perm s; allow insm
allow insm
_t:process sigchld;
■ Inform
ation A ssurance R esearch G roup ■
33
– e.g. bin_t, sbin_t
– e.g. etc_t
– e.g. shlib_t
– e.g. wtm p_t
– e.g. ld_so_t
■ Inform
ation A ssurance R esearch G roup ■
34
allow sendm ail_t etc_aliases_t:file { read write }; allow sendm ail_t etc_m ail:dir { read search add_nam e rem
e }; allow sendm ail_t etc_m ail_t:file { create read write unlink };
allow local_login_t wtm p_t:file { read write }; allow rem
p_t:file { read write }; allow utem pter_t wtm p_t:file { read write };
■ Inform
ation A ssurance R esearch G roup ■
35
allow sendm ail_t sm pt_port_t:tcp_socket nam e_bind; allow sendm ail_t m ail_spool_t:dir { read search add_nam e rem
e }; allow sendm ail_t m ail_spool_t:file { create read write unlink }; allow sendm ail_t m queue_spool_t:dir { read search add_nam e rem
e }; allow sendm ail_t m queue_spool_t:file { create read write unlink };
■ Inform
ation A ssurance R esearch G roup ■
36
allow ftpd_t wtm p_t:file append; allow ftpd_t var_log_t:file append; allow ftpd_t ls_exec_t:process execute;
■ Inform
ation A ssurance R esearch G roup ■
37
– signals, ptrace, /proc
allow user_t tm p_t:dir { read search add_nam e rem
e } ; allow user_t user_tm p_t:file { creat read write unlink }; type_transition user_t tm p_t:file user_tm p_t;
■ Inform
ation A ssurance R esearch G roup ■
38
type_transition getty_t login_exec_t:process local_login_t; allow local_login_t sysadm _t:process transition; allow newrole_t sysadm _t:process transition;
■ Inform
ation A ssurance R esearch G roup ■
39
type_transition user_t netscape_exec_t:process user_netscape_t; allow user_t netscape_exec_t:process { entrypoint execute } ; allow user_netscape_t user_netscape_rw_t:file { read write create unlink };
■ Inform
ation A ssurance R esearch G roup ■
40
– M acrobenchm arks showed no m easurable overhead – M icrobenchm arks showed sm all fixed overhead proportional to com plexity
ission checks – Should be treated as upper bound - no optim ization done
– Scalability and locking issues
■ Inform
ation A ssurance R esearch G roup ■
41
■ Inform
ation A ssurance R esearch G roup ■
42
– http://lsm .im m unix.com / – linux-security-m
wirex.com
– Patch to 2.4.6 kernel w/m
– Currently working on networking hooks
– Available at http://www.nsa.gov/selinux/ soon
■ Inform
ation A ssurance R esearch G roup ■
43