Skip to content

Commit

Permalink
fixed issue with signature path
Browse files Browse the repository at this point in the history
If the path to the signatures contained $HOME or ~ it would not be expanded out.

Signed-off-by: Matty Jones <[email protected]>
  • Loading branch information
mattyjones committed Aug 24, 2020
1 parent f076bc2 commit 74f7393
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
16 changes: 7 additions & 9 deletions core/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package core
import (
"encoding/json"
"fmt"
"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
"io/ioutil"
"os"
"runtime"
Expand All @@ -14,6 +12,9 @@ import (
"time"
"wraith/version"

"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"

"github.com/gin-gonic/gin"
)

Expand Down Expand Up @@ -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
}

Expand Down
12 changes: 1 addition & 11 deletions docs/development/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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~~
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 74f7393

Please sign in to comment.