From 74f73938826c8856c6da69f88d982ea01c45aadd Mon Sep 17 00:00:00 2001 From: Matty Jones Date: Mon, 24 Aug 2020 07:56:11 -0400 Subject: [PATCH] fixed issue with signature path If the path to the signatures contained $HOME or ~ it would not be expanded out. Signed-off-by: Matty Jones --- core/session.go | 16 +++++++--------- docs/development/roadmap.md | 12 +----------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/core/session.go b/core/session.go index feb0cf5..82f0314 100644 --- a/core/session.go +++ b/core/session.go @@ -4,8 +4,6 @@ package core import ( "encoding/json" "fmt" - "github.com/mitchellh/go-homedir" - "github.com/spf13/viper" "io/ioutil" "os" "runtime" @@ -14,6 +12,9 @@ import ( "time" "wraith/version" + "github.com/mitchellh/go-homedir" + "github.com/spf13/viper" + "github.com/gin-gonic/gin" ) @@ -208,16 +209,13 @@ func (s *Session) Initialize(v *viper.Viper, scanType string) { for _, f := range Signatures { f = strings.TrimSpace(f) - if PathExists(f, s) { - curSig = LoadSignatures(f, s.MatchLevel, s) + h := SetHomeDir(f) + if PathExists(h, s) { + curSig = LoadSignatures(h, s.MatchLevel, s) combinedSig = append(combinedSig, curSig...) } } - } else { - curSig = LoadSignatures(v.GetString(".")+"default.yml", s.MatchLevel, s) // TODO implement this - combinedSig = append(combinedSig, curSig...) - } - + } // TODO need to catch this error here Signatures = combinedSig } diff --git a/docs/development/roadmap.md b/docs/development/roadmap.md index 2b35acb..58a6c05 100644 --- a/docs/development/roadmap.md +++ b/docs/development/roadmap.md @@ -53,13 +53,10 @@ ## Milestone 1 ### Bugs -<<<<<<< HEAD -======= - [ ] Gitlab client does not follow redirects - [ ] Need to confirm if github client follows redirects - [ ] In gitlab you can have a project w/ no repo, this will error out - [ ] In github you can have a project w/ no repo, does this error out ->>>>>>> develop - [X] ~~temp directories are not getting deleted~~ - [X] ~~in-mem-clone is not working properly~~ - [X] ~~there are no findings in a gitlab search~~ @@ -92,7 +89,6 @@ - [ ] Document all code completely - [ ] Create a developer doc with the design and code execution flow - [ ] Contributing.md -<<<<<<< HEAD - [ ] wraith - [ ] wraith-tests - [ ] wraith-signatures @@ -106,16 +102,12 @@ - [ ] wraith-signatures - [ ] Initial blog post - [ ] Detailed documentation published on the net and with source control -- [X] ~~Write a new README~~ - [ ] Cleanup issues - [ ] Changelog.md - [ ] wraith - [ ] wraith-tests - [ ] wraith-signatures -======= -- [X] ~~Write a new README~~ - [ ] Label issues for begineer and hacktoberfest ->>>>>>> develop - [ ] Go doc strings - [ ] common - [ ] config @@ -163,6 +155,7 @@ - [X] ~~Ability to silence the output~~ - [X] ~~Max file size to scan~~ - [ ] Only export the functions and variables necessary +- [ ] Capture the eroor if no sig file is presented ### Milestone 2 @@ -183,10 +176,7 @@ - [ ] Scan since a given commit - [ ] Update Signatures command - [ ] Implement threading for local path scans -<<<<<<< HEAD - [ ] Ability to use the .gitignoe when scanning for ingoring paths and files -======= ->>>>>>> develop ### Testing - [ ] Make tech debt fail build process