Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BishopFox/cloudfox into seth-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsec-bf committed Feb 28, 2024
2 parents ae1dac6 + f415f99 commit fd01647
Show file tree
Hide file tree
Showing 18 changed files with 501 additions and 120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# Dependency directories (remove the comment below to include it)
# vendor/
.vscode
.idea
launch.json

######################################################
Expand Down
9 changes: 1 addition & 8 deletions aws/api-gws.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package aws

import (
"fmt"
"os"
"path/filepath"
"sort"
"strconv"
Expand Down Expand Up @@ -144,7 +143,7 @@ func (m *ApiGwModule) PrintApiGws(outputDirectory string, verbosity int) {
Name: m.output.CallingModule,
})
o.PrefixIdentifier = m.AWSProfile
loot := m.writeLoot(o.Table.DirectoryName, verbosity)
loot := m.writeLoot(filepath, verbosity)
o.Loot.LootFiles = append(o.Loot.LootFiles, internal.LootFile{
Name: m.output.CallingModule,
Contents: loot,
Expand Down Expand Up @@ -207,12 +206,6 @@ func (m *ApiGwModule) executeChecks(r string, wg *sync.WaitGroup, semaphore chan

func (m *ApiGwModule) writeLoot(outputDirectory string, verbosity int) string {
path := filepath.Join(outputDirectory, "loot")
err := os.MkdirAll(path, os.ModePerm)
if err != nil {
m.modLog.Error(err.Error())
m.CommandCounter.Error++
panic(err.Error())
}
f := filepath.Join(path, "api-gws.txt")

var out string
Expand Down
4 changes: 3 additions & 1 deletion aws/api-gws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/BishopFox/cloudfox/internal"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/sts"
"github.com/aws/smithy-go/ptr"
"github.com/spf13/afero"
)

Expand All @@ -29,7 +30,8 @@ func TestApiGw(t *testing.T) {

fs := internal.MockFileSystem(true)
defer internal.MockFileSystem(false)
tmpDir := "~/.cloudfox/"
//tmpDir := "~/.cloudfox/"
tmpDir := ptr.ToString(internal.GetLogDirPath())

m.PrintApiGws(tmpDir, 2)

Expand Down
Loading

0 comments on commit fd01647

Please sign in to comment.