Commit 17618db
authored
run-checks: check priority override on ifaces w/ mountinfo rules (#17340)
* run-checks: check prio override on ifaces w/ mountinfo rules
Interfaces that grant access to /proc/self/mountinfo (explicitly or not)
must have a prioritized override (see basePrioritizedSnippets in
interfaces/apparmor/template.go) which swaps out the deny rule.
Otherwise, the deny rule wins out and the interface does not work as
intended.
This adds a static check to run-checks that tries to maintain this
invariant by looking for interfaces that grant /proc/self/mountinfo,
even if by granting broader access (/proc/**, allow file, etc), and
checking whether the file also contains the corresponding override.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>1 parent ab7429c commit 17618db
1 file changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
185 | 237 | | |
186 | 238 | | |
187 | 239 | | |
| |||
389 | 441 | | |
390 | 442 | | |
391 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
392 | 447 | | |
393 | 448 | | |
394 | 449 | | |
| |||
0 commit comments