Skip to contentSkip to conversation

ipsec: add missing permissions for pluto

PATCH Superseded Yuli Khodorkovskiy 2 participants 2 messages Jul 26, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ipsec: add missing permissions for pluto

When using libreswan, pluto needs permissions for building the Security Association Database and for setting contexts on IPSec policy and SAs.

---
 policy/modules/system/ipsec.te | 6 ++++++
 1 file changed, 6 insertions(+)
policy/modules/system/ipsec.te +6 -0
index 867aefc4..1613a960 100644
@@ -212,6 +212,12 @@ domtrans_pattern(ipsec_mgmt_t, ipsec_exec_t, ipsec_t)
 read_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)
 read_lnk_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)
 
+# allow pluto to build Security Association Database
+corenet_setcontext_all_spds(ipsec_t)
+
+# allow pluto to set contexts on ipsec policy and SAs
+domain_ipsec_setcontext_all_domains(ipsec_t)
+
 allow ipsec_mgmt_t ipsec_conf_file_t:file read_file_perms;
 
 manage_files_pattern(ipsec_mgmt_t, ipsec_key_file_t, ipsec_key_file_t)
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 1/1 ipsec: add missing permissions for pluto

Quoted 16 lines · Yuli Khodorkovskiy via refpolicy

When using libreswan, pluto needs permissions for building the Security Association Database and for setting contexts on IPSec policy and SAs.

---
  policy/modules/system/ipsec.te | 6 ++++++
  1 file changed, 6 insertions(+)
policy/modules/system/ipsec.te +0 -0
index 867aefc4..1613a960 100644
@@ -212,6 +212,12 @@ domtrans_pattern(ipsec_mgmt_t, ipsec_exec_t, ipsec_t)
  read_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)
  read_lnk_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)

policy/modules/system/ipsec.te domtrans_pattern(ipsec_mgmt_t, ipsec_exec_t, ipsec_t) · line 223

Quoted 10 lines
policy/modules/system/ipsec.te +6 -0
 
+# allow pluto to build Security Association Database
+corenet_setcontext_all_spds(ipsec_t)
+
+# allow pluto to set contexts on ipsec policy and SAs
+domain_ipsec_setcontext_all_domains(ipsec_t)
+
  allow ipsec_mgmt_t ipsec_conf_file_t:file read_file_perms;
 
  manage_files_pattern(ipsec_mgmt_t, ipsec_key_file_t, ipsec_key_file_t)

One nit: the additions should be down with the other corenet and domain rules.

Signature · 1 line
Chris PeBenito