103 Commits
Author SHA1 Message Date
Bastien Faure 2f0cfd7b1f Added Azure automation command 2026-10-29 23:55:08 -04:00
Bastien Faure e3a1803cce Added Azure Func module 2026-10-29 23:54:16 -04:00
Bastien Faure 6257da9391 Added ACR module for Azure 2026-10-29 23:51:47 -04:00
Seth Art 29ab782b31 Fix region slowness and hangs with opt-in/unreachable regions
Commands were hanging for several minutes when run with low-privilege
credentials against accounts where opt-in regions (e.g. me-south-1)
are not enabled. Each unreachable region exhausted the full AWS SDK
retry budget (3 attempts × ~30s timeout) per service call, compounding
across every check in all-checks mode.

Three-part fix:

1. TCP reachability probe: Before making any API calls, probe
   sts.REGION.amazonaws.com:443 with a 3-second timeout. Unreachable
   regions are filtered out concurrently and cached for the run so the
   probe only happens once per region. This eliminates multi-minute
   stalls caused by regions that are not enabled for the account.

2. --max-retries flag: New persistent flag on the aws subcommand
   (default 3, matching prior behaviour). Setting --max-retries 0
   skips all retries, useful when running black-box against an account
   where most API calls will return 403/401 anyway.

3. Remove me-south-1 from the static fallback region list: This
   Bahrain opt-in region was the primary offender reported in issue
   #132. It is excluded from the hardcoded list so accounts that never
   opted in skip it entirely even before the TCP probe runs.

Also fixes a pre-existing bug in GetIamSimResult where a redundant
second isRoleAdminBool check after the cache-or-compute block would
overwrite a correct "YES" result from the cache with "No" (because
isRoleAdminBool stays false on a cache hit).

