1
0
mirror of https://github.com/tommytran732/QubesOS-Scripts synced 2024-11-22 01:41:34 -05:00

kickseucre

This commit is contained in:
Tommy 2022-05-26 13:50:11 -04:00 committed by GitHub
parent 7951969235
commit 56e8f982fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 32 deletions

View File

@ -1,10 +1,2 @@
# QubesOS-Scripts # 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). 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
View File

@ -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

View File

@ -1,3 +0,0 @@
#!/bin/bash
echo "countme=false" | sudo tee /etc/dnf/dnf.conf

View File

@ -1,3 +0,0 @@
#!/bin/bash
sudo dnf install -y qubes-core-agent-networking iproute qubes-core-agent-dom0-updates

View File

@ -0,0 +1,3 @@
#!/bin/bash
sudo apt install --no-install-recommends qubes-core-agent-networking iproute qubes-core-agent-dom0-updates -y

View 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

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/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 sudo mkdir /etc/gtk-3.0
echo '[Settings] echo '[Settings]

View File

@ -4,9 +4,7 @@
sudo systemctl enable --now permission-hardening sudo systemctl enable --now permission-hardening
#Install LKRG #Install LKRG
sudo apt update sudo apt install --no-install-recommends lkrg-dkms linux-headers-amd64 -y
sudo apt full-upgrade -y
sudo apt install --no-install-recommends lkrg-dkms linux-headers-amd64
#Enable hardened malloc #Enable hardened malloc
echo "/usr/lib/libhardened_malloc.so/libhardened_malloc.so" | sudo tee /etc/ld.so.preload echo "/usr/lib/libhardened_malloc.so/libhardened_malloc.so" | sudo tee /etc/ld.so.preload