2022-02-03 03:03:04 -05:00
|
|
|
#!/bin/bash
|
2022-02-03 12:13:50 -05:00
|
|
|
|
2024-01-11 19:30:55 -05:00
|
|
|
# Remove unnecessary stuff from the Qubes template
|
|
|
|
sudo dnf -y thunderbird httpd keepassxc rygel
|
|
|
|
|
|
|
|
# Remove firefox packages
|
|
|
|
sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem
|
|
|
|
|
|
|
|
# Remove Network + hardware tools packages
|
|
|
|
sudo dnf -y remove '*cups' nmap-ncat nfs-utils nmap-ncat openssh-server net-snmp-libs net-tools opensc traceroute rsync tcpdump teamd geolite2* mtr dmidecode sgpio
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove support for some languages and spelling
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf -y remove ibus-typing-booster '*speech*' '*zhuyin*' '*pinyin*' '*kkc*' '*m17n*' '*hangul*' '*anthy*' words
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove codec + image + printers
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf -y remove openh264 ImageMagick* sane* simple-scan
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove Active Directory + Sysadmin + reporting tools
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf -y remove 'sssd*' realmd adcli cyrus-sasl-plain cyrus-sasl-gssapi mlocate quota* dos2unix kpartx sos abrt samba-client gvfs-smb
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove vm and virtual stuff
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf -y remove 'podman*' '*libvirt*' 'open-vm*' qemu-guest-agent 'hyperv*' spice-vdagent virtualbox-guest-additions vino xorg-x11-drv-vmware xorg-x11-drv-amdgpu
|
2022-02-04 06:58:00 -05:00
|
|
|
sudo dnf autoremove -y
|
2024-01-11 19:30:55 -05:00
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove NetworkManager
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf -y remove NetworkManager-pptp-gnome NetworkManager-ssh-gnome NetworkManager-openconnect-gnome NetworkManager-openvpn-gnome NetworkManager-vpnc-gnome ppp* ModemManager
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove Gnome apps
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf remove -y gnome-photos gnome-connections gnome-tour gnome-themes-extra gnome-screenshot gnome-remote-desktop gnome-font-viewer gnome-calculator gnome-calendar gnome-contacts \
|
|
|
|
gnome-maps gnome-weather gnome-logs gnome-boxes gnome-disk-utility gnome-clocks gnome-color-manager gnome-characters baobab totem \
|
|
|
|
gnome-shell-extension-background-logo gnome-shell-extension-apps-menu gnome-shell-extension-launch-new-instance gnome-shell-extension-places-menu gnome-shell-extension-window-list \
|
|
|
|
gnome-classic* gnome-user* gnome-text-editor chrome-gnome-shell eog
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove apps
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf remove -y rhythmbox yelp evince libreoffice* cheese file-roller* mediawriter
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Remove other packages
|
2024-01-11 19:30:55 -05:00
|
|
|
sudo dnf remove -y lvm2 rng-tools thermald '*perl*' yajl
|
|
|
|
|
|
|
|
# Disable openh264 repo
|
|
|
|
sudo dnf config-manager --set-disabled fedora-cisco-openh264
|
|
|
|
|
|
|
|
# Install custom packages
|
2022-07-01 08:51:06 -04:00
|
|
|
sudo dnf install qubes-u2f qubes-gpg-split arc-theme qt5ct qt5-qtstyleplugins -y
|
2022-07-01 08:00:40 -04:00
|
|
|
echo "countme=False" | sudo tee -a /etc/dnf/dnf.conf
|
2022-02-05 01:37:24 -05:00
|
|
|
|
2022-07-26 17:34:51 -04:00
|
|
|
# Blacklisting kernel modules
|
2023-12-02 01:21:43 -05:00
|
|
|
curl --proxy http://127.0.0.1:8082 https://raw.githubusercontent.com/Kicksecure/security-misc/master/etc/modprobe.d/30_security-misc.conf | sudo tee /etc/modprobe.d/30_security-misc.conf
|
2024-04-26 18:55:51 -04:00
|
|
|
sudo sed -i 's/#install msr/install msr/g' /etc/modprobe.d/30_security-misc.conf
|
2022-07-26 17:34:51 -04:00
|
|
|
|
|
|
|
# Security kernel settings.
|
2023-12-02 01:21:43 -05:00
|
|
|
curl --proxy http://127.0.0.1:8082 https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/990-security-misc.conf | sudo tee /etc/sysctl.d/990-security-misc.conf
|
2023-11-15 16:21:33 -05:00
|
|
|
sudo sed -i 's/kernel.yama.ptrace_scope=2/kernel.yama.ptrace_scope=3/g' /etc/sysctl.d/990-security-misc.conf
|
2023-12-02 01:21:43 -05:00
|
|
|
curl --proxy http://127.00.1:8082 https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/30_silent-kernel-printk.conf | sudo tee /etc/sysctl.d/30_silent-kernel-printk.conf
|
|
|
|
curl --proxy http://127.00.1:8082 https://raw.githubusercontent.com/Kicksecure/security-misc/master/usr/lib/sysctl.d/30_security-misc_kexec-disable.conf | sudo tee /etc/sysctl.d/30_security-misc_kexec-disable.conf
|
2022-07-26 17:34:51 -04:00
|
|
|
|
2022-12-02 03:08:54 -05:00
|
|
|
# Systemd hardening
|
|
|
|
sudo mkdir -p /etc/systemd/system/ModemManager.service.d
|
2023-12-02 01:21:43 -05:00
|
|
|
curl --proxy http://127.0.0.1:8082 https://raw.githubusercontent.com/divestedcg/Brace/master/brace/usr/lib/systemd/system/ModemManager.service.d/99-brace.conf | sudo tee /etc/systemd/system/ModemManager.service.d/99-brace.conf
|
2022-12-02 03:08:54 -05:00
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Setup SSH client
|
2023-01-18 08:52:35 -05:00
|
|
|
echo "GSSAPIAuthentication no" | sudo tee /etc/ssh/ssh_config.d/10-custom.conf
|
|
|
|
echo "VerifyHostKeyDNS yes" | sudo tee -a /etc/ssh/ssh_config.d/10-custom.conf
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Force DNSSEC
|
2023-01-18 08:52:35 -05:00
|
|
|
sudo sed -i 's/#DNSSEC=no/DNSSEC=yes/g' /etc/systemd/resolved.conf
|
|
|
|
sudo systemctl restart systemd-resolved
|
|
|
|
|
2022-12-02 03:08:54 -05:00
|
|
|
# Theming
|
2022-02-06 22:35:30 -05:00
|
|
|
|
2022-07-01 08:51:06 -04:00
|
|
|
echo "export QT_QPA_PLATFORMTHEME=gtk2" | sudo tee /etc/environment
|
|
|
|
|
2022-05-26 17:39:47 -04:00
|
|
|
echo "[org/gnome/desktop/interface]
|
2022-07-01 08:51:06 -04:00
|
|
|
gtk-theme='Arc-Dark'
|
2022-09-01 02:49:12 -04:00
|
|
|
|
|
|
|
[org/gnome/desktop/media-handling]
|
|
|
|
automount=false
|
|
|
|
automount-open=false" | sudo tee /etc/dconf/db/local.d/custom
|
2022-05-26 17:20:33 -04:00
|
|
|
|
2022-05-26 17:39:47 -04:00
|
|
|
sudo dconf update
|
|
|
|
|
2024-01-24 19:46:28 -05:00
|
|
|
# Flatpak update service
|
2022-05-26 19:43:44 -04:00
|
|
|
|
2022-05-26 17:39:47 -04:00
|
|
|
echo "[Unit]
|
2022-05-26 17:20:33 -04:00
|
|
|
Description=Update user Flatpaks
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2024-04-26 18:58:16 -04:00
|
|
|
ExecStart=/usr/bin/flatpak --user update -y" | sudo tee /etc/systemd/user/update-user-flatpaks.service
|
2022-05-26 17:20:33 -04:00
|
|
|
|
2022-05-26 17:39:47 -04:00
|
|
|
echo "[Unit]
|
2022-05-26 17:20:33 -04:00
|
|
|
Description=Update user Flatpaks daily
|
|
|
|
|
|
|
|
[Timer]
|
|
|
|
OnCalendar=daily
|
|
|
|
Persistent=true
|
|
|
|
|
|
|
|
[Install]
|
2022-07-01 07:53:36 -04:00
|
|
|
WantedBy=timers.target" | sudo tee /etc/systemd/user/update-user-flatpaks.timer
|