blob: 51af170c7ce41cdf05392f672b46b6151a2dbf54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
;; SPDX-FileCopyrightText: © 2024 Dominick Grift <dominick.grift@defensec.nl>
;; SPDX-License-Identifier: Unlicense
(sidcontext netmsg (sys.id sys.role net.peer sys.lowlow))
(class peer (recv))
(classorder (unordered peer))
(macro recv_invalid_peers ((type ARG1))
(allow ARG1 invalid (peer (recv))))
(tunableif invalid_peers
(true
(call association_invalid_sctp_sockets
(invalidpeers.except.typeattr))
(call recv_invalid_peers (invalidpeers.except.typeattr))))
(in invalid.unconfined
(allow typeattr .invalid (peer (all))))
(in mcs
(mlsconstrain (peer (recv))
(or (dom h1 h2)
(and
(neq t1 constrained.typeattr)
(neq t2 constrained.typeattr)))))
(in net
(blockinherit peer.template)
(block peer
(macro type ((type ARG1))
(typeattributeset typeattr ARG1))
(typeattribute typeattr)
(blockinherit all_macro_template)
(call .mcs.constrained.type (typeattr))
(call .obj.type (typeattr))
(block all_macro_template
(blockabstract all_macro_template)
(macro recv_all_peers ((type ARG1))
(allow ARG1 typeattr (peer (recv))))
(macro association_all_sctp_sockets ((type ARG1))
(allow ARG1 typeattr (sctp_socket (association)))))
(block base_template
(blockabstract base_template)
(context peer_context (.sys.id .sys.role peer .sys.lowlow))
(type peer)
(call .net.peer.type (peer)))
(block macro_template
(blockabstract macro_template)
(macro recv_peers ((type ARG1))
(allow ARG1 peer (peer (recv))))
(macro association_peer_sctp_sockets ((type ARG1))
(allow ARG1 peer (sctp_socket (association)))))
(block template
(blockabstract template)
(blockinherit .net.peer.base_template)
(blockinherit .net.peer.macro_template))
(block unconfined
(macro type ((type ARG1))
(typeattributeset typeattr ARG1))
(typeattribute typeattr)
(allow typeattr peer.typeattr (peer (all)))
(allow typeattr peer.typeattr (sctp_socket (association))))))
(in net.unconfined
(call .net.peer.unconfined.type (typeattr)))
(in subj
(macro recv_all_peers ((type ARG1))
(allow ARG1 typeattr (peer (recv)))))
(in subj.macro_template
(macro recv_subj_peers ((type ARG1))
(allow ARG1 subj (peer (recv)))))
(in subj.unconfined
(allow typeattr .subj.typeattr (peer (recv))))
|