2005-09-19 21:17:45 +00:00
|
|
|
## <summary>PostgreSQL relational database</summary>
|
|
|
|
|
2008-06-10 15:33:18 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Role access for SE-PostgreSQL.
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="user_role">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## The role associated with the user domain.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="user_domain">
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-20 17:40:18 +00:00
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## The type of the user domain.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`postgresql_role',`
|
2008-06-10 15:33:18 +00:00
|
|
|
gen_require(`
|
|
|
|
class db_database all_db_database_perms;
|
|
|
|
class db_table all_db_table_perms;
|
|
|
|
class db_procedure all_db_procedure_perms;
|
|
|
|
class db_column all_db_column_perms;
|
|
|
|
class db_tuple all_db_tuple_perms;
|
|
|
|
class db_blob all_db_blob_perms;
|
|
|
|
|
|
|
|
attribute sepgsql_client_type, sepgsql_database_type;
|
|
|
|
attribute sepgsql_sysobj_table_type;
|
|
|
|
|
2008-06-24 12:57:06 +00:00
|
|
|
type sepgsql_trusted_proc_exec_t, sepgsql_trusted_proc_t;
|
2008-11-05 16:10:46 +00:00
|
|
|
type user_sepgsql_blob_t, user_sepgsql_proc_exec_t;
|
|
|
|
type user_sepgsql_sysobj_t, user_sepgsql_table_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
typeattribute $2 sepgsql_client_type;
|
2008-11-05 16:10:46 +00:00
|
|
|
role $1 types sepgsql_trusted_proc_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Client local policy
|
|
|
|
#
|
|
|
|
|
2009-06-26 14:40:13 +00:00
|
|
|
allow $2 user_sepgsql_table_t:db_table { getattr use select update insert delete lock };
|
2009-05-21 11:49:33 +00:00
|
|
|
allow $2 user_sepgsql_table_t:db_column { getattr use select update insert };
|
2008-12-03 18:33:19 +00:00
|
|
|
allow $2 user_sepgsql_table_t:db_tuple { use select update insert delete };
|
2009-05-21 11:28:14 +00:00
|
|
|
type_transition $2 sepgsql_database_type:db_table user_sepgsql_table_t;
|
|
|
|
|
2008-12-03 18:33:19 +00:00
|
|
|
allow $2 user_sepgsql_sysobj_t:db_tuple { use select };
|
2009-05-21 11:28:14 +00:00
|
|
|
type_transition $2 sepgsql_sysobj_table_type:db_tuple user_sepgsql_sysobj_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
|
2009-05-21 11:49:33 +00:00
|
|
|
allow $2 user_sepgsql_proc_exec_t:db_procedure { getattr execute };
|
2008-11-05 16:10:46 +00:00
|
|
|
type_transition $2 sepgsql_database_type:db_procedure user_sepgsql_proc_exec_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
|
2009-05-22 13:37:32 +00:00
|
|
|
allow $2 user_sepgsql_blob_t:db_blob { create drop getattr setattr read write import export };
|
2008-11-05 16:10:46 +00:00
|
|
|
type_transition $2 sepgsql_database_type:db_blob user_sepgsql_blob_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
|
2008-06-24 12:57:06 +00:00
|
|
|
allow $2 sepgsql_trusted_proc_t:process transition;
|
|
|
|
type_transition $2 sepgsql_trusted_proc_exec_t:process sepgsql_trusted_proc_t;
|
2010-09-20 17:50:51 +00:00
|
|
|
|
|
|
|
tunable_policy(`sepgsql_enable_users_ddl',`
|
|
|
|
allow $2 user_sepgsql_table_t:db_table { create drop setattr };
|
|
|
|
allow $2 user_sepgsql_table_t:db_column { create drop setattr };
|
|
|
|
|
|
|
|
allow $2 user_sepgsql_sysobj_t:db_tuple { update insert delete };
|
|
|
|
allow $2 user_sepgsql_proc_exec_t:db_procedure { create drop setattr };
|
|
|
|
')
|
2008-06-10 15:33:18 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL loadable shared library module
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a database object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_loadable_module',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_module_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_module_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL database object type
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a database object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_database_object',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_database_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_database_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL table/column/tuple object type
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a table/column/tuple object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_table_object',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_table_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_table_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL system table/column/tuple object type
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a table/column/tuple object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_system_table_object',`
|
|
|
|
gen_require(`
|
2008-07-23 21:38:39 +00:00
|
|
|
attribute sepgsql_table_type, sepgsql_sysobj_table_type;
|
2008-06-10 15:33:18 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_table_type;
|
|
|
|
typeattribute $1 sepgsql_sysobj_table_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL procedure object type
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a database object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_procedure_object',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_procedure_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_procedure_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Marks as a SE-PostgreSQL binary large object type
|
2008-06-10 15:33:18 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="type">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Type marked as a database binary large object type.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_blob_object',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_blob_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_blob_type;
|
|
|
|
')
|
|
|
|
|
2005-09-19 21:17:45 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to search postgresql's database directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`postgresql_search_db',`
|
2005-09-19 21:17:45 +00:00
|
|
|
gen_require(`
|
|
|
|
type postgresql_db_t;
|
|
|
|
')
|
|
|
|
|
2010-09-20 17:53:44 +00:00
|
|
|
allow $1 postgresql_db_t:dir search_dir_perms;
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to manage postgresql's database.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
|
|
|
interface(`postgresql_manage_db',`
|
|
|
|
gen_require(`
|
|
|
|
type postgresql_db_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 postgresql_db_t:dir rw_dir_perms;
|
|
|
|
allow $1 postgresql_db_t:file rw_file_perms;
|
2010-09-20 17:53:44 +00:00
|
|
|
allow $1 postgresql_db_t:lnk_file read_lnk_file_perms;
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute postgresql in the postgresql domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type postgresql_t, postgresql_exec_t;
|
|
|
|
')
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
domtrans_pattern($1, postgresql_exec_t, postgresql_t)
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
2010-03-19 17:51:32 +00:00
|
|
|
######################################
|
|
|
|
## <summary>
|
|
|
|
## Allow domain to signal postgresql
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain allowed access.
|
2010-03-19 17:51:32 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_signal',`
|
|
|
|
gen_require(`
|
|
|
|
type postgresql_t;
|
|
|
|
')
|
|
|
|
allow $1 postgresql_t:process signal;
|
|
|
|
')
|
|
|
|
|
2005-09-19 21:17:45 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to read postgresql's etc.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-09-19 21:17:45 +00:00
|
|
|
#
|
|
|
|
interface(`postgresql_read_config',`
|
|
|
|
gen_require(`
|
|
|
|
type postgresql_etc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
2008-10-20 16:10:42 +00:00
|
|
|
allow $1 postgresql_etc_t:dir list_dir_perms;
|
|
|
|
allow $1 postgresql_etc_t:file read_file_perms;
|
|
|
|
allow $1 postgresql_etc_t:lnk_file read_lnk_file_perms;
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2007-11-26 16:44:57 +00:00
|
|
|
## Allow the specified domain to connect to postgresql with a tcp socket.
|
2005-09-19 21:17:45 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_tcp_connect',`
|
2007-11-26 16:44:57 +00:00
|
|
|
gen_require(`
|
|
|
|
type postgresql_t;
|
|
|
|
')
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
corenet_tcp_recvfrom_labeled($1, postgresql_t)
|
2007-11-26 16:44:57 +00:00
|
|
|
corenet_tcp_sendrecv_postgresql_port($1)
|
|
|
|
corenet_tcp_connect_postgresql_port($1)
|
|
|
|
corenet_sendrecv_postgresql_client_packets($1)
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to connect to postgresql with a unix socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`postgresql_stream_connect',`
|
2005-09-19 21:17:45 +00:00
|
|
|
gen_require(`
|
2006-04-19 15:25:22 +00:00
|
|
|
type postgresql_t, postgresql_var_run_t, postgresql_tmp_t;
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
files_search_pids($1)
|
2010-09-15 11:30:49 +00:00
|
|
|
files_search_tmp($1)
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-20 17:40:18 +00:00
|
|
|
stream_connect_pattern($1, { postgresql_var_run_t postgresql_tmp_t }, { postgresql_var_run_t postgresql_tmp_t }, postgresql_t)
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|
2008-06-10 15:33:18 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Allow the specified domain unprivileged accesses to unifined database objects
|
2008-06-10 15:33:18 +00:00
|
|
|
## managed by SE-PostgreSQL,
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_unpriv_client',`
|
|
|
|
gen_require(`
|
2009-05-21 11:28:14 +00:00
|
|
|
class db_database all_db_database_perms;
|
2008-06-10 15:33:18 +00:00
|
|
|
class db_table all_db_table_perms;
|
|
|
|
class db_procedure all_db_procedure_perms;
|
2009-05-21 11:28:14 +00:00
|
|
|
class db_column all_db_column_perms;
|
|
|
|
class db_tuple all_db_tuple_perms;
|
2008-06-10 15:33:18 +00:00
|
|
|
class db_blob all_db_blob_perms;
|
|
|
|
|
|
|
|
attribute sepgsql_client_type;
|
2009-05-21 11:28:14 +00:00
|
|
|
attribute sepgsql_database_type, sepgsql_sysobj_table_type;
|
2008-06-10 15:33:18 +00:00
|
|
|
|
2008-06-24 12:57:06 +00:00
|
|
|
type sepgsql_trusted_proc_t, sepgsql_trusted_proc_exec_t;
|
2009-05-21 11:28:14 +00:00
|
|
|
type unpriv_sepgsql_blob_t, unpriv_sepgsql_proc_exec_t;
|
|
|
|
type unpriv_sepgsql_sysobj_t, unpriv_sepgsql_table_t;
|
2008-06-10 15:33:18 +00:00
|
|
|
')
|
|
|
|
|
2009-05-21 11:28:14 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2008-06-10 15:33:18 +00:00
|
|
|
typeattribute $1 sepgsql_client_type;
|
|
|
|
|
2009-05-21 11:28:14 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Client local policy
|
|
|
|
#
|
2008-06-10 15:33:18 +00:00
|
|
|
|
2008-06-24 12:57:06 +00:00
|
|
|
type_transition $1 sepgsql_trusted_proc_exec_t:process sepgsql_trusted_proc_t;
|
|
|
|
allow $1 sepgsql_trusted_proc_t:process transition;
|
2009-05-21 11:28:14 +00:00
|
|
|
|
|
|
|
allow $1 unpriv_sepgsql_table_t:db_table { getattr use select update insert delete lock };
|
|
|
|
allow $1 unpriv_sepgsql_table_t:db_column { getattr use select update insert };
|
|
|
|
allow $1 unpriv_sepgsql_table_t:db_tuple { use select update insert delete };
|
|
|
|
type_transition $1 sepgsql_database_type:db_table unpriv_sepgsql_table_t;
|
|
|
|
|
|
|
|
allow $1 unpriv_sepgsql_sysobj_t:db_tuple { use select };
|
|
|
|
type_transition $1 sepgsql_sysobj_table_type:db_tuple unpriv_sepgsql_sysobj_t;
|
|
|
|
|
2009-05-21 11:49:33 +00:00
|
|
|
allow $1 unpriv_sepgsql_proc_exec_t:db_procedure { getattr execute };
|
2009-05-21 11:28:14 +00:00
|
|
|
type_transition $1 sepgsql_database_type:db_procedure unpriv_sepgsql_proc_exec_t;
|
|
|
|
|
2009-05-22 13:37:32 +00:00
|
|
|
allow $1 unpriv_sepgsql_blob_t:db_blob { create drop getattr setattr read write import export };
|
2009-05-21 11:28:14 +00:00
|
|
|
type_transition $1 sepgsql_database_type:db_blob unpriv_sepgsql_blob_t;
|
2010-09-20 17:50:51 +00:00
|
|
|
|
|
|
|
tunable_policy(`sepgsql_enable_users_ddl',`
|
|
|
|
allow $1 unpriv_sepgsql_table_t:db_table { create drop setattr };
|
|
|
|
allow $1 unpriv_sepgsql_table_t:db_column { create drop setattr };
|
|
|
|
allow $1 unpriv_sepgsql_sysobj_t:db_tuple { update insert delete };
|
|
|
|
allow $1 unpriv_sepgsql_proc_exec_t:db_procedure { create drop setattr };
|
|
|
|
')
|
2008-06-10 15:33:18 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Allow the specified domain unconfined accesses to any database objects
|
2008-06-10 15:33:18 +00:00
|
|
|
## managed by SE-PostgreSQL,
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2008-12-03 19:16:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
2008-06-10 15:33:18 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`postgresql_unconfined',`
|
|
|
|
gen_require(`
|
|
|
|
attribute sepgsql_unconfined_type;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_unconfined_type;
|
|
|
|
')
|
2010-02-08 15:34:08 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## All of the rules required to administrate an postgresql environment
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## The role to be allowed to manage the postgresql domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`postgresql_admin',`
|
|
|
|
gen_require(`
|
2010-09-20 17:44:58 +00:00
|
|
|
attribute sepgsql_admin_type, sepgsql_client_type;
|
|
|
|
type postgresql_t, postgresql_var_run_t, postgresql_initrc_exec_t;
|
|
|
|
type postgresql_tmp_t, postgresql_db_t, postgresql_log_t;
|
|
|
|
type postgresql_etc_t;
|
2010-02-08 15:34:08 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 sepgsql_admin_type;
|
|
|
|
|
|
|
|
allow $1 postgresql_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, postgresql_t)
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, postgresql_initrc_exec_t)
|
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 postgresql_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
2010-09-20 17:48:08 +00:00
|
|
|
files_list_pids($1)
|
2010-02-08 15:34:08 +00:00
|
|
|
admin_pattern($1, postgresql_var_run_t)
|
|
|
|
|
2010-09-20 13:36:05 +00:00
|
|
|
files_list_var_lib($1)
|
2010-02-08 15:34:08 +00:00
|
|
|
admin_pattern($1, postgresql_db_t)
|
|
|
|
|
2010-09-20 13:36:05 +00:00
|
|
|
files_list_etc($1)
|
2010-02-08 15:34:08 +00:00
|
|
|
admin_pattern($1, postgresql_etc_t)
|
|
|
|
|
2010-09-20 13:36:05 +00:00
|
|
|
logging_list_logs($1)
|
2010-02-08 15:34:08 +00:00
|
|
|
admin_pattern($1, postgresql_log_t)
|
|
|
|
|
2010-09-20 17:48:08 +00:00
|
|
|
files_list_tmp($1)
|
2010-02-08 15:34:08 +00:00
|
|
|
admin_pattern($1, postgresql_tmp_t)
|
|
|
|
|
|
|
|
postgresql_tcp_connect($1)
|
|
|
|
postgresql_stream_connect($1)
|
|
|
|
')
|