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
1.1.1.1 - cramfs: is not disabled, because it is not even provided
1.1.1.2 - freevxfs: is not disabled, because it is not even provided
1.1.1.3 - jffs2: is not disabled, because it is not even provided
1.1.1.4 - hfs: is not disabled, because it is not even provided
1.1.1.5 - hfsplus: is not disabled, because it is not even provided
1.1.1.6 - squashfs: we provide hardening to remediate
1.1.1.7 - udf: we provide hardening to remediate
1.1.5 - /tmp "noexec": remediation provided
1.1.17 - /dev/shm "noexec": remediation provided
1.1.23 - usb_storage: we provide hardening to remediate
1.3.1 - aide: available to be run in a container (even the system toolbox)
1.3.2 - scheduled aide checks: available through container
1.4.1 - grub config is stored in the cryptographically immutable /usr partition (/usr/boot/syslinux/root.A.cfg and /usr/boot/syslinux/root.B.cfg), though it is readable 0644.
1.4.2 - grub password: remediation provided
1.4.3 - root password: remediation provided (/etc/inittab nor /etc/sysconfig/init will exist or matter)
3.3.1 - tcp_wrappers (libwrap0): this package is not provided, as it only works for TCP traffic, and unless an application links to libwrap, then the /etc/hosts.{allow,deny} do not apply anyways. Modern applications require iptables, nftables, ipset, and/or BPF rules for network policy.
6.1.11 - unowned files (UID): the config filesystem (i.e. cloud-init, or qemu config) are UID 1000, which is not mapped. Also, this is largely irrelevant for UIDs that are not mapped by the host, as this is a container host, and files on the disk will be owned the full range of the 128 bit integer UIDs.
6.1.12 - unowned files (GID): see 6.1.11 explanation
6.2.15 - accounted for groups: TODO determine why this 236 GID is there (it's not in the qemu image)
Level 1 hardening notes
/etc/modprobe.d/blacklist-1.1.1.conf to blacklist modules
chmod 0600 /boot/boot/grub/menu.lst
# BUG permissions are 0755, and the chmod does not persist on reboot...# https://github.com/kinvolk/Flatcar/issues/296
grub password: /usr/share/oem/grub.cfg
set superusers="user1"
password user1 password1
root password: passwd to set a root password; or hash in cloud-init/ignition
core dump restriction:
# /etc/security/limits.d/restrict.conf* hard core 0
sysctl (currently there is a bug for persistence of these settings #297)
sysctl --system
# OR
systemctl restart systemd-sysctl # this ought to pick this up on reboot...
ip6tables
ip6tables -P INPUT DROP
ip6tables -P OUTPUT DROP
ip6tables -P FORWARD DROP
ip6tables -I INPUT 1 -i lo -j ACCEPT
ip6tables -I FORWARD 1 -i lo -j ACCEPT # needs to be validated
ip6tables -I FORWARD 2 -o lo -j ACCEPT # needs to be validated
ip6tables -I FORWARD 3 -i lo -o lo -j ACCEPT # needs to be validated
ip6tables -I OUTPUT 1 -o lo -j ACCEPT
ip6tables -A INPUT -s ::1 -j DROP
ip6tables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
ip6tables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
ip6tables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p udp --dport 68 -j ACCEPT
ip6tables -A INPUT -p tcp --dport 22 -j ACCEPT
# Persist with something like (which may screw up container networking tools):
systemctl enable --now ip6tables-store.service ip6tables-restore.service
iptables:
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -I INPUT 1 -i lo -j ACCEPT
iptables -I FORWARD 1 -i lo -j ACCEPT # needs to be validated
iptables -I FORWARD 2 -o lo -j ACCEPT # needs to be validated
iptables -I FORWARD 3 -i lo -o lo -j ACCEPT # needs to be validated
iptables -I OUTPUT 1 -o lo -j ACCEPT
iptables -A INPUT -s 127.0.0.0/8 -j DROP
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp --dport 68 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Persist with something like (which may screw up container networking tools):
systemctl enable --now iptables-store.service iptables-restore.service
rsyslog, configured like a host service
# https://github.com/voxxit/dockerfiles/blob/master/rsyslog/DockerfileFROM alpine:latest
#FROM voxxit/base:alpine#MAINTAINER Joshua Delsman <j (at) srv.im>RUN apk add --update rsyslog \
&& rm -rf /var/cache/apk/*
EXPOSE 514 514/udp
VOLUME [ "/var/log", "/etc/rsyslog.d" ]
# for some reason, the apk comes built with a v5# config file. using this one for v8:COPY ./etc/rsyslog.conf /etc/rsyslog.conf
ENTRYPOINT [ "rsyslogd", "-n" ]
# rsyslog.conf
#
# if you experience problems, check:
# http://www.rsyslog.com/troubleshoot
$FileCreateMode 0640
#### MODULES ####
module(load="imuxsock") # local system logging support (e.g. via logger command)
#module(load="imklog") # kernel logging support (previously done by rklogd)
module(load="immark") # --MARK-- message support
module(load="imudp") # UDP listener support
module(load="imtcp") # TCP listener support
input(type="imudp" port="514")
input(type="imtcp" port="514")
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
kern.* action(type="omfile" file="/dev/console")
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none action(type="omfile" file="/var/log/messages")
# The authpriv file has restricted access.
authpriv.* action(type="omfile" file="/var/log/secure")
# Log all the mail messages in one place.
mail.* action(type="omfile" file="/var/log/maillog")
# Log cron stuff
cron.* action(type="omfile" file="/var/log/cron")
# Everybody gets emergency messages
*.emerg action(type="omusrmsg" users="*")
# Save news errors of level crit and higher in a special file.
uucp,news.crit action(type="omfile" file="/var/log/spooler")
# Save boot messages also to boot.log
local7.* action(type="omfile" file="/var/log/boot.log")
#*.* @@loghost.example.com
# Include all .conf files in /etc/rsyslog.d
$IncludeConfig /etc/rsyslog.d/*.conf
sed -i 's/^#*ForwardToSyslog=.*$/ForwardToSyslog=yes/' /etc/systemd/journald.conf
sed -i 's/^#*Compress=.*$/Compress=yes/' /etc/systemd/journald.conf
sed -i 's/^#*Storage=.*$/Storage=persistent/' /etc/systemd/journald.conf
systemctl restart systemd-journald
permissions of faillog and btmp
chmod 0600 /var/log/faillog
chmod 0600 /var/log/btmp
# if they're wanting to be sure, then make a systemd unit that sets it on boot