[rešeno] Namestitev USB Guard

Na Ubuntu 16.04 (Xenial) skušam namestiti USB Guard:
https://github.com/dkopecek/usbguard/blob/master/doc/usbguard-on-ubuntu-14.04.md

Rečem:
git clone https://github.com/dkopecek/usbguard
cd usbguard/
./autogen.sh
Namestim še:
sudo apt install libgcrypt11-dev
sudo apt install libsodium-dev
sudo apt install protobuf-compiler
sudo apt install libprotobuf-dev
Nato zaženem:
./configure --prefix=/usr --sysconfdir=/etc --with-bundled-json --with-bundled-spdlog --with-bundled-sodium --with-bundled-catch --with-bundled-pegtl

In dobim:
...
checking for protoc... protoc
configure: Using bundled Catch library
configure: Using bundled PEGTL library
checking for qt5... no
checking for qt4... yes
checking for moc-qt4... moc-qt4
checking for uic-qt4... uic-qt4
checking for rcc-qt4... no
checking for rcc... rcc
checking for lrelease-qt4... lrelease-qt4
checking for dbus... no
configure: error: in `/home/matej/usbguard':
configure: error: Required D-Bus modules (dbus-1, dbus-glib-1, gio-2.0) not found!
See `config.log' for more details

Namestil sem še:
sudo apt install libdbus-1-dev libdconf-dbus-1-0
...pa je isto.

Kakšna ideja kako to rešit?


Komentarji

  • OK, treba je bilo namestiti še tole:
    sudo apt install libdbus-glib-1-dev libpolkit-gobject-1-dev

    In pa namestitev libdconf-dbus-1-0 NI POTREBNA.

    Končno namestitev:
    ./configure --prefix=/usr --sysconfdir=/etc --with-bundled-catch --with-bundled-pegtl
    make

    sudo make install
    Testi so izgleda OK:
    make check
    Še naredimo binarye dostopne sistemu:
    sudo ldconfig
    OK, what now? GUI naj bi bil del tega brancha, pa ga ni videti...
  • Kje se pa omenja GUI? :) Jaz nisem zasledil.
    Urediti moraš usbguard-daemon.conf in napisati svoja pravila za naprave
    https://dkopecek.github.io/usbguard/documentation/configuration.html ter rules.conf
    https://dkopecek.github.io/usbguard/documentation/rule-language.html#initial-policy
  • Matthai Član
    uredil/-a 12. December, 2016
  • OK, pravilno je takole:

    ./configure --prefix=/usr --sysconfdir=/etc --with-bundled-catch --with-bundled-pegtl --with-gui-qt=qt4 --enable-systemd

    Ampak potem zaženem service in se zaletim v tole:
    sudo systemctl status usbguard.service

    ● usbguard.service - USBGuard daemon
       Loaded: loaded (/lib/systemd/system/usbguard.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:usbguard-daemon(8)

    dec 12 10:48:27 cryptoloop systemd[1]: Stopped USBGuard daemon.
    dec 12 10:48:27 cryptoloop systemd[1]: Started USBGuard daemon.
    dec 12 10:48:27 cryptoloop usbguard-daemon[29756]: [1481536107.900] (E) ERROR: Configuration: /etc/usbguard/rules.conf: usbguard::Exception
    dec 12 10:48:27 cryptoloop systemd[1]: usbguard.service: Main process exited, code=exited, status=1/FAILURE
    dec 12 10:48:27 cryptoloop systemd[1]: usbguard.service: Unit entered failed state.
    dec 12 10:48:27 cryptoloop systemd[1]: usbguard.service: Failed with result 'exit-code'.
    dec 12 10:48:28 cryptoloop systemd[1]: usbguard.service: Service hold-off time over, scheduling restart.
    dec 12 10:48:28 cryptoloop systemd[1]: Stopped USBGuard daemon.
    dec 12 10:48:28 cryptoloop systemd[1]: usbguard.service: Start request repeated too quickly.
    dec 12 10:48:28 cryptoloop systemd[1]: Failed to start USBGuard daemon.



  • Evo, s pomočjo na IRCu sem ugotovil:

    Določimo, da so dovoljene trenutno priključene USB naprave:
    sudo usbguard generate-policy > rules.conf
    sudo install -m 0600 -o root -g root rules.conf /etc/usbguard/rules.conf
    sudo systemctl restart usbguard

    Zadeva teče:
    sudo systemctl status usbguard.service

    ● usbguard.service - USBGuard daemon
       Loaded: loaded (/lib/systemd/system/usbguard.service; disabled; vendor preset: enabled)
       Active: active (running) since pon 2016-12-12 11:01:25 CET; 6s ago
         Docs: man:usbguard-daemon(8)
     Main PID: 29930 (usbguard-daemon)
       CGroup: /system.slice/usbguard.service
               └─29930 /usr/sbin/usbguard-daemon -k -c /etc/usbguard/usbguard-daemon.conf

    In deluje! :-)
Za komentiranje se prijavite ali pa se vpišite.