mirror of
https://github.com/tommytran732/QubesOS-Scripts
synced 2024-11-22 01:41:34 -05:00
kickseucre
This commit is contained in:
parent
7951969235
commit
56e8f982fb
@ -1,10 +1,2 @@
|
||||
# QubesOS-Scripts
|
||||
My scripts for setting up QubesOS. Read the scripts and adjust them to your needs, don't just blindly run them. Note that the scripts do not disable passwordless sudo. If you want to do it, follow https://www.qubes-os.org/doc/vm-sudo/ and set it up on the Fedora and Debian templates before using my scripts. The purpose of this is to **hopefully** get a bit better protection against VM escapes (as an attacker would need to both get root privilege in the VM and exploit a bug in the Qubes agents or Xen hypervisor).
|
||||
|
||||
1. Run dom0.sh script to set up dom0
|
||||
2. Download the Fedora Minimal template and use the fedora-minimal.sh script to do basic configuration. Then, create TemplateVMs based on it. The most important thing here is that you replace sys-net and sys-firewall with a minimal version for attack surface reduction. I have been trying to create a minimal template for ProtonVPN, but haven't been able to so far. Any help with this would be appreciated.
|
||||
3. Run the fedora.sh script to trim down the default Fedora template and do basic configuration. The script includes a systemd user timer `update-user-flatpaks.timer` that you can manually enable on AppVMs. Firefox is also replaced with Brave. Other TemplateVMs should be based on the trimmed down Fedora template.
|
||||
4. Copy the Fedora template to a Brave template. Run brave.sh to install brave in the brave template. TemplateVMs which need a dedicated browser should be based on the Brave template of the Fedora template. Create a disposable VM based on the Brave template. When you need to open a browser inside of a VM with no browser, Qubes will open it in a disposable VM instead.
|
||||
5. Run debian.sh to trim down the Debian template.
|
||||
6. Copy the Debian template to a Kicksecure template, then run kicksecure.sh to morph it into Kicksecure. AppVMs should be based on KickSecure instead of Debian.
|
||||
7. Run the kicksecure_hardening.sh script on both the Whonix Gateway and Workstation templates to enable experimental hardening features. The same script can be used to harden AppVMs based on KickSecure too, so long as it doesn't stop your app from running.
|
||||
|
14
debian/kicksecure.sh
vendored
14
debian/kicksecure.sh
vendored
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt full-upgrade
|
||||
sudo addgroup --system console
|
||||
sudo adduser user console
|
||||
|
||||
curl --proxy http://127.0.0.1:8082/ --tlsv1.3 --proto =https --max-time 180 --output ~/derivative.asc https://www.kicksecure.com/derivative.asc
|
||||
sudo cp ~/derivative.asc /usr/share/keyrings/derivative.asc
|
||||
echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.kicksecure.com bullseye main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list
|
||||
|
||||
sudo apt install kicksecure-qubes-cli
|
||||
sudo mv /etc/apt/sources.list ~/
|
||||
sudo touch /etc/apt/sources.list
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "countme=false" | sudo tee /etc/dnf/dnf.conf
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo dnf install -y qubes-core-agent-networking iproute qubes-core-agent-dom0-updates
|
3
kicksecure-minimal/firewall.sh
Normal file
3
kicksecure-minimal/firewall.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt install --no-install-recommends qubes-core-agent-networking iproute qubes-core-agent-dom0-updates -y
|
25
kicksecure-minimal/kicksecure.sh
Normal file
25
kicksecure-minimal/kicksecure.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Adding KickSecure's signing key
|
||||
sudo apt install --no-install-recommends curl -y
|
||||
curl --proxy http://127.0.0.1:8082/ --tlsv1.3 --proto =https --max-time 180 --output ~/derivative.asc https://www.kicksecure.com/derivative.asc
|
||||
sudo cp ~/derivative.asc /usr/share/keyrings/derivative.asc
|
||||
echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.kicksecure.com bullseye main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list
|
||||
|
||||
#Distribution morphing
|
||||
sudo apt install --no-install-recommends kicksecure-qubes-cli -y
|
||||
sudo mv /etc/apt/sources.list ~/
|
||||
sudo touch /etc/apt/sources.list
|
||||
|
||||
#Enabling SUID Disabler and Permission Hardener
|
||||
sudo systemctl enable --now permission-hardening
|
||||
|
||||
#Install LKRG
|
||||
sudo apt install --no-install-recommends lkrg-dkms linux-headers-amd64 -y
|
||||
|
||||
#Enable hardened malloc
|
||||
echo "/usr/lib/libhardened_malloc.so/libhardened_malloc.so" | sudo tee /etc/ld.so.preload
|
||||
|
||||
#Reduce kernel information leaks
|
||||
#Will break a lot of applications. The apps I use on Whonix work fine with it so I am enabling it.
|
||||
sudo systemctl enable --now hide-hardware-info.service
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo dnf install -y qubes-gpg-split arc-theme
|
||||
sudo apt install --no-install-recommends qubes-gpg-split arc-theme -y
|
||||
|
||||
sudo mkdir /etc/gtk-3.0
|
||||
echo '[Settings]
|
@ -4,9 +4,7 @@
|
||||
sudo systemctl enable --now permission-hardening
|
||||
|
||||
#Install LKRG
|
||||
sudo apt update
|
||||
sudo apt full-upgrade -y
|
||||
sudo apt install --no-install-recommends lkrg-dkms linux-headers-amd64
|
||||
sudo apt install --no-install-recommends lkrg-dkms linux-headers-amd64 -y
|
||||
|
||||
#Enable hardened malloc
|
||||
echo "/usr/lib/libhardened_malloc.so/libhardened_malloc.so" | sudo tee /etc/ld.so.preload
|
Loading…
Reference in New Issue
Block a user