Skip to content

Commit 611f618

Browse files
committed
Allow create kerberos files in postgresql db home
The pgsql user has its home in the /var/lib/pgsql directory labeled with the postgresql_db_t type.
1 parent 00f088d commit 611f618

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

policy/modules/contrib/kerberos.if

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@ interface(`kerberos_filetrans_named_content',`
635635
kerberos_tmp_filetrans_host_rcache($1, "ldapmap1_0")
636636
kerberos_tmp_filetrans_host_rcache($1, "ldap_487")
637637
kerberos_tmp_filetrans_host_rcache($1, "ldap_55")
638+
639+
postgresql_db_filetrans($1, krb5_home_t, file, ".k5identity")
640+
postgresql_db_filetrans($1, krb5_home_t, file, ".k5login")
641+
postgresql_db_filetrans($1, krb5_home_t, file, ".k5users")
638642
')
639643

640644
########################################

policy/modules/services/postgresql.fc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ ifdef(`distro_redhat', `
3535
/var/lib/postgres(ql)?(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0)
3636

3737
/var/lib/pgsql(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0)
38+
/var/lib/pgsql/\.k5identity gen_context(system_u:object_r:krb5_home_t,s0)
39+
/var/lib/pgsql/\.k5login gen_context(system_u:object_r:krb5_home_t,s0)
40+
/var/lib/pgsql/\.k5users gen_context(system_u:object_r:krb5_home_t,s0)
41+
3842
/var/lib/pgsql/logfile(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0)
3943
/var/lib/pgsql/.*\.log gen_context(system_u:object_r:postgresql_log_t,s0)
4044
/var/lib/pgsql/data/pg_log(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0)

policy/modules/services/postgresql.if

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,39 @@ interface(`postgresql_filetrans_named_content',`
488488
filetrans_pattern($1, postgresql_db_t, postgresql_log_t, dir, "pg_log")
489489
')
490490

491+
########################################
492+
## <summary>
493+
## Create private objects at postgresql db directory.
494+
## </summary>
495+
## <param name="domain">
496+
## <summary>
497+
## Domain allowed access.
498+
## </summary>
499+
## </param>
500+
## <param name="private type">
501+
## <summary>
502+
## The type of the object to be created.
503+
## </summary>
504+
## </param>
505+
## <param name="object">
506+
## <summary>
507+
## The object class of the object being created.
508+
## </summary>
509+
## </param>
510+
## <param name="name" optional="true">
511+
## <summary>
512+
## The name of the object being created.
513+
## </summary>
514+
## </param>
515+
#
516+
interface(`postgresql_db_filetrans',`
517+
gen_require(`
518+
type postgresql_db_t;
519+
')
520+
521+
filetrans_pattern($1, postgresql_db_t, $2, $3, $4)
522+
')
523+
491524
########################################
492525
## <summary>
493526
## All of the rules required to administrate an postgresql environment

0 commit comments

Comments
 (0)