Mik*_*Rev 10 networking printer printing cups brother-printer
我想购买一台新打印机,因为我的旧打印机拒绝打印,除非我允许它访问 LAN 之外的互联网。我无法真正控制其他组织对我的印刷工作的看法,我不喜欢这样。这就引发了下面的问题。
我将使用 GNU/Linux 机器上的 USB 连接来连接到新打印机。该驱动程序是专有的,以 deb 文件形式提供
$ dpkg --contents /path/to/hll2350dwpdrv-4.0.0-1.i386.deb
drwxr-xr-x root/root 0 2017-07-18 03:36 ./
drwxr-xr-x root/root 0 2017-07-18 03:36 ./usr/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./usr/share/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./usr/share/doc/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./etc/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./etc/opt/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./etc/opt/brother/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./etc/opt/brother/Printers/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./etc/opt/brother/Printers/HLL2350DW/
drwxr-xr-x root/root 0 2017-07-18 03:34 ./etc/opt/brother/Printers/HLL2350DW/inf/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/
-rw-r--r-- root/root 20486 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/LICENSE_ENG.txt
-rw-r--r-- root/root 20799 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/LICENSE_JPN.txt
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/cupswrapper/
-rw-r--r-- root/root 18351 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/cupswrapper/Copying
-rw-r--r-- root/root 17840 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/cupswrapper/brother-HLL2350DW-cups-en.ppd
-rwxr-xr-x root/root 26369 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/cupswrapper/lpdwrapper
-rwxr--r-- root/root 7606 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/cupswrapper/paperconfigml2
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/inf/
-rw-r--r-- root/root 891 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/inf/brHLL2350DWfunc
-rw-r--r-- root/root 168 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/inf/brHLL2350DWrc
-rwxr-xr-x root/root 863 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/inf/setupPrintcap
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/lpd/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/lpd/armv7l/
-rwxr-xr-x root/root 31460 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/armv7l/brprintconflsr3
-rwxr-xr-x root/root 65940 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/armv7l/rawtobr3
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/lpd/i686/
-rwxr-xr-x root/root 28281 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/i686/brprintconflsr3
-rwxr-xr-x root/root 59014 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/i686/rawtobr3
-rwxr-xr-x root/root 6698 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/lpdfilter
drwxr-xr-x root/root 0 2017-07-18 03:36 ./opt/brother/Printers/HLL2350DW/lpd/x86_64/
-rwxr-xr-x root/root 35591 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/x86_64/brprintconflsr3
-rwxr-xr-x root/root 67752 2017-07-18 03:34 ./opt/brother/Printers/HLL2350DW/lpd/x86_64/rawtobr3
drwxr-xr-x root/root 0 2017-07-18 03:36 ./var/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./var/spool/
drwxr-xr-x root/root 0 2017-07-18 03:36 ./var/spool/lpd/
drw-r--r-- root/root 0 2017-07-18 03:34 ./var/spool/lpd/HLL2350DW/
Run Code Online (Sandbox Code Playgroud)
use*_*686 14
CUPS 驱动程序通常包含一个过滤器(转换器),它是在有限用户帐户下运行的实际 Linux 程序。在此示例中,rawtobr3
似乎是 PPD 文件指定使用的过滤器(用于将 CUPS 提供的打印数据转换为 Brother“BR-Script3”格式)。由于它是完整的可执行文件,因此它可以执行操作系统允许其用户帐户执行的任何操作,包括网络访问。
您可以使用各种方法,例如 AppArmor、nft/iptables(使用基于 UID 的规则)、策略路由(同样使用基于 UID 的匹配)或 eBPF(cups.service 中 systemd 的“IPAddressDeny=”)来阻止网络访问 CUPS 及其运行的帮助程序进程。
\n(注意不要禁止本地主机网络访问,因为 CUPS 被架构为 IPP 服务器 \xe2\x80\x93,它甚至通过“localhost:631”接收本地打印作业。)
\n大多数现代打印机都支持 IPP Everywhere(作为 AirPrint 或 Mopria 等各种认证的一部分);这包括可以通过ipp-usb
守护程序使用的 IPP-over-USB。支持IPP Everywhere 的打印机需要“无驱动程序”,即它们必须接受标准格式(例如PDF 或PCLm)的作业,这意味着不需要Brother CUPS 驱动程序即可进行打印。请参阅Debian Wiki 文章以获取更多信息。
当然可以。该驱动程序附带了作为打印过程一部分调用的过滤器程序和脚本。除了原来的工作之外,他们可以做任何事情。他们会吗?可能不会。
您可以使用 SELinux 等安全模块来限制程序可以执行的操作。这可以防止可执行文件访问任意文件并执行任意操作(例如连接到互联网或删除您的内容或其他任何操作)。SELinux 不容易设置(和维护,当您更改系统时)。
一个更容易设置但同样笨重的解决方案是仅将打印过程容器化,禁止容器的任何和所有网络访问。
您最好的选择可能是购买一台直接理解 PostScript 的打印机。这些都存在通用驱动程序。它们不会包含任何恶意软件。但您可能无法使用打印机的所有高级功能。
归档时间: |
|
查看次数: |
2569 次 |
最近记录: |