Compare commits

...
4 Commits
Author SHA1 Message Date
Seth Art 3c6c59ec4b Update README.md 2023-06-09 14:33:51 -04:00
Seth Art 3f8b828a6c Merge pull request #41 from BishopFox/seth-dev
found and fixed some bugs in the new resource-trusts command
2023-06-09 14:32:01 -04:00
sethsec-bf b8bf12f1c4 found and fixed some bugs in the new resource-trusts command 2023-06-09 14:30:39 -04:00
sethsec-bf 690b3c8c77 found and fixed some bugs in the new resource-trusts command 2023-06-09 14:29:33 -04:00
2 changed files with 35 additions and 35 deletions

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ For the full documentation please refer to our [wiki](https://github.com/BishopF
| Provider| CloudFox Commands |
| - | - |
| AWS | 26 |
| AWS | 30 |
| Azure | 4 |
| GCP | Support Planned |
| Kubernetes | Support Planned |
+34 -34
View File
@@ -253,7 +253,7 @@ func (m *ResourceTrustsModule) getSNSTopicsPerRegion(r string, wg *sync.WaitGrou
if err != nil {
m.modLog.Error(err.Error())
m.CommandCounter.Error++
break
continue
}
parsedArn, err := arn.Parse(aws.ToString(t.TopicArn))
if err != nil {
@@ -332,11 +332,13 @@ func (m *ResourceTrustsModule) getS3Buckets(wg *sync.WaitGroup, semaphore chan s
region, err := sdk.CachedGetBucketLocation(cloudFoxS3Client.S3Client, aws.ToString(m.Caller.Account), name)
if err != nil {
m.modLog.Error(err.Error())
continue
}
policyJSON, err := sdk.CachedGetBucketPolicy(cloudFoxS3Client.S3Client, aws.ToString(m.Caller.Account), region, aws.ToString(b.Name))
if err != nil {
m.modLog.Error(err.Error())
continue
} else {
bucket.PolicyJSON = policyJSON
}
@@ -411,14 +413,14 @@ func (m *ResourceTrustsModule) getSQSQueuesPerRegion(r string, wg *sync.WaitGrou
if err != nil {
m.modLog.Error(err.Error())
m.CommandCounter.Error++
break
}
if queue.Policy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
continue
}
if !queue.Policy.IsEmpty() {
if queue.Policy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
}
for i, statement := range queue.Policy.Statement {
prefix := ""
if len(queue.Policy.Statement) > 1 {
@@ -473,16 +475,16 @@ func (m *ResourceTrustsModule) getECRRecordsPerRegion(r string, wg *sync.WaitGro
if err != nil {
m.modLog.Error(err.Error())
m.CommandCounter.Error++
break
}
if repoPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
continue
}
if !repoPolicy.IsEmpty() {
if repoPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
}
for i, statement := range repoPolicy.Statement {
prefix := ""
if len(repoPolicy.Statement) > 1 {
@@ -538,26 +540,25 @@ func (m *ResourceTrustsModule) getCodeBuildResourcePoliciesPerRegion(r string, w
if err != nil {
m.modLog.Error(err.Error())
m.CommandCounter.Error++
break
continue
}
policyJSON, err := sdk.CachedCodeBuildGetResourcePolicy(cloudFoxCodeBuildClient.CodeBuildClient, aws.ToString(cloudFoxCodeBuildClient.Caller.Account), r, p)
if err != nil {
m.modLog.Error(err.Error())
return
sharedLogger.Error(err.Error())
continue
}
projectPolicy, err = policy.ParseJSONPolicy([]byte(policyJSON))
if projectPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
}
if !projectPolicy.IsEmpty() {
if projectPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
}
for i, statement := range projectPolicy.Statement {
prefix := ""
if len(projectPolicy.Statement) > 1 {
@@ -612,18 +613,17 @@ func (m *ResourceTrustsModule) getLambdaPolicyPerRegion(r string, wg *sync.WaitG
if err != nil {
sharedLogger.Error(err.Error())
m.CommandCounter.Error++
break
}
if functionPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
continue
}
if !functionPolicy.IsEmpty() {
if functionPolicy.IsPublic() {
isPublic = magenta("Yes")
isInteresting = magenta("Yes")
} else {
isPublic = "No"
}
for i, statement := range functionPolicy.Statement {
prefix := ""
if len(functionPolicy.Statement) > 1 {
@@ -678,7 +678,7 @@ func (m *ResourceTrustsModule) getEFSfilesystemPoliciesPerRegion(r string, wg *s
if err != nil {
sharedLogger.Error(err.Error())
m.CommandCounter.Error++
break
continue
}
if fsPolicy.IsPublic() {