Fixes #132
2026-06-17 14:29:10 -04:00
jbarciabf 494443d7ce Fix concurrent map access race in network-ports module (#129)
The NetworkPortsModule cached EC2 NACLs and Security Groups in two
per-region maps. The cache lookup read the maps without holding a
lock while the cache population path took a write lock, producing a
"concurrent map read and map write" runtime panic when multiple
region goroutines hit the cache check concurrently. The panic
reproduced reliably in low-density AWS accounts where every region
goroutine raced through the cache check at the same instant.

Take the read lock on the cache fast-path in both
getEC2NACLsPerRegion and getEC2SecurityGroupsPerRegion. Move
naclsMutex and securityGroupsMutex from package-level vars onto the
module struct so concurrent module instances stop serializing on
each other's locks.

Convert CommandCounter from plain int fields with naked ++/-- to
int64 fields with Incr/Decr/Load methods that use atomic.AddInt64
and atomic.LoadInt64 internally. Worker goroutines and the spinner
goroutine were updating and reading the same counters without
synchronization, producing torn integer writes that could show as
off-by-one progress in the spinner. Plain int64 storage keeps the
struct copyable so existing constructors and helpers that take
modules by value continue to vet-clean.

Add TestNetworkPortsCacheConcurrentAccess as a regression test.
With the read lock removed, "go test -race" reports the
mapaccess2_faststr read racing the locked write; with the fix in
place the test passes.
2026-05-26 10:36:17 -04:00
Dominik Prodinger 11763f04f6 Merge branch 'BishopFox:main' into fix-privesc-false-positive 2026-03-04 10:39:12 +01:00
jbarciabf a3b7ab4269 rename buckets -> storage 2026-02-26 15:01:18 -05:00
jbarciabf 8db014b136 updated foxmapper mappings 2026-02-21 14:12:23 -05:00
jbarciabf d021ea54de cleanup output, better streaming and file splitting 2026-02-19 18:17:24 -05:00
jbarciabf 7a18090609 removed attackpath and orgcache flags and enable by default 2026-02-16 15:17:04 -05:00
jbarciabf cb8be678e7 removed attack paths to use foxmapper instead 2026-02-15 23:02:27 -05:00
Dominik Prodinger 6f45cbe900 Fix false positive where GitHub Actions subject was not recognized 2026-02-09 12:19:05 +01:00
jbarciabf de141300e9 fixed enumerate regions where permissions were sometimes denied 2026-02-04 20:35:44 -05:00
jbarciabf eb76d76dea physical cache instead of memory. 1st wave of cleanup 2026-02-04 14:15:16 -05:00
jbarciabf 70107c607f updated session handling 2026-01-23 10:52:42 -05:00
jbarciabf ed732d0c01 migrated over to sdk and caching for standardization with aws modules 2026-01-19 15:35:39 -05:00
jbarciabf 2b272a1335 merged privesc, lat movemet, and data exfil into attack paths 2026-01-16 00:21:08 -05:00
jbarciabf 06a9dabf48 refactored output to be hierarchical, added privesc checks 2026-01-14 14:51:54 -05:00
jbarciabf 8954fc2a72 fixed permissions denied error 2026-01-13 15:37:53 -05:00
jbarciabf 7bb7d947ef fixed logging newline, more 400 errors, text formatting, and enhancements in dns, filestore, endpoints, and dataefil 2026-01-13 15:22:36 -05:00
jbarciabf 3c1213b0ff fixed cloudrun 400 error 2026-01-13 11:03:22 -05:00
jbarciabf 36b45a64c5 rework 2026-01-12 21:08:19 -05:00
jbarciabf 333ca05a11 fixed error handling, added auto org detection for vpc, added features to whoami 2026-01-08 08:50:33 -05:00
jbarciabf ec9a50ead1 fixed error handling 2026-01-04 09:46:15 -05:00
jbarciabf 0df2aa9240 updated to include all-projects and added project name to output 2025-12-30 13:32:16 -05:00
jbarciabf 8f6208d983 Merge remote-tracking branch 'upstream/main' into cloudfox-gcp-new 2025-12-17 14:52:35 -05:00
jbarciabf 83d9611732 init 2025-12-17 14:52:06 -05:00
Seth Art 16b3c66624 Unified logging around logrus. removed standard logging lines. 2025-12-15 13:33:54 -05:00
Seth Art 3dbb98ffc6 Added split level logging to logrus 2025-12-15 13:33:54 -05:00
Seth Art 521cf7e4f4 Reduced the number of times awsservicemap calls out to get the AWS json 2025-12-15 13:33:54 -05:00
edops973 0deb568e41 Get open search policies 2025-03-15 22:47:43 +07:00
edops973 ec497faba4 Support kms service for command resource-trusts 2025-03-07 15:25:53 +07:00
Seth Art ebf9985d40 Fix for #92 2024-10-10 19:14:09 -04:00
Seth Art 6b0970ebd7 Fix for cape in regards to permission expansion 2024-09-24 16:15:49 -04:00
guangwu ca810a00d7 fix: close input file 2024-05-11 20:43:07 +08:00
sethsec-bf abcc930f20 added afero fs back to output2 (needed to pass brew tests) 2024-04-16 11:29:53 -04:00
sethsec-bf 57194ef3e0 bump to version 1.14.0, merged gcp and aws ds functionality 2024-04-16 10:32:19 -04:00
David 23e8878e49 Merge branch 'main' into feature/gcp-v1 2024-04-12 01:04:49 +00:00
sethsec-bf 3a45583015 Got cape working without any aws calls, cleaned up logging messages 2024-04-05 16:07:37 -04:00
sethsec-bf 8fac75ed11 merged from main 2024-03-21 09:58:35 -04:00
sethsec-bf 3ff704e98f merged from main 2024-03-21 09:56:18 -04:00
sethsec-bf a1903f67f7 Major update for role trusts parsing. Cleaner version has case statement on federated principal value and not soley on condition data 2024-03-14 14:47:17 -04:00
David 2f99a7642f working gcp functionality 2024-03-13 14:19:47 +00:00
sethsec-bf 8d039323bf Fix for #77 2024-03-08 09:01:59 -05:00
sethsec-bf 05fd899219 Fixed bug in federeated role trust poclies where multiple subjects are trusted 2024-03-07 15:56:13 -05:00
sethsec-bf 36c9a5b795 Merged changes from neptune PR into this branch 2024-02-28 09:34:41 -05:00
sethsec-bf 80c00f3d97 Added test for databases command 2024-02-27 10:10:56 -05:00
sethsec-bf dd6dd291c5 playing around with saving graph state between runs 2024-02-13 16:20:37 -05:00
sethsec-bf 24b7076bc3 saving place in caper command 2024-02-08 16:32:15 -05:00
sethsec-bf aeccb6db6d Have global data in dom's graph format now. just need to write the table creation code 2024-01-25 15:24:49 -05:00