diff options
author | Jannik Schönartz | 2017-11-15 09:29:10 +0100 |
---|---|---|
committer | Jonathan Bauer | 2021-06-25 14:38:18 +0200 |
commit | 055e2dfe09f270bb2ceca89b5100ad840d9c0837 (patch) | |
tree | 1ab5e94e959f41c70fa9d97a50978d5ffb7ec1f8 /core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh | |
parent | [kiosk-chromium] disable auto-update (diff) | |
download | mltk-055e2dfe09f270bb2ceca89b5100ad840d9c0837.tar.gz mltk-055e2dfe09f270bb2ceca89b5100ad840d9c0837.tar.xz mltk-055e2dfe09f270bb2ceca89b5100ad840d9c0837.zip |
[usbguard] USBGuard module added by Jannik Schönartz
[usb-lock-off] Updated usb info collection script to use the openslx config variables.
[usb-lock-off] Updated usbguard to version 0.7.2 and libsodium to 1.0.16. Fixed the build script, so that -c cleans everything.
Diffstat (limited to 'core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh')
-rwxr-xr-x | core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh b/core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh new file mode 100755 index 00000000..3fe91fef --- /dev/null +++ b/core/modules/usbguard/data/usr/local/etc/usbguard/sendUSBInfo.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# use SLX_KCL_SERVERS +. /opt/openslx/config + +SERVER_IP=${SLX_PXE_SERVER_IP} +CLIENT_IP=${SLX_PXE_CLIENT_IP} +NADAPTER="br0" + +if [ "$USBGUARD_DEVICE_EVENT" == "Insert" ] +then + id=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=id\s).*(?=\sserial)') + serial=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=serial\s").*(?="\sname)') + name=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=name\s").*(?="\shash)') + vhash=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=\shash\s").*(?="\sparent-hash)') + phash=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=\sparent-hash\s").*(?="\svia-port)') + vport=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=\svia-port\s").*(?="\swith-interface)') + interface=$(echo $USBGUARD_DEVICE_RULE | grep -Pzo '(?s)(?<=\swith-interface\s).*') + # nat1 ONLY WORKS FOR some VM's THIS NEEDS TO BE EDITED. IP Info only needed for getting the machineuuid -> location of the machine. + # interface-policy is not needed here is it? --> Once it's implemented in usbguard it is.. but currently the device rule doesn't have those information. + url=$(echo "http://$SERVER_IP/slx-admin/api.php?do=usbguard&action=newdevice&id=$id&serial=$serial&name=$name&ip=$CLIENT_IP&hash=$vhash&parent-hash=$phash&via-port=$vport&with-interface=$interface" | sed 's/ /%20/g') + curl $url +fi |