Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
c7bffe6a77
2 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. 11
    0
      src/freedombone-usb-canary
  2. 8
    0
      src/freedombone-utils-setup

+ 11
- 0
src/freedombone-usb-canary Parādīt failu

1
+#!/bin/bash
2
+
3
+PROJECT_NAME=freedombone
4
+
5
+ADMIN_USER=$(cat /root/${PROJECT_NAME}-completed.txt | grep 'Admin user' | awk -F ':' '{print $2}')
6
+#MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
7
+MY_EMAIL_ADDRESS=root@$(cat /etc/hostname)
8
+echo "USB device connected on ${DEVPATH}" | mail -s "${PROJECT_NAME} USB canary" ${MY_EMAIL_ADDRESS}
9
+echo "${ACTION}" > /tmp/usb-canary
10
+echo "${MY_EMAIL_ADDRESS}" >> /tmp/usb-canary
11
+echo "$(date)" >> /tmp/usb-canary

+ 8
- 0
src/freedombone-utils-setup Parādīt failu

551
     sed -i 's| nullok_secure||g' /etc/pam.d/common-auth
551
     sed -i 's| nullok_secure||g' /etc/pam.d/common-auth
552
 }
552
 }
553
 
553
 
554
+function create_usb_canary {
555
+    echo "ACTION==\"add\", KERNEL==\"sd*[!0-9]\", RUN+=\"/usr/local/bin/${PROJECT_NAME}-usb-canary\"" > /etc/udev/rules.d/00-usb-canary.rules
556
+    udevadm control --reload-rules
557
+}
558
+
554
 function setup_firewall {
559
 function setup_firewall {
555
     function_check create_completion_file
560
     function_check create_completion_file
556
     create_completion_file
561
     create_completion_file
778
 
783
 
779
     function_check schedule_stig_tests
784
     function_check schedule_stig_tests
780
     schedule_stig_tests
785
     schedule_stig_tests
786
+
787
+    function_check create_usb_canary
788
+    create_usb_canary
781
 }
789
 }
782
 
790
 
783
 function setup_email {
791
 function setup_email {