Skip to content

Commit 3a3f39e

Browse files
committed
network_stmt: add CIDR notation support for nodecon
Added in checkpolicy 3.7[1]. [1]: SELinuxProject/selinux@804e52b Signed-off-by: Christian Göttsche <[email protected]>
1 parent 5d643c0 commit 3a3f39e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/network_statements.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,14 @@ It is also possible to add these outside of the policy using the
178178
***semanage**(8)* *node* command that will associate the node to a security
179179
context.
180180

181+
Since ***checkpolicy**(8)* 3.7 the subnet and netmask can be specified together
182+
by using the Classless Inter-Domain Routing (CIDR) notation.
183+
181184
**The statement definition is:**
182185

183186
```
184187
nodecon subnet netmask node_context
188+
nodecon cidr_address node_context
185189
```
186190

187191
**Where:**
@@ -200,6 +204,11 @@ Note that the subnet and netmask values are used to ensure that the
200204

201205
The subnet mask in IPv4 or IPv6 format.
202206

207+
*cidr_address*
208+
209+
The IP address in CIDR notation, consisting of a IPv4 or IPv6 address, and the
210+
netmask as a digit of leading bits, joined by a slash ('/').
211+
203212
*node_context*
204213

205214
The security context for the node.
@@ -224,13 +233,15 @@ Conditional Policy Statements
224233
# The MLS policy nodecon statement using an IPv4 address:
225234
226235
nodecon 127.0.0.1 255.255.255.255 system_u:object_r:lo_node_t:s0 - s15:c0.c255
236+
nodecon 127.0.0.1/32 system_u:object_r:lo_node_t:s0 - s15:c0.c255
227237
```
228238

229239
```
230240
# The MLS policy nodecon statement for the multicast address
231241
# using an IPv6 address:
232242
233243
nodecon ff00:: ff00:: system_u:object_r:multicast_node_t:s0 - s15:c0.c255
244+
nodecon ff00::/8 system_u:object_r:multicast_node_t:s0 - s15:c0.c255
234245
```
235246

236247
***semanage**(8)* **Command example:**

0 commit comments

Comments
 (0)