Commit a7a8ef3
committed
fix(aws): resolve regions and the global region in the ISO partitions
Three assumptions in the provider broke as soon as a partition was not
one of the four the region matrix used to carry.
get_available_aws_service_regions indexed the matrix directly, so an
unknown service or partition raised a KeyError rather than reporting the
service as unavailable. It now yields an empty set, the same outcome a
service explicitly recorded as unavailable already produced.
generate_regional_clients swallowed that KeyError, logged it and fell
through without returning, so it handed back None while promising a dict.
Callers then failed with "'NoneType' object has no attribute 'values'",
with the real cause left behind in a log line. It now returns an empty
dict and the service is simply not scanned.
get_global_region returned the string "aws-iso-global" for anything
matching "aws-iso". That is a botocore pseudo endpoint rather than a
region, and matching on a substring collapsed the four ISO partitions
into a single answer. It now reads the partition's global STS region from
the botocore endpoints data, which returns exactly the values the
hardcoded branches did for the existing partitions and a real region for
each ISO one.1 parent 5be68b2 commit a7a8ef3
5 files changed
Lines changed: 101 additions & 14 deletions
File tree
- prowler
- changelog.d
- providers/aws
- tests/providers/aws
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
911 | 914 | | |
912 | 915 | | |
913 | 916 | | |
| |||
923 | 926 | | |
924 | 927 | | |
925 | 928 | | |
| 929 | + | |
| 930 | + | |
926 | 931 | | |
927 | 932 | | |
928 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
929 | 936 | | |
930 | 937 | | |
931 | 938 | | |
| |||
1132 | 1139 | | |
1133 | 1140 | | |
1134 | 1141 | | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1145 | 1150 | | |
1146 | 1151 | | |
1147 | 1152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
1185 | 1184 | | |
1186 | 1185 | | |
1187 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1188 | 1194 | | |
1189 | 1195 | | |
1190 | 1196 | | |
| |||
1204 | 1210 | | |
1205 | 1211 | | |
1206 | 1212 | | |
1207 | | - | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
1208 | 1228 | | |
1209 | 1229 | | |
1210 | 1230 | | |
| |||
1292 | 1312 | | |
1293 | 1313 | | |
1294 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
1295 | 1336 | | |
1296 | 1337 | | |
1297 | 1338 | | |
| |||
1313 | 1354 | | |
1314 | 1355 | | |
1315 | 1356 | | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
1316 | 1397 | | |
1317 | 1398 | | |
1318 | 1399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
0 commit comments