3 # py-rsbac - RSBAC Python bindings
4 # Copyright (C) 2006 Frederic Jolliton <pyrsbac@tuxee.net>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 __all__ = [ 'RequestVector' , 'RcRequestVector' , 'AclRequestVector' ,
21 'FileFlags' , 'PaxFlags' , 'CapsFlags' , 'JailFlags' ]
23 from rsbac import headers
24 from rsbac._flags import buildFlagsClass
27 sorted( ( getattr( headers , name ) , name.split( '_' , 1 )[ -1 ].lower() )
28 for name in dir( headers )
29 if name.startswith( 'R_' ) and name.upper() != 'R_NONE' )
31 RequestVector = buildFlagsClass( 'RequestVector' , ( object , ) , _g_requests )
34 sorted( ( getattr( headers , name ) , name.split( '_' , 1 )[ -1 ].lower() )
35 for name in dir( headers )
36 if ( name.startswith( 'R_' ) or name.startswith( 'RCR_' ) )
37 and name.upper() not in ( 'R_NONE' , 'RCR_NONE' ) )
39 RcRequestVector = buildFlagsClass( 'RcRequestVector' , ( object , ) , _g_rcrequests )
42 sorted( ( getattr( headers , name ) , name.split( '_' , 1 )[ -1 ].lower() )
43 for name in dir( headers )
44 if ( name.startswith( 'R_' ) or name.startswith( 'ACLR_' ) )
45 and name.upper() not in ( 'R_NONE' , 'ACLR_NONE' ) )
47 AclRequestVector = buildFlagsClass( 'AclRequestVector' , ( object , ) , _g_aclrequests )
50 sorted( ( getattr( headers , name ) , name.split( '_' , 1 )[ -1 ].lower() )
51 for name in dir( headers )
52 if name.startswith( 'ST_' ) and name.upper() != 'ST_NONE' )
54 ScdVector = buildFlagsClass( 'ScdVector' , ( object , ) , _g_scds )
55 JailScdVector = buildFlagsClass( 'JailScdVector' , ( object , ) , _g_scds )
59 ( 1 , 'execute_only' ) ,
60 ( 2 , 'search_only' ) ,
61 ( 3 , 'write_only' ) ,
62 ( 4 , 'secure_delete' ) ,
63 ( 5 , 'no_execute' ) ,
64 ( 6 , 'no_delete_or_rename' ) ,
65 ( 7 , 'add_inherited' ) ,
66 ( 8 , 'append_only' ) ,
71 FileFlags = buildFlagsClass( 'FileFlags' , ( object , ) , _g_fileFlags )
82 PaxFlags = buildFlagsClass( 'PaxFlags' , ( object , ) , _g_paxFlags )
86 ( 1 , 'DAC_OVERRIDE' ) ,
87 ( 2 , 'DAC_READ_SEARCH' ) ,
94 ( 9 , 'LINUX_IMMUTABLE' ) ,
95 ( 10 , 'NET_BIND_SERVICE' ) ,
96 ( 11 , 'NET_BROADCAST' ) ,
97 ( 12 , 'NET_ADMIN' ) ,
100 ( 15 , 'IPC_OWNER' ) ,
101 ( 16 , 'SYS_MODULE' ) ,
102 ( 17 , 'SYS_RAWIO' ) ,
103 ( 18 , 'SYS_CHROOT' ) ,
104 ( 19 , 'SYS_PTRACE' ) ,
105 ( 20 , 'SYS_PACCT' ) ,
106 ( 21 , 'SYS_ADMIN' ) ,
107 ( 22 , 'SYS_BOOT' ) ,
108 ( 23 , 'SYS_NICE' ) ,
109 ( 24 , 'SYS_RESOURCE' ) ,
110 ( 25 , 'SYS_TIME' ) ,
111 ( 26 , 'SYS_TTY_CONFIG' ) ,
116 CapsFlags = buildFlagsClass( 'CapsFlags' , ( object , ) , _g_capsFlags )
119 ( 0 , 'allow_external_ipc' ) ,
120 ( 1 , 'allow_all_net_family' ) ,
121 ( 3 , 'allow_inet_raw' ) ,
122 ( 4 , 'auto_adjust_inet_any' ) ,
123 ( 5 , 'allow_inet_localhost' ) ,
124 ( 7 , 'allow_dev_get_status' ) ,
125 ( 8 , 'allow_dev_mod_system' ) ,
126 ( 9 , 'allow_dev_read' ) ,
127 ( 10 , 'allow_dev_write' ) ,
128 ( 11 , 'allow_tty_open' ) ,
129 ( 12 , 'allow_parent_ipc' ) ,
130 ( 13 , 'allow_suid_files' ) ,
131 ( 14 , 'allow_mount' )
134 JailFlags = buildFlagsClass( 'JailFlags' , ( object , ) , _g_jailFlags )
137 # indent-tabs-mode: nil