summaryrefslogtreecommitdiff
path: root/src/file/misc/unknownfile.cil
diff options
context:
space:
mode:
Diffstat (limited to 'src/file/misc/unknownfile.cil')
-rw-r--r--src/file/misc/unknownfile.cil30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/file/misc/unknownfile.cil b/src/file/misc/unknownfile.cil
new file mode 100644
index 0000000..f6fb47c
--- /dev/null
+++ b/src/file/misc/unknownfile.cil
@@ -0,0 +1,30 @@
+;; SPDX-FileCopyrightText: © 2023 Dominick Grift <dominick.grift@defensec.nl>
+;; SPDX-License-Identifier: Unlicense
+
+(block unknown
+
+ (filecon "/.*" any file_context)
+
+ (macro root_file_type_transition_file ((type ARG1)(class ARG2)(name ARG3))
+ (call .root.file_type_transition
+ (ARG1 file ARG2 ARG3)))
+
+ (blockinherit .file.base_template)
+ (blockinherit .file.macro_template_blk_files)
+ (blockinherit .file.macro_template_chr_files)
+ (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)
+
+ (call .xattr.associate_fs (file)))
+
+(in file.unconfined
+
+ (call .unknown.root_file_type_transition_file (typeattr blk_file "*"))
+ (call .unknown.root_file_type_transition_file (typeattr chr_file "*"))
+ (call .unknown.root_file_type_transition_file (typeattr dir "*"))
+ (call .unknown.root_file_type_transition_file (typeattr fifo_file "*"))
+ (call .unknown.root_file_type_transition_file (typeattr file "*"))
+ (call .unknown.root_file_type_transition_file (typeattr sock_file "*")))