Ubuntu hardening. Not a script. Just follow along and paste in the commands.
Last edited:
@Victor M chatGPT mentioned an app to me yesterday, FlatSeal, might have some relevance for Ubuntu hardening?? I haven't installed it yet...Web site updated today. Private-etc firejail option is not compatible with Ubuntu 25 - you won't be able to connect to the inet.
Yes I installed Flatseal, and made some permission tweaks for one flatpak, so farYes FlatSeal is useful if you use Flatpaks. FlatSeal can let you minimize the connections between the flatpak and the outside world. You can freely experiment/disable what you see listed because there is a 'reset' button for when things don't work out.
Not all possible syntax included in above diagram. Read the man file...................----------- method--------- -------------subject------------------- ---------------object-------------
allow/deny perm=open/execute/any ( exe= uid= gid= trust= dir= all ) : ( path= dir= ftype= trust= all )
The first 2 lines disallows non-trusted python and perl scripts which do not belong to any apt package.deny_audit perm=any exe=/usr/bin/python3.14 : trust=0
deny_audit perm=any exe=/usr/bin/perl : trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/x-shellscript dir=/tmp/ trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/x-shellscript dir=/var/tmp/ trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/x-shellscript dir=/dev/shm/ trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/x-shellscript dir=/run/user/ trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/x-shellscript dir=/home/ trust=0
deny_audit perm=any exe=/usr/bin/bash : ftype=text/plain trust=0
I used to do that - image restore upon trouble. But then I realized that without Adding improved security that Matters, I would end up playing the game where I would restore and the attackers just returns again and again using the same attack method deploying different payloads. And my PC becomes their playground. WDAC App Control / fapolilcyd is a key defense that shackles the attacker from deploying hackware or any foreign exe. I know my red team has several attacks up their sleeve. But when they can't deploy their payload then I stay safe.And in case i can just restore back.