File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ install:
16
16
-t $(DESTDIR ) /etc/opensnitchd/
17
17
@install -Dm644 network_aliases.json \
18
18
-t $(DESTDIR ) /etc/opensnitchd/
19
+ @install -Dm600 data/rules/* $(DESTDIR ) /etc/opensnitchd/rules/
19
20
@systemctl daemon-reload
20
21
21
22
opensnitchd : $(SRC )
Original file line number Diff line number Diff line change 150
150
"Hook" : " output" ,
151
151
"Policy" : " accept" ,
152
152
"Rules" : [
153
+ {
154
+ "Enabled" : false ,
155
+ "Position" : " 0" ,
156
+ "Description" : " allow localhost connections" ,
157
+ "Parameters" : " " ,
158
+ "Expressions" : [
159
+ {
160
+ "Statement" : {
161
+ "Op" : " ==" ,
162
+ "Name" : " ip" ,
163
+ "Values" : [
164
+ {
165
+ "Key" : " daddr" ,
166
+ "Value" : " 127.0.0.0-127.255.255.255"
167
+ }
168
+ ]
169
+ }
170
+ }
171
+ ],
172
+ "Target" : " accept" ,
173
+ "TargetParameters" : " "
174
+ },
153
175
{
154
176
"Enabled" : true ,
155
177
"Position" : " 0" ,
Original file line number Diff line number Diff line change 1
1
daemon/default-config.json etc/opensnitchd/
2
2
daemon/system-fw.json etc/opensnitchd/
3
- daemon//network_aliases.json etc/opensnitchd/
3
+ daemon/network_aliases.json etc/opensnitchd/
4
+ daemon/data/rules/* etc/opensnitchd/rules/
4
5
ebpf_prog/opensnitch.o usr/lib/opensnitchd/ebpf/
5
6
ebpf_prog/opensnitch-dns.o usr/lib/opensnitchd/ebpf/
6
7
ebpf_prog/opensnitch-procs.o usr/lib/opensnitchd/ebpf/
Original file line number Diff line number Diff line change @@ -69,6 +69,19 @@ install -m 644 ebpf_prog/opensnitch.o %{buildroot}/usr/lib/opensnitchd/ebpf/open
69
69
install -m 644 ebpf_prog/opensnitch-dns.o %{buildroot }/usr/lib/opensnitchd/ebpf/opensnitch-dns.o
70
70
install -m 644 ebpf_prog/opensnitch-procs.o %{buildroot }/usr/lib/opensnitchd/ebpf/opensnitch-procs.o
71
71
72
+ B= ""
73
+ r= "/etc/opensnitchd/rules/000-allow-localhost.json"
74
+ if [ -f $r ]; then
75
+ B= "-b"
76
+ fi
77
+ install -m 600 $B daemon/data/rules/000-allow-localhost.json %{buildroot }$r
78
+ B= ""
79
+ r= "/etc/opensnitchd/rules/000-allow-localhost6.json"
80
+ if [ -f $r ]; then
81
+ B= "-b"
82
+ fi
83
+ install -m 600 $B daemon/data/rules/000-allow-localhost6.json %{buildroot }$r
84
+
72
85
# upgrade, uninstall
73
86
%preun
74
87
systemctl stop opensnitch.service || true
You can’t perform that action at this time.
0 commit comments