USBGuard is a software framework that helps protect your systems against rogue USB devices (a.k.a. BadUSB) by implementing basic allowlisting and blocklisting capabilities. This allows you to define access control for USB devices based on device attributes. In case you are not familiar with USBGuard, take a look at Protecting systems against intrusive USB devices. Here is a summary of some of the new features in USBGuard that we delivered in Red Hat Enterprise Linux (RHEL) 8.3.
Comments in rules configuration files
Complex configuration files, such as USBGuard rules, sometimes require complex syntax. In order to improve usability, we enabled using comments in rules configuration files. USBGuard uses the “#” symbol for block comments, so everything after this character to the end of line is ignored. We recommend using a blank line above the comment to physically place it closer to the line below than the line above:
# Allow USB mass storage devices (USB flash disks)
allow with-interface equals { 08:*:* }
The rules.d folder
With the 0.7.8 version available in RHEL 8.3, users can have multiple rules files inside the rules.d directory. By default, the location of this folder is /etc/usbguard/rules.d/ but you can change it in the configuration file. The USBGuard daemon behaves like any other standard Linux daemon and loads rules files in alphanumeric order. When naming files inside the rules.d directory, you should start with a two-digit number prefix indicating the order in which the daemon reads the rules.
For example, your rules.d folder might look like this:
-
A generic configuration (mice, keyboards, host controllers) required for every workstation in /etc/usbguard/rules.d/00_general.conf
-
A list of USB headsets in /etc/usbguard/rules.d/10_headsets.conf
-
A list of allowed USB storage devices in /etc/usbguard/rules.d/20_usbstorage.conf
-
A list of blocked or rejected devices in /etc/usbguard/rules.d/30_reject-or-block.conf
Improved security
Security is a big concern on the current market. To take it to the next level, we introduced a new configuration option inside usbguard-daemon.conf (/etc/usbguard/usbguard-daemon.conf). By default, device identification is stored in system logs. To prevent storing this information in the logs, set the HidePII option to true in the usbguard-daemon.conf file.
# # Hides personally identifiable information such as device # serial numbers and hashes of descriptors (which include the serial number) from audit entries. HidePII=true
Introduce with-connect-type attribute to rule language
Have you ever wanted to distinguish whether a device is integrated to the laptop or connected via a USB cable? Now you can determine device connection type by adding the with-connect-type attribute to your rule file. Please see the usbguard-rules.conf(5) manual page for further details.
Temporary rules
If you are not familiar with writing USBGuard rules, you might want to test them first before making them permanent. Also, in the case that a temporary rule blocks you from interacting with one of the devices, there is no need to restart your machine. You can now append temporary rules to the rule set using the -t command line option, for example:
$ usbguard append-rule -t SOME_RULE
This ensures that the appended rule remains in memory only until the daemon restarts. After you are done testing, you can restart the daemon:
$ sudo systemctl restart usbguard.service
Policy generation for a specific device
To create a rule just for a specific device, such as a plugged in keyboard at /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1, use the generate-policy command, for example:
$ usbguard generate-policy -d /devices/pci0000:00/0000:00:14.0/usb1/1-1
Allow/Block/Reject-device using a single rule
Until now, users of USBGuard could allow devices by using device ID. This was not very user-friendly due to the fact that it required executing a separate command for each device. Now, USBGuard can handle rule strings, and a target will be applied on each device that matches the specified rule string.
Let’s assume that you just plugged in a wired keyboard and mouse that are not allowed by default. You could allow them for use with the following:
$ usbguard allow-device match with-connect-type \"hotplug\"
The block-device and reject-device commands have the same syntax as the allow-device command.
SELinux subpackage
USBGuard now provides its own SELinux policy in usbguard-selinux. The USBGuard daemon is confined under the usbguard_t domain. You can install the policy with the usbguard-selinux subpackage:
$ sudo dnf install usbguard-selinux
Notifier subpackage
Desktop users want to know if the device they have plugged in is allowed for use or not. Until now, the only way for a user to tell if a device is allowed was to see if it is mounted, which really was not very helpful. For this reason, we introduced usbguard-notifier which creates user-friendly notifications in the form of quick pop-up messages. It detects modifications to USBGuard policy and changes in device presence.
To enable desktop notifications, perform the following steps:
-
Install the
usbguard-notifier
package
# sudo dnf install usbguard-notifier
-
Ensure that the `usbguard` service is running in the background
# sudo systemctl start usbguard
-
Enable notifier for the current user
$ systemctl enable --now --user usbguard-notifier.service
When you are done, you will see notifications popping up on your screen when the policy changes or a device is inserted or removed.
Conclusion
As technology advances, there are USB sticks that can destroy your computer, USB sticks loaded with spyware, and even official enterprise USB sticks infected with malware—not to mention “clean” USB sticks that can be used to sneak out sensitive data from your system.
USBGuard can help stop these attacks. It's a great addition to anyone needing to protect a Linux system
저자 소개
Attila is part of the Special Projects Team at Red Hat, focused on productization and development of security technologies such as Advanced Intrusion Detection Environment (AIDE), sudo, USBGuard and rsyslog.
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.