Skip to content

Commit

Permalink
feat: add SELinux CIL policy source files (#1124)
Browse files Browse the repository at this point in the history
Common Intermediate Language is a format of SELinux policy source
  • Loading branch information
dsseng authored Aug 16, 2024
1 parent 3c15368 commit 7769700
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Cabal
Cassius
Ceylon
CHeader
Cil
Clojure
ClojureC
ClojureScript
Expand Down
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["h"]
},
"Cil": {
"name": "CIL (SELinux)",
"line_comment": [";"],
"quotes": [["\\\"", "\\\""]],
"extensions": ["cil"]
},
"Circom": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
Expand Down
20 changes: 20 additions & 0 deletions tests/data/cil.cil
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; 20 lines 15 code 3 comments 2 blanks
;============= etcd_t ==============
(allow etcd_t proc_sysctl_t (dir (search)))
(allow etcd_t proc_sysctl_t (file (read open)))
(allow etcd_t procfs_t (dir (search getattr)))
(allow etcd_t procfs_t (lnk_file (read)))
(allow etcd_t self (dir (read open search)))
(allow etcd_t self (fifo_file (write read)))

;============= kernel_t ==============
(allow kernel_t bin_t (dir (search)))
(allow kernel_t bin_t (file (read execute_no_trans open map execute)))
(allow kernel_t debugfs_t (dir (search)))
(allow kernel_t device_t (blk_file (create setattr)))
(allow kernel_t device_t (chr_file (write create setattr)))
(allow kernel_t self (capability (dac_override mknod)))
(allow kernel_t self (dir (write add_name search)))
(allow kernel_t self (file (write create open)))

(filecon "/.extra(/.*)?" any (system_u object_r extra_t (systemLow systemLow)))

0 comments on commit 7769700

Please sign in to comment.