blob: 84c0b10ff5fa6d332e45942f227bb3f04ffa2f91 (
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
|
;; Copyright (C) 2025 John Turner
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
(in agent
(block weechat
(blockinherit .subj.common.template)
(call subj.common.type (subj))
(roletype .sys.role subj)
(call exec.subj_type_transition (.sys.subj subj))
(call exec.entrypoint_file_files (subj))
(call exec.mapexecute_file_files (subj))
(call exec.read_file_files (subj))
;; unix socket
(allow subj self (unix_dgram_socket (create sendto read write)))
;; network
(allow subj self create_tcp_socket)
(call irc.nameconnect_port_tcp_sockets (subj))
;; use ssl certs
(call .cert.search_file_dirs (subj))
(call .cert.read_file_files (subj))
;; use terminal
(call .sys.use_subj_fds (subj))
(call .dev.readwriteinherited_file_chr_files (subj))
(call .ptytermdev.readwriteinherited_all_chr_files (subj))
;; use pipes
(call .sys.readwriteinherited_subj_fifo_files (subj))
;; read root
(call .root.search_file_dirs (subj))
;; read /etc
(call .conf.search_file_dirs (subj))
(call .conf.read_file_files (subj))
(call .conf.read_file_lnk_files (subj))
;; read /usr/share
(call .data.search_file_dirs (subj))
(call .data.read_file_files (subj))
;; access config stuff
(call .home.search_file_dirs (subj))
(call .user.home.search_file_dirs (subj))
(call .user.home.create_file_dirs (subj))
(call home.search_file_dirs (subj))
(call home.readwrite_file_files (subj))
;; access /run/user
(call .run.search_file_dirs (subj))
(call .runuser.search_file_dirs (subj))
(call .runuser.create_file_dirs (subj))
(block exec
(filecon "/usr/bin/weechat" file file_context)
(blockinherit .file.exec.template))
(block home
(filecon "HOME_DIR/\.config/weechat(/.*)?" any file_context)
(filecon "HOME_DIR/\.local/share/weechat(/.*)?" any file_context)
(filecon "HOME_DIR/\.local/state/weechat(/.*)?" any file_context)
(filecon "HOME_DIR/\.cache/weechat(/.*)?" any file_context)
(blockinherit .file.home.user.template))))
|