-
Notifications
You must be signed in to change notification settings - Fork 2
/
hologram-ferm.pkg.toml
53 lines (40 loc) · 1.5 KB
/
hologram-ferm.pkg.toml
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
[package]
name = "hologram-ferm"
version = "1.1.0"
description = "hologram: configure firewall using ferm"
requires = ["ferm"]
[[symlink]]
path = "/etc/systemd/system/multi-user.target.wants/ferm.service"
target = "/usr/lib/systemd/system/ferm.service"
[[file]]
path = "/usr/share/holo/files/10-ferm/etc/ferm.conf"
content = """
table filter {
chain INPUT {
policy DROP;
# connection tracking
mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;
# allow local connections
interface lo ACCEPT;
# respond to ping
proto icmp icmp-type echo-request ACCEPT;
# allow services configured on this machine (the hologram for the service
# needs to install a snippet to /etc/ferm.d/incoming-$SERVICE)
@include @glob("ferm.d/incoming-*");
# the rest is dropped by the policy above
}
# outgoing connections are not limited
chain OUTPUT policy ACCEPT;
chain FORWARD {
policy DROP;
# connection tracking
mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;
# allow routers configured on this machine (the hologram for the router
# needs to install a snippet to /etc/ferm.d/forwarding-$SERVICE)
@include @glob("ferm.d/forwarding-*");
# the rest is dropped by the policy above
}
}
"""