Skip to contentSkip to conversation

networkmanager: Grant access to unlabeled PKeys

PATCH Paul Moore 3 participants 5 messages Nov 27, 2017 – Nov 29, 2017 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paul Moore

author maintainer
#1 lore raw
Quoted 10 lines · Dan Jurgens

From: Daniel Jurgens <[email protected]>

For controlling IPoIB VLANs

---
 networkmanager.te |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

[NOTE: resending due to a typo in the refpol mailing list address]

We obviously need something like this now so we don't break IPoIB, but I wonder if we should make the IB access controls dynamic like the per-packet network access controls. We could key off the presence of the IB pkey and endport definitions: if there are any objects defined in the loaded policy we enable the controls, otherwise we disable them.

Quoted 15 lines
networkmanager.te +2 -1
index 76d0106..5e881f4 100644
@@ -184,6 +184,8 @@ userdom_write_user_tmp_sockets(NetworkManager_t)
 userdom_dontaudit_use_unpriv_user_fds(NetworkManager_t)
 userdom_dontaudit_use_user_ttys(NetworkManager_t)
 
+corenet_ib_access_unlabeled_pkeys(NetworkManager_t)
+
 optional_policy(`
        avahi_domtrans(NetworkManager_t)
        avahi_kill(NetworkManager_t)
--

1.7.1

Signature · 2 lines
paul moore
www.paul-moore.com
#2 lore raw
Quoted 11 lines · Paul Moore
Quoted 10 lines · Dan Jurgens

From: Daniel Jurgens <[email protected]>

For controlling IPoIB VLANs

---
 networkmanager.te |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 8 lines

[NOTE: resending due to a typo in the refpol mailing list address]

We obviously need something like this now so we don't break IPoIB, but I wonder if we should make the IB access controls dynamic like the per-packet network access controls. We could key off the presence of the IB pkey and endport definitions: if there are any objects defined in the loaded policy we enable the controls, otherwise we disable them.

I think I understand what you're saying Paul, but I'm not clear on the mechanism.? Are you referring to the netlabel/IPSEC enable checks? They are wrapped up in selinux_peerlbl_enabled.

Quoted 16 lines
Quoted 16 lines
networkmanager.te +2 -1
index 76d0106..5e881f4 100644
@@ -184,6 +184,8 @@ userdom_write_user_tmp_sockets(NetworkManager_t)
 userdom_dontaudit_use_unpriv_user_fds(NetworkManager_t)
 userdom_dontaudit_use_user_ttys(NetworkManager_t)
 
+corenet_ib_access_unlabeled_pkeys(NetworkManager_t)
+
 optional_policy(`
        avahi_domtrans(NetworkManager_t)
        avahi_kill(NetworkManager_t)
--

1.7.1

author maintainer
#3 lore raw
Quoted 14 lines · Daniel Jurgens
Quoted 13 lines · Paul Moore
Quoted 10 lines · Dan Jurgens

From: Daniel Jurgens <[email protected]>

For controlling IPoIB VLANs

---
 networkmanager.te |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

[NOTE: resending due to a typo in the refpol mailing list address]

Quoted 8 lines
Quoted 6 lines

We obviously need something like this now so we don't break IPoIB, but I wonder if we should make the IB access controls dynamic like the per-packet network access controls. We could key off the presence of the IB pkey and endport definitions: if there are any objects defined in the loaded policy we enable the controls, otherwise we disable them.

I think I understand what you're saying Paul, but I'm not clear on the mechanism. Are you referring to the netlabel/IPSEC enable checks? They are wrapped up in selinux_peerlbl_enabled.

Basically, yes. We could add a new variable/function that gates the access control checks in selinux_ib_pkey_access() and selinux_ib_endport_manage_subnet(); the checks would be enabled when there was Infiniband configuration loaded with the policy. Without the IB config loaded, all the checks would end up being just a domain check against unlabeled_t, which isn't very interesting, so we would just drop the checks.

Signature · 2 lines
paul moore
www.paul-moore.com
#4 lore raw
Quoted 24 lines · Paul Moore
Quoted 14 lines · Daniel Jurgens
Quoted 13 lines · Paul Moore
Quoted 10 lines · Dan Jurgens

From: Daniel Jurgens <[email protected]>

For controlling IPoIB VLANs

---
  networkmanager.te |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

[NOTE: resending due to a typo in the refpol mailing list address]

Quoted 8 lines
Quoted 6 lines

We obviously need something like this now so we don't break IPoIB, but I wonder if we should make the IB access controls dynamic like the per-packet network access controls. We could key off the presence of the IB pkey and endport definitions: if there are any objects defined in the loaded policy we enable the controls, otherwise we disable them.

I think I understand what you're saying Paul, but I'm not clear on the mechanism. Are you referring to the netlabel/IPSEC enable checks? They are wrapped up in selinux_peerlbl_enabled.

Quoted 7 lines

Basically, yes. We could add a new variable/function that gates the access control checks in selinux_ib_pkey_access() and selinux_ib_endport_manage_subnet(); the checks would be enabled when there was Infiniband configuration loaded with the policy. Without the IB config loaded, all the checks would end up being just a domain check against unlabeled_t, which isn't very interesting, so we would just drop the checks.

As long as it also respects policycap always_check_network, it works for me.

Signature · 1 line
Chris PeBenito
author maintainer
#5 lore raw
In reply to a message not in the archive
Quoted 10 lines · Dan Jurgens

From: Daniel Jurgens <[email protected]>

For controlling IPoIB VLANs

---
 networkmanager.te |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

We obviously need something like this now so we don't break IPoIB, but I wonder if we should make the IB access controls dynamic like the per-packet network access controls. We could key off the presence of the IB pkey and endport definitions: if there are any objects defined in the loaded policy we enable the controls, otherwise we disable them.

Quoted 15 lines
networkmanager.te +2 -1
index 76d0106..5e881f4 100644
@@ -184,6 +184,8 @@ userdom_write_user_tmp_sockets(NetworkManager_t)
 userdom_dontaudit_use_unpriv_user_fds(NetworkManager_t)
 userdom_dontaudit_use_user_ttys(NetworkManager_t)
 
+corenet_ib_access_unlabeled_pkeys(NetworkManager_t)
+
 optional_policy(`
        avahi_domtrans(NetworkManager_t)
        avahi_kill(NetworkManager_t)
--

1.7.1

Signature · 2 lines
paul moore
www.paul-moore.com