[GH-ISSUE #4607] noprinters #2719

Closed
opened 2026-05-05 09:23:08 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @rusty-snake on GitHub (Oct 15, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4607

Describe the solution you'd like

noprinters command to disable printing. It should blacklist /dev/lp* stuff and /run/cups/cups.sock.

This idea is based on the observation that wrc has

  • /run/**/resolv.conf which is either needed or useless because of net none
  • /run/dbus/system_bus_socket which is further handled by dbus-system
  • /run/media which is further handled by disable-mnt/disable-write-mnt.inc
  • /run/cups/cups.sock which is not handled elsewhere.
Originally created by @rusty-snake on GitHub (Oct 15, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4607 ### Describe the solution you'd like `noprinters` command to disable printing. It should `blacklist /dev/lp*` stuff and `/run/cups/cups.sock`. This idea is based on the observation that wrc has - `/run/**/resolv.conf` which is either needed or useless because of `net none` - `/run/dbus/system_bus_socket` which is further handled by `dbus-system` - `/run/media` which is further handled by `disable-mnt`/`disable-write-mnt.inc` - `/run/cups/cups.sock` which is not handled elsewhere.
gitea-mirror 2026-05-05 09:23:08 -06:00
Author
Owner

@netblue30 commented on GitHub (Oct 21, 2021):

Done! --noprinters on command line, noprinters in profile. You guys do some testing, I don't have a printer here and /dev/lp* doesn't appear under my /dev. I'll add the man pages later.

<!-- gh-comment-id:948126400 --> @netblue30 commented on GitHub (Oct 21, 2021): Done! --noprinters on command line, noprinters in profile. You guys do some testing, I don't have a printer here and /dev/lp* doesn't appear under my /dev. I'll add the man pages later.
Author
Owner

@rusty-snake commented on GitHub (Oct 21, 2021):

FTR: bd15e763ea + d9403dcdc8

edit: remember relnotes

<!-- gh-comment-id:948308807 --> @rusty-snake commented on GitHub (Oct 21, 2021): FTR: bd15e763eab8c07072f8ef495a17d387c26150c7 + d9403dcdc8cfb23d5350b0488817a5eaa5a0f20d edit: remember relnotes
Author
Owner

@rusty-snake commented on GitHub (Oct 21, 2021):

  • I've /dev/lp{1..4} (even if I have no physical connected printers, only IPP).
  • blacklist /dev/lp* works
  • --noprofile --noprinters --net=none blocks CUPS (e.g. the print dialog from evince only lists "print to pdf")
  • --net=none is required because
    Listen localhost:631
    Listen /run/cups/cups.sock
    
<!-- gh-comment-id:948484021 --> @rusty-snake commented on GitHub (Oct 21, 2021): - I've `/dev/lp{1..4}` (even if I have no physical connected printers, only IPP). - `blacklist /dev/lp*` works - `--noprofile --noprinters --net=none` blocks CUPS (e.g. the print dialog from evince only lists "print to pdf") - `--net=none` is required because ``` Listen localhost:631 Listen /run/cups/cups.sock ```
Author
Owner

@WhyNotHugo commented on GitHub (Dec 3, 2021):

How about disabling printers by default and having a printers command to enable them when desired?

It's a bit easier to think about permissions in terms of "profile doesn't allow anything, unless otherwise stated", rather than the other way around.

<!-- gh-comment-id:985756534 --> @WhyNotHugo commented on GitHub (Dec 3, 2021): How about disabling printers by default and having a `printers` command to enable them when desired? It's a bit easier to think about permissions in terms of "profile doesn't allow anything, unless otherwise stated", rather than the other way around.
Author
Owner

@rusty-snake commented on GitHub (Dec 3, 2021):

While I generally agree with you to list everything that is required rather than listing everything which is not required (enumerating badness vs. goodness), I don't feel good about changing the logic how firejail works.

<!-- gh-comment-id:985763764 --> @rusty-snake commented on GitHub (Dec 3, 2021): While I generally agree with you to list everything that is required rather than listing everything which is not required (enumerating badness vs. goodness), I don't feel good about changing the logic how firejail works.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2719
No description provided.