From d43947fcbf930343d76395c7370805b6024ba780 Mon Sep 17 00:00:00 2001 From: Brian Davis Date: Thu, 26 Sep 2024 20:11:10 -0400 Subject: [PATCH] fix: rename module to support go install - rename module to support go install - minor updates - hide procLibs --- Makefile | 7 +++---- cmd/dir.go | 2 +- cmd/file.go | 2 +- cmd/fortifyFile.go | 5 +++-- cmd/fortifyProc.go | 5 +++-- cmd/kernel.go | 2 +- cmd/proc.go | 3 ++- cmd/procAll.go | 3 ++- cmd/procLibs.go | 2 ++ go.mod | 2 +- main.go | 2 +- pkg/utils/checks.go | 3 ++- 12 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 3cceebd..493e847 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,9 @@ build: test: ./tests/test-checksec.sh -.PHONY: compose-test -compose-test: go - docker-compose build - docker-compose run +.PHONY: build-image +build-image: + docker build -t slimm609/checksec . .PHONY: go go: diff --git a/cmd/dir.go b/cmd/dir.go index 5b0ed2e..87ca869 100644 --- a/cmd/dir.go +++ b/cmd/dir.go @@ -1,7 +1,7 @@ package cmd import ( - "checksec/pkg/utils" + "github.com/slimm609/checksec/pkg/utils" "github.com/spf13/cobra" ) diff --git a/cmd/file.go b/cmd/file.go index fbcfd47..d56c441 100644 --- a/cmd/file.go +++ b/cmd/file.go @@ -1,7 +1,7 @@ package cmd import ( - "checksec/pkg/utils" + "github.com/slimm609/checksec/pkg/utils" "github.com/spf13/cobra" ) diff --git a/cmd/fortifyFile.go b/cmd/fortifyFile.go index c19cb61..1ce6872 100644 --- a/cmd/fortifyFile.go +++ b/cmd/fortifyFile.go @@ -1,11 +1,12 @@ package cmd import ( - "checksec/pkg/checksec" - "checksec/pkg/utils" "fmt" "os" + "github.com/slimm609/checksec/pkg/checksec" + "github.com/slimm609/checksec/pkg/utils" + "github.com/spf13/cobra" ) diff --git a/cmd/fortifyProc.go b/cmd/fortifyProc.go index ad769df..4ffad42 100644 --- a/cmd/fortifyProc.go +++ b/cmd/fortifyProc.go @@ -1,12 +1,13 @@ package cmd import ( - "checksec/pkg/checksec" - "checksec/pkg/utils" "fmt" "os" "path/filepath" + "github.com/slimm609/checksec/pkg/checksec" + "github.com/slimm609/checksec/pkg/utils" + "github.com/spf13/cobra" ) diff --git a/cmd/kernel.go b/cmd/kernel.go index 0edc121..162b560 100644 --- a/cmd/kernel.go +++ b/cmd/kernel.go @@ -1,7 +1,7 @@ package cmd import ( - "checksec/pkg/utils" + "github.com/slimm609/checksec/pkg/utils" "github.com/spf13/cobra" ) diff --git a/cmd/proc.go b/cmd/proc.go index d20120b..b08bd88 100644 --- a/cmd/proc.go +++ b/cmd/proc.go @@ -1,10 +1,11 @@ package cmd import ( - "checksec/pkg/utils" "fmt" "os" + "github.com/slimm609/checksec/pkg/utils" + "path/filepath" "github.com/spf13/cobra" diff --git a/cmd/procAll.go b/cmd/procAll.go index f366c8d..e0c6f45 100644 --- a/cmd/procAll.go +++ b/cmd/procAll.go @@ -1,11 +1,12 @@ package cmd import ( - "checksec/pkg/utils" "fmt" "os" "path/filepath" + "github.com/slimm609/checksec/pkg/utils" + "github.com/shirou/gopsutil/v3/process" "github.com/spf13/cobra" ) diff --git a/cmd/procLibs.go b/cmd/procLibs.go index f3b12f0..d3a0e2c 100644 --- a/cmd/procLibs.go +++ b/cmd/procLibs.go @@ -10,6 +10,8 @@ import ( var procLibsCmd = &cobra.Command{ Use: "procLibs", Short: "check process libraries", + // hide until refactored + Hidden: true, Run: func(cmd *cobra.Command, args []string) { fmt.Println("procLibs called") }, diff --git a/go.mod b/go.mod index e4d1ce4..b21fd0c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module checksec +module github.com/slimm609/checksec go 1.21.4 diff --git a/main.go b/main.go index 5c4eea6..b52e15e 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "checksec/cmd" +import "github.com/slimm609/checksec/cmd" func main() { cmd.Execute() diff --git a/pkg/utils/checks.go b/pkg/utils/checks.go index 1146391..1baba32 100644 --- a/pkg/utils/checks.go +++ b/pkg/utils/checks.go @@ -1,8 +1,9 @@ package utils import ( - "checksec/pkg/checksec" "reflect" + + "github.com/slimm609/checksec/pkg/checksec" ) // RunFileChecks - Run the file checks