2005-09-19 21:17:45 +00:00
|
|
|
## <summary>PostgreSQL relational database</summary>
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <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;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 postgresql_db_t:dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <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;
|
|
|
|
allow $1 postgresql_db_t:lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute postgresql in the postgresql domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-19 21:17:45 +00:00
|
|
|
## The type of the process performing this action.
|
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;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1,postgresql_exec_t,postgresql_t)
|
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)
|
|
|
|
allow $1 postgresql_etc_t:dir { getattr read search };
|
|
|
|
allow $1 postgresql_etc_t:file { read getattr };
|
|
|
|
allow $1 postgresql_etc_t:lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <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;
|
|
|
|
')
|
|
|
|
|
|
|
|
corenet_tcp_recvfrom_labeled($1,postgresql_t)
|
|
|
|
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-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-09-19 21:17:45 +00:00
|
|
|
#
|
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)
|
|
|
|
allow $1 postgresql_t:unix_stream_socket connectto;
|
|
|
|
allow $1 postgresql_var_run_t:sock_file write;
|
2006-04-19 15:25:22 +00:00
|
|
|
# Some versions of postgresql put the sock file in /tmp
|
|
|
|
allow $1 postgresql_tmp_t:sock_file write;
|
2005-09-19 21:17:45 +00:00
|
|
|
')
|