mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1782] Make ~/.bashrc read only? #1205
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tehpenguin on GitHub (Feb 21, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1782
I am trying to make bashrc read only to prevent attacks from the bashbunny sudo grabber script. I edited /etc/firejail/firejail.config and added "read-only ~/.bashrc" to the end of the file. I am unable to open any applications and it gives an error code at that line. What is the best way to go about making bashrc and .config read only?
@Vincent43 commented on GitHub (Feb 21, 2018):
/etc/firejail/firejail.configis used to configure firejail itself. You can only change options which are already listed there. Don't add anything which isn't listed.To configure running apps you can create/modify
/etc/firejail/<app-name>.profile,/etc/firejail/<app-name>.localor~/.config/firejail/<app-name>.profile. So putread-only ~/.bashrcinto one of those locations.Also
read-only ~/.bashrcis already covered in /etc/disable-common.inc. So you can add line:include /etc/disable-common.incto your app profile instead.Alternatively you can run it from the commandline directly:
firejail <app-name>- it will use default.profile which hasinclude /etc/disable-common.incoption already covered (among others) or:firejail --noprofile --read-only=~/.bashrc <app-name>.@tehpenguin commented on GitHub (Feb 21, 2018):
Thank you Vincent43, this is exactly what I was looking for! A few more questions if you dont mind. Whats the difference between using /etc/firejail/.profile , /etc/firejail/.local or ~/.config/firejail/.profile? Will they all work the same? Also, do I have to add that for every app or is there a way to apply disable-common.inc to everything?
@Vincent43 commented on GitHub (Feb 21, 2018):
/etc/firejail/<app-name>.profilefiles are officially provided by firejail package and maintained here at github. They will be overwritten at every firejail update so it isn't advised to modify them./etc/firejail/<app-name>.localare used as local additions on top of official firejail profiles. If you want to add/remove something to official profile which is already provided by firejail you can do it here..localfiles don't exist by default so you have to create them first.~/.config/firejail/<app-name>.profilefiles can bu used as replacement for official profiles (they will overwrite profile config with the same name in/etc/firejail/) or for creating new profiles for apps which doesn't exist yet in firejail./etc/disable-common.incis already included in most firejail profiles (if it isn't it usually means it breaks app) so you don't have to add it to official profiles. For new profiles you can addinclude /etc/disable-common.incorread-only=~/.bashrcline to their.profile.If you want to add some non-standard option to all profiles (i.e. apparmor) you can create
/etc/firejail/globals.localand add your desired modifications there. All official firejail profiles haveinclude /etc/firejail/globals.localline and they will use this modifications automatically. For new profiles addinclude /etc/firejail/globals.localline to their.profile.@tehpenguin commented on GitHub (Feb 22, 2018):
Oh ok that makes more sense. Thank you for your help. So i have copied /etc/firejail/default.profile to ~/.config/firejail/mate-terminal.profile and it includes /etc/disable-common.inc. However I am still able to nano ~/.bashrc. Any idea what I am doing wrong?
@SkewedZeppelin commented on GitHub (Feb 22, 2018):
@tehpenguin does nano say
[ File '.bashrc' is unwritable ]? or are you actually able to save it and see the changes outside of the sandbox?@tehpenguin commented on GitHub (Feb 22, 2018):
Changes are able to be saved. It will say it wrote 123 lines.
@tehpenguin commented on GitHub (Feb 22, 2018):
Which means it is still writable, even if its contained in that sandbox
@SkewedZeppelin commented on GitHub (Feb 22, 2018):
That is odd. What distro, kernel, and version of firejail are you running? Also are you a standard user or are you root?
I'm not too sure what .bashrc has to do with a USB attack, but if your goal is to prevent USB attacks in general:
@tehpenguin commented on GitHub (Feb 22, 2018):
I am using Parrot OS, kernel 4.14, Unsure of the firejail version (not at my computer) but its no older than december 2017. This is under a normal user
@Vincent43 commented on GitHub (Feb 22, 2018):
Are you sure
mate-terminalis started from firejail? How do you runmate-terminal? It should be:firejail mate-terminal. You can check withfirejail --list(in another terminal) if it's contained. If you want to always runmate-terminalfrom firejail you can do:sudo ln -s /usr/bin/firejail /usr/local/bin/mate-terminaland make suremate-terminalis executed asmate-terminalnot/usr/bin/mate-terminal@SkewedZeppelin commented on GitHub (Feb 22, 2018):
I've just tested this on ParrotOS Home and am still unable to reproduce it.
I know that they maintain their own patches for Firejail, but for the most part they seem to be fairly sane and don't change that much.
@idnovic commented on GitHub (Mar 2, 2018):
I was thinking, if he runs "nano XYZ & disown" is it still sandboxed???
I know offtopic but parrot launches custom made scripts for most of their applicaitons.
(application start from startmenu)
Maybe the terminal is also custom launched.