(c) 2025 Robert Strutts, LIC: MIT

main
Robert 7 months ago
parent ea1e29b4bd
commit dc68aca96a
  1. 2
      README.md
  2. 4
      core/alert/alert.go
  3. 4
      core/configure/configure.go
  4. 4
      core/hasher/hasher.go
  5. 4
      core/make_key/make_key.go
  6. 4
      core/monitor_running_bins/monitor_running_bins.go
  7. 4
      core/new_file_monitor/new_file_monitor.go
  8. 4
      core/scanner/scanner.go
  9. 4
      core/sys_database/sys_database.go
  10. 3
      docs/SystemD.md
  11. 4
      execguard.go
  12. 3
      execguard@.service
  13. 4
      export.sh
  14. 5
      install.sh
  15. 5
      reBuild.sh
  16. 6
      startExecguard.sh
  17. 5
      stopExecguard.sh
  18. 5
      sys_update.sh
  19. 4
      update_bins.sh
  20. 4
      vscan_bins.sh

@ -100,7 +100,7 @@ If not using apt, change the script to use your package manager.
# Once done initializing the System, BEWARE....doing this...: # 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!!!! 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 execguard@init status
sudo systemctl enable --now execguard@enforce sudo systemctl enable --now execguard@enforce

@ -1,5 +1,9 @@
package alert package alert
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/sys_database" "execguard/core/sys_database"
"execguard/core/configure" "execguard/core/configure"

@ -1,5 +1,9 @@
package configure package configure
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"os" "os"
"encoding/json" "encoding/json"

@ -1,5 +1,9 @@
package hasher package hasher
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import( import(
"execguard/core/configure" "execguard/core/configure"
"encoding/base64" "encoding/base64"

@ -1,5 +1,9 @@
package make_key package make_key
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"io" "io"
"crypto/rand" "crypto/rand"

@ -1,5 +1,9 @@
package monitor_running_bins package monitor_running_bins
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/alert" "execguard/core/alert"
"execguard/core/configure" "execguard/core/configure"

@ -1,5 +1,9 @@
package new_file_monitor package new_file_monitor
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/alert" "execguard/core/alert"
"fmt" "fmt"

@ -1,5 +1,9 @@
package scanner package scanner
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/alert" "execguard/core/alert"
"execguard/core/configure" "execguard/core/configure"

@ -1,5 +1,9 @@
package sys_database package sys_database
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/hasher" "execguard/core/hasher"
"bufio" "bufio"

@ -1,3 +1,5 @@
# execguard.service:
```
[Unit] [Unit]
Description=Executable Guardian for %I Description=Executable Guardian for %I
After=network.target After=network.target
@ -35,3 +37,4 @@ RestrictRealtime=yes
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
```

@ -1,5 +1,9 @@
package main package main
// Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
// License: MIT
// GIT: https://git.mysnippetsofcode.com/bobs/execguard
import ( import (
"execguard/core/alert" "execguard/core/alert"
"execguard/core/configure" "execguard/core/configure"

@ -1,4 +1,7 @@
[Unit] [Unit]
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
Description=Executable Guardian for %i Description=Executable Guardian for %i
After=network.target After=network.target
StartLimitIntervalSec=60 StartLimitIntervalSec=60

@ -1,3 +1,7 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# 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 /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" echo "On the remote PC: \$ sudo execguard --initFile migrated_apps.txt"

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
export CGO_ENABLED=1 export CGO_ENABLED=1
# See if the User can become ROOT user # See if the User can become ROOT user
if [ "$EUID" -eq 0 ]; then if [ "$EUID" -eq 0 ]; then

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
export CGO_ENABLED=1 export CGO_ENABLED=1
./stopExecguard.sh ./stopExecguard.sh
/usr/local/bin/go build -o execguard /usr/local/bin/go build -o execguard

@ -1,4 +1,10 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
if [ -z "$1" ]; then if [ -z "$1" ]; then
/usr/bin/echo "Which mode to start: init or enforce?" /usr/bin/echo "Which mode to start: init or enforce?"
exit 1 exit 1

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
/usr/bin/echo "Stopping execguard service if on..." /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@init
/usr/bin/sudo /usr/bin/systemctl stop execguard@enforce /usr/bin/sudo /usr/bin/systemctl stop execguard@enforce

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
/usr/bin/echo "This script will update a computer that uses apt package manager." /usr/bin/echo "This script will update a computer that uses apt package manager."
# Prompt the user # Prompt the user
read -p "Do you want to do a full system upgrade using apt? [y/N] " choice read -p "Do you want to do a full system upgrade using apt? [y/N] " choice

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
# Directories to search for executables # Directories to search for executables
DIRS=("/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin/") DIRS=("/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin/")

@ -1,4 +1,8 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2025 Robert Strutts <bobs@NewToFaith.com>
# License: MIT
# GIT: https://git.mysnippetsofcode.com/bobs/execguard
./stopExecguard.sh ./stopExecguard.sh
/usr/bin/echo "Dumping contents of Database to file..." /usr/bin/echo "Dumping contents of Database to file..."

Loading…
Cancel
Save