Skip to content

Commit 469e354

Browse files
gngrambrianmcgillion
authored andcommitted
greetd.service hardening
- Hardened service config for greetd - Exposure level after hardening: 3.5 Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
1 parent 340ac3a commit 469e354

File tree

1 file changed

+89
-0
lines changed
  • modules/common/systemd/hardened-configs/common

1 file changed

+89
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
{
5+
##############
6+
# Networking #
7+
##############
8+
IPAccounting = true;
9+
IPAddressDeny = "any";
10+
RestrictAddressFamilies = [
11+
"~AF_PACKET"
12+
];
13+
14+
###############
15+
# File system #
16+
###############
17+
18+
ProtectSystem = "full";
19+
ProtectProc = "noaccess";
20+
ReadWritePaths = [
21+
"/run"
22+
"/var/"
23+
"/dev/"
24+
];
25+
26+
PrivateMounts = true;
27+
ProcSubset = "all";
28+
29+
##########
30+
# Kernel #
31+
##########
32+
33+
ProtectKernelTunables = true;
34+
ProtectKernelModules = true;
35+
ProtectKernelLogs = true;
36+
37+
########
38+
# Misc #
39+
########
40+
NoNewPrivileges = true;
41+
UMask = 77;
42+
ProtectHostname = true;
43+
ProtectClock = true;
44+
ProtectControlGroups = true;
45+
RestrictNamespaces = true;
46+
LockPersonality = true;
47+
MemoryDenyWriteExecute = true;
48+
RestrictRealtime = true;
49+
RestrictSUIDSGID = true;
50+
SystemCallArchitectures = "native";
51+
NotifyAccess = false;
52+
53+
################
54+
# Capabilities #
55+
################
56+
57+
CapabilityBoundingSet = [
58+
"CAP_IPC_LOCK"
59+
"CAP_SYS_TTY_CONFIG"
60+
"CAP_SETGID"
61+
"CAP_CHOWN"
62+
"CAP_SETUID"
63+
"CAP_IPC_OWNER"
64+
"CAP_DAC_OVERRIDE"
65+
"CAP_DAC_READ_SEARCH"
66+
];
67+
68+
################
69+
# System calls #
70+
################
71+
SystemCallFilter = [
72+
"@setuid"
73+
"@chown"
74+
"@system-service"
75+
"@file-system"
76+
"@basic-io"
77+
"@ipc"
78+
"@signal"
79+
"~@clock"
80+
"~@cpu-emulation"
81+
"~@debug"
82+
"~@module"
83+
"~@mount"
84+
"~@obsolete"
85+
"~@raw-io"
86+
"~@reboot"
87+
"~@swap"
88+
];
89+
}

0 commit comments

Comments
 (0)