diff --git a/README.md b/README.md index da8b4a2..ea0d1e1 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ If not using apt, change the script to use your package manager. # Once done initializing the System, BEWARE....doing this...: If you have not allowed all the things needed for your system, it will HANG-UP and stop working!!!! ``` -sudo systemctl disable execguard@init +sudo systemctl disable --now execguard@init sudo systemctl execguard@init status sudo systemctl enable --now execguard@enforce diff --git a/core/alert/alert.go b/core/alert/alert.go index a994f1d..04e8c53 100644 --- a/core/alert/alert.go +++ b/core/alert/alert.go @@ -1,5 +1,9 @@ package alert +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/sys_database" "execguard/core/configure" diff --git a/core/configure/configure.go b/core/configure/configure.go index 8ba1fc0..241bc9a 100644 --- a/core/configure/configure.go +++ b/core/configure/configure.go @@ -1,5 +1,9 @@ package configure +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "os" "encoding/json" diff --git a/core/hasher/hasher.go b/core/hasher/hasher.go index 23a5f26..16771b9 100644 --- a/core/hasher/hasher.go +++ b/core/hasher/hasher.go @@ -1,5 +1,9 @@ package hasher +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import( "execguard/core/configure" "encoding/base64" diff --git a/core/make_key/make_key.go b/core/make_key/make_key.go index 3d53c76..078ca6d 100644 --- a/core/make_key/make_key.go +++ b/core/make_key/make_key.go @@ -1,5 +1,9 @@ package make_key +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "io" "crypto/rand" diff --git a/core/monitor_running_bins/monitor_running_bins.go b/core/monitor_running_bins/monitor_running_bins.go index 0f21c4e..0ffdf4c 100644 --- a/core/monitor_running_bins/monitor_running_bins.go +++ b/core/monitor_running_bins/monitor_running_bins.go @@ -1,5 +1,9 @@ package monitor_running_bins +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/alert" "execguard/core/configure" diff --git a/core/new_file_monitor/new_file_monitor.go b/core/new_file_monitor/new_file_monitor.go index fe0243a..df2dd03 100644 --- a/core/new_file_monitor/new_file_monitor.go +++ b/core/new_file_monitor/new_file_monitor.go @@ -1,5 +1,9 @@ package new_file_monitor +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/alert" "fmt" diff --git a/core/scanner/scanner.go b/core/scanner/scanner.go index a9644b7..092a93d 100644 --- a/core/scanner/scanner.go +++ b/core/scanner/scanner.go @@ -1,5 +1,9 @@ package scanner +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/alert" "execguard/core/configure" diff --git a/core/sys_database/sys_database.go b/core/sys_database/sys_database.go index 807fe6f..aba56eb 100644 --- a/core/sys_database/sys_database.go +++ b/core/sys_database/sys_database.go @@ -1,5 +1,9 @@ package sys_database +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/hasher" "bufio" diff --git a/docs/SystemD.md b/docs/SystemD.md index 84f08c1..06ded19 100644 --- a/docs/SystemD.md +++ b/docs/SystemD.md @@ -1,3 +1,5 @@ +# execguard.service: +``` [Unit] Description=Executable Guardian for %I After=network.target @@ -35,3 +37,4 @@ RestrictRealtime=yes [Install] WantedBy=multi-user.target +``` diff --git a/execguard.go b/execguard.go index d39526a..9902939 100644 --- a/execguard.go +++ b/execguard.go @@ -1,5 +1,9 @@ package main +// Copyright (c) 2025 Robert Strutts +// License: MIT +// GIT: https://git.mysnippetsofcode.com/bobs/execguard + import ( "execguard/core/alert" "execguard/core/configure" diff --git a/execguard@.service b/execguard@.service index 6715e5b..54e60f6 100644 --- a/execguard@.service +++ b/execguard@.service @@ -1,4 +1,7 @@ [Unit] +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard Description=Executable Guardian for %i After=network.target StartLimitIntervalSec=60 diff --git a/export.sh b/export.sh index 44a149b..cf8f347 100644 --- a/export.sh +++ b/export.sh @@ -1,3 +1,7 @@ #!/bin/bash +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + /usr/bin/sudo /usr/bin/sqlite3 /etc/execguard/system.db "SELECT path FROM allowed;" > migrated_apps.txt echo "On the remote PC: \$ sudo execguard --initFile migrated_apps.txt" diff --git a/install.sh b/install.sh index e0bec00..f50fd6f 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + export CGO_ENABLED=1 # See if the User can become ROOT user if [ "$EUID" -eq 0 ]; then diff --git a/reBuild.sh b/reBuild.sh index 06a3dc2..8575690 100755 --- a/reBuild.sh +++ b/reBuild.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + export CGO_ENABLED=1 ./stopExecguard.sh /usr/local/bin/go build -o execguard diff --git a/startExecguard.sh b/startExecguard.sh index 92d3841..804a877 100755 --- a/startExecguard.sh +++ b/startExecguard.sh @@ -1,4 +1,10 @@ #!/bin/bash + +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + + if [ -z "$1" ]; then /usr/bin/echo "Which mode to start: init or enforce?" exit 1 diff --git a/stopExecguard.sh b/stopExecguard.sh index 7bc0119..70da89e 100755 --- a/stopExecguard.sh +++ b/stopExecguard.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + /usr/bin/echo "Stopping execguard service if on..." /usr/bin/sudo /usr/bin/systemctl stop execguard@init /usr/bin/sudo /usr/bin/systemctl stop execguard@enforce diff --git a/sys_update.sh b/sys_update.sh index eb6ab60..01980f7 100755 --- a/sys_update.sh +++ b/sys_update.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + /usr/bin/echo "This script will update a computer that uses apt package manager." # Prompt the user read -p "Do you want to do a full system upgrade using apt? [y/N] " choice diff --git a/update_bins.sh b/update_bins.sh index f56d804..14f6023 100755 --- a/update_bins.sh +++ b/update_bins.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + # Directories to search for executables DIRS=("/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin/") diff --git a/vscan_bins.sh b/vscan_bins.sh index ff418eb..8ec2349 100755 --- a/vscan_bins.sh +++ b/vscan_bins.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2025 Robert Strutts +# License: MIT +# GIT: https://git.mysnippetsofcode.com/bobs/execguard + ./stopExecguard.sh /usr/bin/echo "Dumping contents of Database to file..."