Installing and Configuring USBGuard

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

In this lab, we’ll be setting up USBGuard to to control which USB devices are allowd to communicate with our hosts once they are plugged in. USB devices are an easy way for attackers to gain a foothold in our environments via USB Dropper attacks. USBGuard is a great security control that can help us avoid being infected by a malicious USB device.

*This course is not approved or sponsored by Red Hat.*

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install and Configure USBGuard with Basic Settings
  1. Install USBGuard

    [root@host]# yum install -y usbguard
  2. Start the USBGuard service

    [root@host]# systemctl start usbguard.service
  3. Generate a base policy for USBGuard

    [root@host]# usbguard generate-policy > /etc/usbguard/rules.conf
  4. Restart the USBGuard service after creating the base policy

    [root@host]# systemctl restart usbguard.service
  5. Enable the USBGuard service to start at boot

    [root@host]# systemctl enable usbguard.service
Configure USBGuard Permissions
  1. Create a group named USBGuard-Users

    [root@host]# groupadd USBGuard-Users
  2. Add cloud_user to the USBGuard-Users group

    [root@host]# usermod -a -G USBGuard-Users cloud_user
    • Verify group membership:

      [root@host]# cat /etc/group | grep USBGuard-Users
  3. Update USBGuard to permit the USBGuard-Users group to make changes to USBGuard

    [root@host]# nano /etc/usbguard/usbguard-daemon.conf

    Change the IPCAllowedGroups line to read:

    IPCAllowedGroups=USBGuard-Users
  4. Restart the USBGuard service

    [root@host]# systemctl restart usbguard.service

Additional Resources

We have been assigned the task of setting up a host to test the effectiveness of USBGuard. We are to install USBGuard, get it to a functional state, and ensure it will start at boot.

The security team will take over after that and test the creation of rules and their effectiveness. To help the the security team out we'll need to create a group named USBGuard-Users, then add the cloud_user account as a member of the USBGuard-Users group, so it can be used to make changes to USBGuard.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?