summaryrefslogtreecommitdiff
path: root/src/file/authfile.cil
blob: 78dd05c088cf01c7bebcadc133f550b44afd887a (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
;; SPDX-FileCopyrightText: M-BM-) 2025 Dominick Grift <dominick.grift@defensec.nl>
;; SPDX-License-Identifier: Unlicense

(in file

    (call auth.relabelto.type (unconfined.typeattr))
    (call auth.write.type (unconfined.typeattr))

    (block auth

	(macro type ((type ARG1))
	    (typeattributeset typeattr ARG1))

	(blockinherit file.all_macro_template_dirs)
	(blockinherit file.all_macro_template_fifo_files)
	(blockinherit file.all_macro_template_files)
	(blockinherit file.all_macro_template_lnk_files)
	(blockinherit file.all_macro_template_sock_files)

	(typeattribute typeattr)

	(call file.exception.type (typeattr))

	(call .xattr.associate_fs (typeattr))

	(block base_template

	    (blockabstract base_template)

	    (blockinherit .file.base_template)

	    (call .file.auth.type (file)))

	(block relabelto

	    (macro type ((type ARG1))
		(typeattributeset typeattr ARG1))

	    (typeattribute not_typeattr)
	    (typeattribute typeattr)

	    (typeattributeset not_typeattr (not typeattr))

	    (neverallow not_typeattr auth.typeattr (file (relabelto))))

	(block template

	    (blockabstract template)

	    (blockinherit .file.auth.base_template)
	    (blockinherit .file.macro_template_dirs)
	    (blockinherit .file.macro_template_fifo_files)
	    (blockinherit .file.macro_template_files)
	    (blockinherit .file.macro_template_lnk_files)
	    (blockinherit .file.macro_template_sock_files))

	(block write

	    (macro type ((type ARG1))
		(typeattributeset typeattr ARG1))

	    (typeattribute not_typeattr)
	    (typeattribute typeattr)

	    (typeattributeset not_typeattr (not typeattr))

	    (neverallow not_typeattr auth.typeattr (file (append write))))))