You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if grep 'ID="rhel"' /etc/os-release > /dev/null || grep 'ID_LIKE="*rhel*' /etc/os-release > /dev/null; then
1171
1178
FLAVOR=rhel
1172
1179
if grep -e 'PLATFORM_ID=".*el10' /etc/os-release > /dev/null; then
1173
1180
RELEASE=10
1174
-
SYSTEMD_PREFIX=/usr/lib/systemd
1181
+
SYSTEMD_PREFIX=/usr/lib/systemd
1175
1182
elif grep -e 'PLATFORM_ID=".*el9' /etc/os-release > /dev/null; then
1176
1183
RELEASE=9
1177
-
SYSTEMD_PREFIX=/etc/systemd
1184
+
SYSTEMD_PREFIX=/etc/systemd
1178
1185
elif grep -e 'PLATFORM_ID=".*el8' /etc/os-release > /dev/null; then
1179
1186
RELEASE=8
1180
-
SYSTEMD_PREFIX=/etc/systemd
1187
+
SYSTEMD_PREFIX=/etc/systemd
1181
1188
else
1182
1189
log_quit "RHEL or alike release not compatible: dist=${DIST},flavor=${FLAVOR},release=${RELEASE}"
1183
1190
fi
@@ -1190,12 +1197,15 @@ get_el_version() {
1190
1197
FLAVOR=debian
1191
1198
if grep -e 'VERSION_ID="11' /etc/os-release > /dev/null; then
1192
1199
RELEASE=11
1193
-
SYSTEMD_PREFIX=/etc/systemd
1200
+
SYSTEMD_PREFIX=/etc/systemd
1194
1201
elif grep -e 'VERSION_ID="12' /etc/os-release > /dev/null; then
1195
1202
RELEASE=12
1196
-
SYSTEMD_PREFIX=/etc/systemd
1203
+
SYSTEMD_PREFIX=/etc/systemd
1204
+
elif grep -e 'VERSION_ID="13' /etc/os-release > /dev/null; then
1205
+
RELEASE=13
1206
+
SYSTEMD_PREFIX=/etc/systemd
1197
1207
fi
1198
-
if [ "${RELEASE}" -eq 11 ] || [ "${RELEASE}" -eq 12 ]; then
1208
+
if [ "${RELEASE}" -eq 11 ] || [ "${RELEASE}" -eq 12 ] || [ "${RELEASE}" -eq 13 ]; then
1199
1209
log "Found Linux ${DIST} release ${RELEASE}"
1200
1210
else
1201
1211
log_quit "Not compatible with ${DIST} release ${RELEASE} "
@@ -1331,22 +1341,7 @@ if [ "${SCAP_PROFILE}" != false ]; then
1331
1341
if [ "${FLAVOR}" = "rhel" ]; then
1332
1342
dnf install -y openscap scap-security-guide 2> "${LOG_FILE}" || log "OpenSCAP is missing and cannot be installed""ERROR"
1333
1343
elif [ "${FLAVOR}" = "debian" ]; then
1334
-
# Download debian 12 anssi profiles which need ssg-debian 0.17.4 at least
1335
-
# which are not available in stable as of 2025/02/14
1336
-
# As of 2025/04/24, ssg-debian 0.1.76-1 is the most recent release one can get
1337
-
if [ "${RELEASE}" -eq 12 ]; then
1338
-
log "Downloading up ssg openscap data for debian 12"
1339
-
if type curl > /dev/null 2>&1; then
1340
-
curl -OL http://ftp.debian.org/debian/pool/main/s/scap-security-guide/ssg-base_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-base cannot be downloaded with curl""ERROR"
1341
-
curl -OL http://ftp.debian.org/debian/pool/main/s/scap-security-guide/ssg-debian_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-debian cannot be downloaded with curl""ERROR"
1342
-
else
1343
-
wget http://ftp.debian.org/debian/pool/main/s/scap-security-guide/ssg-base_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-base cannot be downloaded with wget""ERROR"
1344
-
wget http://ftp.debian.org/debian/pool/main/s/scap-security-guide/ssg-debian_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-debian cannot be downloaded with wget""ERROR"
1345
-
fi
1346
-
dpkg -i ssg-base_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-base cannot be installed""ERROR"
1347
-
dpkg -i ssg-debian_0.1.76-1_all.deb 2> "${LOG_FILE}" || log "OpenSCAP new deb 12 profiles ssg-debian cannot be installed""ERROR"
1348
-
fi
1349
-
apt install -y openscap-utils 2> "${LOG_FILE}" || log "OpenSCAP is missing and cannot be installed""ERROR"
1344
+
apt install -y openscap-utils ssg-base ssg-debderived ssg-debian ssg-applications 2> "${LOG_FILE}" || log "OpenSCAP is missing and cannot be installed""ERROR"
1350
1345
else
1351
1346
log_quit "Cannot setup OpenSCAP on this system"
1352
1347
fi
@@ -1396,8 +1391,8 @@ fi
1396
1391
check_internet
1397
1392
if [ $? -eq 0 ]; then
1398
1393
log "Install available with internet. setting up additional packages."
# Starting fail2ban may need a reboot to work, so let's not log start failures here
2833
2829
systemctl start fail2ban
2834
-
fi
2830
+
fi
2835
2831
fi
2836
2832
2837
2833
# Enable guest agent on KVM
@@ -2890,6 +2886,12 @@ EOF
2890
2886
chmod +x /usr/local/bin/el_configurator_metrics.sh || log "Failed to chmod /usr/local/bin/el_configurator_metrics.sh""ERROR"
2891
2887
fi
2892
2888
2889
+
if [ "${ALLOW_UNPROTECTED_FS_SYMLINKS}" != false ]; then
2890
+
log "Allowing unprotected symlinks in filesystems"
2891
+
sysctl -w fs.protected_symlinks=0 2>> "${LOG_FILE}" || log "Failed to set fs.protected_symlinks at runtime""ERROR"
2892
+
set_conf_value /etc/sysctl.d/99-fs-symlinks.conf "fs.protected_symlinks""0" || log "Failed to set fs.protected_symlinks in /etc/sysctl.d/99-fs-symlinks.conf""ERROR"
2893
+
fi
2894
+
2893
2895
# Setting up watchdog in systemd
2894
2896
if [ "${CONFIGURE_WATCHDOG}" != false ]; then
2895
2897
log "Setting up systemd watchdog"
@@ -2912,14 +2914,14 @@ fi
2912
2914
if [ "${ALLOW_SUDO}" = true ] && [ "${SCAP_PROFILE}" != false ]; then
2913
2915
log "Allowing sudo command regardless of scap profile ${SCAP_PROFILE}"
2914
2916
# Patch sudoers file since noexec is set by default, which prevents sudo
2915
-
sed -i 's/^Defaults noexec/#Defaults noexec/g' /etc/sudoers 2>> "${LOG_FILE}" || log "Failed to sed /etc/sudoers""ERROR"
0 commit comments