From Fedora Project Wiki

(Created page with "{{QA/Test_Case |description=This test case tests {{package|usbguard}} CLI device management. |setup= # Ensure the {{package|usbguard}} package is installed # To start from a c...")
 
No edit summary
 
Line 8: Line 8:
{{admon/tip|How to get to a clean state|As root, run {{command|systemctl stop usbguard}} and {{command|rm -f /etc/usbguard/rules.conf}}. '''This will remove your policy, so make a backup if you don't want to lose it'''.}}
{{admon/tip|How to get to a clean state|As root, run {{command|systemctl stop usbguard}} and {{command|rm -f /etc/usbguard/rules.conf}}. '''This will remove your policy, so make a backup if you don't want to lose it'''.}}
|actions=
|actions=
# Start the usbguard service: {{command|systemctl start usbguard}}
# Start the usbguard service: <pre># systemctl start usbguard</pre>
# Check that your connected USB devices are still working.
# Check that your connected USB devices are still working.
# List devices using the usbguard tool and check that all connected USB devices are listed: {{command|sudo usbguard list-devices}}
# List devices using the usbguard tool and check that all connected USB devices are listed: <pre># usbguard list-devices</pre>
# Connect the new device to the system. The device should be blocked -- not working.
# Connect the new device to the system. The device should be blocked -- not working.
# List blocked device using the usbguard tool: {{command|sudo usbguard list-devices -b}}
# List blocked device using the usbguard tool: <pre># usbguard list-devices -b</pre>
# Allow the new device using the usbguard tool: {{command|sudo usbguard allow-device <id>}}
# Allow the new device using the usbguard tool: <pre># usbguard allow-device <id></pre>
# Check that the new device is working.
# Check that the new device is working.
# List blocked device and check that the list is empty: {{command|sudo usbguard list-devices -b}}
# List blocked device and check that the list is empty: <pre># usbguard list-devices -b</pre>
|results=
|results=
# USB devices work after the usbguard service start.
# USB devices work after the usbguard service start.

Latest revision as of 08:15, 22 August 2016

Description

This test case tests usbguard CLI device management.

Setup

  1. Ensure the usbguard package is installed
  2. To start from a clean state, ensure that the usbguard service is stopped and that there's no existing policy.
  3. Ensure that there's at least one USB device connected to your system which can be disconnected and connected again. For example a USB keyboard or mouse.
  4. Prepare a USB device which is not connected to the system. For example a USB flash drive.
How to get to a clean state
As root, run systemctl stop usbguard and rm -f /etc/usbguard/rules.conf. This will remove your policy, so make a backup if you don't want to lose it.

How to test

  1. Start the usbguard service:
    # systemctl start usbguard
  2. Check that your connected USB devices are still working.
  3. List devices using the usbguard tool and check that all connected USB devices are listed:
    # usbguard list-devices
  4. Connect the new device to the system. The device should be blocked -- not working.
  5. List blocked device using the usbguard tool:
    # usbguard list-devices -b
  6. Allow the new device using the usbguard tool:
    # usbguard allow-device <id>
  7. Check that the new device is working.
  8. List blocked device and check that the list is empty:
    # usbguard list-devices -b

Expected Results

  1. USB devices work after the usbguard service start.
  2. Newly connected USB devices do not work.
  3. Blocked devices work after allowing them using the usbguard tool.