Compare commits

...

835 Commits
1.0 ... 2.2.0

Author SHA1 Message Date
Toni de la Fuente
24cccf64d6 Merge branch 'fredski-github-master' 2020-02-21 15:32:47 +01:00
Toni de la Fuente
77f07cccf8 Merge branch 'master' of https://github.com/fredski-github/prowler into fredski-github-master 2020-02-21 15:31:23 +01:00
Kasprzykowski
40985212ab check_extra775 added | group7_extras and group11_secrets updated 2020-02-21 09:24:13 -05:00
Toni de la Fuente
e461714226 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-02-21 15:06:24 +01:00
Toni de la Fuente
11e5d44d9b version 2.2.0 2020-02-21 15:06:13 +01:00
Kasprzykowski
a1d26b44c3 check_extra999 added and group7_extras updated 2020-02-21 09:05:33 -05:00
Toni de la Fuente
42af217524 Merge pull request #489 from TopherIsSwell/master
Extra 774 - Fixed bug - Erroneously checking account creation date
2020-02-21 14:44:21 +01:00
Christopher Morrow
4a1d4060ec Check Extra 774 - Fixed bug - was checking account creation time instead of last logon date. 2020-02-20 15:11:13 -08:00
Toni de la Fuente
0210c43b60 Merge branch 'bridgecrewio-bugfix/check_11_check_access_keys_usage'
t push origin master:wq
2020-02-19 18:19:37 +01:00
Toni de la Fuente
ca34590da0 Merge branch 'bugfix/check_11_check_access_keys_usage' of https://github.com/bridgecrewio/prowler into bridgecrewio-bugfix/check_11_check_access_keys_usage 2020-02-19 18:14:37 +01:00
Toni de la Fuente
44716cfab2 Merge pull request #486 from bridgecrewio/bugfix/mark_only_available_rds_instances_as_violating
Filter for only available rds instances
2020-02-19 18:11:43 +01:00
Toni de la Fuente
1f3aaa8c7b Merge pull request #485 from bridgecrewio/bugfix/es_public_domains_filter_condition
Add conditions check for extra716
2020-02-19 18:09:37 +01:00
Toni de la Fuente
6213a7418c Merge pull request #484 from bridgecrewio/bugfix/public_bucket_policy_check_for_conditions
Add conditions check for extra771
2020-02-19 18:08:02 +01:00
Toni de la Fuente
bf9ffc0485 Merge pull request #483 from bridgecrewio/bugfix/extra748_check_for_all_ports
Check extra748 should fail in case of all ports (0-65535) open
2020-02-19 17:58:17 +01:00
Toni de la Fuente
fff605b356 Merge pull request #482 from bridgecrewio/bugfix/fix_extra_764_handle_all_aws
Check extra764 should also check for principal being AWS = "*"
2020-02-19 17:50:54 +01:00
Nimrod Kor
e41e77ed78 Remove unnecessary print
(cherry picked from commit 72bb29f13c)
2020-02-18 11:58:05 +02:00
Nimrod Kor
a6516e4af8 Check 1.1 - check password access and access key usage
(cherry picked from commit f62cde1bf1)
2020-02-18 11:36:57 +02:00
Nimrod Kor
4fe575030b Filter for only available rds instances
(cherry picked from commit 5a7356be3c)
2020-02-18 10:48:58 +02:00
Nimrod Kor
178a34e40d Add conditions check for extra716
(cherry picked from commit 2ec6696897)
2020-02-18 10:48:25 +02:00
Nimrod Kor
5f3293af1e Add conditions check for extra771
(cherry picked from commit 805b276578)
2020-02-18 10:28:36 +02:00
Nimrod Kor
28a8ae7572 Check extra748 should fail in case of all ports (0-65535) open 2020-02-18 10:26:44 +02:00
Nimrod Kor
daa26ed14c extra764 should also check for principal being AWS = "*" 2020-02-18 10:20:13 +02:00
Toni de la Fuente
9bd54ca30e Fixed issue #378 2020-02-12 23:46:42 +01:00
Toni de la Fuente
d832b11047 Merge branch 'alphad05-patch-1' 2020-02-12 23:22:44 +01:00
Toni de la Fuente
f99d35888a Merge branch 'patch-1' of https://github.com/alphad05/prowler into alphad05-patch-1 2020-02-12 23:20:32 +01:00
Toni de la Fuente
4d683a7566 Merge branch 'bridgecrewio-fix-check11' 2020-02-12 23:15:30 +01:00
Toni de la Fuente
35fc8cd0bf Merge branch 'fix-check11' of https://github.com/bridgecrewio/prowler into bridgecrewio-fix-check11 2020-02-12 23:13:49 +01:00
jonnyCodev
447657140d check if last_login_date is a valid date 2020-02-12 10:16:18 +02:00
alphad05
5069fd29f9 Associate VPCFlowLog with VPC
Associate VPCFlowLow with the VPC it is for to ensure accurate check. If there are multiple VPCs in a region and only some have VPC flow logs, current check will pass all VPCs even those without VPC flow logs.
2020-02-11 20:55:30 -08:00
Toni de la Fuente
b9a4f2c4e8 Merge pull request #479 from nickmalcolm/patch-1
Remove `ses:sendemails`
2020-02-11 23:46:46 +01:00
Nick Malcolm
0d1807bd33 Remove ses:sendemails
Prowler doesn't need to send emails via SES. https://github.com/toniblyx/prowler/issues/124
2020-02-12 11:38:23 +13:00
Toni de la Fuente
a77d3b0361 Merge pull request #477 from toniblyx/revert-474-feature/handle_get_bucket_policy_error
Revert "Feature/handle get bucket policy error"
2020-02-10 23:31:23 +01:00
Toni de la Fuente
274d02576f Revert "Feature/handle get bucket policy error" 2020-02-10 23:31:02 +01:00
Toni de la Fuente
5cebebba97 Merge pull request #474 from bridgecrewio/feature/handle_get_bucket_policy_error
Feature/handle get bucket policy error
2020-02-10 23:29:04 +01:00
Toni de la Fuente
092dc84186 Merge pull request #454 from zfLQ2qx2/prowler_check119
Add command for check119
2020-02-10 22:56:34 +01:00
Toni de la Fuente
528e14d4cf Update check119
updated to not scored
2020-02-10 22:55:57 +01:00
Toni de la Fuente
9519539de3 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-02-07 17:01:52 +01:00
Toni de la Fuente
1e1de4fa46 Added Security Hub integration link 2020-02-07 17:00:23 +01:00
jonnyCodev
fe2d2b45bb check root account access login and fail if used in the last day 2020-02-06 11:10:10 +02:00
Or Evron
74cbbddc5c add text info in case of error occurred
(cherry picked from commit b28917beb7)
2020-02-06 09:37:16 +02:00
Or Evron
e575fcd6b2 typo
(cherry picked from commit eb4f336428)
2020-02-06 09:37:16 +02:00
Or Evron
aca93b7526 typo
(cherry picked from commit b89f67bba1)
2020-02-06 09:37:16 +02:00
Or Evron
029c330ed1 fix check extra 764
(cherry picked from commit 0db690ad5f)
2020-02-06 09:37:16 +02:00
Toni de la Fuente
4ecc9c929c Merge pull request #473 from bridgecrewio/check-if-user-have-unused-login-more-then-30-days
Check if user have unused console login
2020-02-05 09:30:25 -05:00
jonnyCodev
2abe36083f Update group7_extras 2020-02-05 15:55:09 +02:00
jonnyCodev
d473ebe3f2 moving MAX_DAYS to the inner scope of the function 2020-02-05 11:15:14 +02:00
jonnyCodev
a824e064b3 Check if user have unused console login 2020-02-04 14:39:42 +02:00
Toni de la Fuente
24780b4caa Improve documentation with prowler-additions-policy.json, issue #468 2020-01-30 22:23:53 +00:00
Toni de la Fuente
b35350291f Merge pull request #442 from dbellizzi/patch-1
add "lambda:GetAccountSettings",
"lambda:GetFunctionConfiguration",
"lambda:GetLayerVersionPolicy",
"lambda:GetPolicy",
"lambda:List*",  to prowler-additions-policy
2020-01-27 18:07:05 -05:00
Toni de la Fuente
f038074e0c Update prowler-additions-policy.json 2020-01-27 18:06:43 -05:00
Toni de la Fuente
f797805970 Merge pull request #463 from zfLQ2qx2/issue458
Rewrite of check extra73
2020-01-27 18:03:28 -05:00
Toni de la Fuente
ef001af1ec Merge pull request #461 from zfLQ2qx2/issue459
Add additional error checking to address issue 459
2020-01-27 18:01:00 -05:00
Toni de la Fuente
2d712f6ab0 Merge pull request #457 from fayezgb/issue-163-CloudFront-WAF
Issue 163 cloud front waf
2020-01-27 17:59:30 -05:00
Toni de la Fuente
8b5733b5fe Merge branch 'master' into issue-163-CloudFront-WAF 2020-01-27 17:59:13 -05:00
Toni de la Fuente
278e382f9a Update group7_extras 2020-01-27 17:58:04 -05:00
Toni de la Fuente
425fe16752 Update and rename check_extra772 to check_extra773 2020-01-27 17:57:06 -05:00
Toni de la Fuente
3452ecdf03 Merge pull request #453 from zfLQ2qx2/prowler_eip_check
Add Prowler check for unused elastic IP addresses
2020-01-27 17:45:35 -05:00
Toni de la Fuente
e65a11bc27 Merge branch 'master' into prowler_eip_check 2020-01-27 17:44:59 -05:00
Toni de la Fuente
f2f82165ab Merge pull request #462 from zfLQ2qx2/issue460
Remove check 766, dupe of check 765
2020-01-27 17:42:30 -05:00
C.J
f735de8836 Rewrite of check extra73 2020-01-26 03:00:45 -05:00
C.J
9fc0f6c61c Remove check 766, dupe of check 765 2020-01-25 15:29:05 -05:00
C.J
41ccd4517b Add additional error checking to address issue 459 2020-01-25 15:22:39 -05:00
Fayez Barbari
2f17cfbc30 Check if CloudFront is using a WAF 2020-01-20 17:14:52 -06:00
Toni de la Fuente
ab5968cbee Merge pull request #452 from bgeesaman/remove-colors-json
Prevent colorization on Failed and Info
2020-01-20 22:03:47 +01:00
Toni de la Fuente
5f8c2328f1 Merge pull request #456 from fayezgb/cross-account
Use custom aws profile with Role to assume
2020-01-20 21:52:24 +01:00
Fayez Barbari
cc0b1bcf11 Merge pull request #1 from fayezgb/cross-account
Use custom aws profile with Role to assume
2020-01-20 14:47:08 -06:00
Fayez Barbari
f006c81e6a Use custom aws profile with Role to assume 2020-01-20 14:36:01 -06:00
root
9ed7d75c44 Add command for check119 2020-01-12 17:40:41 -05:00
root
4c1d1887e4 Add Prowler check for unused elastic IP addresses 2020-01-10 15:47:15 -05:00
bgeesaman
cea0cfb47d Prevent colorization on Failed and Info 2020-01-08 20:21:18 -05:00
Toni de la Fuente
754ff31ea3 Merge pull request #450 from lanhhuyet510/patch-1
Update README.md with jq install instructions
2020-01-08 09:15:25 +01:00
Toni de la Fuente
49ec898b9e Update README.md 2020-01-08 09:14:21 +01:00
Ngọ Anh Đức
c2f541134b Update README.md
Add jq package in requirements
2020-01-08 11:13:25 +07:00
Toni de la Fuente
b3b903959b Merge pull request #446 from zfLQ2qx2/cleanup_temp_files
Try to make sure prowler cleans up its temporary files
2019-12-31 15:21:33 +01:00
Toni de la Fuente
4806d5fc78 Merge pull request #447 from zfLQ2qx2/update_check_extra764
Misc fixes to check extra764
2019-12-31 11:39:21 +01:00
Toni de la Fuente
a755ec806a Merge pull request #444 from zfLQ2qx2/update_extra769
Add additional error checking to check extra769
2019-12-31 11:05:44 +01:00
Toni de la Fuente
3c703de4f4 Merge pull request #448 from zfLQ2qx2/update_check_extra726
Resolve issue with not_available state in results
2019-12-31 11:03:34 +01:00
root
7d324bed65 Resolve issue with not_available state in results 2019-12-30 14:43:51 -05:00
root
b22b0af2ce Misc fixes to check extra764 2019-12-30 14:20:50 -05:00
root
4cc5cd1ab1 Try to make sure prowler cleans up its temporary files 2019-12-30 13:43:53 -05:00
Toni de la Fuente
f3bfe90587 Add native support for AssumeRole clean up issue #445 2019-12-30 18:32:00 +01:00
Toni de la Fuente
53ea126065 Add native support for AssumeRole issue #445 2019-12-30 18:30:25 +01:00
root
688f028698 Add additional error checkings to check extra769 2019-12-30 11:33:12 -05:00
Toni de la Fuente
74380a62d9 Merge pull request #443 from zfLQ2qx2/update_ecr_checks
Add error checking to checks extra77 and extra765
2019-12-30 16:31:27 +01:00
root
c84190c3d9 Add error checking to checks extra77 and extra765 2019-12-30 10:07:14 -05:00
Toni de la Fuente
42f15ce164 Merge pull request #441 from dbellizzi/master
Add quiet mode that only logs failures
2019-12-27 12:33:13 +01:00
Toni de la Fuente
23be47a9b6 Enhanced title for check extra723 2019-12-27 12:09:35 +01:00
Toni de la Fuente
ab75f19a62 Merge pull request #440 from bridgecrewio/feature/small_fixes_to_extra731_extra716
Small check fixes to extra716 & extra731
2019-12-27 12:02:55 +01:00
Toni de la Fuente
20b127f516 Added DS IAM actions 2019-12-26 16:34:24 +01:00
Dominick Bellizzi
cc5da42797 add lambda:get* to prowler-additions-policy
The check: 7.60 [extra760] Find secrets in Lambda functions code (Not Scored) (Not part of CIS benchmark) 

errors by default, with the following:
An error occurred (AccessDeniedException) when calling the GetFunction operation: User: user/prowler is not authorized to perform: lambda:GetFunction on resource: arn:aws:lambda:eu-west-2:347708466071:function:ApiSimpleDelayDDMonitor

Adding this policy to be successfully run that check.
2019-12-18 14:53:09 -08:00
Dom Bellizzi
f979c7334f Add quiet mode that only logs failures 2019-12-18 22:06:44 +00:00
Nimrod Kor
1087d60457 Small check fixes
(cherry picked from commit 70879ba1e0)
2019-12-18 13:24:31 +02:00
Toni de la Fuente
d2b3e5ecdc Added new checks to extras group 2019-12-17 10:44:38 +01:00
Toni de la Fuente
3db94a5a98 Merge pull request #429 from dbellizzi/patch-1
Add "access-analyzer:ListTagsForResource" to prowler-additions-policy…
2019-12-17 10:42:04 +01:00
Toni de la Fuente
0d120a4536 Merge pull request #437 from bridgecrewio/feature/check_bucket_policies_public_write
Check bucket policies public write
2019-12-17 10:41:35 +01:00
Toni de la Fuente
0ab5d87b8f Merge pull request #433 from kmcquade/check/public-instance-with-instance-profile-attached
Added check_extra770, which checks for internet facing instances with an instance profile attached
2019-12-17 10:40:01 +01:00
Toni de la Fuente
39c7ea52c6 Add feature custom checks folder issue #439 2019-12-17 10:37:14 +01:00
Toni de la Fuente
933e4152cc Merge pull request #435 from bridgecrewio/feature/fix_check26
Fix check26 - get the account ID from sts
2019-12-17 10:14:11 +01:00
Nimrod Kor
fc3f4e830e Reuse ACCOUNT_NUM 2019-12-17 09:29:06 +02:00
Nimrod Kor
7e803bb6a9 Change to check 771 2019-12-15 18:18:02 +02:00
Nimrod Kor
2d5d551696 Initial commit 2019-12-15 18:18:02 +02:00
Nimrod Kor
8e1aa17a80 Fix check26 - get the account ID from sts
(cherry picked from commit ae20d9c5b7)
2019-12-15 15:55:54 +02:00
Toni de la Fuente
dd5bf6c7f8 Merge pull request #432 from bridgecrewio/feature/fix_check21
Add trail count to check21 and fail if no trail exist
2019-12-13 14:22:14 +01:00
Dominick Bellizzi
7cb869ad33 use more generic access-analyzer:List* 2019-12-12 09:36:19 -08:00
Kinnaird McQuade
3b264d556b Added check_extra770, which checks for internet facing instances with an Instance Profile attached. 2019-12-12 11:07:14 -05:00
Toni de la Fuente
e4a063f9d1 Merge pull request #430 from JohnVonNeumann/patch-1
UPDATE README.md - fix incorrect group flag
2019-12-12 10:19:28 +01:00
Nimrod Kor
559b0585dc Add trail count to check21 and fail if no trail exist
(cherry picked from commit fcf28dfa70)
2019-12-12 09:45:06 +02:00
JohnVonNeumann
2da125ff8b UPDATE README.md - fix incorrect group flag
To run prowler with the cislevelx group you use '-g', not '-c'
2019-12-12 11:28:52 +11:00
Dominick Bellizzi
53f097c2af Add "access-analyzer:ListTagsForResource" to prowler-additions-policy.json
check extra769 (Check if IAM Access Analyzer is enabled and its findings) requires this IAM permission
2019-12-06 14:49:36 -08:00
Toni de la Fuente
b6e34adc24 Fix issue #409 2019-12-05 12:52:19 +01:00
Toni de la Fuente
7b5ece8007 New check IAM Access Analyzer issue #428 2019-12-03 15:58:19 +01:00
Toni de la Fuente
fe65eaf373 New check ECS scan on push issue #427 2019-12-03 15:27:09 +01:00
Toni de la Fuente
4af3dc1254 Fix issue #426 updated base64 function 2019-12-02 15:26:48 +01:00
Toni de la Fuente
923fadbfa9 Merge pull request #425 from zfLQ2qx2/check-3xx-whitespace-tolerance
Make check3x more tolerant
2019-11-26 10:18:49 +01:00
Toni de la Fuente
3f68accf6f Added missing file iam/prowler-additions-policy.json 2019-11-26 09:57:29 +01:00
zfLQ2qx2
25d1aa9126 Make check3x more tolerant 2019-11-26 00:56:52 -05:00
Toni de la Fuente
dce9d5c96d Merge pull request #423 from barnhartguy/master
Update check_extra768
2019-11-25 10:03:27 +01:00
Toni de la Fuente
80c6900193 Merge pull request #424 from willthames/extra764_fix
Fix extra764 check
2019-11-25 10:01:51 +01:00
Will Thames
2e11e0a3f2 Fix extra764 check
Add missing bracket to prevent:

```
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
.Statement[]|select(((.Principal|type == "object") and .Principal.AWS == "*") or ((.Principal|type == "string") and
.Principal == "*")) and .Action=="s3:*" and (.Resource|type == "array") and (.Resource|map({(.):0})[]|has($arn)) and
(.Resource|map({(.):0})[]|has($arn+"/*")) and .Condition.Bool."aws:SecureTransport" == "false")
```

(line breaks added to reduce commit width)
2019-11-25 16:01:26 +10:00
barnhartguy
c630c02a26 Update check_extra768
fixed typo
2019-11-24 14:37:09 +02:00
Toni de la Fuente
e18cea213b consolidated ProwlerReadOnlyPolicy and available json 2019-11-22 12:42:57 +01:00
Toni de la Fuente
8f91bfee24 clean up documentation and added info to check_sample 2019-11-22 11:59:03 +01:00
Toni de la Fuente
a191a4eae6 consolidated ProwlerReadOnlyPolicy and available json 2019-11-22 11:41:13 +01:00
Toni de la Fuente
ce7e07d66d consolidated ProwlerReadOnlyPolicy and available json 2019-11-22 11:29:16 +01:00
Toni de la Fuente
ab5ed2c527 Merge pull request #421 from jonrau-at-aws/master
Update HIPAA language
2019-11-22 09:49:57 +01:00
Toni de la Fuente
c513e7af6c Merge pull request #420 from bridgecrewio/feature/ecs_task_definition_secrets_check_contribute
Add ECS task definition environment variables check
2019-11-22 00:18:00 +01:00
Toni de la Fuente
2e1cead3a2 Merge pull request #419 from zfLQ2qx2/prowler-extra719
Filter out private zones in check extra719
2019-11-22 00:12:36 +01:00
Toni de la Fuente
5c8b0aa942 Merge pull request #418 from zfLQ2qx2/prowler-check726
Handle Trusted Advisor entitlement issue gracefully
2019-11-22 00:10:39 +01:00
Toni de la Fuente
15dda01842 Merge pull request #417 from zfLQ2qx2/prowler-misc-updates
Update extra764 and extra734, add .gitignore rules for vim
2019-11-22 00:09:35 +01:00
Nimrod Kor
d19ae27f7c Fix merge issue 2019-11-21 12:48:17 -08:00
Nimrod Kor
b61af3a9eb Add ECS task definition environment variables check
(cherry picked from commit 662f287dd6)
2019-11-21 12:44:09 -08:00
zfLQ2qx2
687686c929 Filter out private zones in check extra719 2019-11-21 15:36:38 -05:00
zfLQ2qx2
94a90599bd Handle Trusted Advisor entitlement issue gracefully 2019-11-21 15:17:03 -05:00
zfLQ2qx2
669469e618 Update extra764 and extra734, add .gitignore rules for vim 2019-11-21 14:56:13 -05:00
Jonathan Rau
73a5ee1bac Update README.md 2019-11-21 12:38:31 -05:00
Jonathan Rau
0ff9806d70 Update README.md 2019-11-21 12:33:38 -05:00
Toni de la Fuente
961b79a4aa Added extra767 for CloudFront field level encryption issue #425 2019-11-21 17:48:34 +01:00
Toni de la Fuente
264b84ae2a Added check_extra765 ECR scanning issue #406 2019-11-21 00:52:18 +01:00
Toni de la Fuente
031b68adde fixed typo in iam policy 2019-11-20 23:20:17 +01:00
Toni de la Fuente
d737193b98 Merge pull request #407 from zfLQ2qx2/prowler_misc_fixes
Misc prowler fixes


    Add GetEbsEncryptionByDefault wherever Prowler policies are mentioned
    Update Extra718 check to be aware of access denied responses
    Update Extra726 check to be more verbose for non-failure items
    Update Extra73 check to be aware of access denied responses
    Update Extra734 check to be aware of access denied responses and parse policies with jq for better accuracy
    Update Extra742 check for verbiage
    Update Extra756 check for verbiage and parameter order
    Update Extra761 check for failure scenarios (requires most recent awscli and addition to Prowler IAM policy)
    Added Extra763 check to verify that object versioning is enabled on S3 buckets
    Added Extra764 check to verify that S3 buckets enforce a secure transport policy
2019-11-20 22:03:02 +00:00
Toni de la Fuente
649192eb41 Merge pull request #411 from zfLQ2qx2/prowler-extra75-enhancement
Update extra75 to be aware of default security groups
2019-11-20 21:46:21 +00:00
Toni de la Fuente
f83ce78e8f Merge pull request #410 from zfLQ2qx2/prowler-3x-checks
Update log metric filter checks to latest AWS CIS Foundations Benchmarks
2019-11-20 21:44:23 +00:00
zfLQ2qx2
054043d78e Update extra75 to aware of default security groups 2019-11-20 00:09:35 -05:00
zfLQ2qx2
603ed0b16f Update log metric filter checks to latest AWS CIS Foundations Benchmark and provide hints on how to remediate 2019-11-19 01:37:42 -05:00
zfLQ2qx2
3a893889b6 Misc prowler fixes 2019-11-13 22:49:32 -05:00
Toni de la Fuente
2e181920ab Added pull request template 2019-11-05 11:07:09 +01:00
Toni de la Fuente
4f4591dc42 Added more install details and docker run 2019-10-29 23:36:39 +01:00
Toni de la Fuente
18e5c0b8ae Merge pull request #404 from gabrielsoltz/check_extra731_jq
Extra 731 with JQ
2019-10-28 15:36:43 +01:00
Toni de la Fuente
e748275fc5 Merge pull request #403 from gabrielsoltz/check_extra727_smarter
Check extra727 smarter (SQS)
2019-10-28 15:35:45 +01:00
Toni de la Fuente
4ca5b53948 Merge pull request #401 from gabrielsoltz/extra73_smarter
Smarter extra73 (S3 Public Buckets)
2019-10-28 15:29:48 +01:00
gabrielsoltz
8bb1529c2a jq_improvements 2019-10-25 16:46:36 +02:00
gabrielsoltz
61ef02ec50 reduce_api_calls 2019-10-25 16:42:59 +02:00
gabrielsoltz
fb45fa0c03 reduce_api_calls 2019-10-24 23:56:02 +02:00
gabrielsoltz
6a52ebe492 reduce_api_calls 2019-10-24 23:54:04 +02:00
gabrielsoltz
9b81fc0ac7 fix jq array 2019-10-24 23:30:34 +02:00
gabrielsoltz
508a9354b7 fix jq array 2019-10-24 23:28:58 +02:00
gabrielsoltz
63898690c8 remove_old_check 2019-10-24 13:25:18 +02:00
gabrielsoltz
d026ed5cac improve_extra727 2019-10-24 13:22:26 +02:00
gabrielsoltz
529fc6421d better_output 2019-10-23 15:04:22 +02:00
gabrielsoltz
7aa1573275 comments 2019-10-23 14:06:29 +02:00
gabrielsoltz
bb69f51456 comment 2019-10-23 14:03:49 +02:00
gabrielsoltz
5cadd0c2f2 remove_unused_variable 2019-10-23 14:03:08 +02:00
gabrielsoltz
df5def48d9 comments_and_fix 2019-10-23 13:45:20 +02:00
gabrielsoltz
5252518d97 extra73 2019-10-23 13:38:36 +02:00
Toni de la Fuente
231f0e6fb3 Merge pull request #400 from MrSecure/check762_cleanup
extra 7.62 - output cleanup
2019-10-22 17:48:04 +02:00
Mr. Secure
be0bc7aa65 extra 7.62 - output cleanup
- remove warnings about long execution
- update pass/fail text to help split on ':' for CSV post-processing
2019-10-22 10:35:48 -05:00
Toni de la Fuente
c460e351a4 Merge pull request #399 from MrSecure/obsolete_runtimes
Add check for unsupported lambda runtimes
2019-10-22 15:29:26 +02:00
Mr. Secure
827b1fdb3b add region info to textFail,textPass output 2019-10-22 08:12:00 -05:00
Mr. Secure
23a7c7f393 fix spelling error in message 2019-10-21 18:07:56 -05:00
Mr. Secure
e683ea5384 fix over-quoting bug 2019-10-21 09:38:16 -05:00
Mr. Secure
2c531a2ffc add check for unsupported lambda runtimes 2019-10-21 09:28:00 -05:00
Toni de la Fuente
e25ea9621b Merge pull request #396 from ricoli/dockerfile-git-clone-cache-fix
replacing git clone with ADD as to not cache layer indefinetely
2019-10-17 22:11:27 +02:00
Ricardo Oliveira
826cc00a7c replacing git clone with ADD as to not cache layer indefinetely 2019-10-16 09:56:44 +01:00
Toni de la Fuente
65f787bfe0 Merge pull request #397 from ricoli/fix-exclude-checks-from-group
fixing multiple exclusions overriding each other because of iteration
2019-10-15 18:17:19 +02:00
Ricardo Oliveira
77b3a9b4d9 unsetting excluded_checks 2019-10-15 11:12:59 +01:00
Toni de la Fuente
f8db025fdf Merge pull request #395 from MrSecure/mega
Fix paths in multi-account code-build job
2019-10-14 23:17:33 +02:00
Mr. Secure
d4fad17416 update pipeline commands to use multi-account path 2019-10-14 15:42:09 -05:00
Mr. Secure
ddb498320a bring in quoting nits 2019-10-14 15:39:33 -05:00
Toni de la Fuente
31a4024dfc Merge pull request #392 from MrSecure/mega
WIP: MegaProwler Add-on
2019-10-14 18:13:23 +02:00
Toni de la Fuente
38c0b60141 Rename util/megaprowler.sh to util/multi-account/megaprowler.sh 2019-10-14 18:11:46 +02:00
Toni de la Fuente
81cc85a8fc Rename util/config to util/multi-account/config 2019-10-14 18:11:24 +02:00
Toni de la Fuente
ffcfef02a6 Rename util/Audit_Pipeline.yaml to util/multi-account/Audit_Pipeline.yaml 2019-10-14 18:10:57 +02:00
Toni de la Fuente
27305365ef Rename util/Audit_Exec_Role.yaml to util/multi-account/Audit_Exec_Role.yaml 2019-10-14 18:10:34 +02:00
Toni de la Fuente
08cd94fe5b Merge pull request #391 from jcaffet/add/check_extra761
add extra761 check if EBS default encryption is enabled per region
2019-10-13 20:55:19 +02:00
Toni de la Fuente
40a2ea6c90 fixed region for extra757 and extra758 2019-10-13 19:05:57 +02:00
Jerome Caffet
7e28f85247 add cli options 2019-10-13 08:02:18 +02:00
Mr. Secure
64667ea9d0 grant codebuild the ability to assume audit role 2019-10-11 21:46:20 -05:00
Mr. Secure
70304dc2a2 suppress remaining shell check warnings 2019-10-11 21:16:17 -05:00
Mr. Secure
e0a77b3e46 cleanup using shellcheck 2019-10-11 21:12:24 -05:00
Mr. Secure
70de023114 more output structure cleanup 2019-10-11 20:30:59 -05:00
Mr. Secure
b5ccdad3dc change bucket resource name
cleans up auto-generated bucket name
2019-10-11 20:21:07 -05:00
Mr. Secure
d0af7f439f remove 'out' from artifact storage path 2019-10-11 20:10:30 -05:00
Mr. Secure
64e38dd843 bring in megaprowler code 2019-10-11 19:58:49 -05:00
Jerome Caffet
66c59ea1f7 add extra761 EBS default encryption 2019-10-09 14:33:46 +02:00
Toni de la Fuente
fc77b4a55e Merge pull request #390 from Quiq/master
Add missing permission
2019-10-02 14:37:16 -04:00
Roman Vynar
4540fd77e6 Add missing permission 2019-10-02 21:17:52 +03:00
Toni de la Fuente
d415ea6f20 restore docs 2019-09-19 15:25:00 -04:00
Toni de la Fuente
ec8f51ba8a readthedocs initial commit 2019-09-19 14:40:31 -04:00
Toni de la Fuente
ad49d2accb readthedocs initial commit 2019-09-19 14:33:42 -04:00
Toni de la Fuente
67311e84d2 Delete index.rst 2019-09-19 14:30:21 -04:00
Toni de la Fuente
8f566ec690 Create index.rst 2019-09-19 14:25:38 -04:00
Toni de la Fuente
75f6cbbdd6 Merge pull request #384 from venky999/master
fixing #383 and #380
2019-09-17 14:54:31 -04:00
Toni de la Fuente
4401d4209c CURRENT_ACCOUNT_ID is not needed
since ACCOUNT_ID is available
2019-09-17 14:52:30 -04:00
Venki
44cfa71358 updated logging 2019-09-16 09:24:34 +01:00
Venki
ecde62451c remove unnecessary variables and removed echo 2019-09-16 09:16:59 +01:00
Venkatadri Duggina
d5f22ab100 fixing check26 cross access bug 2019-09-15 23:33:37 +01:00
Venkatadri Duggina
72b1421294 fixing cross account cloudtrail issue 2019-09-14 22:10:45 +01:00
Toni de la Fuente
04acb7412b Enhanced requirements and installation 2019-09-12 19:13:52 -04:00
Toni de la Fuente
0327880258 Merge pull request #376 from mastertinner/372
List CloudFront distributions only once
2019-09-13 00:09:37 +02:00
Toni de la Fuente
6a9f32a284 Merge pull request #375 from mastertinner/373
List successful cases as PASS! for 7.27
2019-09-13 00:08:17 +02:00
Toni de la Fuente
3079bd51f3 Merge pull request #382 from venky999/master
fixing check3x bug 381 related to cloudwatch groups
2019-09-13 00:08:00 +02:00
Venki
dffb09b001 updating tr 2019-09-12 12:24:49 +01:00
Venkatadri Duggina
5e4eba54cc fixing check3x bug 381 related to cloudwatch groups 2019-09-11 15:53:20 +01:00
Toni de la Fuente
84d69ef5d8 Merge pull request #377 from bfallik/patch-1
fix typo
2019-09-06 14:20:09 -04:00
Brian Fallik
cd52bf8b7d fix typo 2019-08-23 15:04:02 -04:00
Tobi Fuhrimann
aba697aa99 List CloudFront distributions only once
Fixes #372
2019-08-23 09:13:33 +02:00
Toni de la Fuente
18be522b87 Merge pull request #370 from shaunography/master
Fix Pipfile for equal or newer versions
2019-08-23 15:01:08 +08:00
Tobi Fuhrimann
49994d1c51 List successful cases as PASS! for 7.27
Fixes #373
2019-08-23 08:57:21 +02:00
shaunography
f3d617a1c8 Fix Pipfile 2019-08-21 19:34:14 +01:00
Toni de la Fuente
de5b87c6ad Merge pull request #366 from mastertinner/master
Make 3.x tests simpler and more useful
2019-08-18 14:03:48 +08:00
Tobi Fuhrimann
f32b76987e Make 3.x tests simpler and more useful 2019-08-17 20:07:03 +02:00
Toni de la Fuente
1be58e02b2 Fix issue #323 2019-08-17 20:13:34 +08:00
Toni de la Fuente
8333c575ae Fixed issue #348 -e option back to work 2019-08-17 15:18:44 +08:00
Toni de la Fuente
02d2561d6b Fix issue #354 2019-08-17 12:57:48 +08:00
Toni de la Fuente
30b2f55ba1 Merge pull request #365 from rjnienaber/support_role_added_to_groups
Allow check 1.20 to evaluate users, groups or roles
2019-08-17 12:19:58 +08:00
Toni de la Fuente
253fa5ef54 Merge pull request #352 from FoxAndDuckSoftware/351
Ability to exclude check(s) from group run
2019-08-17 12:10:11 +08:00
Toni de la Fuente
188a681cb5 Merge pull request #350 from ralphrodkey/check314_case_sensitivity
Made check314 less case sensitive
2019-08-17 12:06:40 +08:00
Toni de la Fuente
1fb8b47a9c Merge pull request #342 from mapete94/master
adding regex for wildcard option in cloudtrail extra 720
2019-08-17 11:49:59 +08:00
Toni de la Fuente
2afdabf9bc Merge pull request #367 from toniblyx/revert-340-fix_check_extra741
Revert "ignore None when user data is empty (gunzip: invalid magic)"
2019-08-17 11:33:20 +08:00
Toni de la Fuente
3a989516d1 Revert "ignore None when user data is empty (gunzip: invalid magic)" 2019-08-17 11:32:12 +08:00
Toni de la Fuente
9e06297d5f Merge pull request #340 from gabrielsoltz/fix_check_extra741
ignore None when user data is empty (gunzip: invalid magic)
2019-08-17 11:23:50 +08:00
Toni de la Fuente
1789dab4df Merge branch 'master' into fix_check_extra741 2019-08-17 11:12:11 +08:00
Toni de la Fuente
eecb272f93 Fixed output for PR #339 2019-08-17 11:01:30 +08:00
Toni de la Fuente
2ed3378556 Merge pull request #339 from gabrielsoltz/refactor_check_extra734
refactor check_extra734
2019-08-17 10:48:24 +08:00
Toni de la Fuente
bd9ae4bce7 Merge pull request #336 from gabrielsoltz/improve_check_extra73
Fix check extra73
2019-08-17 10:42:46 +08:00
Toni de la Fuente
459a688b7a Merge pull request #362 from koflTW/master
[FIX] allow 1.22 checks on policies with only one statement block
2019-08-17 10:21:40 +08:00
Richard Nienaber
30e2360acc remove filter by roles so that groups are included as well 2019-08-15 13:09:36 +01:00
Toni de la Fuente
d8c29cc263 Merge pull request #363 from james-portman-contino/patch-1
Stop colorizing the JSON output
2019-08-08 20:25:55 +08:00
james-portman-contino
7313628cc6 Stop colorizing the JSON output
If using a terminal then jq prints out JSON with color.
I suggest color should either be disabled always or with some other flag (more complicated)
jq flag: -M monochrome (don't colorize JSON);
2019-08-08 08:50:28 +01:00
Kim Oliver Fehrs
033e2623d3 [FIX] remove duplicated filter condition | kf/aa/if 2019-08-07 16:13:36 +02:00
Kim Oliver Fehrs
2b95f69fa6 [FIX] allow 1.22 checks on policies with only one statement block | kf/aa/if 2019-08-07 16:06:51 +02:00
Toni de la Fuente
0ebdb1698f Merge pull request #357 from bridgecrewio/master
create Pipfile
2019-07-13 21:59:56 -04:00
Barak Schoster Goihman
50d8359022 Merge pull request #1 from bridgecrewio/create-pipfile
Create Pipfile
2019-07-14 01:07:41 +03:00
Barak Schoster Goihman
4bc64e938e Create Pipfile
add python dependencies
2019-07-14 01:07:21 +03:00
Toni de la Fuente
8f852457ff Merge pull request #353 from kpawloski/patch-1
Fix typo
2019-07-11 22:58:43 -03:00
Kevin Pawloski
5bd3f0b995 Fix typo
Fix a small typo in the messaging.
2019-07-11 18:04:45 -07:00
Martin Kemp
e5e5e84112 Add documentation for excluding group checks 2019-07-10 13:15:10 +01:00
Martin Kemp
a430ad421b Tabs to 4 spaces 2019-07-10 12:57:32 +01:00
Martin Kemp
58fdd45424 Ability to exclude check from group run
Fixes #351
2019-07-10 12:46:51 +01:00
Ralph Rodkey
85dc0408c2 Made check314 less case sensitive 2019-07-09 10:58:07 -04:00
Toni de la Fuente
c037067be2 Merge pull request #346 from nomex/add_detect_secrets_to_docker
Fixing missing &&
2019-07-04 05:36:15 -03:00
David Lladro
4fa48671e0 Merge branch 'master' into add_detect_secrets_to_docker 2019-07-04 08:45:35 +02:00
David Lladro
a259571cb0 Fixing missing && 2019-07-04 08:38:25 +02:00
Toni de la Fuente
8b2c113614 Merge pull request #344 from nomex/add_detect_secrets_to_docker
Adding detect_secrets support to Docker
2019-06-28 17:23:29 -03:00
David Lladro
e273ae3123 Adding detect_secrets support to Docker 2019-06-27 15:27:19 -05:00
Michael Peterson
e04c34986e adding regex for wildcard option in cloudtrail 2019-06-25 13:45:52 -04:00
Toni de la Fuente
ea6d9c93fc Integration with Yelp detect-secrets 2019-06-25 08:28:50 -04:00
gabrielsoltz
cea45f43c8 remove REGION from Bucket Listing 2019-06-20 17:36:15 +02:00
gabrielsoltz
d7d2246498 improved for other file types like empty and very short 2019-06-19 14:58:18 +02:00
gabrielsoltz
e6992e87ee ignore None when user data is empty 2019-06-18 12:59:58 +02:00
gabrielsoltz
c8622bc347 better check denied 2019-06-13 14:32:19 +02:00
gabrielsoltz
76e6657e42 refactor check_extra734 2019-06-13 14:12:43 +02:00
gabrielsoltz
de8336092b fix locations 2019-06-13 12:05:39 +02:00
gabrielsoltz
d50c3afebd add check for explicit deny 2019-06-13 12:04:52 +02:00
Toni de la Fuente
f54bc4238e Merge branch 'master' of https://github.com/toniblyx/prowler 2019-06-12 10:14:22 +02:00
Toni de la Fuente
c7320ec7e2 Added comment to clarify change 2019-06-12 10:13:58 +02:00
Toni de la Fuente
a5ea0f59b2 Merge pull request #335 from gabrielsoltz/age_checks
improve AWS CLI parameters order, same as other checks (extra757 and extra758)
2019-06-12 03:35:39 -04:00
Toni de la Fuente
3947ee2aae Improved -l option to list uniq checks 2019-06-11 20:37:18 +02:00
gabrielsoltz
0db97d5a24 improve AWS CLI parameters order, same as other checks 2019-06-11 20:36:40 +02:00
Toni de la Fuente
588976ac45 Fixed lack of in PR #331 2019-06-11 19:31:07 +02:00
Toni de la Fuente
6eb68a1218 Merge pull request #331 from gabrielsoltz/age_checks
New ec2 age checks
2019-06-11 13:21:18 -04:00
gabrielsoltz
b1e7dc8519 get_date_previous_than_months compatible busybox 2019-06-11 17:09:28 +02:00
gabrielsoltz
c5f170307d add linux and cygwin get_date_previous_than_months function 2019-06-11 12:08:48 +02:00
Toni de la Fuente
e8b59b6722 Merge pull request #332 from gabrielsoltz/fix_extra731
fix extra731 output
2019-06-07 12:55:01 -04:00
Toni de la Fuente
ea886b84f2 Merge pull request #334 from gabrielsoltz/guardduty_regions
add guardduty regions
2019-06-07 12:54:32 -04:00
gabrielsoltz
89268e4875 textInfo 2019-06-07 05:51:26 +01:00
gabrielsoltz
8ee06449b7 fix code 2019-06-07 05:49:47 +01:00
gabrielsoltz
a09055ff31 fix 2019-06-06 21:35:52 +01:00
gabrielsoltz
d640086112 add guardduty regions 2019-06-06 21:26:10 +01:00
gabrielsoltz
5037cb03f2 improve code 2019-06-06 21:07:57 +01:00
gabrielsoltz
085dd338f4 function os 2019-06-06 21:04:40 +01:00
Toni de la Fuente
5a0366382b Merge pull request #333 from gabrielsoltz/fix_check121
Review outputs, credentials never used are a FAIL now
2019-06-06 15:58:20 -04:00
gabrielsoltz
c4ddb8f14a review outputs 2019-06-06 19:42:55 +01:00
gabrielsoltz
df6c323a64 fix extra731 output 2019-06-06 19:37:10 +01:00
gabrielsoltz
40117ed5dd new ec2 age checks 2019-06-06 19:22:26 +01:00
Toni de la Fuente
2012bbb119 Merge pull request #328 from gabrielsoltz/master
check43: iterate across all default sg
2019-06-05 21:58:56 -04:00
gabrielsoltz
004f882a1d iterate across all default sg, so fail more for each one and also add output sg 2019-05-23 17:19:56 +02:00
Toni de la Fuente
7bf636bfc7 Add new checks to group extras 2019-05-16 16:15:13 -04:00
Toni de la Fuente
b8c79154cb Added check extra756 Redshift cluster public 2019-05-16 15:41:29 -04:00
Toni de la Fuente
5cd7214f21 Added check extra755 open Memcached port 2019-05-16 15:40:48 -04:00
Toni de la Fuente
4f00760e88 Added check extra754 open Cassandra port 2019-05-16 15:40:23 -04:00
Toni de la Fuente
660b573d05 Added check extra753 open MongoDB port 2019-05-16 15:40:00 -04:00
Toni de la Fuente
1d45c45afa Added check extra752 open Redis prt 2019-05-16 15:39:30 -04:00
Toni de la Fuente
3693ee3692 Added check extra751 SG open Postgres port 2019-05-16 15:38:41 -04:00
Toni de la Fuente
c36a6067fa Added check extra750 SG open MySQL ports 2019-05-16 15:38:00 -04:00
Toni de la Fuente
5325bab0ab Added check extra750 SG open MySQL ports 2019-05-16 15:02:06 -04:00
Toni de la Fuente
e283d3587b Added check extra749 SG open Oracle ports 2019-05-16 14:57:48 -04:00
Toni de la Fuente
b95cf5bc7b Added check extra748 SG open to any port 2019-05-16 14:48:00 -04:00
Toni de la Fuente
c6dfbfd0ec Added IPv6 support to networking checks 2019-05-16 14:38:11 -04:00
Toni de la Fuente
62991cfb48 Added exttra747 RDS CloudWatch Log integration 2019-05-15 23:31:25 -04:00
Toni de la Fuente
8b4b59e9d5 Added extra739 RDS backup and RDS group of checks 2019-05-15 23:12:06 -04:00
Toni de la Fuente
303cdc7acd Merge branch 'master' of https://github.com/toniblyx/prowler 2019-05-14 20:46:17 -04:00
Toni de la Fuente
3275713aa8 Added new apigateway checks to extras 2019-05-14 20:45:56 -04:00
Toni de la Fuente
08cdf3511f Added CODE_OF_CONDUCT.md 2019-05-14 15:05:21 -04:00
Toni de la Fuente
f28c4330b4 Merge branch 'master' of https://github.com/toniblyx/prowler 2019-05-13 17:02:16 -04:00
Toni de la Fuente
a6569a0a70 Added group12 apigateway checks 2019-05-13 17:01:45 -04:00
Toni de la Fuente
959bd8dfd4 Changed version to 2.0.2 2019-05-13 17:01:17 -04:00
Toni de la Fuente
a59aedc43b Fixed accuracy for check_extra722 2019-05-13 17:00:56 -04:00
Toni de la Fuente
50b6e630d8 Added extra746 API Gateway has authorizers 2019-05-13 16:39:37 -04:00
Toni de la Fuente
da25a02e80 removed extra746 duplicated with extra722 2019-05-13 16:33:38 -04:00
Toni de la Fuente
967fe029c2 Fixed new API Gateway checks alias 2019-05-13 16:30:03 -04:00
Toni de la Fuente
3582b424b0 Added extra747 API Gateway has CloudWatch Logs 2019-05-13 16:29:28 -04:00
Toni de la Fuente
65e2ff7951 Added extra746 API Gateway has authorizers 2019-05-13 15:52:48 -04:00
Toni de la Fuente
ab66211f9b Merge pull request #326 from RyPeck/patch-1
Update README.md to clone from right repo
2019-05-13 15:08:07 -04:00
Ryan John Peck
8e71c6e5c5 Update README.md to clone from right repo
Looks like the project was moved out of an org to your personal account.
2019-05-13 13:56:12 -04:00
Toni de la Fuente
504a11bb2e Added extra745 API Gateway public or private 2019-05-07 00:03:23 -04:00
Toni de la Fuente
f03eccf6c8 Added extra744 API Gateway has a WAF ACL attached 2019-05-06 23:25:14 -04:00
Toni de la Fuente
d0789859a3 Added extra743 API Gateway has client certificate enabled 2019-05-06 23:21:27 -04:00
Toni de la Fuente
1b4045d57c Added extra743 API Gateway has client certificate enabled 2019-05-06 23:10:27 -04:00
Toni de la Fuente
f406b4bbcf Merge pull request #322 from toniblyx/devel
Devel
2019-04-29 22:34:22 -04:00
Toni de la Fuente
d9ced05d25 Merge pull request #321 from soffensive/devel
Separate handling of S3 default encryption and bucket policy encryption
2019-04-29 22:08:04 -04:00
soffensive
f5708d7db6 Separate default encryption and bucket policy encryption
Default encryption (2017): https://aws.amazon.com/blogs/aws/new-amazon-s3-encryption-security-features/
Bucket policy (2016): https://aws.amazon.com/blogs/security/how-to-prevent-uploads-of-unencrypted-objects-to-amazon-s3/
2019-04-29 16:31:42 +02:00
Toni de la Fuente
6dd0ab06d2 Merge pull request #319 from toniblyx/devel
Devel
2019-04-23 23:21:47 -04:00
Toni de la Fuente
42220828ce Fixed issue #317 2019-04-23 23:20:11 -04:00
Toni de la Fuente
4527522acb Merge pull request #314 from soffensive/devel
Iterate over all regions for Cloudtrail Checks check21 and check22
2019-04-23 23:01:43 -04:00
Toni de la Fuente
b4c4a46cc6 Fixed issue #315 2019-04-23 11:32:56 -04:00
soffensive
e0d86c134a Iterate over all regions
Iterate over all regions
2019-04-17 13:38:12 +02:00
soffensive
7a44b8bcca Iterate over all regions
Iterate over all regions
2019-04-17 13:36:00 +02:00
Toni de la Fuente
a707b382b0 Revert adding freebsd detector 2019-04-08 22:15:22 -04:00
Toni de la Fuente
fff424dbfa Label v2.0.1 2019-04-08 21:58:01 -04:00
Toni de la Fuente
2870f38bdc Merge pull request #312 from toniblyx/devel
Devel for 2.0.1
2019-04-09 02:51:04 +01:00
Toni de la Fuente
1956be4dc3 Delete duplicate check extra739 2019-04-09 02:49:55 +01:00
Toni de la Fuente
e4cf874c5c Merge pull request #311 from artashus/master
Fixed check122 to match CIS 1.22 checks requirements, instead of '=~ …
2019-04-09 02:32:25 +01:00
Toni de la Fuente
a2ccac97d9 Make it work in FreeBSD issue #310 2019-04-08 21:18:39 -04:00
Artashes Arabajyan
917a323c15 Fixed check122 to match CIS 1.22 checks requirements, instead of '=~ *' use '== *' 2019-04-05 12:06:27 +02:00
Toni de la Fuente
ddad72fc5f Fix issue #309 2019-03-27 22:42:13 +00:00
Toni de la Fuente
b03aca80a1 Fixed issue #308 2019-03-27 22:35:50 +00:00
Toni de la Fuente
9d526ff098 Added group11 keys and improved 741 and 742 2019-03-12 23:14:50 -04:00
Toni de la Fuente
bde9482928 Added check extra742 to find keys in CloudFormation Outputs 2019-03-12 22:40:40 -04:00
Toni de la Fuente
07f426aec0 Merge pull request #306 from nicdoye/devel
Merge RUNs. Run as non-root. Added jq
2019-03-12 10:05:38 -04:00
Toni de la Fuente
3b2f5522fd Merge branch 'devel' into devel 2019-03-12 10:00:52 -04:00
Nic Doye
ea89242644 Merge RUNs. Run as non-root 2019-03-12 13:52:42 +00:00
Toni de la Fuente
da9cb41b3b Added jq to Dockerfile and fixes 2019-03-12 09:44:34 -04:00
Toni de la Fuente
bc9d4fe762 Created a new Dockerfile based on Alpine 2019-03-11 23:59:02 -04:00
Toni de la Fuente
ec05e2f0f4 Merge pull request #305 from toniblyx/devel
Fix issue #301
2019-03-11 22:45:15 -04:00
Toni de la Fuente
fa1a3b8406 Fix issue #301 2019-03-11 22:44:00 -04:00
Toni de la Fuente
a3d1ed5129 Merge pull request #304 from toniblyx/devel
Devel
2019-03-11 22:27:07 -04:00
Toni de la Fuente
e284dd3afc Merge pull request #302 from mindfulmonk/patch-1
Update cislevel names README.md
2019-03-11 22:20:36 -04:00
Toni de la Fuente
c8cc343784 Fix issue #303 2019-03-11 22:12:54 -04:00
Toni de la Fuente
6d15bb67fe Fix issue #300 2019-03-11 22:10:37 -04:00
Toni de la Fuente
b60d320622 Improved tittle to describe what extra71 does 2019-03-11 22:09:12 -04:00
Marcus Maxwell
3290563716 Update README.md 2019-03-07 09:21:15 +00:00
Marcus Maxwell
4c0c6b181b Update README.md 2019-03-07 09:18:57 +00:00
Marcus Maxwell
10a99aa5ae Update README.md
-c is only for individual checks, need to use -g for level1 checks.
2019-03-07 09:11:12 +00:00
Toni de la Fuente
7117399e14 Added find creds in URL on extra741 2019-03-05 11:40:29 -05:00
Toni de la Fuente
6f678a1093 Merge pull request #298 from toniblyx/devel
Devel
2019-03-04 22:45:58 -05:00
Toni de la Fuente
bc1271788c Added MFA help to README issue #294 2019-03-04 22:45:15 -05:00
Toni de la Fuente
9d88a27e0a Merge branch 'devel' of https://github.com/toniblyx/prowler into devel 2019-03-04 22:25:22 -05:00
Toni de la Fuente
2bc3575de8 Improved extra714 to find secrets 2019-03-04 22:25:04 -05:00
Toni de la Fuente
18e9e7f0e1 Merge pull request #297 from toniblyx/devel
Devel
2019-03-04 21:26:29 -05:00
Toni de la Fuente
327323e32f Merge pull request #295 from clintmoyer/spellcheck
Spelling fix "reshift" means "redshift"
2019-02-20 18:11:31 -05:00
Clint Moyer
3c2ad65246 Spelling fix "reshift" means "redshift" 2019-02-20 12:30:04 -07:00
Toni de la Fuente
069b54057b Fixed typo in hipaa 2019-02-11 09:08:05 -05:00
Toni de la Fuente
edf7826121 Fixed typo on hipaa 2019-02-11 09:07:27 -05:00
Toni de la Fuente
be4bbe4430 New POC scoring and extra741 key finder userdata 2019-02-08 16:47:51 +00:00
Toni de la Fuente
9bf3fd87ac New POC scoring and extra741 key finder userdata 2019-02-08 16:47:12 +00:00
Toni de la Fuente
11c7d55203 New POC scoring and extra741 key finder userdata 2019-02-08 16:39:57 +00:00
Toni de la Fuente
170557a422 New POC scoring and extra741 key finder userdata 2019-02-08 16:39:05 +00:00
Toni de la Fuente
5b0c6f8689 Merge pull request #290 from tomcrawf90/master
Added check for integer in response from AWS
2019-02-04 22:55:24 +00:00
tomcrawf90
17f00f167f Merge pull request #1 from tomcrawf90/check111fix
Added check for integer in response from AWS
2019-02-04 17:08:49 +00:00
Tom Crawford
34b6c4446d Added check for integer in response from AWS 2019-02-04 17:01:37 +00:00
Toni de la Fuente
6600df9be9 extra741 finding keys in UserData 2019-01-29 06:09:37 +00:00
Toni de la Fuente
8f89a01541 Merge pull request #284 from toniblyx/devel
Devel
2019-01-07 22:15:28 -05:00
Toni de la Fuente
b59d5db16b Added new opton exclude to README 2019-01-07 22:12:01 -05:00
Toni de la Fuente
2e754a5370 Fixed check120 2019-01-07 22:06:34 -05:00
Toni de la Fuente
2f9886efe2 Merge pull request #283 from SDugo/master
New option "-E" supports exclusion of one or multiple checks
2018-12-21 09:06:58 -05:00
Samuel Dugo
71355b0c4c New option "-E" supports exclusion of one or multiple checks
Added new option "-E" which will execute all tests except a list of specified checks separated by comma (i.e. check21,check31). Any invalid check name will be discarded. And if just one argument is passed and this is invalid, then Prowler will execute all checks.

To save space, the option will return a list of total checks excluding the list provided. Then, the functionality will overwrite CHECK_ID with the final list and the program will continue as if the user entered "-c" option and the final list of checks.
2018-12-21 12:14:10 +01:00
Toni de la Fuente
1203700d34 Merge pull request #282 from toniblyx/devel
Devel
2018-12-19 23:57:26 -05:00
Toni de la Fuente
97a59cf5e4 Merge pull request #276 from affanhmalik/check29
Check for flowlogs only in active VPCs, avoid false flag if a region …
2018-12-19 23:53:42 -05:00
Toni de la Fuente
8a3893cd33 Merge pull request #281 from SDugo/master
Option "-c" supports one or multiple checks
2018-12-19 23:50:57 -05:00
Toni de la Fuente
1fc2b77bfb Merge pull request #278 from SatanicMechanic/patch-1
Update check_extra739
2018-12-19 23:49:53 -05:00
Samuel Dugo
00e5e65176 Option "-c" supports one or multiple checks
Added support for option "-c" to specify one or multiple specific checks to be performed. To specify multiple tests include them using a comma delimiter (i.e. check21,check22).
2018-12-19 17:05:13 +01:00
Morey Straus
8935233a05 Update check_extra739
typo correction
2018-12-14 14:32:38 -08:00
Toni de la Fuente
c9c4620988 format fix 2018-12-13 18:14:31 +01:00
Toni de la Fuente
2700365101 Improved README and change rules ID 2018-12-13 18:13:18 +01:00
Affan Malik
bacdf6ed22 Check for flowlogs only in active VPCs, avoid false flag if a region has no VPCs 2018-12-12 15:09:31 -05:00
Toni de la Fuente
30cac002fa Wazuh integration guide DRAFT 2018-12-05 14:41:07 +00:00
Toni de la Fuente
d818381bcf Wazuh integration guide DRAFT 2018-12-05 14:38:39 +00:00
Toni de la Fuente
d78424b346 gdpr fix 2018-12-05 12:00:38 +00:00
Toni de la Fuente
1727758479 enhanced gdpr and first wazuh integration bits 2018-12-05 11:58:43 +00:00
Toni de la Fuente
9e0923407e Merge branch 'devel' of https://github.com/toniblyx/prowler into devel 2018-12-05 11:55:51 +00:00
Toni de la Fuente
79e02ce074 Merge pull request #271 from toniblyx/devel
Fixed bug in check extra730: certs expiration
2018-12-05 11:52:19 +00:00
Toni de la Fuente
b4cb323de4 Merge pull request #270 from SDugo/master
Fixed AccessDeniedException on extra730
2018-12-05 11:49:41 +00:00
Samuel Dugo
573fa46aac Fixed AccessDeniedException on extra730
When executing Prowler using a specific profile (in my case to assume a role) , check_extra730 returns:

"An error occurred (AccessDeniedException) when calling the DescribeCertificate operation: User: [ASSUMED_ROLE_ARN] is not authorized to perform: acm:DescribeCertificate on resource: [RESOURCE_ARN]"

This is because line 28 did not contain  the following parameters: "$PROFILE_OPT --region $regx" .
2018-12-05 11:35:44 +01:00
Toni de la Fuente
31a0de167c Adding extra340 to GDPR group 2018-11-27 00:07:19 -05:00
Toni de la Fuente
6c2d4d6b01 Adding newer checks to GDPR and extras group 2018-11-27 00:03:40 -05:00
Toni de la Fuente
0ca1a8f28c version and extras last addition 2018-11-26 23:23:16 -05:00
Toni de la Fuente
be29f2f0d9 version and extras last addition 2018-11-26 23:22:05 -05:00
Toni de la Fuente
c567781bcd Merge pull request #269 from toniblyx/devel
New checks, documentation and fixes:
Added extra739 ELB logging and typos
Added extra740 EBS snapshots are encrypted and HIPAA
Added info about GDPR and HIPAA
Improved Prowler description
fixed issue #268
2018-11-26 22:50:27 -05:00
Toni de la Fuente
84c9b97c48 Merge branch 'master' into devel 2018-11-26 22:48:30 -05:00
Toni de la Fuente
2015a50733 fixed issue #268 2018-11-26 12:26:35 -05:00
Toni de la Fuente
d839b2fba1 Improved Prowler description 2018-11-19 23:54:42 -05:00
Toni de la Fuente
3f70c86736 Added info about GDPR and HIPAA 2018-11-19 23:39:17 -05:00
Toni de la Fuente
aeaf533585 Added extra740 EBS snapshots are encrypted and HIPAA 2018-11-19 23:22:18 -05:00
Toni de la Fuente
5757a88227 Added extra739 ELB logging and typos 2018-11-19 22:55:29 -05:00
Toni de la Fuente
83de86ca2c fixed HIPAA typo 2018-11-15 14:38:05 -05:00
Toni de la Fuente
e2861614c2 Generate creds report only if group1 related 2018-11-14 22:30:22 -05:00
Toni de la Fuente
d14bdcc6c3 added option -L to list check groups 2018-11-14 20:38:02 -05:00
Toni de la Fuente
013a435784 added extra738 to group extras 2018-11-14 20:09:20 -05:00
Toni de la Fuente
cd9bedb526 Merge pull request #266 from onkymykiss1/update-check29
Updated check29 to validate against FlowLogId which is valid for both…
2018-11-14 19:57:47 -05:00
Jason Turner
cafd203406 Updated check29 to validate against FlowLogId which is valid for both CloudWatch and s3 destinations 2018-11-14 14:19:44 -08:00
Toni de la Fuente
2437f8fb16 Added extra738 CloudFront HTTPS 2018-11-08 20:21:46 -05:00
Toni de la Fuente
fa5b81b28e Added extra737 KMS keys rotation 2018-11-07 23:37:06 -05:00
Toni de la Fuente
9bdbf6f51c Added extra736 check exposed KMS keys 2018-11-07 23:27:58 -05:00
Toni de la Fuente
b6a30df808 Added extra735 check encrypted RDS 2018-11-07 22:00:28 -05:00
Toni de la Fuente
0dc2b9a081 Improved extra734 checking enforce policy 2018-11-06 00:17:00 -05:00
Toni de la Fuente
29e142361b Improved extra734 checking enforce policy 2018-11-06 00:15:20 -05:00
Toni de la Fuente
883afa4959 Added extra734 check S3 bucket encryption 2018-11-05 23:30:00 -05:00
Toni de la Fuente
b4ea16b6f7 Changed label to beta3 2018-10-31 23:16:23 -04:00
Toni de la Fuente
9985e98cd3 Added more info for GDPR 2018-10-31 23:16:00 -04:00
Toni de la Fuente
87d1cc13bc Added new checks to GDPR group 2018-10-31 23:13:07 -04:00
Toni de la Fuente
c7bfd72d2d Add check extra733 SAML Provider STS 2018-10-31 23:09:24 -04:00
Toni de la Fuente
9a88249965 Added check extra732 Cloudfront CDN Geo restrictions 2018-10-31 22:45:59 -04:00
Toni de la Fuente
6cb75fa26a Added check extra732 Cloudfront CDN Geo restrictions 2018-10-31 22:44:45 -04:00
Toni de la Fuente
2fd6f9801a Added check extra731 SNS topics Public 2018-10-31 22:23:41 -04:00
Toni de la Fuente
4902d11614 Updated CIS version in Description 2018-10-31 21:32:50 -04:00
Toni de la Fuente
f1c46c28a0 Improved features section 2018-10-31 21:31:00 -04:00
Toni de la Fuente
5e35915ca3 Merge pull request #256 from UranusBytes/prowler-255
List not only listing
2018-10-31 11:33:05 -04:00
Toni de la Fuente
fe6eae7d30 Added check extra730 to group extras 2018-10-31 00:07:36 -04:00
Toni de la Fuente
fe8a123ead Added check extra730 - ACM cert expiration 2018-10-31 00:01:47 -04:00
Toni de la Fuente
110b59d25d Merge pull request #262 from SkxNMDI5/accelerate-122
Accelerate check 122 (scope local, 1 less API call by policy)
2018-10-24 13:40:34 -04:00
Toni de la Fuente
f8130fa2df Merge pull request #261 from SkxNMDI5/fix-260
Issue 260 : Fix incremental policy
2018-10-24 13:37:40 -04:00
jlamande@gmail.com
bd06720416 Accelerate check 122 (scope local, 1 less API call by policy) 2018-10-19 13:43:37 +02:00
jlamande@gmail.com
e49cf1fde7 Fix incremental policy 2018-10-19 09:04:32 +02:00
Toni de la Fuente
db2483b7a5 Merge pull request #259 from SkxNMDI5/master
fix(check13): should not pass if user never logged in
2018-10-17 16:04:11 -04:00
Toni de la Fuente
e3b6a09482 Merge pull request #257 from mixmatch/patch-1
Add missing permission to example prowler policy (support:describetrustedadvisorchecks)
2018-10-17 15:59:55 -04:00
jlamande@gmail.com
8798861c99 fix(check13): should not pass if user never logged in 2018-10-17 10:16:49 +02:00
Daniel Petty
3e39bfd077 Add missing permission to example prowler policy
"support:describetrustedadvisorchecks"
2018-10-09 08:09:47 -06:00
Jeremy Phillips
ad012f8db6 List not listing checks, but executing them. Then only displays the first check per group. 2018-10-09 08:52:24 -04:00
Toni de la Fuente
e20b32da0c Merge pull request #253 from slmingol/master
Fixed typos
2018-10-08 17:16:02 -04:00
Toni de la Fuente
2483eb0d67 Merge pull request #254 from mixmatch/patch-1
Add missing permissions for prowler policy
2018-10-08 17:15:09 -04:00
Daniel Petty
04c627577b Add missing permissions for prowler policy 2018-10-08 15:11:27 -06:00
Sam Mingo
c51ac34590 Fixed typos 2018-10-05 16:51:14 -04:00
Toni de la Fuente
bcbabc0239 Merge pull request #252 from flomotlik/master
Allow AWS_PROFILE to be used from the environment
2018-10-03 10:27:59 -04:00
Florian Motlik
ad7ee2c2a3 Allow AWS_PROFILE to be used from the environment
AWS_PROFILE is a default AWSCLI environment variable configuring the profile to use. Prowler should accept it as well and not set the default profile.

More information on AWSCLI environment variables can be found in the docs: https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html
2018-10-03 14:47:52 +02:00
Toni de la Fuente
ba96929313 Merge pull request #251 from crashGoBoom/add_hipaa_checks
Add new HIPAA compliance group.
2018-10-02 13:43:51 -04:00
crashGoBoom
be81e88ff8 Refactor to add new hipaa group.
This adds a new hipaa group. More checks will be
needed but this is just a start.
2018-10-02 13:26:08 -04:00
Toni de la Fuente
db5863c84f Merge pull request #250 from mbode/extra_7_13
Use awscli query instead of cut for Extra 7.13
2018-10-02 09:23:08 -04:00
Maximilian Bode
ff973e09c4 Use awscli query instead of cut for Extra 7.13
Fixes #249.
The text output of `aws guardduty get-detector` has changed with awscli release 1.16.25, leading to GuardDuty detectors misreported as suspended.
2018-10-02 12:20:42 +02:00
Toni de la Fuente
843a762e44 Fixed issue #247 2018-09-24 22:27:34 -04:00
Toni de la Fuente
fe44298e4e fixed checkID in check_extra76 2018-09-21 09:45:22 -04:00
Toni de la Fuente
c99fd2a10c Merge pull request #248 from atomdampflok/master
Take age of access key 2 from correct column
2018-09-20 17:36:51 -04:00
Michael Schubert
c7b913fff4 Take age of access key 2 from correct column 2018-09-20 16:18:19 +02:00
Toni de la Fuente
fe996a6b43 Merge pull request #244 from gpatt/master
Update Check 1.16
2018-09-12 16:32:12 -04:00
Gary Patterson
5aad05b0ae Added managed to output 2018-09-11 23:06:00 -05:00
Gary Patterson
c575b5c243 Update Check 1.16 based on CIS v1.2 05-23-2018 to include list-user-policies for Inline Polices 2018-09-11 22:56:06 -05:00
Toni de la Fuente
62ea9135b6 Improved username filtering for check12 2018-09-05 11:09:03 +01:00
Toni de la Fuente
b25954a750 Merge pull request #241 from mattfinlayson/fargate_support
Support for fargate's container metadata endpoint
2018-09-02 19:23:33 +02:00
Toni de la Fuente
7f53b6d3ce Merge pull request #239 from martinusnel/hotfix/check_extra725
Fixed test for no S3 buckets and moved code.
2018-09-02 19:17:08 +02:00
Matthew Finlayson
751fe3123b Support for fargate's container metadata endpoint 2018-08-31 16:55:04 -07:00
Martinus Nel
3bffbe2ca4 Fixed test for no S3 buckets and moved code. Changed method to run through the trails list file. 2018-08-28 16:52:31 +01:00
Toni de la Fuente
68675ac365 PR 235 2018-08-15 16:09:17 -04:00
Toni de la Fuente
1516c4ea15 Fixed as SCORED 2018-08-15 15:48:58 -04:00
Toni de la Fuente
7a474aa335 Fixed as SCORED 2018-08-15 15:48:39 -04:00
Keith Rhea
97da9c2122 Modified checks and documentation to reflect changes in CIS_Benchmark_v1.2.0(05-23-2018) 2018-08-15 09:16:27 -06:00
Toni de la Fuente
ebceebbc75 Merge pull request #232 from rheak/master
Update Scored Value for 115 and 315. Update 13 to only check users with enabled console password.
2018-08-14 10:18:39 -04:00
Toni de la Fuente
b59aaf40d4 Issue #230 2018-08-14 10:11:44 -04:00
Toni de la Fuente
302dbb5e9d Merge pull request #228 from martinusnel/hotfix/check111
Fixed Bash test.
2018-08-10 19:07:49 -04:00
Toni de la Fuente
13dd9275b8 Merge pull request #229 from martinusnel/feature/check45_sorted_output
Sorted output to have a fixed list for diff.
2018-08-10 19:07:11 -04:00
Keith Rhea
3ef5a42b73 Updated check13 to only check users that have console password enabled 2018-08-10 15:21:39 -06:00
Keith Rhea
b98d337478 Updated check315 variable CHECK_SCORED_check315=NOT_SCORED 2018-08-10 15:20:03 -06:00
Keith Rhea
3f90a33a13 Updated check115 variable CHECK_SCORED_check115=NOT_SCORED 2018-08-10 15:19:20 -06:00
Martinus Nel
39276a90ff Sorted output to have a fixed list for diff. 2018-08-10 11:36:58 +01:00
Martinus Nel
350d784414 Fixed Bash test. 2018-08-10 11:21:51 +01:00
Toni de la Fuente
665ca9fda3 fixed issue #226 2018-08-01 23:05:54 -04:00
Toni de la Fuente
17b821aee6 improved group error handling 2018-07-26 23:30:48 -04:00
Toni de la Fuente
e12f1f6957 fixed and improved check27 2018-07-26 21:44:59 -04:00
Toni de la Fuente
d36674a297 Merge pull request #223 from roo7break/master
Check-111 Password expiration check
2018-06-26 10:39:56 -04:00
Nik
0fd6c9f815 Merge pull request #1 from roo7break/check111-patch-1
Corrected Password expiration check
2018-06-26 12:30:31 +01:00
Nik
0c213ce566 Corrected Password expiration check
The previous check didnt accept lower password expiration time. Updated to accept less than or equal to 90 days. Also edited printed statement to include set value.
2018-06-26 12:29:54 +01:00
Toni de la Fuente
be9cbf893b Merge pull request #222 from tmonk42/tmonk42/missing_profiles
Fix extra727 and extra728 #221
2018-06-13 19:33:42 -04:00
Nathan Haneysmith
f7737a9efd Fix extra727 and extra728 #221 2018-06-13 14:18:22 -07:00
Toni de la Fuente
a97069e1ed Fix extra73 issue #219 2018-06-04 21:39:27 -04:00
Toni de la Fuente
62bfb28d21 Fix extra73 issue #219 2018-06-04 21:38:17 -04:00
Toni de la Fuente
11d3a17e14 Fix extra73 issue #219 2018-06-04 21:34:52 -04:00
Toni de la Fuente
8c72031b43 Merge pull request #217 from myoung34/master
Fix issue with CLOUDWATCH_LOGGROUP_REGION possibly returning multiple duplicate regions
2018-06-01 10:55:42 -04:00
Marcus Young
0d109c77d9 Fix issue with CLOUDWATCH_LOGGROUP_REGION possibly returning multiple duplicate regions 2018-06-01 09:35:08 -05:00
Toni de la Fuente
85e893d74a Merge pull request #216 from hb3b/master
Support graceful failing of buckets with corrupt/unintended permissions
2018-05-29 20:49:46 -04:00
Ben Hecht
ac7d51b6f3 Support graceful failing of buckets with corrupt/unintended permissions 2018-05-29 17:19:23 -04:00
Toni de la Fuente
8acc18b32b added json support to README and usage 2018-05-29 16:23:37 -04:00
Toni de la Fuente
9fb344bb89 Merge pull request #215 from hb3b/master
Add JSON support
2018-05-29 16:05:13 -04:00
Ben Hecht
84e9ef2f94 Add JSON support 2018-05-29 15:22:08 -04:00
Toni de la Fuente
c08e803a8b Merge pull request #212 from craighurley/master
Update readme formatting.
2018-05-14 18:51:29 -04:00
Toni de la Fuente
b8178a7a92 Merge pull request #213 from yapale/yapale-patch-1
missing aim roles
2018-05-14 18:48:52 -04:00
yapale
4076ee5679 missing aim roles
adding missing IAM roles
"cloudtrail:GetEventSelectors", "apigateway:GET",
2018-05-13 19:27:20 +03:00
Craig Hurley
f25a9afd5a Update readme formatting. 2018-05-12 22:06:29 +12:00
Toni de la Fuente
6136afcf3d Modified Requirements section 2018-05-04 10:10:20 -04:00
Toni de la Fuente
3d278f9ebd fixed check28 issue #209 2018-04-30 12:24:10 -04:00
Toni de la Fuente
c445c6d46f fixed check28 issue #209 2018-04-30 12:21:26 -04:00
Toni de la Fuente
737fbb5837 fixed check28 issue #209 2018-04-30 12:20:10 -04:00
Toni de la Fuente
3a6cc73319 Merge pull request #208 from MrSecure/need_cred_report
ensure credential report is available before running any checks
2018-04-27 13:42:31 -04:00
MrSecure
00df2c0d0a ensure credential report is available before running any checks 2018-04-27 12:37:56 -05:00
Toni de la Fuente
be680b00b6 Merge pull request #207 from MrSecure/restore_check_levels
Restore check levels
2018-04-25 01:11:06 -04:00
MrSecure
fbd82a8dca fix typo setting CHECK TYPE for 3.11 2018-04-24 21:27:38 -07:00
MrSecure
bd9e49d3e3 mark Extra checks as such 2018-04-24 21:19:42 -07:00
MrSecure
ef069386e8 fix mismatched check_type
fix CHECK_ALTERNATE
2018-04-24 21:12:25 -07:00
MrSecure
6e97b41e06 add EXTRA level marker to sample check 2018-04-24 21:10:10 -07:00
MrSecure
2cc6715124 mark Level 2 checks as such 2018-04-24 21:09:46 -07:00
MrSecure
1150f2782a mark Level 1 checks as such 2018-04-24 21:02:41 -07:00
Toni de la Fuente
7f386358d3 Fix issue #206 2018-04-24 23:58:27 -04:00
Toni de la Fuente
3212b0db55 Added license and commercial use disclaimer to README 2018-04-24 10:25:16 -04:00
Toni de la Fuente
94893b8c4e fixed typo in extra74 2018-04-23 15:48:55 -04:00
Toni de la Fuente
2afbda53b2 fixed banner on -g option 2018-04-20 17:36:54 -04:00
Toni de la Fuente
60bfb31a19 new check extra729 and test group gdpr 2018-04-20 17:28:01 -04:00
Toni de la Fuente
6b66be25a9 Merge pull request #205 from MrSecure/tweaks
Tweaks - AWS Account ID, -V flag
2018-04-20 17:09:15 -04:00
MrSecure
d1693e0f3d move getWhoami to position where it will run before any checks
This restores the AWS account number in the CSV output when running
checks or groups.
2018-04-20 15:55:51 -05:00
MrSecure
7ba6080522 add -V flag to show version 2018-04-20 15:54:47 -05:00
Toni de la Fuente
e1958270c0 added new checks for SQS extra727 and 728 2018-04-20 14:42:54 -04:00
Toni de la Fuente
5efd2669fa new check Trusted Avisor errors/warnings 2018-04-20 12:57:07 -04:00
Toni de la Fuente
c21c14d8de updated list 2018-04-19 13:36:44 -04:00
Toni de la Fuente
770691fa87 updated list 2018-04-19 13:34:16 -04:00
Toni de la Fuente
c53a1f9428 Merge pull request #203 from toniblyx/devel
Merge latest 2.0 beta to Master
2018-04-19 13:19:25 -04:00
Toni de la Fuente
919f97cd79 Merge branch 'master' into devel 2018-04-19 13:19:10 -04:00
Toni de la Fuente
2362518f13 added -g option to README and fixes 2018-04-19 09:52:31 -04:00
Toni de la Fuente
38ad3ca657 region and profile handling improved 2018-04-19 09:47:16 -04:00
Toni de la Fuente
7767a4ba74 Merge pull request #202 from ceyes/master
Fix curl error; improve default region
2018-04-19 09:41:17 -04:00
Jason Chen
775d28f9c4 prowler: fix IAM role detection and curl error
Related to https://github.com/toniblyx/prowler/pull/200

If the ec2 instance is not attached to an IAM role, the `curl -s -m 1
http://169.254.169.254/latest/meta-data/iam/security-credentials` will
return a 404 page instead of null, INSTANCE_PROFILE will always be true
and result to curl error when trying to use default cli profile:

    curl: option -: is unknown
    curl: try 'curl --help' or 'curl --manual' for more information
2018-04-19 14:56:36 +08:00
Jason Chen
2f166e2ba3 prowler: Set default region by aws config, fall back to us-east-1 2018-04-19 14:56:36 +08:00
Toni de la Fuente
ada8a225ae fixed and improved aws profile loader 2018-04-16 14:09:30 -04:00
Toni de la Fuente
e1559b263c Merge pull request #201 from netflash/master
Fixes #200
2018-04-16 14:06:21 -04:00
Alex Romanov
d8687bfab0 Fixes #200 2018-04-16 17:58:39 +00:00
Toni de la Fuente
98a1f4bda0 improved error handling on check111 2018-04-11 14:09:55 -04:00
Toni de la Fuente
8f86a5319f set version label 2.0-beta2 2018-04-11 10:14:34 -04:00
Toni de la Fuente
4c607bba1c improved current directoy handler for includes 2018-04-11 10:13:43 -04:00
Toni de la Fuente
1b0d09da13 added version variable to banner 2018-04-11 10:01:50 -04:00
Toni de la Fuente
473c9b9ce0 added extra725 to extras and forensics 2018-04-10 16:21:08 -04:00
Toni de la Fuente
25cd2202a7 added check extra725 S3 object-level logging 2018-04-10 16:17:53 -04:00
Toni de la Fuente
168ccffaf4 disable concurrency queries due API limits 2018-04-09 15:55:07 -04:00
Toni de la Fuente
7d510b11b2 disable concurrency checks due API limits 2018-04-09 15:41:55 -04:00
Toni de la Fuente
e3e038127f license changes for checks 2018-04-09 15:09:30 -04:00
Toni de la Fuente
eaaf51813b Merge pull request #198 from sidewinder12s/patch-2
Update all CIS document links to AWS version.
2018-04-05 00:43:34 -04:00
Geoff Webster
1da206cb90 Update all CIS document links to AWS version. 2018-04-04 21:39:57 -07:00
Toni de la Fuente
cd41766e22 added checkid to every check and group title 2018-03-29 10:36:46 -04:00
Toni de la Fuente
7cde6f15e7 removed some spaces from output 2018-03-28 14:24:37 -04:00
Toni de la Fuente
eaf0a6bf09 added command to save report in S3 2018-03-28 13:58:07 -04:00
Toni de la Fuente
058a8d5b33 changed extra742 to FAIL if not default value 2018-03-28 13:51:32 -04:00
Toni de la Fuente
fa474876e9 changed extra742 to FAIL if not default value 2018-03-28 12:51:13 -04:00
Toni de la Fuente
91b8a832ec hide banner on csv output for group mode 2018-03-28 12:32:51 -04:00
Toni de la Fuente
9a035b1a94 updated check extra724 INFO instead of FAIL if enabled 2018-03-28 11:12:59 -04:00
Toni de la Fuente
07b166baa9 changed outputs to the new ones 2018-03-28 11:07:46 -04:00
Toni de la Fuente
1acc6e45d0 added check extra724 Certificate Transparency 2018-03-28 10:54:59 -04:00
Toni de la Fuente
db8b5a4d0b added check extra724 Certificate Transparency 2018-03-28 10:50:56 -04:00
Toni de la Fuente
919c530155 added check extra724 Certificate Transparency 2018-03-28 10:49:39 -04:00
Toni de la Fuente
94e7faa1c1 added check extra724 Certificate Transparency 2018-03-28 10:49:00 -04:00
Toni de la Fuente
f130c899e5 added check extra724 Certificate Transparency 2018-03-28 10:44:36 -04:00
Toni de la Fuente
1c0229e1a3 added new CHECKLIST.md file 2018-03-27 18:43:58 -04:00
Toni de la Fuente
39b597ee47 updated README and usage 2018-03-27 18:11:13 -04:00
Toni de la Fuente
a535e66d06 updated README and usage 2018-03-27 18:09:02 -04:00
Toni de la Fuente
70483ba81b updated README and usage 2018-03-27 18:07:03 -04:00
Toni de la Fuente
ef9b7cef1a clean up extras 2018-03-26 23:01:52 -04:00
Toni de la Fuente
2648067ac6 fully functional beta 2.0 2018-03-26 22:54:21 -04:00
Toni de la Fuente
6647702d90 added support of -g groups 2018-03-26 21:32:15 -04:00
Toni de la Fuente
7866d42df9 changed output to PASS and FAIL 2018-03-26 15:40:40 -04:00
Toni de la Fuente
da0f266944 first semi functional v2 2018-03-23 19:26:10 -04:00
Toni de la Fuente
a2806ad86b populated checks 2018-03-23 10:05:20 -04:00
Toni de la Fuente
a98fdf7679 create check files 2018-03-20 23:08:35 -04:00
Toni de la Fuente
a21bff31a5 create check files 2018-03-20 22:59:34 -04:00
Toni de la Fuente
0a9e50ce53 Merge pull request #194 from mbode/check33_bugfix
Fix check 3.3
2018-03-20 11:54:34 -04:00
Maximilian Bode
2172f60a18 Reintroduce lost $-sign in check 3.3 2018-03-20 16:50:37 +01:00
Toni de la Fuente
2f761f62a6 new folder structure 2018-03-20 10:56:37 -04:00
Toni de la Fuente
6a4127dc40 tests v2 2018-03-19 14:55:25 -04:00
Toni de la Fuente
4901561fec tests v2 2018-03-19 14:54:05 -04:00
Toni de la Fuente
68d12ae72f fix issue #193 2018-03-19 12:24:59 -04:00
Toni de la Fuente
01a88e6c89 move prowler-policy to iam folder 2018-03-19 11:23:13 -04:00
Toni de la Fuente
0e43a05d16 fix issue #184 2018-03-19 11:11:45 -04:00
Toni de la Fuente
a670716625 preparing new structure 2018-03-19 11:10:10 -04:00
Toni de la Fuente
f411223fa8 added extra723 and clean up 2018-03-19 10:55:35 -04:00
Toni de la Fuente
c96e2be257 Merge pull request #192 from toniblyx/master
update devel branch
2018-03-19 10:45:40 -04:00
Toni de la Fuente
d806c86e90 Merge pull request #188 from ahhh/patch-1
Update prowler output text for extra717
2018-03-06 13:21:47 -05:00
Dan Borges
5156376df6 Update prowler 2018-03-06 09:58:12 -08:00
Toni de la Fuente
e714a20ae3 Merge pull request #187 from rtkjbillo/update_cloudwatch_logs_permissions
Update IAM permissions needed for CloudWatch Logs
2018-03-05 16:33:38 -05:00
Jake Billo
c20f8878da Update IAM permissions needed for CloudWatch Logs
According to the AWS documentation for the CloudWatch Logs permissions reference [1], the IAM policy to permit or deny CloudWatch Logs actions uses the `logs:` prefix rather than `cloudwatchlogs:`. This commit updates the policy additions JSON file as well as the README to reflect this change.

I confirmed this having assumed an appropriate role in an AWS account, then executing the AWS CLI command `aws logs describe-log-groups`; with the `cloudwatchlogs:` prefix an AccessDeniedException was returned to the client.

[1] https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/permissions-reference-cwl.html
2018-03-05 16:01:42 -05:00
Toni de la Fuente
6ccd1020e3 Merge pull request #180 from subramani95/patch-4
Improving check41 and check42
2018-02-26 23:23:29 -05:00
Toni de la Fuente
fa03991edd Merge pull request #181 from doshitan/improve-check28
Improve check28
2018-02-22 11:38:26 -08:00
Toni de la Fuente
5fdedd082b Merge pull request #182 from doshitan/better-shebang
Use `#!/usr/bin/env bash` instead of hard coding `#!/bin/bash`
2018-02-22 11:26:27 -08:00
Tanner Doshier
d7f4f99f15 Improve check28
The CIS benchmarks state that only customer managed CMKs should be checked, so
exclude all AWS managed CMKs, not just the one for ACM.

Also fix up some formatting and dead code.
2018-02-22 12:32:36 -06:00
Tanner Doshier
1295c5ecff Use #!/usr/bin/env bash instead of hard coding #!/bin/bash
Better cross-platform support.
2018-02-22 12:16:12 -06:00
Subramani Ramanathan
65c417a357 Improving check41 and check42
Improved check41 and check42 to ensure no inbound rule exists that has:-
# port no 22 and source of 0.0.0.0/0
# port no in the range (i.e 0-1024) and source of 0.0.0.0/0
# port value of all and source of 0.0.0.0/0
2018-02-21 02:48:20 +05:30
Toni de la Fuente
111615bff4 Merge pull request #177 from toniblyx/master
New checks and improvements
2018-02-16 14:13:00 -05:00
Toni de la Fuente
ec7930146b New checks and improvements 2018-02-16 12:33:05 -05:00
Toni de la Fuente
282f758fd7 Merge pull request #176 from subramani95/patch-3
Fix printing texts when both Ok and Warn are present in 'check31'
2018-02-13 21:35:08 -05:00
Subramani Ramanathan
6b759db0ae Fix printing texts when both Ok and Warn are present in 'check31'
We may have groups in both Ok and Warn; so we have to go through both CHECK31OK and CHECK31WARN one by one.
2018-02-13 21:27:04 +05:30
Toni de la Fuente
9ddf17484a Merge pull request #17 from Alfresco/master
get latest PR  from master
2018-02-12 16:19:08 -05:00
Toni de la Fuente
1580c38a06 Merge pull request #174 from subramani95/patch-2
Improved 'check31'
2018-02-12 11:32:50 -05:00
Subramani Ramanathan
771cbf6b08 Fix to get CloudWatch Log Group Region
Fix to get CloudWatch Log Group Region, when more than one log group names are there
2018-02-12 21:55:55 +05:30
Subramani Ramanathan
f64fac3e17 Improved 'check31'
Get the Metric Name using Log Group and Filter names and check the alarms associated with that metric.
2018-02-12 18:43:20 +05:30
Toni de la Fuente
01d13691b3 Merge pull request #173 from toniblyx/master
Added new check extra719 route53 query logging
2018-02-09 19:58:52 -05:00
Toni de la Fuente
d101e2b3bf Added new check extra719 route53 query logging 2018-02-09 19:57:54 -05:00
Toni de la Fuente
e248be83f1 Merge pull request #172 from toniblyx/master
Added check extra718 bucket server access logging
2018-02-09 18:19:08 -05:00
Toni de la Fuente
f5ba67da86 Added check extra718 bucket server access logging 2018-02-09 18:15:06 -05:00
Toni de la Fuente
da86408431 Merge pull request #171 from toniblyx/master
Fixed extra79 and added extra717
2018-02-09 17:22:43 -05:00
Toni de la Fuente
1281867bd4 Removed redundand info in README 2018-02-09 17:19:48 -05:00
Toni de la Fuente
1cc7c7d3aa Removed redundand info in README 2018-02-09 17:18:43 -05:00
Toni de la Fuente
cd276ab959 Added new check extra717 ELB logging 2018-02-09 17:17:09 -05:00
Toni de la Fuente
d38e5aa088 Merge pull request #170 from toniblyx/master
Added new check extra716 ES service allow open access
2018-02-08 01:22:25 -05:00
Toni de la Fuente
b2264997d6 Added new check extra716 ES service allow open access 2018-02-08 01:21:22 -05:00
Toni de la Fuente
dce78805a8 Merge pull request #169 from toniblyx/master
Added new check extra715 ES service logging
Added new check extra716 ES service allow open access
2018-02-08 01:02:20 -05:00
Toni de la Fuente
55d3d642f9 Added new check extra716 ES service allow open access 2018-02-08 01:01:28 -05:00
Toni de la Fuente
841e5436b9 Added new check extra715 ES service logging 2018-02-08 00:27:27 -05:00
Toni de la Fuente
0360db1b64 Merge pull request #168 from toniblyx/master
Added check extra714 CloudFront logging
2018-02-07 23:50:31 -05:00
Toni de la Fuente
3665d64f2b Added check extra714 CloudFront logging 2018-02-07 23:49:26 -05:00
Toni de la Fuente
0b7a17b2b2 Merge pull request #167 from toniblyx/master
Improved OSTYPE handling
2018-02-07 22:53:46 -05:00
Toni de la Fuente
b92ba781ba Fixed mktemp in OSX and OS handlign 2018-02-07 22:52:32 -05:00
Toni de la Fuente
c447e456d0 Fixed mktemp in OSX 2018-02-07 22:48:02 -05:00
Toni de la Fuente
9f977d263d Fixed mktemp in OSX 2018-02-07 22:47:13 -05:00
Toni de la Fuente
752a07d406 Merge pull request #166 from toniblyx/master
New check and fix issue #165
2018-02-07 22:25:24 -05:00
Toni de la Fuente
53580d488c Fix issue #165 2018-02-07 22:22:51 -05:00
Toni de la Fuente
84591d25a6 New check extra713 for GuardDuty 2018-02-05 23:41:19 -05:00
Toni de la Fuente
d67170b87c New forensics-ready check group and extra712 2018-02-05 23:11:43 -05:00
Toni de la Fuente
194eecb269 New forensics-ready check group and extra712 2018-02-05 23:07:55 -05:00
Toni de la Fuente
db765e9c55 Fixed typo in README 2018-02-05 22:26:03 -05:00
Toni de la Fuente
dc2c32be54 Merge pull request #164 from toniblyx/master
Improved check31 issue #111
2018-02-05 22:04:17 -05:00
Toni de la Fuente
9f01be416a Improved check31 issue #111 2018-02-05 22:02:53 -05:00
Toni de la Fuente
fbbb1dd904 Merge pull request #16 from Alfresco/master
get all changes from main repo
2018-02-05 21:44:11 -05:00
Toni de la Fuente
9b1451aff1 Merge pull request #162 from subramani95/patch-1
Update to 'check114'
2018-02-05 21:39:31 -05:00
Subramani Ramanathan
e192a5ef44 Update to 'check114'
Updated 'check114' to ensure hardware MFA is enabled for root account by:-
1) Querying for 'SerialNumber' of the Virtual MFA Devices list
2) 'SerialNumber' is ARN for Virtual MFA Device and Device Number for Hardware MFA Device; so did grep for ARN with 'root-account-mfa-device' in the expression
2018-02-05 21:49:15 +05:30
Toni de la Fuente
845ed39b8c Merge pull request #161 from sidewinder12s/public-redshift-cluster
Add check for publicly accessible redshift clusters.
2018-02-02 15:48:01 -05:00
Geoff Webster
64a11a3446 Add check for publicly accessible redshift clusters. 2018-02-02 10:59:45 -08:00
Toni de la Fuente
e1126d744f Merge pull request #160 from sidewinder12s/endpoint-names
Update extras 7.8-10 to display public endpoints as well as names.
2018-02-01 21:13:50 -05:00
Geoff Webster
db4a91f623 Update extras 7.8-10 to display public endpoints as well as names. 2018-02-01 14:48:33 -08:00
Toni de la Fuente
4f6972c9cd Merge pull request #15 from Alfresco/master
sync with main code
2018-02-01 15:40:34 -05:00
Toni de la Fuente
d4b14c2510 Merge pull request #156 from sidewinder12s/extra-check-710
Extra check 710
2018-02-01 12:42:43 -05:00
Toni de la Fuente
affe26cfe6 Merge pull request #155 from sidewinder12s/extra-check-79
added extra79 to check for internet facing ELBs.
2018-02-01 12:41:03 -05:00
Geoff Webster
33029e35d5 Added extra710 to check for internet facing EC2 Instances. 2018-01-31 17:20:46 -08:00
Geoff Webster
398e55f21a added extra79 to check for internet facing ELBs. 2018-01-31 15:38:56 -08:00
Toni de la Fuente
4b395d50db Merge pull request #150 from toniblyx/master
Improved load of auth credentials
2018-01-27 10:37:22 -05:00
Toni de la Fuente
9c19e7b85d improved load of auth credentials 2018-01-27 10:35:25 -05:00
Toni de la Fuente
d0c66181f0 Merge pull request #14 from Alfresco/master
sync with main repo
2018-01-26 18:12:31 -05:00
Toni de la Fuente
66862fddf3 Merge pull request #146 from neonbunny/patch-3
Fix typos in messages
2018-01-16 11:37:33 -05:00
neonbunny
189462c474 Fix typos in messages 2018-01-16 16:31:31 +00:00
Toni de la Fuente
99e663d06c Merge pull request #143 from toniblyx/master
Added check extra78
2018-01-11 16:50:35 -05:00
Toni de la Fuente
609b4810f2 Added check extra78 2018-01-11 16:47:58 -05:00
Toni de la Fuente
36e851b79f Added check extra78 2018-01-11 16:46:08 -05:00
Toni de la Fuente
dec8391d73 Merge pull request #141 from toniblyx/master
Added new extras and README changes
2018-01-09 15:53:48 -05:00
Toni de la Fuente
d004c28436 Added Third Party Integrations to README 2018-01-09 15:25:48 -05:00
Toni de la Fuente
e6d858cbe3 Added how to add Custom Checks to README 2018-01-09 15:19:50 -05:00
Toni de la Fuente
d9685149d0 Added how to add Custom Checks to README 2018-01-09 15:18:37 -05:00
Toni de la Fuente
993a58a0c4 Added how to add Custom Checks to README 2018-01-09 15:17:51 -05:00
Toni de la Fuente
e04d2df953 Added how to add Custom Checks to README 2018-01-09 15:16:54 -05:00
Toni de la Fuente
741ff97b02 Added how to add Custom Checks to README 2018-01-09 15:15:16 -05:00
Toni de la Fuente
dc6b1dd915 Added how to add Custom Checks 2018-01-09 15:13:12 -05:00
Toni de la Fuente
e5c65fd523 added extra77 check public ECR repos 2018-01-09 14:59:23 -05:00
Toni de la Fuente
bfdba6257b added -l flag to show only a list of all checks 2018-01-09 14:20:35 -05:00
Toni de la Fuente
ac8179ec83 added extra76 check public AMIs 2018-01-09 11:51:57 -05:00
Toni de la Fuente
17b0df3053 added region info to help output 2018-01-09 11:49:07 -05:00
Toni de la Fuente
e6fa8dd92d added region info to help output 2018-01-09 11:47:49 -05:00
Toni de la Fuente
09896c3e3c Merge remote-tracking branch 'upstream/master' 2018-01-09 11:38:31 -05:00
Toni de la Fuente
deacd27ac6 Merge pull request #139 from st33v/add_docker
add simple docker file
2017-12-24 19:54:34 +01:00
Steve Neuharth
785633cc3b add simple docker file 2017-12-24 12:33:48 -06:00
Toni de la Fuente
8e93bcc3da Merge pull request #138 from wassies/master
Pull request - Text change for issue #133
2017-12-17 19:45:59 -05:00
wassies
07635ce579 Text change for issue #133
Updated OK text for issue #133
2017-12-18 10:31:29 +10:00
Toni de la Fuente
232292fa3e Merge pull request #137 from ASIDataScience/fix-check114
Use a query to get AccountMFAEnabled rather than awk/sed
2017-12-13 19:03:56 -05:00
Tomáš Milata
b67ca429e9 Use a query to get AccountMFAEnabled rather than awk/sed
Parsing with awk/sed relies on the json being pretty printed (no other values on the same line), which is not always true, causing false-positive warings sometimes. Querying for SummaryMap.AccountMFAEnabled directly should be more robust
2017-12-13 13:38:27 +00:00
Toni de la Fuente
7121fb448a Merge pull request #136 from ASIDataScience/fix-check113
Use a query to get AccountMFAEnabled on a root account rather than awk/sed
2017-12-12 22:24:46 -05:00
Tomáš Milata
887805c5be Use a query to get AccountMFAEnabled rather than awk/sed
Parsing with awk/sed relies on the json being pretty printed (no other values on the same line), which is not always true, causing false-positive warings sometimes. Querying for SummaryMap.AccountMFAEnabled directly should be more robust.
2017-12-12 17:21:34 +00:00
Toni de la Fuente
2063a718a5 Merge pull request #135 from sente/patch-1
Support "" (blank) values to if [[ ]] statements
2017-12-07 09:26:03 -05:00
Stuart Powers
4e53521c59 Support "" (blank) values to if [[ ]] statements 2017-12-07 08:06:04 -05:00
Toni de la Fuente
858110179b Merge pull request #134 from pbugnion/fix-check124
Check 1.24: fix error getting policy version when multiple policies share the same words
2017-12-06 16:10:21 -05:00
Pascal Bugnion
d8879d9085 Fix bug getting policy versions
When serveral policies have the same full word substring, getting the policy
versions can return multiple entries. Now fixed.
2017-12-06 18:36:51 +00:00
Toni de la Fuente
477023d32a Merge pull request #131 from st33v/st33v-patch-1
fixed internet gateway check
2017-12-04 12:00:59 -08:00
Steve Neuharth
4b7b28eb87 fixed internet gateway check 2017-11-27 20:27:38 -06:00
Toni de la Fuente
3d282e2a99 Merge pull request #13 from Alfresco/master
sync with master
2017-11-22 22:37:58 -05:00
Toni de la Fuente
bb2958620c Merge pull request #130 from ASIDataScience/avoid-username-clash-in-check12
Avoid name clashes on word boundaries
2017-11-22 22:36:44 -05:00
Pascal Bugnion
0ff6b7fd70 Avoid name clashes on word boundaries 2017-11-22 13:03:42 +00:00
Toni de la Fuente
eaf95a6239 Merge pull request #129 from toniblyx/master
fixed issue with multiple CLOUDWATCH_GROUPS in section 3. Issue #111
2017-11-21 10:21:28 -05:00
Toni de la Fuente
010dd950b3 fixed issue with multiple CLOUDWATCH_GROUPS in section 3. Issue #111 2017-11-21 10:20:38 -05:00
Toni de la Fuente
95c4f4683f Merge pull request #128 from toniblyx/master
Added exit code enhancement #126
2017-11-17 18:46:04 -05:00
Toni de la Fuente
2c86cc04d5 Added exit code enhancement #126 2017-11-17 18:45:20 -05:00
Toni de la Fuente
23c61b4077 Merge pull request #127 from toniblyx/master
fixed #111 and improved section 3
2017-11-17 18:24:08 -05:00
Toni de la Fuente
521088aa55 fixed #111 and improved section 3 2017-11-17 18:20:42 -05:00
Toni de la Fuente
482d3c5a77 fixed #111 and improved section 3 2017-11-17 18:17:23 -05:00
Toni de la Fuente
49393d258a Merge pull request #123 from Alfresco/devel
Added 2 additional extra checks
2017-11-08 21:28:56 +00:00
Toni de la Fuente
cc843c16a8 Merge pull request #122 from dougbyrne/check123_false_positives
Better grep pattern to find users in the IAM report
2017-11-08 21:26:13 +00:00
Doug Byrne
f5ebc1d227 Better grep pattern to find users in the IAM report 2017-11-08 16:19:42 -05:00
Toni de la Fuente
431178c462 Merge pull request #121 from toniblyx/master
added new extras to README
2017-11-08 12:03:23 +00:00
Toni de la Fuente
a06c101fe2 added new extras to README 2017-11-08 12:02:43 +00:00
Toni de la Fuente
caf67f4e6c Merge pull request #120 from toniblyx/master
added extra74 and extra75
2017-11-08 00:03:23 +00:00
Toni de la Fuente
3b251bc4f5 added extra74 and extra75 2017-11-08 00:00:21 +00:00
Toni de la Fuente
0e5da362cb Merge pull request #119 from toniblyx/master
fixed issue #113
2017-11-06 19:30:24 -05:00
Toni de la Fuente
4c9b79a9d2 fixed issue #113 2017-11-06 19:29:41 -05:00
Toni de la Fuente
35da09d97a Merge pull request #117 from toniblyx/master
Fixed issue #112
2017-10-26 18:11:25 -04:00
Toni de la Fuente
0f1407325f Fixed issue #112 2017-10-26 18:09:36 -04:00
Toni de la Fuente
b5901d0b65 Fixed issue #112 2017-10-26 18:06:45 -04:00
Toni de la Fuente
4daf8cbcae Merge pull request #116 from toniblyx/master
Fixed issue #114
2017-10-26 17:15:39 -04:00
Toni de la Fuente
fc58cd535c Fixed issue #114 2017-10-26 17:14:41 -04:00
Toni de la Fuente
21e5102206 Merge branch 'master' of https://github.com/toniblyx/prowler 2017-10-26 16:58:34 -04:00
Toni de la Fuente
ca469b5f7c issue #85 2017-10-26 16:58:14 -04:00
Toni de la Fuente
a6f1affefa Merge pull request #12 from Alfresco/master
syc with master repo
2017-10-26 15:45:05 -04:00
Toni de la Fuente
26b749b470 Merge pull request #110 from netflash/master
Fix typo on AWS_ACCESS_KEY_ID variable name
2017-10-05 13:27:16 -04:00
Alex Romanov
d87c4a1cff Fix typo 2017-10-05 10:14:38 -07:00
Toni de la Fuente
0051adb855 Merge pull request #109 from toniblyx/master
Issue #107
2017-10-04 22:38:20 -04:00
Toni de la Fuente
3b62bc433e Issue #107
https://github.com/Alfresco/prowler/issues/107 
AWS recommends in official docs is to follow this order:
1 Command line options
2 Environment variables
3 The AWS credentials file
4 The CLI configuration file
5 Container credentials
6 Instance profile credentials
This change makes Prowler first reads creds from enviroment variables if no profile especified, if they are not available look for default profile in ~/.aws/credentials and finally if it has an instance profile attached it uses its credentials.
2017-10-04 22:36:36 -04:00
Toni de la Fuente
15337ad62c Added info about env credentials 2017-10-04 22:33:14 -04:00
Toni de la Fuente
48ef4f555e Merge pull request #11 from Alfresco/master
get all changes from the main repo
2017-10-04 11:42:28 -04:00
Toni de la Fuente
c16455d752 Merge pull request #106 from neonbunny/patch-2
Clarify warning message when CloudTrail is not consumed by CloudWatch
2017-09-26 10:20:05 -04:00
neonbunny
1df55ebf60 Clarify warning message when CloudTrail is not consumed by CloudWatch 2017-09-26 14:49:05 +01:00
Toni de la Fuente
1a79c6e0f9 Merge pull request #105 from neonbunny/patch-1
Clarify warning message
2017-09-22 08:53:04 -04:00
neonbunny
3ccf28617e Clarify warning message
A previous change replaced a comma in the message with the word "but" which is incorrect - the missing KMS key was the indicator that the trail was not encrypted.
2017-09-22 11:22:59 +01:00
Toni de la Fuente
ae8b8076c5 Merge pull request #104 from toniblyx/master
Fix issue #103
2017-09-11 18:18:14 -04:00
Toni de la Fuente
c7925b6f94 Fix issue #103
Fix issue #103
2017-09-11 18:16:18 -04:00
Toni de la Fuente
0e2502fcad Merge pull request #102 from toniblyx/master
Added numeral feature issue #101
2017-09-08 18:20:57 -04:00
Toni de la Fuente
e9ed339610 issue #101
added numeral feature request issue #101
2017-09-08 18:19:31 -04:00
Toni de la Fuente
dfd8e74003 issue #101
added numeral feature request issue #101
2017-09-08 18:18:40 -04:00
Toni de la Fuente
90497a5daf Merge pull request #100 from toniblyx/master
removed printCurrentDate reference
2017-08-22 10:55:55 +02:00
Toni de la Fuente
73f7c3d16d removed printCurrentDate reference 2017-08-22 10:55:18 +02:00
Toni de la Fuente
8c79d37099 Merge pull request #10 from Alfresco/master
get all changes from main repo
2017-08-22 10:42:15 +02:00
Toni de la Fuente
591b6e70f6 Merge pull request #98 from hemedga/referencelong
Updated infoReferenceLong() text and moved the function call
2017-08-22 10:40:59 +02:00
Toni de la Fuente
1618568be2 Merge branch 'master' into referencelong 2017-08-22 10:39:41 +02:00
Toni de la Fuente
436ea15d9a Merge pull request #99 from hemedga/short
Fix issue #96 - remove bit.ly reference
2017-08-22 10:35:54 +02:00
Toni de la Fuente
fa181a4ada Merge pull request #97 from hemedga/date
removed printCurrentDate() and added current date to banner
2017-08-22 10:34:14 +02:00
Hemed Gur-Ary
866200d018 Fix issue #96 - remove bit.ly reference 2017-08-22 00:34:17 +03:00
Hemed Gur-Ary
afb914f9d7 Updated infoReferenceLong() text and moved the function call 2017-08-22 00:19:49 +03:00
Hemed Gur-Ary
43918cfcfe removed printCurrentDate() and added current date to banner 2017-08-21 23:44:34 +03:00
Toni de la Fuente
0e0f3a334e Merge pull request #95 from toniblyx/master
fixed issue #94
2017-08-14 15:25:28 -07:00
Toni de la Fuente
711ebf3878 Added max items option to extra72 issue #94
issue #94
2017-08-14 18:24:31 -04:00
Toni de la Fuente
6198f9472f Merge pull request #9 from Alfresco/master
update from master
2017-08-14 15:22:24 -07:00
Toni de la Fuente
0fb7d1236a Merge pull request #92 from MrSecure/74_fix_scored_output
74 fix scored output
2017-08-11 17:13:28 -07:00
Ben Allen
580cacede5 make sure CSV header is shown before any results 2017-08-02 21:49:09 -05:00
Ben Allen
e4f6825662 add level to CSV output 2017-08-02 21:41:19 -05:00
Ben Allen
86bbb4583c update scored/level marking for level2 & support 2017-08-02 21:39:12 -05:00
Ben Allen
b9b0e3fcb3 update scored/level marking for level1 & extras 2017-08-02 21:34:21 -05:00
Ben Allen
c66d581ed2 restore not-scored markers to multiple checks. 2017-08-02 15:09:07 -05:00
Toni de la Fuente
c5da6b2cdd Merge pull request #91 from neonbunny/master
Broken sed expression & typos
2017-07-28 09:44:02 -07:00
Stephen Tomkinson
7e8fa330b5 Fixed a few more typos 2017-07-28 14:26:30 +01:00
Stephen Tomkinson
abb2bfbe9f Fixed broken sed expression and a typo in the output. 2017-07-28 14:17:01 +01:00
Toni de la Fuente
d859aa989e Merge pull request #88 from toniblyx/master
Fix for issue #87
2017-07-24 10:40:18 -04:00
Toni de la Fuente
29221bc5a9 fixed issue with mktemp at temp policy file
As per GNU mktemp man, TEMPLATE must contain at least 3 consecutive ‘X’s in last component .XXXXXXXXXX on the temp file. It is a bit different for the BSD version.
2017-07-24 10:38:50 -04:00
Toni de la Fuente
5b611566df Merge pull request #8 from Alfresco/master
get all changes from the master repo
2017-07-24 10:31:44 -04:00
Toni de la Fuente
f93eae1c3c Merge pull request #86 from jphuynh/master
Fix LICENSE
2017-07-24 09:25:04 -04:00
Jean-Pierre Huynh
717a4906c6 Fix license inconsistency between LICENSE file and prowler license header
Signed-off-by: Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>
2017-07-23 09:20:01 +01:00
Toni de la Fuente
a1b13fd346 Merge pull request #84 from toniblyx/master
Improved and error handling for checks sec 1 and 4
2017-07-21 11:35:30 -04:00
Toni de la Fuente
7eb08ddea4 Improved and error handling for checks sec 1 and 4
check41 Fixed sg-group handling with sg-id instead of name
check15 to check111 improved error handling for brand new aws accounts
2017-07-21 11:34:47 -04:00
Toni de la Fuente
acfb61fe42 Merge pull request #83 from toniblyx/master
Improved extra73 (added s3 policy review)
2017-07-21 00:15:25 -04:00
Toni de la Fuente
955cde08fd Improved extra73 (s3 bucket permissions)
Now extra73 checks for S3 policies that have Allow for Principal as *.
2017-07-21 00:13:11 -04:00
Toni de la Fuente
65e10c27c2 Merge pull request #82 from toniblyx/master
Fixed bug in extra73 for buckets in EU (eu-west-1)
2017-07-19 13:33:22 -04:00
Toni de la Fuente
ed2448dbe0 Fixed bug in extra73 for buckets in EU (eu-west-1) 2017-07-19 13:33:03 -04:00
Toni de la Fuente
644b04c1ac Merge pull request #81 from toniblyx/master
Improved extra73 - S3 bucket permissions
2017-07-19 11:00:09 -04:00
Toni de la Fuente
9f8941b76f updated check 7.3 2017-07-19 10:58:39 -04:00
Toni de la Fuente
7eeee0e777 Improved extra73 to check also Authenticated users
Ensure there are no S3 buckets open to the Everyone or Any AWS user (Not Scored) (Not part of CIS benchmark)
2017-07-19 10:57:05 -04:00
Toni de la Fuente
0ea9de8f64 Merge pull request #80 from toniblyx/master
Update README.md
2017-07-18 13:01:54 -04:00
Toni de la Fuente
5723bcb1a4 Update README.md 2017-07-18 13:00:46 -04:00
Toni de la Fuente
222ab4d8d6 Merge pull request #79 from toniblyx/master
Add TOC and section about Extras
2017-07-18 12:33:10 -04:00
Toni de la Fuente
f949d2f588 Add TOC and section about extras 2017-07-18 12:32:16 -04:00
Toni de la Fuente
918f74d6c5 Merge pull request #78 from toniblyx/master
Added check73 to find S3 buckets open to AllUsers
2017-07-18 11:49:01 -04:00
Toni de la Fuente
2faa50c4de fixed typo in TITTLE73 2017-07-18 11:47:56 -04:00
Toni de la Fuente
ae274b2fc9 Added check73 S3 buckets open to the AllUsers 2017-07-18 11:45:52 -04:00
Toni de la Fuente
6f5b28a99c Merge pull request #77 from Alfresco/revert-76-revert-75-master
Revert "Revert "added check72 about EBS snapshots set as public""
2017-07-18 09:32:45 -04:00
Toni de la Fuente
ce9a2b8162 Revert "Revert "added check72 about EBS snapshots set as public"" 2017-07-18 09:32:23 -04:00
Toni de la Fuente
92598d54f5 Merge pull request #76 from Alfresco/revert-75-master
Revert "added check72 about EBS snapshots set as public"
2017-07-18 09:30:44 -04:00
Toni de la Fuente
1697d6c92a Revert "added check72 about EBS snapshots set as public" 2017-07-18 09:30:31 -04:00
Toni de la Fuente
f64607d925 Merge pull request #75 from toniblyx/master
added check72 about EBS snapshots set as public
2017-07-18 09:16:24 -04:00
Toni de la Fuente
255b6f4ccb Added extra check72
7.2  Ensure there are no EBS Snapshots set as Public (Not Scored) (Not part of CIS benchmark)
2017-07-18 09:15:31 -04:00
Toni de la Fuente
7e3b1bd3ca Merge pull request #7 from Alfresco/master
get changes
2017-07-17 23:10:35 -04:00
Toni de la Fuente
93d5d7295f Merge pull request #73 from MrSecure/extra71-admins
add extra check - look for admins w/o MFA
2017-07-17 23:08:45 -04:00
Toni de la Fuente
435d2ed6fc Merge pull request #72 from MrSecure/check315-fixes
update check315
2017-07-17 22:55:01 -04:00
Ben Allen
bb1cb1e081 add extra71 check 2017-07-17 21:43:43 -05:00
Ben Allen
1527e438a1 update check315 to provide more consistent display of topics & subscriptiongs 2017-07-17 21:42:18 -05:00
Toni de la Fuente
c2b5ed17c2 Merge pull request #71 from toniblyx/master
fixed issue with check 3.15 issue #70
2017-07-17 22:28:02 -04:00
Toni de la Fuente
c2540b2828 fixed issue with check 3.15 2017-07-17 22:27:12 -04:00
Toni de la Fuente
fe4dfdb368 Merge pull request #68 from toniblyx/master
Added checks based on CIS profile definitions, issue #64
2017-07-17 21:21:54 -04:00
Toni de la Fuente
39f1411f30 added info about profile definitions 2017-07-17 21:20:05 -04:00
Toni de la Fuente
ebf80a6455 Added CIS profile definitions checks
level1 and level2 profile definition checks enabled see https://github.com/Alfresco/prowler/issues/64
2017-07-17 21:14:46 -04:00
Toni de la Fuente
ebeb747686 Merge pull request #67 from toniblyx/master
issue #65
2017-07-17 20:50:40 -04:00
Toni de la Fuente
e3400b05ba fixed issue #65
added --output json to those places needed to override different default configuration
2017-07-17 20:49:19 -04:00
Toni de la Fuente
90b24ef734 Merge pull request #6 from Alfresco/master
get latest updates
2017-07-13 09:58:07 -04:00
Toni de la Fuente
2de0b5e6b0 Merge pull request #62 from MrSecure/keep-cred-report
Keep cred report
2017-07-12 11:57:21 -04:00
Ben Allen
2ddf31ca22 Merge in tweaks to keep the credential report, when requested, and fix a notice 2017-07-12 10:34:55 -05:00
Ben Allen
b8d2d1cd4b Merge branch 'policy_requirements' into all-updates 2017-07-12 10:32:06 -05:00
Toni de la Fuente
fb420d13cc Merge pull request #61 from MrSecure/policy_requirements
Policy requirements
2017-07-12 11:24:18 -04:00
Toni de la Fuente
55ed1273d9 Merge pull request #60 from MrSecure/fail-early
Fail early
2017-07-12 11:15:35 -04:00
Ben Allen
edceb17b71 Merge branch 'fail-early' into all-updates 2017-07-12 10:13:07 -05:00
Ben Allen
a1e3c09fad Merge branch 'fail-early' into all-updates 2017-07-12 10:06:39 -05:00
Ben Allen
118da69eb5 add headings for incremental policy and bootstrap script 2017-07-11 16:34:25 -05:00
Ben Allen
02a4ab665f fix policy document syntax error in README 2017-07-11 16:34:25 -05:00
Ben Allen
c8a2e16a1c add note about saving the key material 2017-07-11 16:34:25 -05:00
Ben Allen
ca012ebf76 fix policy document syntax error 2017-07-11 16:34:25 -05:00
Ben Allen
1cbedb1eb6 add incremental policy file; update readme to show use case 2017-07-11 16:34:25 -05:00
Ben Allen
30c3a8aa76 correct typo in permission name 2017-07-11 16:34:25 -05:00
Ben Allen
68f8e08506 add option (-k) to keep the credential report after execution. 2017-07-11 16:24:42 -05:00
Ben Allen
866fe11610 fix typo in function name 2017-07-11 16:23:50 -05:00
Ben Allen
f787c57636 improve trap handling 2017-07-11 16:04:27 -05:00
Ben Allen
93b815ecf2 gather count of topics per region, even when unable to list subscribers. 2017-07-11 15:58:50 -05:00
Ben Allen
fe99890683 swallow error message for list-subscriptions-by-topic 2017-07-11 15:58:42 -05:00
Ben Allen
9ef23aecca handle permission failure on list-subscriptions-by-topic gracefully 2017-07-11 15:58:34 -05:00
Ben Allen
043fa32aef exit script if there are problems with the credentials. 2017-07-11 15:58:21 -05:00
Ben Allen
5bdd5d8e54 add account number to CSV output. 2017-07-11 15:57:33 -05:00
Ben Allen
df47f94cf9 change name of temp file so that it's random
Allows multiple instances of prowler to run in parallel (eg. via xargs
-P ).
Also, add trap handler to remove temp file if interrupted.
2017-07-11 15:57:33 -05:00
Ben Allen
7b6f168d8c update output for check 1.22 to handle multiple users 2017-07-11 15:57:16 -05:00
Ben Allen
cf9a73d539 gather count of topics per region, even when unable to list subscribers. 2017-07-11 15:52:21 -05:00
Toni de la Fuente
ae6ebfcafd Merge pull request #59 from toniblyx/master
Updated README with shortlist of features and parallel command
2017-07-11 16:51:59 -04:00
Toni de la Fuente
52f88abd33 Update README.md
Added short list of features and parallel command from @MrSecure
2017-07-11 16:50:55 -04:00
Ben Allen
95a4b56575 swallow error message for list-subscriptions-by-topic 2017-07-11 15:47:06 -05:00
Toni de la Fuente
1625bbcf19 Merge pull request #5 from Alfresco/master
get all new changes
2017-07-11 16:39:25 -04:00
Toni de la Fuente
59c8c8a9c5 Merge pull request #58 from MrSecure/parallelism
Parallelism Tweaks
2017-07-11 16:36:42 -04:00
Ben Allen
5c335b28b2 handle permission failure on list-subscriptions-by-topic gracefully 2017-07-11 15:36:35 -05:00
Toni de la Fuente
96ec896179 Merge pull request #57 from MrSecure/check122-multiple-users
update output for check 1.22 to handle multiple users
2017-07-11 16:33:02 -04:00
Ben Allen
8913ca84d0 exit script if there are problems with the credentials. 2017-07-11 14:59:20 -05:00
Ben Allen
cdbcac5251 add account number to CSV output. 2017-07-07 16:35:32 -05:00
Ben Allen
1e3985d3b4 change name of temp file so that it's random
Allows multiple instances of prowler to run in parallel (eg. via xargs
-P ).
Also, add trap handler to remove temp file if interrupted.
2017-07-07 16:33:42 -05:00
Ben Allen
d1d0f9edf0 update output for check 1.22 to handle multiple users 2017-07-06 14:14:57 -05:00
Toni de la Fuente
62dfd9a17b Merge pull request #55 from MrSecure/spelling
fix spelling error in CSV output
2017-06-27 12:53:06 -04:00
Ben Allen
d0f587fd55 fix spelling error in CSV output 2017-06-27 11:31:04 -05:00
Toni de la Fuente
765be03111 Merge pull request #53 from MrSecure/add-csv-out
Add csv output mode and code clean up
2017-06-27 10:11:18 -04:00
Ben Allen
94efa3028a clean up CSV output for 1.23 when multiple users match 2017-06-27 09:06:29 -05:00
Ben Allen
085ddae3b9 capture script start time using well supported date arguments 2017-06-27 08:52:55 -05:00
Ben Allen
8232a07437 clean up usage of expr 2017-06-26 17:06:17 -05:00
Ben Allen
e9122b3453 move CSV separator character to a variable 2017-06-26 16:50:57 -05:00
Ben Allen
43527302ac remove commas from output text 2017-06-26 16:45:17 -05:00
Ben Allen
85e620345c remove -b flag, since -M covers it 2017-06-26 16:35:56 -05:00
Ben Allen
8cba6df362 add output mode to README 2017-06-26 16:34:02 -05:00
Ben Allen
1eee23e4e1 documentation & formatting updates
* add M switch to help, readme
* remove title_id data from mono / color output lines
2017-06-26 16:21:07 -05:00
Ben Allen
e66bb7f1ab tiny output tweaks 2017-06-26 16:13:16 -05:00
Ben Allen
9a44414a8e more CSV tweaks
* handle multi-region tests cleanly
* clean up report generation info
2017-06-26 16:05:27 -05:00
Ben Allen
2f16ee4e6e add SCORED column to CSV output; handle section tiles properly 2017-06-26 15:40:28 -05:00
Ben Allen
acb889a267 Initial CSV Support
* rename text output functions to follow convention
* send appropriate data to stderr for progress monitoring
* send results to stdout in pipe-delimited format
* skip banner, etc. when running in CSV mode
2017-06-26 15:32:59 -05:00
Ben Allen
6334e19730 pull ID out of title, and pass it to text_title 2017-06-26 14:53:45 -05:00
Ben Allen
57034ab47d move titles from echo to output function 2017-06-26 13:42:00 -05:00
Ben Allen
f3be4f4c38 cleaning up output messages, clean up logic on chec14 2017-06-26 13:24:45 -05:00
Ben Allen
169eb51b0d switch WARNING output to use text_warn function 2017-06-26 13:09:46 -05:00
Ben Allen
a3a23eb8dc move output formatting functions up in file; use them earlier 2017-06-26 10:54:12 -05:00
Ben Allen
3fadc1cce1 convert NOTICE text to use output function 2017-06-26 10:48:56 -05:00
Ben Allen
029bce9b5b wrap all notice blocks to be single-line ready 2017-06-26 10:38:35 -05:00
Ben Allen
9bb8f0537a finish up first pass of conversion to text_ok for passed checks 2017-06-26 10:30:33 -05:00
Ben Allen
408cc78499 begin transition to function-based output - starting with OK responses for check1* 2017-06-26 10:26:56 -05:00
Ben Allen
045e88038f Clean up ordering; add Mode flag
refactor callCheck case statement to move cleanTemp && exit to end
move calls to functions to after all functions are defined
add -M flag to handle mode changing: text, mono, csv
2017-06-22 16:16:44 -05:00
173 changed files with 8846 additions and 1835 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

1
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1 @@
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

18
.gitignore vendored Normal file
View File

@@ -0,0 +1,18 @@
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

76
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at community@prowler.cloud. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

205
LICENSE
View File

@@ -1,201 +1,6 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
All CIS based checks in the checks folder are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License.
The link to the license terms can be found at
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Any other piece of code is licensed as Apache License 2.0 as specified in each file. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0

201
LICENSE-APACHE-2.0 Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

360
LICENSE-CC-BY-SA-4.0 Normal file
View File

@@ -0,0 +1,360 @@
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International Public License
("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-NC-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution, NonCommercial, and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.

View File

@@ -0,0 +1,4 @@
```
./prowler -l # to see all available checks and groups.
./prowler -L # to see all available groups only.
```

14
Pipfile Normal file
View File

@@ -0,0 +1,14 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
boto3 = ">=1.9.188"
ansi2html = ">=1.5.2"
detect-secrets = ">=0.12.4"
[requires]
python_version = "3.7"

856
README.md
View File

@@ -1,493 +1,461 @@
# Prowler: AWS CIS Benchmark Tool
## Table of Contents
- [Description](#description)
- [Features](#features)
- [Requirements and Installation](#requirements-and-installation)
- [Usage](#usage)
- [Advanced Usage](#advanced-usage)
- [Fix](#fix)
- [Screenshots](#screenshots)
- [Troubleshooting](#troubleshooting)
- [Extras](#extras)
- [Forensics Ready Checks](#forensics-ready-checks)
- [GDPR Checks](#gdpr-checks)
- [HIPAA Checks](#hipaa-checks)
- [Add Custom Checks](#add-custom-checks)
- [Third Party Integrations](#third-party-integrations)
- [Full list of checks and groups](/LIST_OF_CHECKS_AND_GROUPS.md)
- [License](#license)
## Description
Tool based on AWS-CLI commands for AWS account hardening, following guidelines of the [CIS Amazon Web Services Foundations Benchmark 1.1 ](https://benchmarks.cisecurity.org/tools2/amazon/CIS_Amazon_Web_Services_Foundations_Benchmark_v1.1.0.pdf)
Prowler is a command line tool for AWS Security Best Practices Assessment, Auditing, Hardening and Forensics Readiness Tool.
It covers hardening and security best practices for all regions related to:
It follows guidelines of the CIS Amazon Web Services Foundations Benchmark (49 checks) and has 40 additional checks including related to GDPR and HIPAA.
- Identity and Access Management (24 checks)
- Logging (8 checks)
- Monitoring (15 checks)
- Networking (5 checks)
Read more about [CIS Amazon Web Services Foundations Benchmark v1.2.0 - 05-23-2018](https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf)
For a comprehesive list and resolution look at the guide on the link above.
## Features
It covers hardening and security best practices for all AWS regions related to the next groups:
- Identity and Access Management (22 checks) [group1]
- Logging (9 checks) [group2]
- Monitoring (14 checks) [group3]
- Networking (4 checks) [group4]
- CIS Level 1 [cislevel1]
- CIS Level 2 [cislevel2]
- Extras (39 checks) *see Extras section* [extras]
- Forensics related group of checks [forensics-ready]
- GDPR [gdpr] Read more [here](#gdpr-checks)
- HIPAA [hipaa] Read more [here](#hipaa-checks)
For a comprehensive list and resolution look at the guide on the link above.
With Prowler you can:
- get a colorful or monochrome report
- a CSV format report for diff
- run specific checks without having to run the entire report
- check multiple AWS accounts in parallel
## Requirements and Installation
## Requirements
This script has been written in bash using AWS-CLI and it works in Linux and OSX.
- Make sure your AWS-CLI is installed on your workstation, with Python pip already installed:
```
pip install awscli
```
Or install it using "brew", "apt", "yum" or manually from https://aws.amazon.com/cli/
- Make sure the latest version of AWS-CLI is installed on your workstation, and other components needed, with Python pip already installed:
```sh
pip install awscli ansi2html detect-secrets
```
AWS-CLI can be also installed it using "brew", "apt", "yum" or manually from <https://aws.amazon.com/cli/>, but `ansi2html` and `detect-secrets` has to be installed using `pip`. You will need to install `jq` to get more accuracy in some checks.
- Make sure jq is installed (example below with "apt" but use a valid package manager for your OS):
```sh
sudo apt install jq
```
- Previous steps, from your workstation:
```
git clone https://github.com/Alfresco/prowler
cd prowler
```
- Make sure you have properly configured your AWS-CLI with a valid Access Key and Region:
```
aws configure
```
```sh
git clone https://github.com/toniblyx/prowler
cd prowler
```
- Make sure your Secret and Access Keys are associated to a user with proper permissions to do all checks. To make sure add SecurityAuditor default policy to your user. Policy ARN is
- Make sure you have properly configured your AWS-CLI with a valid Access Key and Region or declare AWS variables properly (or intance profile):
```sh
aws configure
```
or
```sh
export AWS_ACCESS_KEY_ID="ASXXXXXXX"
export AWS_SECRET_ACCESS_KEY="XXXXXXXXX"
export AWS_SESSION_TOKEN="XXXXXXXXX"
```
- Those credentials must be associated to a user or role with proper permissions to do all checks. To make sure add SecurityAuditor default policy to your user. Policy ARN is
```sh
arn:aws:iam::aws:policy/SecurityAudit
```
> Additional permissions needed: to make sure Prowler can scan all services included in the group *Extras*, make sure you attach also the custom policy [prowler-additions-policy.json](https://github.com/toniblyx/prowler/blob/master/iam/prowler-additions-policy.json) to the role you are using.
## Usage
1. Run the `prowler` command without options (it will use your environment variable credentials if they exist or will default to using the `~/.aws/credentials` file and run checks over all regions when needed. The default region is us-east-1):
```sh
./prowler
```
Use `-l` to list all available checks and group of checks (sections)
If you want to avoid installing dependences run it using Docker:
```sh
docker run -ti --rm --name prowler --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_SESSION_TOKEN toniblyx/prowler:latest
```
1. For custom AWS-CLI profile and region, use the following: (it will use your custom profile and run checks over all regions when needed):
```sh
./prowler -p custom-profile -r us-east-1
```
1. For a single check use option `-c`:
```sh
./prowler -c check310
```
With Docker:
```sh
docker run -ti --rm --name prowler --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_SESSION_TOKEN toniblyx/prowler:latest "-c check310"
```
or multiple checks separated by comma:
```sh
./prowler -c check310,check722
```
or all checks but some of them:
```sh
./prowler -E check42,check43
```
or for custom profile and region:
```sh
./prowler -p custom-profile -r us-east-1 -c check11
```
or for a group of checks use group name:
```sh
./prowler -g group1 # for iam related checks
```
or exclude some checks in the group:
```sh
./prowler -g group4 -E check42,check43
```
Valid check numbers are based on the AWS CIS Benchmark guide, so 1.1 is check11 and 3.10 is check310
1. If you want to save your report for later analysis:
```sh
./prowler -M mono > prowler-report.txt
```
or if you want a coloured HTML report do:
```sh
pip install ansi2html
./prowler | ansi2html -la > report.html
```
or if you want a pipe-delimited report file, do:
```sh
./prowler -M csv > output.psv
```
or json formatted output using jq, do:
```sh
./prowler -M json > prowler-output.json
```
or save your report in a S3 bucket:
```sh
./prowler -M mono | aws s3 cp - s3://bucket-name/prowler-report.txt
```
1. To perform an assessment based on CIS Profile Definitions you can use cislevel1 or cislevel2 with `-g` flag, more information about this [here, page 8](https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf):
```sh
./prowler -g cislevel1
```
1. If you want to run Prowler to check multiple AWS accounts in parallel (runs up to 4 simultaneously `-P 4`):
```sh
grep -E '^\[([0-9A-Aa-z_-]+)\]' ~/.aws/credentials | tr -d '][' | shuf | \
xargs -n 1 -L 1 -I @ -r -P 4 ./prowler -p @ -M csv 2> /dev/null >> all-accounts.csv
```
1. For help use:
```
./prowler -h
USAGE:
prowler [ -p <profile> -r <region> -h ]
Options:
-p <profile> specify your AWS profile to use (i.e.: default)
-r <region> specify an AWS region to direct API requests to
(i.e.: us-east-1), all regions are checked anyway if the check requires it
-c <check_id> specify a check id, to see all available checks use -l option
(i.e.: check11 for check 1.1 or extra71 for extra check 71)
-g <group_id> specify a group of checks by id, to see all available group of checks use -L
(i.e.: check3 for entire section 3, cislevel1 for CIS Level 1 Profile Definitions or forensics-ready)
-f <filterregion> specify an AWS region to run checks against
(i.e.: us-west-1)
-m <maxitems> specify the maximum number of items to return for long-running requests (default: 100)
-M <mode> output mode: text (default), mono, json, csv (separator is ,; data is on stdout; progress on stderr)
-k keep the credential report
-n show check numbers to sort easier
(i.e.: 1.01 instead of 1.1)
-l list all available checks only (does not perform any check)
-L list all groups (does not perform any check)
-e exclude group extras
-E execute all tests except a list of specified checks separated by comma (i.e. check21,check31)
-b do not print Prowler banner
-V show version number & exit
-s show scoring report
-x specify external directory with custom checks (i.e. /my/own/checks, files must start by check)
-q suppress info messages and passing test output
-A account id for the account where to assume a role, requires -R and -T
(i.e.: 123456789012)
-R role name to assume in the account, requires -A and -T
(i.e.: ProwlerRole)
-T session durantion given to that role credentials in seconds, default 1h (3600) recommended 12h, requires -R and -T
(i.e.: 43200)
-h this help
```
## Advanced Usage
### Assume Role:
Prowler uses the AWS CLI underneath so it uses the same authentication methods. However, there are few ways to run Prowler against multiple accounts using IAM Assume Role feature depending on eachg use case. You can just set up your custom profile inside `~/.aws/config` with all needed information about the role to assume then call it with `./prowler -p your-custom-profile`. Additionally you can use `-A 123456789012` and `-R RemoteRoleToAssume` and Prowler will get those temporary credentials using `aws sts assume-role`, set them up as environment variables and run against that given account.
```
arn:aws:iam::aws:policy/SecurityAudit
```
> In some cases you may need more list or get permissions in some services, look at the Troubleshooting section for a more comprehensive policy if you find issues with the default SecurityAudit policy.
## How to create a report
1 - Run the prowler.sh command without options (it will use your default credentials and run checks over all regions when needed, default region is us-east-1):
```
./prowler
./prowler -A 123456789012 -R ProwlerRole
```
2 - For custom AWS-CLI profile and region, use the following: (it will use your custom profile and run checks over all regions when needed):
> *NOTE 1 about Session Duration*: By default it gets credentials valid for 1 hour (3600 seconds). Depending on the mount of checks you run and the size of your infrastructure, Prowler may require more than 1 hour to finish. Use option `-T <seconds>` to allow up to 12h (43200 seconds). To allow more than 1h you need to modify *"Maximum CLI/API session duration"* for that particular role, read more [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session).
> *NOTE 2 about Session Duration*: Bear in mind that if you are using roles assumed by role chaining there is a hard limit of 1 hour so consider not using role chaining if possible, read more about that, in foot note 1 below the table [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html).
For example, if you want to get only the fails in CSV format from all checks regarding RDS without banner from the AWS Account 123456789012 assuming the role RemoteRoleToAssume and set a fixed session duration of 1h:
```
./prowler -p custom-profile -r us-east-1
./prowler -A 123456789012 -R RemoteRoleToAssume -T 3600 -b -M cvs -q -g rds
```
3 - For a single check use option -c:
### Custom folder for custom checks
Flag `-x /my/own/checks` will include any check in that particular directory. To see how to write checks see [Add Custom Checks](#add-custom-checks) section.
### Show or log only FAILs
In order to remove noise and get only FAIL findings there is a `-q` flag that makes Prowler to show and log only FAILs. It can be combined with any other option.
```
./prowler -c check310
```
or for custom profile and region
```
./prowler -p custom-profile -r us-east-1 -c check11
```
or for a group of checks use group name:
```
./prowler -c check3
./prowler -q -M csv -b
```
Valid check numbers are based on the AWS CIS Benchmark guide, so 1.1 is check11 and 3.10 is check310
4 - If you want to save your report for later analysis:
```
./prowler > prowler-report.txt
```
or if you want a colored HTML report do:
```
pip install ansi2html
./prowler | ansi2html -la > report.html
```
## How to fix every FAIL
5 - For help use:
```
./prowler -h
USAGE:
prowler -p <profile> -r <region> [ -h ]
Options:
-p <profile> specify your AWS profile to use (i.e.: default)
-r <region> specify an AWS region to direct API requests to (i.e.: us-east-1)
-c <checknum> specify a check number or group from the AWS CIS benchmark (i.e.: check11 for check 1.1 or check3 for entire section 3)
-f <filterregion> specify an AWS region to run checks against (i.e.: us-west-1)
-m <maxitems> specify the maximum number of items to return for long-running requests (default: 100)
-b do not use colors in the output
-h this help
```
## How to fix all WARNINGS:
Check your report and fix the issues following all specific guidelines per check in https://benchmarks.cisecurity.org/tools2/amazon/CIS_Amazon_Web_Services_Foundations_Benchmark_v1.1.0.pdf
Check your report and fix the issues following all specific guidelines per check in <https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf>
## Screenshots
- Sample screenshot of report first lines:
<img width="1125" alt="screenshot 2016-09-13 16 05 42" src="https://cloud.githubusercontent.com/assets/3985464/18489640/50fe6824-79cc-11e6-8a9c-e788b88a8a6b.png">
- Sample screnshot of single check for check 3.3:
<img width="1006" alt="screenshot 2016-09-14 13 20 46" src="https://cloud.githubusercontent.com/assets/3985464/18522590/a04ca9a6-7a7e-11e6-8730-b545c9204990.png">
<img width="1125" alt="screenshot 2016-09-13 16 05 42" src="https://cloud.githubusercontent.com/assets/3985464/18489640/50fe6824-79cc-11e6-8a9c-e788b88a8a6b.png">
- Sample of a full report:
- Sample screenshot of single check for check 3.3:
```
$ ./prowler
_
_ __ _ __ _____ _| | ___ _ __
| '_ \| '__/ _ \ \ /\ / / |/ _ \ '__|
| |_) | | | (_) \ V V /| | __/ |
| .__/|_| \___/ \_/\_/ |_|\___|_|
|_| CIS based AWS Account Hardening Tool
Date: Wed Sep 14 13:30:13 EDT 2016
This report is being generated using credentials below:
AWS-CLI Profile: [default] AWS Region: [us-east-1]
--------------------------------------------------------------------------------------
| GetCallerIdentity |
+--------------+-------------------------------------------+-------------------------+
| Account | Arn | UserId |
+--------------+-------------------------------------------+-------------------------+
| XXXXXXXXXXXX| arn:aws:iam::XXXXXXXXXXXX:user/toni | XXXXXXXXXXXXXXXXXXXXX |
+--------------+-------------------------------------------+-------------------------+
Colors Code for results: INFORMATIVE, OK (RECOMMENDED VALUE), CRITICAL (FIX REQUIRED)
Generating AWS IAM Credential Report....COMPLETE
1 Identity and Access Management *********************************
1.1 Avoid the use of the root account (Scored). Last time root account was used
(password last used, access_key_1_last_used, access_key_2_last_used):
2016-08-11T20:59:27+00:00, N/A, N/A
1.2 Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored)
List of users with Password enabled but MFA disabled:
toni
1.3 Ensure credentials unused for 90 days or greater are disabled (Scored)
User list:
toni
1.4 Ensure access keys are rotated every 90 days or less (Scored)
Users with access key 1 older than 90 days:
<root_account>
Users with access key 2 older than 90 days:
1.5 Ensure IAM password policy requires at least one uppercase letter (Scored)
FALSE
1.6 Ensure IAM password policy require at least one lowercase letter (Scored)
FALSE
1.7 Ensure IAM password policy require at least one symbol (Scored)
FALSE
1.8 Ensure IAM password policy require at least one number (Scored)
FALSE
1.9 Ensure IAM password policy requires minimum length of 14 or greater (Scored)
FALSE
1.10 Ensure IAM password policy prevents password reuse (Scored)
FALSE
1.11 Ensure IAM password policy expires passwords within 90 days or less (Scored)
FALSE
1.12 Ensure no root account access key exists (Scored)
Found access key 1
OK No access key 2 found
1.13 Ensure hardware MFA is enabled for the root account (Scored)
OK
1.14 Ensure security questions are registered in the AWS account (Not Scored)
No command available for check 1.14
Login to the AWS Console as root, click on the Account
Name -> My Account -> Configure Security Challenge Questions
1.15 Ensure IAM policies are attached only to groups or roles (Scored)
Users with policy attached to them instead to groups: (it may take few seconds...)
toni
2 Logging ********************************************************
2.1 Ensure CloudTrail is enabled in all regions (Scored)
FALSE
2.2 Ensure CloudTrail log file validation is enabled (Scored)
FALSE
2.3 Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)
WARNING! CloudTrail bucket doesn't exist!
2.4 Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored)
WARNING! No CloudTrail trails found!
2.5 Ensure AWS Config is enabled in all regions (Scored)
WARNING! Region ap-south-1 has AWS Config disabled or not configured
WARNING! Region eu-west-1 has AWS Config disabled or not configured
WARNING! Region ap-southeast-1 has AWS Config disabled or not configured
WARNING! Region ap-southeast-2 has AWS Config disabled or not configured
WARNING! Region eu-central-1 has AWS Config disabled or not configured
WARNING! Region ap-northeast-2 has AWS Config disabled or not configured
WARNING! Region ap-northeast-1 has AWS Config disabled or not configured
WARNING! Region us-east-1 has AWS Config disabled or not configured
WARNING! Region sa-east-1 has AWS Config disabled or not configured
WARNING! Region us-west-1 has AWS Config disabled or not configured
WARNING! Region us-west-2 has AWS Config disabled or not configured
2.6 Ensure S3 bucket access logging is enabled on the CloudTrail S3 bucket (Scored)
WARNING! CloudTrail bucket doesn't exist!
2.7 Ensure CloudTrail logs are encrypted at rest using KMS CMKs (Scored)
WARNING! CloudTrail bucket doesn't exist!
2.8 Ensure rotation for customer created CMKs is enabled (Scored)
Region ap-south-1 doesn't have encryption keys
Region eu-west-1 doesn't have encryption keys
Region ap-southeast-1 doesn't have encryption keys
Region ap-southeast-2 doesn't have encryption keys
Region eu-central-1 doesn't have encryption keys
Region ap-northeast-2 doesn't have encryption keys
Region ap-northeast-1 doesn't have encryption keys
WARNING! Key a0e988df-bc84-423f-996c-XXXX in Region us-east-1 is not set to rotate!
Region sa-east-1 doesn't have encryption keys
Region us-west-1 doesn't have encryption keys
Region us-west-2 doesn't have encryption keys
3 Monitoring *****************************************************
3.1 Ensure a log metric filter and alarm exist for unauthorized API calls (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.2 Ensure a log metric filter and alarm exist for Management Console sign-in without MFA (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.3 Ensure a log metric filter and alarm exist for usage of root account (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.4 Ensure a log metric filter and alarm exist for IAM policy changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.5 Ensure a log metric filter and alarm exist for CloudTrail configuration changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.6 Ensure a log metric filter and alarm exist for AWS Management Console authentication failures (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.7 Ensure a log metric filter and alarm exist for disabling or scheduled deletion of customer created CMKs (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.8 Ensure a log metric filter and alarm exist for S3 bucket policy changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.9 Ensure a log metric filter and alarm exist for AWS Config configuration changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.10 Ensure a log metric filter and alarm exist for security group changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.11 Ensure a log metric filter and alarm exist for changes to Network Access Control Lists (NACL) (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.12 Ensure a log metric filter and alarm exist for changes to network gateways (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.13 Ensure a log metric filter and alarm exist for route table changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.14 Ensure a log metric filter and alarm exist for VPC changes (Scored)
WARNING! No CloudWatch group found, no metric filters or alarms associated
3.15 Ensure security contact information is registered (Scored)
No command available for check 3.15
Login to the AWS Console, click on My Account
Go to Alternate Contacts -> make sure Security section is filled
3.16 Ensure appropriate subscribers to each SNS topic (Not Scored)
Region ap-south-1 doesn't have topics
Region eu-west-1 doesn't have topics
Region ap-southeast-1 doesn't have topics
Region ap-southeast-2 doesn't have topics
Region eu-central-1 doesn't have topics
Region ap-northeast-2 doesn't have topics
Region ap-northeast-1 doesn't have topics
Region us-east-1 doesn't have topics
Region sa-east-1 doesn't have topics
Region us-west-1 doesn't have topics
Region us-west-2 doesn't have topics
4 Networking **************************************************
4.1 Ensure no security groups allow ingress from 0.0.0.0/0 to port 22 (Scored)
OK, No Security Groups found in ap-south-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in eu-west-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-southeast-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-southeast-2 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in eu-central-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-northeast-2 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-northeast-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-east-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in sa-east-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-west-1 with port 22 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-west-2 with port 22 TCP open to 0.0.0.0/0
4.2 Ensure no security groups allow ingress from 0.0.0.0/0 to port 3389 (Scored)
OK, No Security Groups found in ap-south-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in eu-west-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-southeast-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-southeast-2 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in eu-central-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-northeast-2 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in ap-northeast-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-east-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in sa-east-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-west-1 with port 3389 TCP open to 0.0.0.0/0
OK, No Security Groups found in us-west-2 with port 3389 TCP open to 0.0.0.0/0
4.3 Ensure VPC Flow Logging is Enabled in all Applicable Regions (Scored)
WARNING! no VPCFlowLog has been found in Region ap-south-1
WARNING! no VPCFlowLog has been found in Region eu-west-1
WARNING! no VPCFlowLog has been found in Region ap-southeast-1
WARNING! no VPCFlowLog has been found in Region ap-southeast-2
WARNING! no VPCFlowLog has been found in Region eu-central-1
WARNING! no VPCFlowLog has been found in Region ap-northeast-2
WARNING! no VPCFlowLog has been found in Region ap-northeast-1
WARNING! no VPCFlowLog has been found in Region us-east-1
WARNING! no VPCFlowLog has been found in Region sa-east-1
WARNING! no VPCFlowLog has been found in Region us-west-1
WARNING! no VPCFlowLog has been found in Region us-west-2
4.4 Ensure the default security group restricts all traffic (Scored)
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region ap-south-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region eu-west-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region ap-southeast-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region ap-southeast-2
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region eu-central-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region ap-northeast-2
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region ap-northeast-1
OK, no Default Security Groups open to 0.0.0.0 found in Region us-east-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region sa-east-1
WARNING! Default Security Groups found that allow 0.0.0.0 IN or OUT traffic in Region us-west-1
OK, no Default Security Groups open to 0.0.0.0 found in Region us-west-2
- For more information and reference:
https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
```
<img width="1006" alt="screenshot 2016-09-14 13 20 46" src="https://cloud.githubusercontent.com/assets/3985464/18522590/a04ca9a6-7a7e-11e6-8730-b545c9204990.png">
## Troubleshooting
### STS expired token
If you are using an STS token for AWS-CLI and your session is expired you probably get this error:
```
A client error (ExpiredToken) occurred when calling the GenerateCredentialReport operation: The security token included in the request is expired
```
To fix it, please renew your token by authenticating again to the AWS API.
To fix it, please renew your token by authenticating again to the AWS API, see next section below if you use MFA.
### Run Prowler with MFA protected credentials
To run Prowler using a profile that requires MFA you just need to get the session token before hand. Just make sure you use this command:
```
aws --profile <YOUR_AWS_PROFILE> sts get-session-token --duration 129600 --serial-number <ARN_OF_MFA> --token-code <MFA_TOKEN_CODE> --output text
```
Once you get your token you can export it as environment variable:
```
export AWS_PROFILE=YOUR_AWS_PROFILE
export AWS_SESSION_TOKEN=YOUR_NEW_TOKEN
AWS_SECRET_ACCESS_KEY=YOUR_SECRET
export AWS_ACCESS_KEY_ID=YOUR_KEY
```
or set manually up your `~/.aws/credentials` file properly.
There are some helpfull tools to save time in this process like [aws-mfa-script](https://github.com/asagage/aws-mfa-script) or [aws-cli-mfa](https://github.com/sweharris/aws-cli-mfa).
### Custom IAM Policy
Instead of using default policy SecurityAudit for the account you use for checks you may need to create a custom policy with a few more permissions (get and list, not change!) here you go a good example for a "ProwlerPolicyReadOnly":
Some new and specific checks require Prowler to inherit more permissions than SecurityAudit to work properly. In addition to the AWS managed policy "SecurityAudit" for the role you use for checks you may need to create a custom policy with a few more permissions (get and list and additional services mostly). Here you go a good example for a "ProwlerReadOnlyPolicy" (see below bootstrap script for set it up):
[iam/prowler-additions-policy.json](iam/prowler-additions-policy.json)
> Note: Action `ec2:get*` is included in "ProwlerReadOnlyPolicy" policy above, that includes `get-password-data`, type `aws ec2 get-password-data help` to better understand its implications.
### Bootstrap Script
Quick bash script to set up a "prowler" IAM user with "SecurityAudit" group with the required permissions (including "ProwlerReadOnlyPolicy"). To run the script below, you need user with administrative permissions; set the `AWS_DEFAULT_PROFILE` to use that account:
```sh
export AWS_DEFAULT_PROFILE=default
export ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' | tr -d '"')
aws iam create-group --group-name SecurityAudit
aws iam create-policy --policy-name ProwlerReadOnlyPolicy --policy-document file://$(pwd)/iam/prowler-additions-policy.json
aws iam attach-group-policy --group-name SecurityAudit --policy-arn arn:aws:iam::aws:policy/SecurityAudit
aws iam attach-group-policy --group-name SecurityAudit --policy-arn arn:aws:iam::${ACCOUNT_ID}:policy/ProwlerReadOnlyPolicy
aws iam create-user --user-name prowler
aws iam add-user-to-group --user-name prowler --group-name SecurityAudit
aws iam create-access-key --user-name prowler
unset ACCOUNT_ID AWS_DEFAULT_PROFILE
```
The `aws iam create-access-key` command will output the secret access key and the key id; keep these somewhere safe, and add them to `~/.aws/credentials` with an appropriate profile name to use them with prowler. This is the only time they secret key will be shown. If you lose it, you will need to generate a replacement.
## Extras
We are adding additional checks to improve the information gather from each account, these checks are out of the scope of the CIS benchmark for AWS but we consider them very helpful to get to know each AWS account set up and find issues on it.
Some of these checks look for publicly facing resources may not actually be fully public due to other layered controls like S3 Bucket Policies, Security Groups or Network ACLs.
To list all existing checks please run the command below:
```
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"acm:describecertificate",
"acm:listcertificates",
"autoscaling:describe*",
"cloudformation:describestack*",
"cloudformation:getstackpolicy",
"cloudformation:gettemplate",
"cloudformation:liststack*",
"cloudfront:get*",
"cloudfront:list*",
"cloudtrail:describetrails",
"cloudtrail:gettrailstatus",
"cloudtrail:listtags",
"cloudwatch:describe*",
"cloudwatchlogs:describeloggroups",
"cloudwatchlogs:describemetricfilters",
"codecommit:batchgetrepositories",
"codecommit:getbranch",
"codecommit:getobjectidentifier",
"codecommit:getrepository",
"codecommit:list*",
"codedeploy:batch*",
"codedeploy:get*",
"codedeploy:list*",
"config:deliver*",
"config:describe*",
"config:get*",
"datapipeline:describeobjects",
"datapipeline:describepipelines",
"datapipeline:evaluateexpression",
"datapipeline:getpipelinedefinition",
"datapipeline:listpipelines",
"datapipeline:queryobjects",
"datapipeline:validatepipelinedefinition",
"directconnect:describe*",
"dynamodb:listtables",
"ec2:describe*",
"ecs:describe*",
"ecs:list*",
"elasticache:describe*",
"elasticbeanstalk:describe*",
"elasticloadbalancing:describe*",
"elasticmapreduce:describejobflows",
"elasticmapreduce:listclusters",
"es:describeelasticsearchdomainconfig",
"es:listdomainnames",
"firehose:describe*",
"firehose:list*",
"glacier:listvaults",
"iam:generatecredentialreport",
"iam:get*",
"iam:list*",
"kms:describe*",
"kms:get*",
"kms:list*",
"lambda:getpolicy",
"lambda:listfunctions",
"logs:DescribeMetricFilters",
"rds:describe*",
"rds:downloaddblogfileportion",
"rds:listtagsforresource",
"redshift:describe*",
"route53:getchange",
"route53:getcheckeripranges",
"route53:getgeolocations",
"route53:gethealthcheck",
"route53:gethealthcheckcount",
"route53:gethealthchecklastfailurereason",
"route53:gethostedzone",
"route53:gethostedzonecount",
"route53:getreusabledelegationset",
"route53:listgeolocations",
"route53:listhealthchecks",
"route53:listhostedzones",
"route53:listhostedzonesbyname",
"route53:listresourcerecordsets",
"route53:listreusabledelegationsets",
"route53:listtagsforresource",
"route53:listtagsforresources",
"route53domains:getdomaindetail",
"route53domains:getoperationdetail",
"route53domains:listdomains",
"route53domains:listoperations",
"route53domains:listtagsfordomain",
"s3:getbucket*",
"s3:getlifecycleconfiguration",
"s3:getobjectacl",
"s3:getobjectversionacl",
"s3:listallmybuckets",
"sdb:domainmetadata",
"sdb:listdomains",
"ses:getidentitydkimattributes",
"ses:getidentityverificationattributes",
"ses:listidentities",
"ses:listverifiedemailaddresses",
"ses:sendemail",
"sns:gettopicattributes",
"sns:listsubscriptionsbytopic",
"sns:listtopics",
"sqs:getqueueattributes",
"sqs:listqueues",
"tag:getresources",
"tag:gettagkeys"
],
"Effect": "Allow",
"Resource": "*"
}]
}
./prowler -l
```
>There are some checks not included in that list, they are experimental or checks that takes long to run like `extra759` and `extra760` (search for secrets in Lambda function variables and code).
To check all extras in one command:
```sh
./prowler -g extras
```
or to run just one of the checks:
```sh
./prowler -c extraNUMBER
```
## Forensics Ready Checks
With this group of checks, Prowler looks if each service with logging or audit capabilities has them enabled to ensure all needed evidences are recorded and collected for an eventual digital forensic investigation in case of incident. List of checks part of this group (you can also see all groups with `./prowler -L`). The list of checks can be seen in the group file at:
[groups/group8_forensics](groups/group8_forensics)
The `forensics-ready` group of checks uses existing and extra checks. To get a forensics readiness report, run this command:
```sh
./prowler -g forensics-ready
```
## GDPR Checks
With this group of checks, Prowler shows result of checks related to GDPR, more information [here](https://github.com/toniblyx/prowler/issues/189). The list of checks can be seen in the group file at:
[groups/group9_gdpr](groups/group9_gdpr)
The `gdpr` group of checks uses existing and extra checks. To get a GDPR report, run this command:
```sh
./prowler -g gdpr
```
## HIPAA Checks
With this group of checks, Prowler shows results of controls related to the "Security Rule" of the Health Insurance Portability and Accountability Act aka [HIPAA](https://www.hhs.gov/hipaa/for-professionals/security/index.html) as defined in [45 CFR Subpart C - Security Standards for the Protection of Electronic Protected Health Information](https://www.law.cornell.edu/cfr/text/45/part-164/subpart-C) within [PART 160 - GENERAL ADMINISTRATIVE REQUIREMENTS](https://www.law.cornell.edu/cfr/text/45/part-160) and [Subpart A](https://www.law.cornell.edu/cfr/text/45/part-164/subpart-A) and [Subpart C](https://www.law.cornell.edu/cfr/text/45/part-164/subpart-C) of PART 164 - SECURITY AND PRIVACY
More information on the original PR is [here](https://github.com/toniblyx/prowler/issues/227).
### Note on Business Associate Addendum's (BAA)
Under the HIPAA regulations, cloud service providers (CSPs) such as AWS are considered business associates. The Business Associate Addendum (BAA) is an AWS contract that is required under HIPAA rules to ensure that AWS appropriately safeguards protected health information (PHI). The BAA also serves to clarify and limit, as appropriate, the permissible uses and disclosures of PHI by AWS, based on the relationship between AWS and our customers, and the activities or services being performed by AWS. Customers may use any AWS service in an account designated as a HIPAA account, but they should only process, store, and transmit protected health information (PHI) in the HIPAA-eligible services defined in the Business Associate Addendum (BAA). For the latest list of HIPAA-eligible AWS services, see [HIPAA Eligible Services Reference](https://aws.amazon.com/compliance/hipaa-eligible-services-reference/).
More information on AWS & HIPAA can be found [here](https://aws.amazon.com/compliance/hipaa-compliance/)
The list of checks showed by this group is as follows, they will be mostly relevant for Subsections [164.306 Security standards: General rules](https://www.law.cornell.edu/cfr/text/45/164.306) and [164.312 Technical safeguards](https://www.law.cornell.edu/cfr/text/45/164.312). Prowler is only able to make checks in the spirit of the technical requirements outlined in these Subsections, and cannot cover all procedural controls required. They be found in the group file at:
[groups/group10_hipaa](groups/group10_hipaa)
The `hipaa` group of checks uses existing and extra checks. To get a HIPAA report, run this command:
```sh
./prowler -g hipaa
```
## Add Custom Checks
In order to add any new check feel free to create a new extra check in the extras group or other group. To do so, you will need to follow these steps:
1. Follow structure in file `checks/check_sample`
2. Name your check with a number part of an existing group or a new one
3. Save changes and run it as `./prowler -c extraNN`
4. Send me a pull request! :)
## Add Custom Groups
1. Follow structure in file `groups/groupN_sample`
1. Name your group with a non existing number
1. Save changes and run it as `./prowler -g extraNN`
1. Send me a pull request! :)
- You can also create a group with only the checks that you want to perform in your company, for instance a group named `group9_mycompany` with only the list of checks that you care or your particular compliance applies.
## Third Party Integrations
### AWS Security Hub
There is a blog post about that integration in the AWS Security blog here <https://aws.amazon.com/blogs/security/use-aws-fargate-prowler-send-security-configuration-findings-about-aws-services-security-hub/>
### Telegram
Javier Pecete has done an awesome job integrating Prowler with Telegram, you have more details here <https://github.com/i4specete/ServerTelegramBot>
### Cloud Security Suite
The guys of SecurityFTW have added Prowler in their Cloud Security Suite along with other cool security tools <https://github.com/SecurityFTW/cs-suite>
## License
All CIS based checks in the checks folder are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License.
The link to the license terms can be found at
<https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode>
Any other piece of code is licensed as Apache License 2.0 as specified in each file. You may obtain a copy of the License at
<http://www.apache.org/licenses/LICENSE-2.0>
NOTE: If you are interested in using Prowler for commercial purposes remember that due to the CC4.0 license “The distributors or partners that are interested and using Prowler would need to enroll as CIS SecureSuite Members to incorporate this product, which includes references to CIS resources, in their offering.". Information about CIS pricing for vendors here: <https://www.cisecurity.org/cis-securesuite/pricing-and-categories/product-vendor/>
**I'm not related anyhow with CIS organization, I just write and maintain Prowler to help companies over the world to make their cloud infrastructure more secure.**
If you want to contact me visit <https://blyx.com/contact>

37
checks/check11 Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check11="1.1,1.01"
CHECK_TITLE_check11="[check11] Avoid the use of the root account (Scored)"
CHECK_SCORED_check11="SCORED"
CHECK_TYPE_check11="LEVEL1"
CHECK_ALTERNATE_check101="check11"
check11(){
# "Avoid the use of the root account (Scored)."
MAX_DAYS=-1
last_login_dates=$(cat $TEMP_REPORT_FILE | awk -F, '{ print $1,$5,$11,$16 }' | grep '<root_account>' | cut -d' ' -f2,3,4)
failures=0
for date in $last_login_dates; do
if [[ ${date%T*} =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]];then
days_not_in_use=$(how_many_days_from_today ${date%T*})
if [ "$days_not_in_use" -gt "$MAX_DAYS" ];then
failures=1
textFail "Root user in the account was last accessed ${MAX_DAYS#-} day ago"
break
fi
fi
done
if [[ $failures == 0 ]]; then
textPass "Root user in the account wasn't accessed in the last ${MAX_DAYS#-} days"
fi
}

29
checks/check110 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check110="1.10"
CHECK_TITLE_check110="[check110] Ensure IAM password policy prevents password reuse: 24 or greater (Scored)"
CHECK_SCORED_check110="SCORED"
CHECK_TYPE_check110="LEVEL1"
CHECK_ALTERNATE_check110="check110"
check110(){
# "Ensure IAM password policy prevents password reuse: 24 or greater (Scored)"
COMMAND110=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --query 'PasswordPolicy.PasswordReusePrevention' --output text 2> /dev/null)
if [[ $COMMAND110 ]];then
if [[ $COMMAND110 -gt "23" ]];then
textPass "Password Policy limits reuse"
else
textFail "Password Policy has weak reuse requirement (lower than 24)"
fi
else
textFail "Password Policy missing reuse requirement"
fi
}

29
checks/check111 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check111="1.11"
CHECK_TITLE_check111="[check111] Ensure IAM password policy expires passwords within 90 days or less (Scored)"
CHECK_SCORED_check111="SCORED"
CHECK_TYPE_check111="LEVEL1"
CHECK_ALTERNATE_check111="check111"
check111(){
# "Ensure IAM password policy expires passwords within 90 days or less (Scored)"
COMMAND111=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --query PasswordPolicy.MaxPasswordAge --output text 2> /dev/null)
if [[ $COMMAND111 == [0-9]* ]];then
if [[ "$COMMAND111" -le "90" ]];then
textPass "Password Policy includes expiration (Value: $COMMAND111)"
else
textFail "Password expiration is set greater than 90 days"
fi
else
textFail "Password expiration is not set"
fi
}

32
checks/check112 Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check112="1.12"
CHECK_TITLE_check112="[check112] Ensure no root account access key exists (Scored)"
CHECK_SCORED_check112="SCORED"
CHECK_TYPE_check112="LEVEL1"
CHECK_ALTERNATE_check112="check112"
check112(){
# "Ensure no root account access key exists (Scored)"
# ensure the access_key_1_active and access_key_2_active fields are set to FALSE.
ROOTKEY1=$(cat $TEMP_REPORT_FILE |grep root_account|awk -F',' '{ print $9 }')
ROOTKEY2=$(cat $TEMP_REPORT_FILE |grep root_account|awk -F',' '{ print $14 }')
if [ "$ROOTKEY1" == "false" ];then
textPass "No access key 1 found for root"
else
textFail "Found access key 1 for root "
fi
if [ "$ROOTKEY2" == "false" ];then
textPass "No access key 2 found for root"
else
textFail "Found access key 2 for root "
fi
}

25
checks/check113 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check113="1.13"
CHECK_TITLE_check113="[check113] Ensure MFA is enabled for the root account (Scored)"
CHECK_SCORED_check113="SCORED"
CHECK_TYPE_check113="LEVEL1"
CHECK_ALTERNATE_check113="check113"
check113(){
# "Ensure MFA is enabled for the root account (Scored)"
COMMAND113=$($AWSCLI iam get-account-summary $PROFILE_OPT --region $REGION --output json --query 'SummaryMap.AccountMFAEnabled')
if [ "$COMMAND113" == "1" ]; then
textPass "Virtual MFA is enabled for root"
else
textFail "MFA is not ENABLED for root account "
fi
}

30
checks/check114 Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check114="1.14"
CHECK_TITLE_check114="[check114] Ensure hardware MFA is enabled for the root account (Scored)"
CHECK_SCORED_check114="SCORED"
CHECK_TYPE_check114="LEVEL2"
CHECK_ALTERNATE_check114="check114"
check114(){
# "Ensure hardware MFA is enabled for the root account (Scored)"
COMMAND113=$($AWSCLI iam get-account-summary $PROFILE_OPT --region $REGION --output json --query 'SummaryMap.AccountMFAEnabled')
if [ "$COMMAND113" == "1" ]; then
COMMAND114=$($AWSCLI iam list-virtual-mfa-devices $PROFILE_OPT --region $REGION --output text --assignment-status Assigned --query 'VirtualMFADevices[*].[SerialNumber]' | grep '^arn:aws:iam::[0-9]\{12\}:mfa/root-account-mfa-device$')
if [[ "$COMMAND114" ]]; then
textFail "Only Virtual MFA is enabled for root"
else
textPass "Hardware MFA is enabled for root "
fi
else
textFail "MFA is not ENABLED for root account "
fi
}

22
checks/check115 Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check115="1.15"
CHECK_TITLE_check115="[check115] Ensure security questions are registered in the AWS account (Not Scored)"
CHECK_SCORED_check115="NOT_SCORED"
CHECK_TYPE_check115="LEVEL1"
CHECK_ALTERNATE_check115="check115"
check115(){
# "Ensure security questions are registered in the AWS account (Not Scored)"
textInfo "No command available for check 1.15 "
textInfo "Login to the AWS Console as root & click on the Account "
textInfo "Name -> My Account -> Configure Security Challenge Questions "
}

36
checks/check116 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check116="1.16"
CHECK_TITLE_check116="[check116] Ensure IAM policies are attached only to groups or roles (Scored)"
CHECK_SCORED_check116="SCORED"
CHECK_TYPE_check116="LEVEL1"
CHECK_ALTERNATE_check116="check116"
check116(){
# "Ensure IAM policies are attached only to groups or roles (Scored)"
LIST_USERS=$($AWSCLI iam list-users --query 'Users[*].UserName' --output text $PROFILE_OPT --region $REGION)
C116_NUM_USERS=0
for user in $LIST_USERS;do
USER_POLICY=$($AWSCLI iam list-attached-user-policies --output text $PROFILE_OPT --region $REGION --user-name $user)
if [[ $USER_POLICY ]]; then
textFail "$user has managed policy directly attached "
C116_NUM_USERS=$(expr $C116_NUM_USERS + 1)
fi
USER_POLICY=$($AWSCLI iam list-user-policies --output text $PROFILE_OPT --region $REGION --user-name $user)
if [[ $USER_POLICY ]]; then
textFail "$user has inline policy directly attached "
C116_NUM_USERS=$(expr $C116_NUM_USERS + 1)
fi
done
if [[ $C116_NUM_USERS -eq 0 ]]; then
textPass "No policies attached to users."
fi
}

22
checks/check117 Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check117="1.17"
CHECK_TITLE_check117="[check117] Maintain current contact details (Not Scored)"
CHECK_SCORED_check117="NOT_SCORED"
CHECK_TYPE_check117="LEVEL1"
CHECK_ALTERNATE_check117="check117"
check117(){
# "Maintain current contact details (Scored)"
# No command available
textInfo "No command available for check 1.17 "
textInfo "See section 1.17 on the CIS Benchmark guide for details "
}

22
checks/check118 Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check118="1.18"
CHECK_TITLE_check118="[check118] Ensure security contact information is registered (Not Scored)"
CHECK_SCORED_check118="NOT_SCORED"
CHECK_TYPE_check118="LEVEL1"
CHECK_ALTERNATE_check118="check118"
check118(){
# "Ensure security contact information is registered (Scored)"
# No command available
textInfo "No command available for check 1.18 "
textInfo "See section 1.18 on the CIS Benchmark guide for details "
}

35
checks/check119 Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check119="1.19"
CHECK_TITLE_check119="[check119] Ensure IAM instance roles are used for AWS resource access from instances (Not Scored)"
CHECK_SCORED_check119="NOT_SCORED"
CHECK_TYPE_check119="LEVEL2"
CHECK_ALTERNATE_check119="check119"
check119(){
for regx in $REGIONS; do
EC2_DATA=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[].Instances[].[InstanceId, IamInstanceProfile.Arn]')
EC2_DATA=$(echo $EC2_DATA | jq '.[]|{InstanceId: .[0], ProfileArn: .[1]}')
INSTANCE_LIST=$(echo $EC2_DATA | jq -r '.InstanceId')
if [[ $INSTANCE_LIST ]]; then
for instance in $INSTANCE_LIST; do
PROFILEARN=$(echo $EC2_DATA | jq -r --arg i "$instance" 'select(.InstanceId==$i)|.ProfileArn')
if [[ $PROFILEARN == "null" ]]; then
textFail "$regx: Instance $instance not associated with an instance role." $regx
else
textPass "$regx: Instance $instance associated with role ${PROFILEARN##*/}." $regx
fi
done
else
textInfo "$regx: No EC2 instances found" $regx
fi
done
}

32
checks/check12 Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check12="1.2,1.02"
CHECK_TITLE_check12="[check12] Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored)"
CHECK_SCORED_check12="SCORED"
CHECK_TYPE_check12="LEVEL1"
CHECK_ALTERNATE_check102="check12"
check12(){
# "Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored)"
# List users with password enabled
COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED=$(cat $TEMP_REPORT_FILE|awk -F, '{ print $1,$4 }' |grep true | awk '{ print $1 }')
COMMAND12=$(
for i in $COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED; do
cat $TEMP_REPORT_FILE|awk -F, '{ print $1,$8 }' |grep "^$i " |grep false | awk '{ print $1 }'
done)
if [[ $COMMAND12 ]]; then
for u in $COMMAND12; do
textFail "User $u has Password enabled but MFA disabled"
done
else
textPass "No users found with Password enabled and MFA disabled"
fi
}

37
checks/check120 Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check120="1.20"
CHECK_TITLE_check120="[check120] Ensure a support role has been created to manage incidents with AWS Support (Scored)"
CHECK_SCORED_check120="SCORED"
CHECK_TYPE_check120="LEVEL1"
CHECK_ALTERNATE_check120="check120"
check120(){
# "Ensure a support role has been created to manage incidents with AWS Support (Scored)"
SUPPORTPOLICYARN=$($AWSCLI iam list-policies --query "Policies[?PolicyName == 'AWSSupportAccess'].Arn" $PROFILE_OPT --region $REGION --output text)
if [[ $SUPPORTPOLICYARN ]];then
for policyarn in $SUPPORTPOLICYARN;do
POLICYROLES=$($AWSCLI iam list-entities-for-policy --policy-arn $SUPPORTPOLICYARN $PROFILE_OPT --region $REGION --output text | awk -F$'\t' '{ print $3 }')
if [[ $POLICYROLES ]];then
for name in $POLICYROLES; do
textPass "Support Policy attached to $name"
done
# for user in $(echo "$POLICYUSERS" | grep UserName | cut -d'"' -f4) ; do
# textInfo "User $user has support access via $policyarn"
# done
else
textFail "Support Policy not applied to any Role "
fi
done
else
textFail "No Support Policy found"
fi
}

40
checks/check121 Normal file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check121="1.21"
CHECK_TITLE_check121="[check121] Do not setup access keys during initial user setup for all IAM users that have a console password (Not Scored)"
CHECK_SCORED_check121="NOT_SCORED"
CHECK_TYPE_check121="LEVEL1"
CHECK_ALTERNATE_check121="check121"
check121(){
# "Do not setup access keys during initial user setup for all IAM users that have a console password (Not Scored)"
LIST_USERS=$($AWSCLI iam list-users --query 'Users[*].UserName' --output text $PROFILE_OPT --region $REGION)
# List of USERS with KEY1 last_used_date as N/A
LIST_USERS_KEY1_NA=$(for user in $LIST_USERS; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$11 }'|grep N/A |awk '{ print $1 }'; done)
LIST_USERS_KEY1_ACTIVE=$(for user in $LIST_USERS_KEY1_NA; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$9 }'|grep "true$"|awk '{ print $1 }'|sed 's/[[:blank:]]+/,/g' ; done)
if [[ $LIST_USERS_KEY1_ACTIVE ]]; then
for user in $LIST_USERS_KEY1_ACTIVE; do
textFail "$user has never used Access Key 1"
done
else
textPass "No users found with Access Key 1 never used"
fi
# List of USERS with KEY2 last_used_date as N/A
LIST_USERS_KEY2_NA=$(for user in $LIST_USERS; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$16 }'|grep N/A |awk '{ print $1 }' ; done)
LIST_USERS_KEY2_ACTIVE=$(for user in $LIST_USERS_KEY2_NA; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$14 }'|grep "true$" |awk '{ print $1 }' ; done)
if [[ $LIST_USERS_KEY2_ACTIVE ]]; then
for user in $LIST_USERS_KEY2_ACTIVE; do
textFail "$user has never used Access Key 2"
done
else
textPass "No users found with Access Key 2 never used"
fi
}

41
checks/check122 Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check122="1.22"
CHECK_TITLE_check122="[check122] Ensure IAM policies that allow full \"*:*\" administrative privileges are not created (Scored)"
CHECK_SCORED_check122="SCORED"
CHECK_TYPE_check122="LEVEL1"
CHECK_ALTERNATE_check122="check122"
check122(){
# "Ensure IAM policies that allow full \"*:*\" administrative privileges are not created (Scored)"
LIST_CUSTOM_POLICIES=$($AWSCLI iam list-policies --output text $PROFILE_OPT --region $REGION --scope Local --query 'Policies[*].[Arn,DefaultVersionId]' | grep -v -e '^None$' | awk -F '\t' '{print $1","$2"\n"}')
if [[ $LIST_CUSTOM_POLICIES ]]; then
textInfo "Looking for custom policies: (skipping default policies - it may take few seconds...)"
for policy in $LIST_CUSTOM_POLICIES; do
POLICY_ARN=$(echo $policy | awk -F ',' '{print $1}')
POLICY_VERSION=$(echo $policy | awk -F ',' '{print $2}')
POLICY_WITH_FULL=$($AWSCLI iam get-policy-version --output text --policy-arn $POLICY_ARN --version-id $POLICY_VERSION --query "[PolicyVersion.Document.Statement] | [] | [?Action!=null] | [?Effect == 'Allow' && Resource == '*' && Action == '*']" $PROFILE_OPT --region $REGION)
if [[ $POLICY_WITH_FULL ]]; then
POLICIES_ALLOW_LIST="$POLICIES_ALLOW_LIST $POLICY_ARN"
fi
done
if [[ $POLICIES_ALLOW_LIST ]]; then
textInfo "List of custom policies: "
for policy in $POLICIES_ALLOW_LIST; do
textFail "Policy $policy allows \"*:*\""
done
else
textPass "No custom policy found that allow full \"*:*\" administrative privileges"
fi
else
textPass "No custom policies found"
fi
}

39
checks/check13 Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check13="1.3,1.03"
CHECK_TITLE_check13="[check13] Ensure credentials unused for 90 days or greater are disabled (Scored)"
CHECK_SCORED_check13="SCORED"
CHECK_TYPE_check13="LEVEL1"
CHECK_ALTERNATE_check103="check13"
check13(){
# "Ensure credentials unused for 90 days or greater are disabled (Scored)"
COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED=$(cat $TEMP_REPORT_FILE|awk -F, '{ print $1,$4 }' |grep true | awk '{ print $1 }')
# Only check Password last used for users with password enabled
if [[ $COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED ]]; then
for i in $COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED; do
DATEUSED=$($AWSCLI iam list-users --query "Users[?UserName=='$i'].PasswordLastUsed" --output text $PROFILE_OPT --region $REGION | cut -d'T' -f1)
if [ "$DATEUSED" == "" ]
then
textFail "User \"$i\" has not logged in during the last 90 days "
else
HOWOLDER=$(how_older_from_today $DATEUSED)
if [ $HOWOLDER -gt "90" ];then
textFail "User \"$i\" has not logged in during the last 90 days "
else
textPass "User \"$i\" found with credentials used in the last 90 days"
fi
fi
done
else
textPass "No users found with password enabled"
fi
}

59
checks/check14 Normal file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check14="1.4,1.04"
CHECK_TITLE_check14="[check14] Ensure access keys are rotated every 90 days or less (Scored)"
CHECK_SCORED_check14="SCORED"
CHECK_TYPE_check14="LEVEL1"
CHECK_ALTERNATE_check104="check14"
check14(){
# "Ensure access keys are rotated every 90 days or less (Scored)" # also checked by Security Monkey
LIST_OF_USERS_WITH_ACCESS_KEY1=$(cat $TEMP_REPORT_FILE| awk -F, '{ print $1, $9 }' |grep "\ true" | awk '{ print $1 }')
LIST_OF_USERS_WITH_ACCESS_KEY2=$(cat $TEMP_REPORT_FILE| awk -F, '{ print $1, $14 }' |grep "\ true" | awk '{ print $1 }')
C14_NUM_USERS1=0
C14_NUM_USERS2=0
if [[ $LIST_OF_USERS_WITH_ACCESS_KEY1 ]]; then
# textFail "Users with access key 1 older than 90 days:"
for user in $LIST_OF_USERS_WITH_ACCESS_KEY1; do
# check access key 1
DATEROTATED1=$(cat $TEMP_REPORT_FILE | grep -v user_creation_time | grep "^${user},"| awk -F, '{ print $10 }' | grep -v "N/A" | awk -F"T" '{ print $1 }')
HOWOLDER=$(how_older_from_today $DATEROTATED1)
if [ $HOWOLDER -gt "90" ];then
textFail " $user has not rotated access key1 in over 90 days."
C14_NUM_USERS1=$(expr $C14_NUM_USERS1 + 1)
fi
done
if [[ $C14_NUM_USERS1 -eq 0 ]]; then
textPass "No users with access key 1 older than 90 days."
fi
else
textPass "No users with access key 1."
fi
if [[ $LIST_OF_USERS_WITH_ACCESS_KEY2 ]]; then
# textFail "Users with access key 2 older than 90 days:"
for user in $LIST_OF_USERS_WITH_ACCESS_KEY2; do
# check access key 2
DATEROTATED2=$(cat $TEMP_REPORT_FILE | grep -v user_creation_time | grep "^${user},"| awk -F, '{ print $15 }' | grep -v "N/A" | awk -F"T" '{ print $1 }')
HOWOLDER=$(how_older_from_today $DATEROTATED2)
if [ $HOWOLDER -gt "90" ];then
textFail " $user has not rotated access key2 in over 90 days. "
C14_NUM_USERS2=$(expr $C14_NUM_USERS2 + 1)
fi
done
if [[ $C14_NUM_USERS2 -eq 0 ]]; then
textPass "No users with access key 2 older than 90 days."
fi
else
textPass "No users with access key 2."
fi
}

25
checks/check15 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check15="1.5,1.05"
CHECK_TITLE_check15="[check15] Ensure IAM password policy requires at least one uppercase letter (Scored)"
CHECK_SCORED_check15="SCORED"
CHECK_TYPE_check15="LEVEL1"
CHECK_ALTERNATE_check105="check15"
check15(){
# "Ensure IAM password policy requires at least one uppercase letter (Scored)"
COMMAND15=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --output json --query 'PasswordPolicy.RequireUppercaseCharacters' 2> /dev/null) # must be true
if [[ "$COMMAND15" == "true" ]];then
textPass "Password Policy requires upper case"
else
textFail "Password Policy missing upper-case requirement"
fi
}

25
checks/check16 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check16="1.6,1.06"
CHECK_TITLE_check16="[check16] Ensure IAM password policy require at least one lowercase letter (Scored)"
CHECK_SCORED_check16="SCORED"
CHECK_TYPE_check16="LEVEL1"
CHECK_ALTERNATE_check106="check16"
check16(){
# "Ensure IAM password policy require at least one lowercase letter (Scored)"
COMMAND16=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --output json --query 'PasswordPolicy.RequireLowercaseCharacters' 2> /dev/null) # must be true
if [[ "$COMMAND16" == "true" ]];then
textPass "Password Policy requires lower case"
else
textFail "Password Policy missing lower-case requirement"
fi
}

25
checks/check17 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check17="1.7,1.07"
CHECK_TITLE_check17="[check17] Ensure IAM password policy require at least one symbol (Scored)"
CHECK_SCORED_check17="SCORED"
CHECK_TYPE_check17="LEVEL1"
CHECK_ALTERNATE_check107="check17"
check17(){
# "Ensure IAM password policy require at least one symbol (Scored)"
COMMAND17=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --output json --query 'PasswordPolicy.RequireSymbols' 2> /dev/null) # must be true
if [[ "$COMMAND17" == "true" ]];then
textPass "Password Policy requires symbol"
else
textFail "Password Policy missing symbol requirement"
fi
}

25
checks/check18 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check18="1.8,1.08"
CHECK_TITLE_check18="[check18] Ensure IAM password policy require at least one number (Scored)"
CHECK_SCORED_check18="SCORED"
CHECK_TYPE_check18="LEVEL1"
CHECK_ALTERNATE_check108="check18"
check18(){
# "Ensure IAM password policy require at least one number (Scored)"
COMMAND18=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --output json --query 'PasswordPolicy.RequireNumbers' 2> /dev/null) # must be true
if [[ "$COMMAND18" == "true" ]];then
textPass "Password Policy requires number"
else
textFail "Password Policy missing number requirement"
fi
}

25
checks/check19 Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check19="1.9,1.09"
CHECK_TITLE_check19="[check19] Ensure IAM password policy requires minimum length of 14 or greater (Scored)"
CHECK_SCORED_check19="SCORED"
CHECK_TYPE_check19="LEVEL1"
CHECK_ALTERNATE_check109="check19"
check19(){
# "Ensure IAM password policy requires minimum length of 14 or greater (Scored)"
COMMAND19=$($AWSCLI iam get-account-password-policy $PROFILE_OPT --region $REGION --output json --query 'PasswordPolicy.MinimumPasswordLength' 2> /dev/null)
if [[ $COMMAND19 -gt "13" ]];then
textPass "Password Policy requires more than 13 characters"
else
textFail "Password Policy missing or weak length requirement"
fi
}

39
checks/check21 Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check21="2.1,2.01"
CHECK_TITLE_check21="[check21] Ensure CloudTrail is enabled in all regions (Scored)"
CHECK_SCORED_check21="SCORED"
CHECK_TYPE_check21="LEVEL1"
CHECK_ALTERNATE_check201="check21"
check21(){
trail_count=0
# "Ensure CloudTrail is enabled in all regions (Scored)"
for regx in $REGIONS; do
LIST_OF_TRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].Name' --output text --no-include-shadow-trails)
if [[ $LIST_OF_TRAILS ]];then
for trail in $LIST_OF_TRAILS;do
trail_count=$((trail_count + 1))
MULTIREGION_TRAIL_STATUS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].IsMultiRegionTrail' --output text --trail-name-list $trail)
if [[ "$MULTIREGION_TRAIL_STATUS" == 'False' ]];then
textFail "$trail trail in $regx is not enabled in multi region mode"
else
textPass "$trail trail in $regx is enabled for all regions"
fi
done
fi
done
if [[ $trail_count == 0 ]]; then
textFail "No CloudTrail trails were found in the account"
fi
}

33
checks/check22 Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check22="2.2,2.02"
CHECK_TITLE_check22="[check22] Ensure CloudTrail log file validation is enabled (Scored)"
CHECK_SCORED_check22="SCORED"
CHECK_TYPE_check22="LEVEL2"
CHECK_ALTERNATE_check202="check22"
check22(){
# "Ensure CloudTrail log file validation is enabled (Scored)"
for regx in $REGIONS; do
LIST_OF_TRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].Name' --output text --no-include-shadow-trails)
if [[ $LIST_OF_TRAILS ]];then
for trail in $LIST_OF_TRAILS;do
LOGFILEVALIDATION_TRAIL_STATUS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].LogFileValidationEnabled' --output text --trail-name-list $trail)
if [[ "$LOGFILEVALIDATION_TRAIL_STATUS" == 'False' ]];then
textFail "$trail trail in $regx has not log file validation enabled"
else
textPass "$trail trail in $regx has log file validation enabled"
fi
done
fi
done
}

36
checks/check23 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check23="2.3,2.03"
CHECK_TITLE_check23="[check23] Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"
CHECK_SCORED_check23="SCORED"
CHECK_TYPE_check23="LEVEL1"
CHECK_ALTERNATE_check203="check23"
check23(){
# "Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"
CLOUDTRAILBUCKET=$($AWSCLI cloudtrail describe-trails --query 'trailList[*].S3BucketName' --output text $PROFILE_OPT --region $REGION)
if [[ $CLOUDTRAILBUCKET ]]; then
for bucket in $CLOUDTRAILBUCKET;do
CLOUDTRAILBUCKET_HASALLPERMISIONS=$($AWSCLI s3api get-bucket-acl --bucket $bucket --query 'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers`]' $PROFILE_OPT --region $REGION --output text 2>&1)
if [[ $(echo "$CLOUDTRAILBUCKET_HASALLPERMISIONS" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Acl for $bucket"
continue
fi
if [[ $CLOUDTRAILBUCKET_HASALLPERMISIONS ]]; then
textFail "check your $bucket CloudTrail bucket ACL and Policy!"
else
textPass "Bucket $bucket is set correctly"
fi
done
else
textFail "No CloudTrail bucket found!"
fi
}

40
checks/check24 Normal file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check24="2.4,2.04"
CHECK_TITLE_check24="[check24] Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored)"
CHECK_SCORED_check24="SCORED"
CHECK_TYPE_check24="LEVEL1"
CHECK_ALTERNATE_check204="check24"
check24(){
# "Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored)"
TRAILS_AND_REGIONS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $REGION --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion}' --output text | tr " " ',')
if [[ $TRAILS_AND_REGIONS ]];then
for reg_trail in $TRAILS_AND_REGIONS;do
trail=$(echo $reg_trail | cut -d',' -f2)
TRAIL_REGION=$(echo $reg_trail | cut -d',' -f1)
LATESTDELIVERY_TIMESTAMP=$($AWSCLI cloudtrail get-trail-status --name $trail $PROFILE_OPT --region $TRAIL_REGION --query 'LatestCloudWatchLogsDeliveryTime' --output text|grep -v None)
if [[ ! $LATESTDELIVERY_TIMESTAMP ]];then
textFail "$trail trail is not logging in the last 24h or not configured (it is in $TRAIL_REGION)"
else
LATESTDELIVERY_DATE=$(timestamp_to_date $LATESTDELIVERY_TIMESTAMP)
HOWOLDER=$(how_older_from_today $LATESTDELIVERY_DATE)
if [ $HOWOLDER -gt "1" ];then
textFail "$trail trail is not logging in the last 24h or not configured (it is in $TRAIL_REGION)"
else
textPass "$trail trail has been logging during the last 24h (it is in $TRAIL_REGION)"
fi
fi
done
else
textFail "No CloudTrail trails found!"
fi
}

27
checks/check25 Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check25="2.5,2.05"
CHECK_TITLE_check25="[check25] Ensure AWS Config is enabled in all regions (Scored)"
CHECK_SCORED_check25="SCORED"
CHECK_TYPE_check25="LEVEL1"
CHECK_ALTERNATE_check205="check25"
check25(){
# "Ensure AWS Config is enabled in all regions (Scored)"
for regx in $REGIONS; do
CHECK_AWSCONFIG_STATUS=$($AWSCLI configservice get-status $PROFILE_OPT --region $regx --output json| grep "recorder: ON")
if [[ $CHECK_AWSCONFIG_STATUS ]];then
textPass "Region $regx has AWS Config recorder: ON" "$regx"
else
textFail "Region $regx has AWS Config disabled or not configured" "$regx"
fi
done
}

51
checks/check26 Normal file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check26="2.6,2.06"
CHECK_TITLE_check26="[check26] Ensure S3 bucket access logging is enabled on the CloudTrail S3 bucket (Scored)"
CHECK_SCORED_check26="SCORED"
CHECK_TYPE_check26="LEVEL1"
CHECK_ALTERNATE_check206="check26"
check26(){
# "Ensure S3 bucket access logging is enabled on the CloudTrail S3 bucket (Scored)"
CLOUDTRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].Name' --output text| tr '\011' '\012' | awk -F: '{print $1}')
if [[ $CLOUDTRAILS ]]; then
for trail in $CLOUDTRAILS; do
CLOUDTRAIL_ACCOUNT_ID=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region "$REGION" --query 'trailList[*].TrailARN' --output text | tr '\011' '\012' | grep "$trail" | awk -F: '{ print $5 }' | head -n 1)
CLOUDTRAILBUCKET=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $REGION --query 'trailList[*].[Name, S3BucketName]' --output text | tr '\011' ':' | grep "$trail" | awk -F: '{ print $2 }' )
if [[ $CLOUDTRAILBUCKET ]]; then
bucket=$CLOUDTRAILBUCKET
if [ "$CLOUDTRAIL_ACCOUNT_ID" == "$ACCOUNT_NUM" ]; then
CLOUDTRAILBUCKET_LOGENABLED=$($AWSCLI s3api get-bucket-logging --bucket $bucket $PROFILE_OPT --region $REGION --query 'LoggingEnabled.TargetBucket' --output text 2>&1)
if [[ $(echo "$CLOUDTRAILBUCKET_LOGENABLED" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Logging for $bucket"
continue
fi
if [[ $CLOUDTRAILBUCKET_LOGENABLED != "null" ]]; then
textPass "Bucket access logging enabled in CloudTrail S3 bucket $bucket for $trail"
else
textFail "Bucket access logging is not enabled in CloudTrail S3 bucket $bucket for $trail"
fi
else
textInfo "CloudTrail S3 bucket $bucket for trail $trail is not in current account"
fi
else
textFail "CloudTrail bucket not found!"
fi
done
else
textFail "No CloudWatch group found and no CloudTrail bucket"
fi
}

30
checks/check27 Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check27="2.7,2.07"
CHECK_TITLE_check27="[check27] Ensure CloudTrail logs are encrypted at rest using KMS CMKs (Scored)"
CHECK_SCORED_check27="SCORED"
CHECK_TYPE_check27="LEVEL2"
CHECK_ALTERNATE_check207="check27"
check27(){
# "Ensure CloudTrail logs are encrypted at rest using KMS CMKs (Scored)"
$AWSCLI cloudtrail describe-trails --query 'trailList[].[Name,KmsKeyId]' --output text $PROFILE_OPT --region $REGION | while read trail key; do
if [[ "$trail" ]] ; then
if [[ "$key" != "None" ]] ; then
textPass "KMS key found for $trail"
else
textFail "Encryption is not enabled in your CloudTrail trail $trail (KMS key not found)!"
fi
else
textFail "CloudTrail bucket doesn't exist!"
fi
done
}

47
checks/check28 Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check28="2.8,2.08"
CHECK_TITLE_check28="[check28] Ensure rotation for customer created CMKs is enabled (Scored)"
CHECK_SCORED_check28="SCORED"
CHECK_TYPE_check28="LEVEL2"
CHECK_ALTERNATE_check208="check28"
check28(){
# "Ensure rotation for customer created CMKs is enabled (Scored)"
for regx in $REGIONS; do
CHECK_KMS_KEYLIST=$($AWSCLI kms list-keys $PROFILE_OPT --region $regx --output text --query 'Keys[*].KeyId')
if [[ $CHECK_KMS_KEYLIST ]];then
CHECK_KMS_KEYLIST_NO_DEFAULT=$(
for key in $CHECK_KMS_KEYLIST; do
$AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --query 'KeyMetadata.{key:KeyId,state:KeyState,man:KeyManager}' --output text|grep Enabled$|grep -v AWS| awk '{ print $1 }'
done )
if [[ $CHECK_KMS_KEYLIST_NO_DEFAULT ]]; then
for key in $CHECK_KMS_KEYLIST_NO_DEFAULT; do
CHECK_KMS_KEY_TYPE=$($AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --query 'KeyMetadata.Origin' | sed 's/["]//g')
if [[ "$CHECK_KMS_KEY_TYPE" == "EXTERNAL" ]];then
textPass "$regx: Key $key in Region $regx Customer Uploaded Key Material." "$regx"
else
CHECK_KMS_KEY_ROTATION=$($AWSCLI kms get-key-rotation-status --key-id $key $PROFILE_OPT --region $regx --output text)
if [[ "$CHECK_KMS_KEY_ROTATION" == "True" ]];then
textPass "$regx: Key $key is set correctly" "$regx"
else
textFail "$regx: Key $key is not set to rotate!" "$regx"
fi
fi
done
else
textInfo "$regx: This region doesn't have CUSTOM encryption keys" "$regx"
fi
else
textInfo "$regx: This region doesn't have ANY encryption keys" "$regx"
fi
done
}

32
checks/check29 Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check29="2.9,2.09"
CHECK_TITLE_check29="[check29] Ensure VPC Flow Logging is Enabled in all VPCs (Scored)"
CHECK_SCORED_check29="SCORED"
CHECK_TYPE_check29="LEVEL2"
CHECK_ALTERNATE_check209="check29"
check29(){
# "Ensure VPC Flow Logging is Enabled in all VPCs (Scored)"
for regx in $REGIONS; do
AVAILABLE_VPC=$($AWSCLI ec2 describe-vpcs $PROFILE_OPT --region $regx --query 'Vpcs[?State==`available`].VpcId' --output text)
for vpcx in $AVAILABLE_VPC; do
CHECK_FL=$($AWSCLI ec2 describe-flow-logs $PROFILE_OPT --region $regx --filter Name="resource-id",Values="${vpcx}" --query 'FlowLogs[?FlowLogStatus==`ACTIVE`].FlowLogId' --output text)
if [[ $CHECK_FL ]];then
for FL in $CHECK_FL;do
textPass "VPC $vpcx: VPCFlowLog is enabled for LogGroupName: $FL in Region $regx" "$regx"
done
else
textFail "VPC $vpcx: No VPCFlowLog has been found in Region $regx" "$regx"
fi
done
done
}

44
checks/check31 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/MyCloudTrailLG \
# --filter-name AWSAuthorizationFailures \
# --filter-pattern '{ $.errorCode = "*UnauthorizedOperation" || $.errorCode = "AccessDenied*" }' \
# --metric-transformations metricName=AuthorizationFailureCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name "Authorization Failures" \
# --alarm-description "Alarm triggered when unauthorized API calls are made" \
# --metric-name AuthorizationFailureCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check31="3.1,3.01"
CHECK_TITLE_check31="[check31] Ensure a log metric filter and alarm exist for unauthorized API calls (Scored)"
CHECK_SCORED_check31="SCORED"
CHECK_TYPE_check31="LEVEL1"
CHECK_ALTERNATE_check301="check31"
check31(){
check3x '\$\.errorCode\s*=\s*"\*UnauthorizedOperation".+\$\.errorCode\s*=\s*"AccessDenied\*"'
}

44
checks/check310 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name SecurityGroupConfigChanges \
# --filter-pattern '{ ($.eventName = AuthorizeSecurityGroupIngress) || ($.eventName = AuthorizeSecurityGroupEgress) || ($.eventName = RevokeSecurityGroupIngress) || ($.eventName = RevokeSecurityGroupEgress) || ($.eventName = CreateSecurityGroup) || ($.eventName = DeleteSecurityGroup) }' \
# --metric-transformations metricName=SecurityGroupEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name SecurityGroupConfigChangesAlarm \
# --alarm-description "Triggered by AWS security group(s) config changes." \
# --metric-name SecurityGroupEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check310="3.10"
CHECK_TITLE_check310="[check310] Ensure a log metric filter and alarm exist for security group changes (Scored)"
CHECK_SCORED_check310="SCORED"
CHECK_TYPE_check310="LEVEL2"
CHECK_ALTERNATE_check310="check310"
check310(){
check3x '\$\.eventName\s*=\s*AuthorizeSecurityGroupIngress.+\$\.eventName\s*=\s*AuthorizeSecurityGroupEgress.+\$\.eventName\s*=\s*RevokeSecurityGroupIngress.+\$\.eventName\s*=\s*RevokeSecurityGroupEgress.+\$\.eventName\s*=\s*CreateSecurityGroup.+\$\.eventName\s*=\s*DeleteSecurityGroup'
}

44
checks/check311 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name NetworkACLConfigChanges \
# --filter-pattern '{ ($.eventName = CreateNetworkAcl) || ($.eventName = CreateNetworkAclEntry) || ($.eventName = DeleteNetworkAcl) || ($.eventName = DeleteNetworkAclEntry) || ($.eventName = ReplaceNetworkAclEntry) || ($.eventName = ReplaceNetworkAclAssociation) }' \
# --metric-transformations metricName=NetworkAclEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name NetworkACLConfigChangesAlarm \
# --alarm-description "Triggered by AWS Network ACL(s) config changes." \
# --metric-name NetworkAclEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check311="3.11"
CHECK_TITLE_check311="[check311] Ensure a log metric filter and alarm exist for changes to Network Access Control Lists (NACL) (Scored)"
CHECK_SCORED_check311="SCORED"
CHECK_TYPE_check311="LEVEL2"
CHECK_ALTERNATE_check311="check311"
check311(){
check3x '\$\.eventName\s*=\s*CreateNetworkAcl.+\$\.eventName\s*=\s*CreateNetworkAclEntry.+\$\.eventName\s*=\s*DeleteNetworkAcl.+\$\.eventName\s*=\s*DeleteNetworkAclEntry.+\$\.eventName\s*=\s*ReplaceNetworkAclEntry.+\$\.eventName\s*=\s*ReplaceNetworkAclAssociation'
}

44
checks/check312 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name VPCGatewayConfigChanges \
# --filter-pattern '{ ($.eventName = CreateCustomerGateway) || ($.eventName = DeleteCustomerGateway) || ($.eventName = AttachInternetGateway) || ($.eventName = CreateInternetGateway) || ($.eventName = DeleteInternetGateway) || ($.eventName = DetachInternetGateway) }' \
# --metric-transformations metricName=GatewayEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name VPCGatewayConfigChangesAlarm \
# --alarm-description "Triggered by VPC Customer/Internet Gateway changes." \
# --metric-name GatewayEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check312="3.12"
CHECK_TITLE_check312="[check312] Ensure a log metric filter and alarm exist for changes to network gateways (Scored)"
CHECK_SCORED_check312="SCORED"
CHECK_TYPE_check312="LEVEL1"
CHECK_ALTERNATE_check312="check312"
check312(){
check3x '\$\.eventName\s*=\s*CreateCustomerGateway.+\$\.eventName\s*=\s*DeleteCustomerGateway.+\$\.eventName\s*=\s*AttachInternetGateway.+\$\.eventName\s*=\s*CreateInternetGateway.+\$\.eventName\s*=\s*DeleteInternetGateway.+\$\.eventName\s*=\s*DetachInternetGateway'
}

44
checks/check313 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name RouteTableConfigChanges \
# --filter-pattern '{ ($.eventName = CreateRoute) || ($.eventName = CreateRouteTable) || ($.eventName = ReplaceRoute) || ($.eventName = ReplaceRouteTableAssociation) || ($.eventName = DeleteRouteTable) || ($.eventName = DeleteRoute) || ($.eventName = DisassociateRouteTable) }' \
# --metric-transformations metricName=RouteTableEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name RouteTableConfigChangesAlarm \
# --alarm-description "Triggered by AWS Route Table config changes." \
# --metric-name RouteTableEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check313="3.13"
CHECK_TITLE_check313="[check313] Ensure a log metric filter and alarm exist for route table changes (Scored)"
CHECK_SCORED_check313="SCORED"
CHECK_TYPE_check313="LEVEL1"
CHECK_ALTERNATE_check313="check313"
check313(){
check3x '\$\.eventName\s*=\s*CreateRoute.+\$\.eventName\s*=\s*CreateRouteTable.+\$\.eventName\s*=\s*ReplaceRoute.+\$\.eventName\s*=\s*ReplaceRouteTableAssociation.+\$\.eventName\s*=\s*DeleteRouteTable.+\$\.eventName\s*=\s*DeleteRoute.+\$\.eventName\s*=\s*DisassociateRouteTable'
}

44
checks/check314 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name VPCNetworkConfigChanges \
# --filter-pattern '{ ($.eventName = CreateVpc) || ($.eventName = DeleteVpc) || ($.eventName = ModifyVpcAttribute) || ($.eventName = AcceptVpcPeeringConnection) || ($.eventName = CreateVpcPeeringConnection) || ($.eventName = DeleteVpcPeeringConnection) || ($.eventName = RejectVpcPeeringConnection) || ($.eventName = AttachClassicLinkVpc) || ($.eventName = DetachClassicLinkVpc) || ($.eventName = DisableVpcClassicLink) || ($.eventName = EnableVpcClassicLink) }' \
# --metric-transformations metricName=VpcEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name VPCNetworkConfigChangesAlarm \
# --alarm-description "Triggered by AWS VPC(s) environment config changes." \
# --metric-name VpcEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check314="3.14"
CHECK_TITLE_check314="[check314] Ensure a log metric filter and alarm exist for VPC changes (Scored)"
CHECK_SCORED_check314="SCORED"
CHECK_TYPE_check314="LEVEL1"
CHECK_ALTERNATE_check314="check314"
check314(){
check3x '\$\.eventName\s*=\s*CreateVpc.+\$\.eventName\s*=\s*DeleteVpc.+\$\.eventName\s*=\s*ModifyVpcAttribute.+\$\.eventName\s*=\s*AcceptVpcPeeringConnection.+\$\.eventName\s*=\s*CreateVpcPeeringConnection.+\$\.eventName\s*=\s*DeleteVpcPeeringConnection.+\$\.eventName\s*=\s*RejectVpcPeeringConnection.+\$\.eventName\s*=\s*AttachClassicLinkVpc.+\$\.eventName\s*=\s*DetachClassicLinkVpc.+\$\.eventName\s*=\s*DisableVpcClassicLink.+\$\.eventName\s*=\s*EnableVpcClassicLink'
}

44
checks/check32 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name ConsoleSignInWithoutMfaCount \
# --filter-pattern '{ $.eventName = "ConsoleLogin" && $.additionalEventData.MFAUsed != "Yes" }' \
# --metric-transformations metricName=ConsoleSignInWithoutMfaCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name ConsoleSignInWithoutMfaAlarm \
# --alarm-description "Triggered by sign-in requests made without MFA." \
# --metric-name ConsoleSignInWithoutMfaCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check32="3.2,3.02"
CHECK_TITLE_check32="[check32] Ensure a log metric filter and alarm exist for Management Console sign-in without MFA (Scored)"
CHECK_SCORED_check32="SCORED"
CHECK_TYPE_check32="LEVEL1"
CHECK_ALTERNATE_check302="check32"
check32(){
check3x '\$\.eventName\s*=\s*"ConsoleLogin".+\$\.additionalEventData\.MFAUsed\s*!=\s*"Yes"'
}

44
checks/check33 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name RootAccountUsage \
# --filter-pattern '{ $.userIdentity.type = "Root" && $.userIdentity.invokedBy NOT EXISTS && $.eventType != "AwsServiceEvent" }' \
# --metric-transformations metricName=RootAccountUsageEventCount,metricNamespace=CloudTrailMetrics,metricValue=1 \
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name RootAccountUsageAlarm \
# --alarm-description "Triggered by AWS Root Account usage." \
# --metric-name RootAccountUsageEventCount \
# --namespace CloudTrailMetrics \
# --statistic \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check33="3.3,3.03"
CHECK_TITLE_check33="[check33] Ensure a log metric filter and alarm exist for usage of root account (Scored)"
CHECK_SCORED_check33="SCORED"
CHECK_TYPE_check33="LEVEL1"
CHECK_ALTERNATE_check303="check33"
check33(){
check3x '\$\.userIdentity\.type\s*=\s*"Root".+\$\.userIdentity\.invokedBy NOT EXISTS.+\$\.eventType\s*!=\s*"AwsServiceEvent"'
}

44
checks/check34 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name IAMAuthConfigChanges \
# --filter-pattern '{ ($.eventName = DeleteGroupPolicy) || ($.eventName = DeleteRolePolicy) || ($.eventName = DeleteUserPolicy) || ($.eventName = PutGroupPolicy) || ($.eventName = PutRolePolicy) || ($.eventName = PutUserPolicy) || ($.eventName = CreatePolicy) || ($.eventName = DeletePolicy) || ($.eventName = CreatePolicyVersion) || ($.eventName = DeletePolicyVersion) || ($.eventName = AttachRolePolicy) || ($.eventName = DetachRolePolicy) || ($.eventName = AttachUserPolicy) || ($.eventName = DetachUserPolicy) || ($.eventName = AttachGroupPolicy) || ($.eventName = DetachGroupPolicy) }' \
# --metric-transformations metricName=IAMPolicyEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name IAMAuthorizationActivityAlarm \
# --alarm-description "Triggered by AWS IAM authorization config changes." \
# --metric-name IAMPolicyEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check34="3.4,3.04"
CHECK_TITLE_check34="[check34] Ensure a log metric filter and alarm exist for IAM policy changes (Scored)"
CHECK_SCORED_check34="SCORED"
CHECK_TYPE_check34="LEVEL1"
CHECK_ALTERNATE_check304="check34"
check34(){
check3x '\$\.eventName\s*=\s*DeleteGroupPolicy.+\$\.eventName\s*=\s*DeleteRolePolicy.+\$\.eventName\s*=\s*DeleteUserPolicy.+\$\.eventName\s*=\s*PutGroupPolicy.+\$\.eventName\s*=\s*PutRolePolicy.+\$\.eventName\s*=\s*PutUserPolicy.+\$\.eventName\s*=\s*CreatePolicy.+\$\.eventName\s*=\s*DeletePolicy.+\$\.eventName\s*=\s*CreatePolicyVersion.+\$\.eventName\s*=\s*DeletePolicyVersion.+\$\.eventName\s*=\s*AttachRolePolicy.+\$\.eventName\s*=\s*DetachRolePolicy.+\$\.eventName\s*=\s*AttachUserPolicy.+\$\.eventName\s*=\s*DetachUserPolicy.+\$\.eventName\s*=\s*AttachGroupPolicy.+\$\.eventName\s*=\s*DetachGroupPolicy'
}

44
checks/check35 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/MyCloudTrailLG \
# --filter-name AWSCloudTrailChanges \
# --filter-pattern '{ ($.eventName = CreateTrail) || ($.eventName = UpdateTrail) || ($.eventName = DeleteTrail) || ($.eventName = StartLogging) || ($.eventName = StopLogging) }' \
# --metric-transformations metricName=CloudTrailEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name "CloudTrail Changes" \
# --alarm-description "Triggered by AWS CloudTrail configuration changes." \
# --metric-name CloudTrailEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check35="3.5,3.05"
CHECK_TITLE_check35="[check35] Ensure a log metric filter and alarm exist for CloudTrail configuration changes (Scored)"
CHECK_SCORED_check35="SCORED"
CHECK_TYPE_check35="LEVEL1"
CHECK_ALTERNATE_check305="check35"
check35(){
check3x '\$\.eventName\s*=\s*CreateTrail.+\$\.eventName\s*=\s*UpdateTrail.+\$\.eventName\s*=\s*DeleteTrail.+\$\.eventName\s*=\s*StartLogging.+\$\.eventName\s*=\s*StopLogging'
}

44
checks/check36 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/MyCloudTrailLG \
# --filter-name AWSConsoleSignInFailures \
# --filter-pattern '{ ($.eventName = ConsoleLogin) && ($.errorMessage = "Failed authentication") }' \
# --metric-transformations metricName=ConsoleSigninFailureCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name "Console Sign-in Failures" \
# --alarm-description "AWS Management Console Sign-in Failure Alarm." \
# --metric-name ConsoleSigninFailureCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 3 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check36="3.6,3.06"
CHECK_TITLE_check36="[check36] Ensure a log metric filter and alarm exist for AWS Management Console authentication failures (Scored)"
CHECK_SCORED_check36="SCORED"
CHECK_TYPE_check36="LEVEL2"
CHECK_ALTERNATE_check306="check36"
check36(){
check3x '\$\.eventName\s*=\s*ConsoleLogin.+\$\.errorMessage\s*=\s*"Failed authentication"'
}

44
checks/check37 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name AWSCMKChanges \
# --filter-pattern '{ ($.eventSource = kms.amazonaws.com) && (($.eventName = DisableKey) || ($.eventName = ScheduleKeyDeletion)) }' \
# --metric-transformations metricName=CMKEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name AWSCMKChangesAlarm \
# --alarm-description "Triggered by AWS CMK changes." \
# --metric-name CMKEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check37="3.7,3.07"
CHECK_TITLE_check37="[check37] Ensure a log metric filter and alarm exist for disabling or scheduled deletion of customer created CMKs (Scored)"
CHECK_SCORED_check37="SCORED"
CHECK_TYPE_check37="LEVEL2"
CHECK_ALTERNATE_check307="check37"
check37(){
check3x '\$\.eventSource\s*=\s*kms.amazonaws.com.+\$\.eventName\s*=\s*DisableKey.+\$\.eventName\s*=\s*ScheduleKeyDeletion'
}

44
checks/check38 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name S3BucketConfigChanges \
# --filter-pattern '{ ($.eventSource = s3.amazonaws.com) && (($.eventName = PutBucketAcl) || ($.eventName = PutBucketPolicy) || ($.eventName = PutBucketCors) || ($.eventName = PutBucketLifecycle) || ($.eventName = PutBucketReplication) || ($.eventName = DeleteBucketPolicy) || ($.eventName = DeleteBucketCors) || ($.eventName = DeleteBucketLifecycle) || ($.eventName = DeleteBucketReplication)) }' \
# --metric-transformations metricName=S3BucketEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name S3BucketConfigChangesAlarm \
# --alarm-description "Triggered by AWS S3 Bucket config changes." \
# --metric-name S3BucketEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check38="3.8,3.08"
CHECK_TITLE_check38="[check38] Ensure a log metric filter and alarm exist for S3 bucket policy changes (Scored)"
CHECK_SCORED_check38="SCORED"
CHECK_TYPE_check38="LEVEL1"
CHECK_ALTERNATE_check308="check38"
check38(){
check3x '\$\.eventSource\s*=\s*s3.amazonaws.com.+\$\.eventName\s*=\s*PutBucketAcl.+\$\.eventName\s*=\s*PutBucketPolicy.+\$\.eventName\s*=\s*PutBucketCors.+\$\.eventName\s*=\s*PutBucketLifecycle.+\$\.eventName\s*=\s*PutBucketReplication.+\$\.eventName\s*=\s*DeleteBucketPolicy.+\$\.eventName\s*=\s*DeleteBucketCors.+\$\.eventName\s*=\s*DeleteBucketLifecycle.+\$\.eventName\s*=\s*DeleteBucketReplication'
}

44
checks/check39 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
#
# Remediation:
#
# https://d1.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf
#
# aws logs put-metric-filter \
# --region us-east-1 \
# --log-group-name CloudTrail/CloudWatchLogGroup \
# --filter-name AWSConfigChanges \
# --filter-pattern '{ ($.eventSource = config.amazonaws.com) && (($.eventName = StopConfigurationRecorder)||($.eventName = DeleteDeliveryChannel)||($.eventName = PutDeliveryChannel)||($.eventName = PutConfigurationRecorder)) }' \
# --metric-transformations metricName=ConfigEventCount,metricNamespace=CloudTrailMetrics,metricValue=1
#
# aws cloudwatch put-metric-alarm \
# --region us-east-1 \
# --alarm-name AWSConfigChangesAlarm \
# --alarm-description "Triggered by AWS Config changes." \
# --metric-name ConfigEventCount \
# --namespace CloudTrailMetrics \
# --statistic Sum \
# --comparison-operator GreaterThanOrEqualToThreshold \
# --evaluation-periods 1 \
# --period 300 \
# --threshold 1 \
# --actions-enabled \
# --alarm-actions arn:aws:sns:us-east-1:123456789012:CloudWatchAlarmTopic
CHECK_ID_check39="3.9,3.09"
CHECK_TITLE_check39="[check39] Ensure a log metric filter and alarm exist for AWS Config configuration changes (Scored)"
CHECK_SCORED_check39="SCORED"
CHECK_TYPE_check39="LEVEL2"
CHECK_ALTERNATE_check309="check39"
check39(){
check3x '\$\.eventSource\s*=\s*config.amazonaws.com.+\$\.eventName\s*=\s*StopConfigurationRecorder.+\$\.eventName\s*=\s*DeleteDeliveryChannel.+\$\.eventName\s*=\s*PutDeliveryChannel.+\$\.eventName\s*=\s*PutConfigurationRecorder'
}

29
checks/check41 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check41="4.1,4.01"
CHECK_TITLE_check41="[check41] Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 22 (Scored)"
CHECK_SCORED_check41="SCORED"
CHECK_TYPE_check41="LEVEL2"
CHECK_ALTERNATE_check401="check41"
check41(){
# "Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 22 (Scored)"
for regx in $REGIONS; do
SG_LIST=$($AWSCLI ec2 describe-security-groups --query 'SecurityGroups[?length(IpPermissions[?((FromPort==null && ToPort==null) || (FromPort<=`22` && ToPort>=`22`)) && (contains(IpRanges[].CidrIp, `0.0.0.0/0`) || contains(Ipv6Ranges[].CidrIpv6, `::/0`))]) > `0`].{GroupId:GroupId}' $PROFILE_OPT --region $regx --output text)
if [[ $SG_LIST ]];then
for SG in $SG_LIST;do
textFail "Found Security Group: $SG open to 0.0.0.0/0 in Region $regx" "$regx"
done
else
textPass "No Security Groups found in $regx with port 22 TCP open to 0.0.0.0/0" "$regx"
fi
done
}

29
checks/check42 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check42="4.2,4.02"
CHECK_TITLE_check42="[check42] Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 3389 (Scored)"
CHECK_SCORED_check42="SCORED"
CHECK_TYPE_check42="LEVEL2"
CHECK_ALTERNATE_check402="check42"
check42(){
# "Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 3389 (Scored)"
for regx in $REGIONS; do
SG_LIST=$($AWSCLI ec2 describe-security-groups --query 'SecurityGroups[?length(IpPermissions[?((FromPort==null && ToPort==null) || (FromPort<=`3389` && ToPort>=`3389`)) && (contains(IpRanges[].CidrIp, `0.0.0.0/0`) || contains(Ipv6Ranges[].CidrIpv6, `::/0`))]) > `0`].{GroupId:GroupId}' $PROFILE_OPT --region $regx --output text)
if [[ $SG_LIST ]];then
for SG in $SG_LIST;do
textFail "Found Security Group: $SG open to 0.0.0.0/0 in Region $regx" "$regx"
done
else
textPass "No Security Groups found in $regx with port 3389 TCP open to 0.0.0.0/0" "$regx"
fi
done
}

30
checks/check43 Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check43="4.3,4.03"
CHECK_TITLE_check43="[check43] Ensure the default security group of every VPC restricts all traffic (Scored)"
CHECK_SCORED_check43="SCORED"
CHECK_TYPE_check43="LEVEL2"
CHECK_ALTERNATE_check403="check43"
check43(){
# "Ensure the default security group of every VPC restricts all traffic (Scored)"
for regx in $REGIONS; do
CHECK_SGDEFAULT_IDS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --filters Name=group-name,Values='default' --query 'SecurityGroups[*].GroupId[]' --output text)
for CHECK_SGDEFAULT_ID in $CHECK_SGDEFAULT_IDS; do
CHECK_SGDEFAULT_ID_OPEN=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --group-ids $CHECK_SGDEFAULT_ID --query 'SecurityGroups[*].{IpPermissions:IpPermissions,IpPermissionsEgress:IpPermissionsEgress,GroupId:GroupId}' --output text |egrep '0.0.0.0|\:\:\/0')
if [[ $CHECK_SGDEFAULT_ID_OPEN ]];then
textFail "Default Security Groups ($CHECK_SGDEFAULT_ID) found that allow 0.0.0.0 IN or OUT traffic in Region $regx" "$regx"
else
textPass "No Default Security Groups ($CHECK_SGDEFAULT_ID) open to 0.0.0.0 found in Region $regx" "$regx"
fi
done
done
}

34
checks/check44 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
#
# This Prowler check is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
CHECK_ID_check44="4.4,4.04"
CHECK_TITLE_check44="[check44] Ensure routing tables for VPC peering are \"least access\" (Not Scored)"
CHECK_SCORED_check44="NOT_SCORED"
CHECK_TYPE_check44="LEVEL2"
CHECK_ALTERNATE_check404="check44"
check44(){
# "Ensure routing tables for VPC peering are \"least access\" (Not Scored)"
textInfo "Looking for VPC peering in all regions... "
for regx in $REGIONS; do
LIST_OF_VPCS_PEERING_CONNECTIONS=$($AWSCLI ec2 describe-vpc-peering-connections --output text $PROFILE_OPT --region $regx --query 'VpcPeeringConnections[*].VpcPeeringConnectionId'| sort | paste -s -d" " -)
if [[ $LIST_OF_VPCS_PEERING_CONNECTIONS ]];then
textInfo "$regx: $LIST_OF_VPCS_PEERING_CONNECTIONS - review routing tables" "$regx"
#LIST_OF_VPCS=$($AWSCLI ec2 describe-vpcs $PROFILE_OPT --region $regx --query 'Vpcs[*].VpcId' --output text)
#aws ec2 describe-route-tables --filter "Name=vpc-id,Values=vpc-0213e864" --query "RouteTables[*].{RouteTableId:RouteTableId, VpcId:VpcId, Routes:Routes, AssociatedSubnets:Associations[*].SubnetId}" $PROFILE_OPT --region $regx
# for vpc in $LIST_OF_VPCS; do
# VPCS_WITH_PEERING=$($AWSCLI ec2 describe-route-tables --filter "Name=vpc-id,Values=$vpc" $PROFILE_OPT --region $regx --query "RouteTables[*].{RouteTableId:RouteTableId, VpcId:VpcId, Routes:Routes, AssociatedSubnets:Associations[*].SubnetId}" |grep GatewayId|grep pcx-)
# done
#echo $VPCS_WITH_PEERING
else
textPass "$regx: No VPC peering found" "$regx"
fi
done
}

48
checks/check_extra71 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra71="7.1,7.01"
CHECK_TITLE_extra71="[extra71] Ensure users of groups with AdministratorAccess policy have MFA tokens enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra71="NOT_SCORED"
CHECK_TYPE_extra71="EXTRA"
CHECK_ALTERNATE_extra701="extra71"
CHECK_ALTERNATE_check71="extra71"
CHECK_ALTERNATE_check701="extra71"
extra71(){
# "Ensure users of groups with AdministratorAccess policy have MFA tokens enabled (Not Scored) (Not part of CIS benchmark)"
ADMIN_GROUPS=''
AWS_GROUPS=$($AWSCLI $PROFILE_OPT iam list-groups --output text --query 'Groups[].GroupName')
for grp in $AWS_GROUPS; do
# aws --profile onlinetraining iam list-attached-group-policies --group-name Administrators --query 'AttachedPolicies[].PolicyArn' | grep 'arn:aws:iam::aws:policy/AdministratorAccess'
# list-attached-group-policies
CHECK_ADMIN_GROUP=$($AWSCLI $PROFILE_OPT iam list-attached-group-policies --group-name $grp --output json --query 'AttachedPolicies[].PolicyArn' | grep 'arn:aws:iam::aws:policy/AdministratorAccess')
if [[ $CHECK_ADMIN_GROUP ]]; then
ADMIN_GROUPS="$ADMIN_GROUPS $grp"
textInfo "$grp group provides administrative access"
ADMIN_USERS=$($AWSCLI $PROFILE_OPT iam get-group --group-name $grp --output json --query 'Users[].UserName' | grep '"' | cut -d'"' -f2 )
for auser in $ADMIN_USERS; do
# users in group are Administrators
# users
# check for user MFA device in credential report
USER_MFA_ENABLED=$( cat $TEMP_REPORT_FILE | grep "^$auser," | cut -d',' -f8)
if [[ "true" == $USER_MFA_ENABLED ]]; then
textPass "$auser / MFA Enabled / admin via group $grp"
else
textFail "$auser / MFA DISABLED / admin via group $grp"
fi
done
else
textInfo "$grp group provides non-administrative access"
fi
done
}

34
checks/check_extra710 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra710="7.10"
CHECK_TITLE_extra710="[extra710] Check for internet facing EC2 Instances (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra710="NOT_SCORED"
CHECK_TYPE_extra710="EXTRA"
CHECK_ALTERNATE_check710="extra710"
extra710(){
# "Check for internet facing EC2 Instances (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for instances in all regions... "
for regx in $REGIONS; do
LIST_OF_PUBLIC_INSTANCES=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[*].Instances[?PublicIpAddress].[InstanceId,PublicIpAddress]' --output text)
if [[ $LIST_OF_PUBLIC_INSTANCES ]];then
while read -r instance;do
INSTANCE_ID=$(echo $instance | awk '{ print $1; }')
PUBLIC_IP=$(echo $instance | awk '{ print $2; }')
textFail "$regx: Instance: $INSTANCE_ID at IP: $PUBLIC_IP is internet-facing!" "$regx"
done <<< "$LIST_OF_PUBLIC_INSTANCES"
else
textPass "$regx: no Internet Facing EC2 Instances found" "$regx"
fi
done
}

34
checks/check_extra711 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra711="7.11"
CHECK_TITLE_extra711="[extra711] Check for Publicly Accessible Redshift Clusters (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra711="NOT_SCORED"
CHECK_TYPE_extra711="EXTRA"
CHECK_ALTERNATE_check711="extra711"
extra711(){
# "Check for Publicly Accessible Redshift Clusters (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for Redshift clusters in all regions... "
for regx in $REGIONS; do
LIST_OF_PUBLIC_REDSHIFT_CLUSTERS=$($AWSCLI redshift describe-clusters $PROFILE_OPT --region $regx --query 'Clusters[?PubliclyAccessible == `true`].[ClusterIdentifier,Endpoint.Address]' --output text)
if [[ $LIST_OF_PUBLIC_REDSHIFT_CLUSTERS ]];then
while read -r cluster;do
CLUSTER_ID=$(echo $cluster | awk '{ print $1; }')
CLUSTER_ENDPOINT=$(echo $cluster | awk '{ print $2; }')
textFail "$regx: Cluster: $CLUSTER_ID at Endpoint: $CLUSTER_ENDPOINT is publicly accessible!" "$regx"
done <<< "$LIST_OF_PUBLIC_REDSHIFT_CLUSTERS"
else
textPass "$regx: no Publicly Accessible Redshift Clusters found" "$regx"
fi
done
}

29
checks/check_extra712 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra712="7.12"
CHECK_TITLE_extra712="[extra712] Check if Amazon Macie is enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra712="NOT_SCORED"
CHECK_TYPE_extra712="EXTRA"
CHECK_ALTERNATE_check712="extra712"
extra712(){
# "Check if Amazon Macie is enabled (Not Scored) (Not part of CIS benchmark)"
textInfo "No API commands available to check if Macie is enabled,"
textInfo "just looking if IAM Macie related permissions exist. "
MACIE_IAM_ROLES_CREATED=$($AWSCLI iam list-roles $PROFILE_OPT --query 'Roles[*].Arn'|grep AWSMacieServiceCustomer|wc -l)
if [[ $MACIE_IAM_ROLES_CREATED -eq 2 ]];then
textPass "Macie related IAM roles exist so it might be enabled. Check it out manually."
else
textFail "No Macie related IAM roles found. It is most likely not to be enabled"
fi
}

42
checks/check_extra713 Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra713="7.13"
CHECK_TITLE_extra713="[extra713] Check if GuardDuty is enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra713="NOT_SCORED"
CHECK_TYPE_extra713="EXTRA"
CHECK_ALTERNATE_check713="extra713"
extra713(){
# "Check if GuardDuty is enabled (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_GUARDDUTY_DETECTORS=$($AWSCLI guardduty list-detectors $PROFILE_OPT --region $regx --output text --query DetectorIds[*] 2> /dev/null)
RESULT=$?
if [ $RESULT -eq 0 ];then
if [[ $LIST_OF_GUARDDUTY_DETECTORS ]];then
while read -r detector;do
DETECTOR_ENABLED=$($AWSCLI guardduty get-detector --detector-id $detector $PROFILE_OPT --region $regx --query "Status" --output text|grep ENABLED)
if [[ $DETECTOR_ENABLED ]]; then
textPass "$regx: GuardDuty detector $detector enabled" "$regx"
else
textFail "$regx: GuardDuty detector $detector configured but suspended" "$regx"
fi
done <<< "$LIST_OF_GUARDDUTY_DETECTORS"
else
textFail "$regx: GuardDuty detector not configured!" "$regx"
fi
else
# if list-detectors return any error
textInfo "$regx: GuardDuty not checked" "$regx"
fi
done
}

34
checks/check_extra714 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra714="7.14"
CHECK_TITLE_extra714="[extra714] Check if CloudFront distributions have logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra714="NOT_SCORED"
CHECK_TYPE_extra714="EXTRA"
CHECK_ALTERNATE_check714="extra714"
extra714(){
# "Check if CloudFront distributions have logging enabled (Not Scored) (Not part of CIS benchmark)"
LIST_OF_DISTRIBUTIONS=$($AWSCLI cloudfront list-distributions $PROFILE_OPT --query 'DistributionList.Items[].Id' --output text | grep -v "^None")
if [[ $LIST_OF_DISTRIBUTIONS ]]; then
for dist in $LIST_OF_DISTRIBUTIONS; do
LOG_ENABLED=$($AWSCLI cloudfront get-distribution $PROFILE_OPT --id "$dist" --query 'Distribution.DistributionConfig.Logging.Enabled' | grep true)
if [[ $LOG_ENABLED ]]; then
textPass "CloudFront distribution $dist has logging enabled"
else
textFail "CloudFront distribution $dist has logging disabled"
fi
done
else
textInfo "No CloudFront distributions found"
fi
}

41
checks/check_extra715 Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra715="7.15"
CHECK_TITLE_extra715="[extra715] Check if Elasticsearch Service domains have logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra715="NOT_SCORED"
CHECK_TYPE_extra715="EXTRA"
CHECK_ALTERNATE_check715="extra715"
extra715(){
for regx in $REGIONS; do
LIST_OF_DOMAINS=$($AWSCLI es list-domain-names $PROFILE_OPT --region $regx --query DomainNames --output text)
if [[ $LIST_OF_DOMAINS ]]; then
for domain in $LIST_OF_DOMAINS;do
SEARCH_SLOWLOG_ENABLED=$($AWSCLI es describe-elasticsearch-domain-config --domain-name $domain $PROFILE_OPT --region $regx --query DomainConfig.LogPublishingOptions.Options.SEARCH_SLOW_LOGS.Enabled --output text |grep -v ^None|grep -v ^False)
if [[ $SEARCH_SLOWLOG_ENABLED ]];then
textPass "$regx: ElasticSearch Service domain $domain SEARCH_SLOW_LOGS enabled" "$regx"
else
textFail "$regx: ElasticSearch Service domain $domain SEARCH_SLOW_LOGS disabled!" "$regx"
fi
INDEX_SLOWLOG_ENABLED=$($AWSCLI es describe-elasticsearch-domain-config --domain-name $domain $PROFILE_OPT --region $regx --query DomainConfig.LogPublishingOptions.Options.INDEX_SLOW_LOGS.Enabled --output text |grep -v ^None|grep -v ^False)
if [[ $INDEX_SLOWLOG_ENABLED ]];then
textPass "$regx: ElasticSearch Service domain $domain INDEX_SLOW_LOGS enabled" "$regx"
else
textFail "$regx: ElasticSearch Service domain $domain INDEX_SLOW_LOGS disabled!" "$regx"
fi
done
else
textInfo "$regx: No Elasticsearch Service domain found" "$regx"
fi
done
}

45
checks/check_extra716 Normal file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra716="7.16"
CHECK_TITLE_extra716="[extra716] Check if Elasticsearch Service domains allow open access (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra716="NOT_SCORED"
CHECK_TYPE_extra716="EXTRA"
CHECK_ALTERNATE_check716="extra716"
extra716(){
# "Check if Elasticsearch Service domains allow open access (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_DOMAINS=$($AWSCLI es list-domain-names $PROFILE_OPT --region $regx --query DomainNames --output text)
if [[ $LIST_OF_DOMAINS ]]; then
for domain in $LIST_OF_DOMAINS;do
CHECK_IF_MEMBER_OF_VPC=$($AWSCLI es describe-elasticsearch-domain-config --domain-name $domain $PROFILE_OPT --region $regx --query DomainConfig.VPCOptions.Options.VPCId --output text|grep -v ^None)
if [[ ! $CHECK_IF_MEMBER_OF_VPC ]];then
TEMP_POLICY_FILE=$(mktemp -t prowler-${ACCOUNT_NUM}-es-domain.policy.XXXXXXXXXX)
$AWSCLI es describe-elasticsearch-domain-config --domain-name $domain $PROFILE_OPT --region $regx --query DomainConfig.AccessPolicies.Options --output text > $TEMP_POLICY_FILE 2> /dev/null
# check if the policy has Principal as *
CHECK_ES_DOMAIN_ALLUSERS_POLICY=$(cat $TEMP_POLICY_FILE | jq -r '. | .Statement[] | select(.Effect == "Allow" and (((.Principal|type == "object") and .Principal.AWS == "*") or ((.Principal|type == "string") and .Principal == "*")) and .Condition == null)')
if [[ $CHECK_ES_DOMAIN_ALLUSERS_POLICY ]];then
textFail "$regx: $domain policy \"may\" allow Anonymous users to perform actions (Principal: \"*\")" "$regx"
else
textPass "$regx: $domain is not open" "$regx"
fi
else
textPass "$regx: $domain is in a VPC" "$regx"
fi
rm -f $TEMP_POLICY_FILE
done
else
textInfo "$regx: No Elasticsearch Service domain found" "$regx"
fi
done
}

50
checks/check_extra717 Normal file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra717="7.17"
CHECK_TITLE_extra717="[extra717] Check if Elastic Load Balancers have logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra717="NOT_SCORED"
CHECK_TYPE_extra717="EXTRA"
CHECK_ALTERNATE_check717="extra717"
extra717(){
# "Check if Elastic Load Balancers have logging enabled (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_ELBS=$($AWSCLI elb describe-load-balancers $PROFILE_OPT --region $regx --query 'LoadBalancerDescriptions[*].LoadBalancerName' --output text|xargs -n1)
LIST_OF_ELBSV2=$($AWSCLI elbv2 describe-load-balancers $PROFILE_OPT --region $regx --query 'LoadBalancers[*].LoadBalancerArn' --output text|xargs -n1)
if [[ $LIST_OF_ELBS || $LIST_OF_ELBSV2 ]]; then
if [[ $LIST_OF_ELBS ]]; then
for elb in $LIST_OF_ELBS; do
CHECK_ELBS_LOG_ENABLED=$($AWSCLI elb describe-load-balancer-attributes $PROFILE_OPT --region $regx --load-balancer-name $elb --query 'LoadBalancerAttributes.AccessLog.Enabled'|grep "^true")
if [[ $CHECK_ELBS_LOG_ENABLED ]]; then
textPass "$regx: $elb has access logs to S3 configured" "$regx"
else
textFail "$regx: $elb has not configured access logs" "$regx"
fi
done
fi
if [[ $LIST_OF_ELBSV2 ]]; then
for elbarn in $LIST_OF_ELBSV2; do
CHECK_ELBSV2_LOG_ENABLED=$($AWSCLI elbv2 describe-load-balancer-attributes $PROFILE_OPT --region $regx --load-balancer-arn $elbarn --query Attributes[*] --output text|grep "^access_logs.s3.enabled"|cut -f2|grep true)
ELBV2_NAME=$(echo $elbarn|cut -d\/ -f3)
if [[ $CHECK_ELBSV2_LOG_ENABLED ]]; then
textPass "$regx: $ELBV2_NAME has access logs to S3 configured" "$regx"
else
textFail "$regx: $ELBV2_NAME has not configured access logs" "$regx"
fi
done
fi
else
textInfo "$regx: No ELBs found" "$regx"
fi
done
}

38
checks/check_extra718 Normal file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra718="7.18"
CHECK_TITLE_extra718="[extra718] Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra718="NOT_SCORED"
CHECK_TYPE_extra718="EXTRA"
CHECK_ALTERNATE_check718="extra718"
extra718(){
# "Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
LIST_OF_BUCKETS=$($AWSCLI s3api list-buckets $PROFILE_OPT --query Buckets[*].Name --output text|xargs -n1)
if [[ $LIST_OF_BUCKETS ]]; then
for bucket in $LIST_OF_BUCKETS;do
BUCKET_SERVER_LOG_ENABLED=$($AWSCLI s3api get-bucket-logging --bucket $bucket $PROFILE_OPT --query [LoggingEnabled] --output text 2>&1)
if [[ $(echo "$BUCKET_SERVER_LOG_ENABLED" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Logging for $bucket"
continue
fi
if [[ $(echo "$BUCKET_SERVER_LOG_ENABLED" | grep "^None$") ]]; then
textFail "Bucket $bucket has server access logging disabled!"
else
textPass "Bucket $bucket has server access logging enabled"
fi
done
else
textInfo "No S3 Buckets found"
fi
}

34
checks/check_extra719 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra719="7.19"
CHECK_TITLE_extra719="[extra719] Check if Route53 public hosted zones are logging queries to CloudWatch Logs (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra719="NOT_SCORED"
CHECK_TYPE_extra719="EXTRA"
CHECK_ALTERNATE_check719="extra719"
extra719(){
# You can't create a query logging config for a private hosted zone.
LIST_OF_HOSTED_ZONES=$($AWSCLI route53 list-hosted-zones $PROFILE_OPT | jq -r ".HostedZones[] | select(.Config.PrivateZone == false) | .Id")
if [[ $LIST_OF_HOSTED_ZONES ]]; then
for hostedzoneid in $LIST_OF_HOSTED_ZONES;do
HOSTED_ZONE_QUERY_LOG_ENABLED=$($AWSCLI route53 list-query-logging-configs --hosted-zone-id $hostedzoneid $PROFILE_OPT --query QueryLoggingConfigs[*].CloudWatchLogsLogGroupArn --output text|cut -d: -f7)
if [[ $HOSTED_ZONE_QUERY_LOG_ENABLED ]];then
textPass "Route53 public hosted zone Id $hostedzoneid has query logging enabled in Log Group $HOSTED_ZONE_QUERY_LOG_ENABLED"
else
textFail "Route53 public hosted zone Id $hostedzoneid has query logging disabled!"
fi
done
else
textInfo "No Route53 hosted zones found"
fi
}

35
checks/check_extra72 Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra72="7.2,7.02"
CHECK_TITLE_extra72="[extra72] Ensure there are no EBS Snapshots set as Public (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra72="NOT_SCORED"
CHECK_TYPE_extra72="EXTRA"
CHECK_ALTERNATE_extra702="extra72"
CHECK_ALTERNATE_check72="extra72"
CHECK_ALTERNATE_check702="extra72"
extra72(){
# "Ensure there are no EBS Snapshots set as Public (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for EBS Snapshots in all regions... "
for regx in $REGIONS; do
LIST_OF_EBS_SNAPSHOTS=$($AWSCLI ec2 describe-snapshots $PROFILE_OPT --region $regx --owner-ids $ACCOUNT_NUM --output text --query 'Snapshots[*].{ID:SnapshotId}' --max-items $MAXITEMS | grep -v None 2> /dev/null)
for snapshot in $LIST_OF_EBS_SNAPSHOTS; do
SNAPSHOT_IS_PUBLIC=$($AWSCLI ec2 describe-snapshot-attribute $PROFILE_OPT --region $regx --output text --snapshot-id $snapshot --attribute createVolumePermission --query "CreateVolumePermissions[?Group=='all']")
if [[ $SNAPSHOT_IS_PUBLIC ]];then
textFail "$regx: $snapshot is currently Public!" "$regx"
else
textPass "$regx: $snapshot is not Public" "$regx"
fi
done
done
}

57
checks/check_extra720 Normal file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra720="7.20"
CHECK_TITLE_extra720="[extra720] Check if Lambda functions invoke API operations are being recorded by CloudTrail (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra720="NOT_SCORED"
CHECK_TYPE_extra720="EXTRA"
CHECK_ALTERNATE_check720="extra720"
extra720(){
# "Check if Lambda functions invoke API operations are being recorded by CloudTrail (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_FUNCTIONS=$($AWSCLI lambda list-functions $PROFILE_OPT --region $regx --query Functions[*].FunctionName --output text)
if [[ $LIST_OF_FUNCTIONS ]]; then
for lambdafunction in $LIST_OF_FUNCTIONS;do
LIST_OF_TRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query trailList[?HomeRegion==\`$regx\`].Name --output text)
if [[ $LIST_OF_TRAILS ]]; then
for trail in $LIST_OF_TRAILS; do
FUNCTION_ENABLED_IN_TRAIL=$($AWSCLI cloudtrail get-event-selectors $PROFILE_OPT --trail-name $trail --region $regx --query "EventSelectors[*].DataResources[?Type == \`AWS::Lambda::Function\`].Values" --output text |xargs -n1| grep -E "^arn:aws:lambda.*function:$lambdafunction$|^arn:aws:lambda$")
if [[ $FUNCTION_ENABLED_IN_TRAIL ]]; then
textPass "$regx: Lambda function $lambdafunction enabled in trail $trail" "$regx"
else
textFail "$regx: Lambda function $lambdafunction NOT enabled in trail $trail" "$regx"
fi
done
# LIST_OF_MULTIREGION_TRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query "trailList[?IsMultiRegionTrail == \`true\`].Name" --output text)
# if [[ $LIST_OF_MULTIREGION_TRAILS ]]; then
# for trail in $LIST_OF_MULTIREGION_TRAILS; do
# REGION_OF_TRAIL=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query "trailList[?IsMultiRegionTrail == \`true\` && Name == \`$trail\` ].HomeRegion" --output text)
# FUNCTION_ENABLED_IN_THIS_REGION=$($AWSCLI cloudtrail get-event-selectors $PROFILE_OPT --trail-name $trail --region $REGION_OF_TRAIL --query "EventSelectors[*].DataResources[?Type == \`AWS::Lambda::Function\`].Values" --output text |xargs -n1| grep -E "^arn:aws:lambda.*function:$lambdafunction$")
# if [[ $FUNCTION_ENABLED_IN_THIS_REGION ]]; then
# textPass "$regx: Lambda function $lambdafunction enabled in trail $trail" "$regx"
# else
# textFail "$regx: Lambda function $lambdafunction NOT enabled in trail $trail" "$regx"
# fi
# done
# else
# textFail "$regx: Lambda function $lambdafunction is not being recorded!" "$regx"
# fi
else
textFail "$regx: Lambda function $lambdafunction is not being recorded no CloudTrail found!" "$regx"
fi
done
else
textInfo "$regx: No Lambda functions found" "$regx"
fi
done
}

37
checks/check_extra721 Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra721="7.21"
CHECK_TITLE_extra721="[extra721] Check if Redshift cluster has audit logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra721="NOT_SCORED"
CHECK_TYPE_extra721="EXTRA"
CHECK_ALTERNATE_check721="extra721"
extra721(){
# "Check if Redshift cluster has audit logging enabled (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_REDSHIFT_CLUSTERS=$($AWSCLI redshift describe-clusters $PROFILE_OPT --region $regx --query 'Clusters[*].ClusterIdentifier' --output text)
if [[ $LIST_OF_REDSHIFT_CLUSTERS ]]; then
for redshiftcluster in $LIST_OF_REDSHIFT_CLUSTERS;do
REDSHIFT_LOG_ENABLED=$($AWSCLI redshift describe-logging-status $PROFILE_OPT --region $regx --cluster-identifier $redshiftcluster --query LoggingEnabled --output text | grep True)
if [[ $REDSHIFT_LOG_ENABLED ]];then
REDSHIFT_LOG_ENABLED_BUCKET=$($AWSCLI redshift describe-logging-status $PROFILE_OPT --region $regx --cluster-identifier $redshiftcluster --query BucketName --output text)
textPass "$regx: Redshift cluster $redshiftcluster has audit logging enabled to bucket $REDSHIFT_LOG_ENABLED_BUCKET" "$regx"
else
textFail "$regx: Redshift cluster $redshiftcluster logging disabled!" "$regx"
fi
done
else
textInfo "$regx: No Redshift cluster configured" "$regx"
fi
done
}

44
checks/check_extra722 Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra722="7.22"
CHECK_TITLE_extra722="[extra722] Check if API Gateway has logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra722="NOT_SCORED"
CHECK_TYPE_extra722="EXTRA"
CHECK_ALTERNATE_check722="extra722"
extra722(){
# "Check if API Gateway has logging enabled (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_API_GW=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query items[*].id --output text)
if [[ $LIST_OF_API_GW ]];then
for apigwid in $LIST_OF_API_GW;do
API_GW_NAME=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query "items[?id==\`$apigwid\`].name" --output text)
CHECK_STAGES_NAME=$($AWSCLI apigateway get-stages $PROFILE_OPT --region $regx --rest-api-id $apigwid --query "item[*].stageName" --output text)
if [[ $CHECK_STAGES_NAME ]];then
for stagname in $CHECK_STAGES_NAME;do
CHECK_STAGE_METHOD_LOGGING=$($AWSCLI apigateway get-stages $PROFILE_OPT --region $regx --rest-api-id $apigwid --query "item[?stageName == \`$stagname\` ].methodSettings" --output text |awk '{ print $6 }' |egrep 'ERROR|INFO')
if [[ $CHECK_STAGE_METHOD_LOGGING ]];then
textPass "$regx: API Gateway $API_GW_NAME ID $apigwid in $stagname has logging enabled as $CHECK_STAGE_METHOD_LOGGING" "$regx"
else
textFail "$regx: API Gateway $API_GW_NAME ID $apigwid in $stagname has logging disabled" "$regx"
fi
done
else
textFail "$regx: No Stage name found for $API_GW_NAME" "$regx"
fi
done
else
textInfo "$regx: No API Gateway found" "$regx"
fi
done
}

51
checks/check_extra723 Normal file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra723="7.23"
CHECK_TITLE_extra723="[extra723] Check if RDS Snapshots and Cluster Snapshots are public (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra723="NOT_SCORED"
CHECK_TYPE_extra723="EXTRA"
CHECK_ALTERNATE_check723="extra723"
extra723(){
# "Check if RDS Snapshots are public (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
# RDS snapshots
LIST_OF_RDS_SNAPSHOTS=$($AWSCLI rds describe-db-snapshots $PROFILE_OPT --region $regx --query DBSnapshots[*].DBSnapshotIdentifier --output text)
if [[ $LIST_OF_RDS_SNAPSHOTS ]]; then
for rdssnapshot in $LIST_OF_RDS_SNAPSHOTS;do
SNAPSHOT_IS_PUBLIC=$($AWSCLI rds describe-db-snapshot-attributes $PROFILE_OPT --region $regx --db-snapshot-identifier $rdssnapshot --query DBSnapshotAttributesResult.DBSnapshotAttributes[*] --output text|grep ^ATTRIBUTEVALUES|cut -f2|grep all)
if [[ $SNAPSHOT_IS_PUBLIC ]];then
textFail "$regx: RDS Snapshot $rdssnapshot is public!" "$regx"
else
textPass "$regx: RDS Snapshot $rdssnapshot is not shared" "$regx"
fi
done
else
textInfo "$regx: No RDS Snapshots found" "$regx"
fi
# RDS cluster snapshots
LIST_OF_RDS_CLUSTER_SNAPSHOTS=$($AWSCLI rds describe-db-cluster-snapshots $PROFILE_OPT --region $regx --query DBClusterSnapshots[*].DBClusterSnapshotIdentifier --output text)
if [[ $LIST_OF_RDS_CLUSTER_SNAPSHOTS ]]; then
for rdsclustersnapshot in $LIST_OF_RDS_CLUSTER_SNAPSHOTS;do
CLUSTER_SNAPSHOT_IS_PUBLIC=$($AWSCLI rds describe-db-cluster-snapshot-attributes $PROFILE_OPT --region $regx --db-cluster-snapshot-identifier $rdsclustersnapshot --query DBClusterSnapshotAttributesResult.DBClusterSnapshotAttributes[*] --output text|grep ^ATTRIBUTEVALUES|cut -f2|grep all)
if [[ $CLUSTER_SNAPSHOT_IS_PUBLIC ]];then
textFail "$regx: RDS Cluster Snapshot $rdsclustersnapshot is public!" "$regx"
else
textPass "$regx: RDS Cluster Snapshot $rdsclustersnapshot is not shared" "$regx"
fi
done
else
textInfo "$regx: No RDS Cluster Snapshots found" "$regx"
fi
done
}

38
checks/check_extra724 Normal file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra724="7.24"
CHECK_TITLE_extra724="[extra724] Check if ACM certificates have Certificate Transparency logging enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra724="NOT_SCORED"
CHECK_TYPE_extra724="EXTRA"
CHECK_ALTERNATE_check724="extra724"
extra724(){
# "Check if ACM certificates have Certificate Transparency logging enabled (Not Scored) (Not part of CIS benchmark)"
for regx in $REGIONS; do
LIST_OF_CERTS=$($AWSCLI acm list-certificates $PROFILE_OPT --region $regx --query CertificateSummaryList[].CertificateArn --output text)
if [[ $LIST_OF_CERTS ]];then
for cert_arn in $LIST_OF_CERTS;do
CT_ENABLED=$($AWSCLI acm describe-certificate $PROFILE_OPT --region $regx --certificate-arn $cert_arn --query Certificate.Options.CertificateTransparencyLoggingPreference --output text)
CERT_DOMAIN_NAME=$(aws acm describe-certificate $PROFILE_OPT --region $regx --certificate-arn $cert_arn --query Certificate.DomainName --output text)
if [[ $CT_ENABLED == "ENABLED" ]];then
textPass "$regx: ACM Certificate $CERT_DOMAIN_NAME has Certificate Transparency logging enabled!" "$regx"
else
textFail "$regx: ACM Certificate $CERT_DOMAIN_NAME has Certificate Transparency logging disabled!" "$regx"
fi
done
else
textInfo "$regx: No ACM Certificates found" "$regx"
fi
done
textInfo "*Read more about this here: https://aws.amazon.com/blogs/security/how-to-get-ready-for-certificate-transparency/"
}

63
checks/check_extra725 Normal file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra725="7.25"
CHECK_TITLE_extra725="[extra725] Check if S3 buckets have Object-level logging enabled in CloudTrail (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra725="NOT_SCORED"
CHECK_TYPE_extra725="EXTRA"
CHECK_ALTERNATE_check725="extra725"
# per Object-level logging is not configured at Bucket level but at CloudTrail trail level
extra725(){
# "Check if S3 buckets have Object-level logging enabled in CloudTrail (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for S3 Buckets Object-level logging information in all trails... "
# create a file with a list of all buckets
TEMP_BUCKET_LIST_FILE=$(mktemp -t prowler.bucket-list-XXXXXX)
$AWSCLI s3api list-buckets --query 'Buckets[*].{Name:Name}' $PROFILE_OPT --region $REGION --output text > $TEMP_BUCKET_LIST_FILE
if [ ! -s $TEMP_BUCKET_LIST_FILE ]; then
textInfo "$regx: No S3 buckets found" "$regx"
exit
fi
# now create a list with all trails available and their region
TEMP_TRAILS_LIST_FILE=$(mktemp -t prowler.trails-list-XXXXXX)
for regx in $REGIONS; do
$AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query trailList[?HomeRegion==\`$regx\`].[Name,HomeRegion] --output text >> $TEMP_TRAILS_LIST_FILE
done
# look for buckets being logged per trail and create a list with them
TEMP_BUCKETS_LOGGING_LIST_FILE=$(mktemp -t prowler.buckets-logging-list-XXXXXX)
while IFS='' read -r LINE || [[ -n "${LINE}" ]]; do
TRAIL_REGION=$(echo "${LINE}" | awk '{ print $2 }')
TRAIL_NAME=$(echo "${LINE}" | awk '{ print $1 }')
BUCKETS_OBJECT_LOGGING_ENABLED=$($AWSCLI cloudtrail get-event-selectors --trail-name "${TRAIL_NAME}" $PROFILE_OPT --region $TRAIL_REGION --query "EventSelectors[*].DataResources[?Type == \`AWS::S3::Object\`].Values" --output text |xargs -n1 |cut -d: -f 6|sed 's/\///g')
echo $BUCKETS_OBJECT_LOGGING_ENABLED |tr " " "\n"|sort >> $TEMP_BUCKETS_LOGGING_LIST_FILE
if [[ $BUCKETS_OBJECT_LOGGING_ENABLED ]]; then
for bucket in $BUCKETS_OBJECT_LOGGING_ENABLED; do
textPass "$regx: S3 bucket $bucket has Object-level logging enabled in trail $trail" "$regx"
done
fi
done < $TEMP_TRAILS_LIST_FILE
# diff to get the ones that are not in any trail then they are not logging
BUCKETS_NOT_LOGGING=$(diff $TEMP_BUCKETS_LOGGING_LIST_FILE $TEMP_BUCKET_LIST_FILE | sed -n 's/^> //p')
if [[ $BUCKETS_NOT_LOGGING ]]; then
for bucket in $BUCKETS_NOT_LOGGING; do
textFail "$regx: S3 bucket $bucket has Object-level logging disabled" "$regx"
done
fi
# delete all temp files
rm -fr $TEMP_BUCKET_LIST_FILE $TEMP_TRAILS_LIST_FILE $TEMP_BUCKETS_LOGGING_LIST_FILE
}

51
checks/check_extra726 Normal file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra726="7.26"
CHECK_TITLE_extra726="[extra726] Check Trusted Advisor for errors and warnings (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra726="NOT_SCORED"
CHECK_TYPE_extra726="EXTRA"
CHECK_ALTERNATE_check726="extra726"
extra726(){
trap "exit" INT
# forcing us-east-1 region only since support only works in that region
TA_CHECKS_ID=$($AWSCLI support describe-trusted-advisor-checks --language en $PROFILE_OPT --region us-east-1 --query checks[*].id --output text 2>&1)
if [[ $(echo "$TA_CHECKS_ID" | grep SubscriptionRequiredException) ]]; then
textInfo "Trusted Advisor requires AWS Premium Support Subscription"
return
fi
for checkid in $TA_CHECKS_ID; do
TA_CHECKS_NAME=$($AWSCLI support describe-trusted-advisor-checks --language en $PROFILE_OPT --region us-east-1 --query "checks[?id==\`$checkid\`].{name:name}[*]" --output text)
QUERY_TA_CHECK_RESULT=$($AWSCLI support describe-trusted-advisor-check-result --check-id $checkid --language en $PROFILE_OPT --region us-east-1 --query 'result.status' --output text)
# Possible results - https://docs.aws.amazon.com/cli/latest/reference/support/describe-trusted-advisor-check-result.html
case "$QUERY_TA_CHECK_RESULT" in
"ok")
textPass "Trusted Advisor check $TA_CHECKS_NAME is in ok state $QUERY_TA_CHECK_RESULT"
;;
"error")
textFail "Trusted Advisor check $TA_CHECKS_NAME is in error state $QUERY_TA_CHECK_RESULT"
;;
"warning")
textInfo "Trusted Advisor check $TA_CHECKS_NAME is in warning state $QUERY_TA_CHECK_RESULT"
;;
"not_available")
textInfo "Trusted Advisor check $TA_CHECKS_NAME is in not_available state $QUERY_TA_CHECK_RESULT"
;;
"*")
textFail "Trusted Advisor check $TA_CHECKS_NAME is in unknown state $QUERY_TA_CHECK_RESULT"
;;
esac
done
}

50
checks/check_extra727 Normal file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra727="7.27"
CHECK_TITLE_extra727="[extra727] Check if SQS queues have policy set as Public (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra727="NOT_SCORED"
CHECK_TYPE_extra727="EXTRA"
CHECK_ALTERNATE_check727="extra727"
extra727(){
for regx in $REGIONS; do
LIST_SQS=$($AWSCLI sqs list-queues $PROFILE_OPT --region $regx --query QueueUrls --output text |grep -v ^None)
if [[ $LIST_SQS ]]; then
for queue in $LIST_SQS; do
SQS_POLICY=$($AWSCLI sqs get-queue-attributes --queue-url $queue $PROFILE_OPT --region $regx --attribute-names All --query Attributes.Policy)
if [[ "$SQS_POLICY" != "null" ]]; then
SQS_POLICY_ALLOW_ALL=$(echo $SQS_POLICY \
| jq '. | fromjson' | jq '.Statement[] | select(.Effect=="Allow") | select(.Principal=="*" or .Principal.AWS=="*" or .Principal.CanonicalUser=="*")')
if [[ $SQS_POLICY_ALLOW_ALL ]]; then
SQS_POLICY_ALLOW_ALL_WITHOUT_CONDITION=$(echo $SQS_POLICY \
| jq '. | fromjson' | jq '.Statement[] | select(.Effect=="Allow") | select(.Principal=="*" or .Principal.AWS=="*" or .Principal.CanonicalUser=="*") | select(has("Condition") | not)')
if [[ $SQS_POLICY_ALLOW_ALL_WITHOUT_CONDITION ]]; then
SQS_POLICY_ALLOW_ALL_WITHOUT_CONDITION_DETAILS=$(echo $SQS_POLICY_ALLOW_ALL_WITHOUT_CONDITION \
| jq '"[Principal: " + (.Principal|tostring) + " Action: " + (.Action|tostring) + "]"' )
textFail "$regx: SQS $queue queue policy with public access: $SQS_POLICY_ALLOW_ALL_WITHOUT_CONDITION_DETAILS" "$regx"
else
textInfo "$regx: SQS $queue queue policy with public access but has a Condition" "$regx"
fi
else
textPass "$regx: SQS $queue queue without public access" "$regx"
fi
else
textPass "$regx: SQS $queue queue without policy" "$regx"
fi
done
else
textInfo "$regx: No SQS queues found" "$regx"
fi
done
}

37
checks/check_extra728 Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra728="7.28"
CHECK_TITLE_extra728="[extra728] Check if SQS queues have Server Side Encryption enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra728="NOT_SCORED"
CHECK_TYPE_extra728="EXTRA"
CHECK_ALTERNATE_check728="extra728"
extra728(){
for regx in $REGIONS; do
LIST_SQS=$($AWSCLI sqs list-queues $PROFILE_OPT --region $regx --query QueueUrls --output text |grep -v ^None)
if [[ $LIST_SQS ]]; then
for queue in $LIST_SQS; do
# check if the policy has KmsMasterKeyId therefore SSE enabled
SSE_ENABLED_QUEUE=$($AWSCLI sqs get-queue-attributes --queue-url $queue $PROFILE_OPT --region $regx --attribute-names All --query Attributes.KmsMasterKeyId --output text|grep -v ^None)
if [[ $SSE_ENABLED_QUEUE ]]; then
textPass "$regx: SQS queue $queue is using Server Side Encryption" "$regx"
else
textFail "$regx: SQS queue $queue is not using Server Side Encryption" "$regx"
fi
done
else
textInfo "$regx: No SQS queues found" "$regx"
fi
done
}

37
checks/check_extra729 Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra729="7.29"
CHECK_TITLE_extra729="[extra729] Ensure there are no EBS Volumes unencrypted (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra729="NOT_SCORED"
CHECK_TYPE_extra729="EXTRA"
CHECK_ALTERNATE_check729="extra729"
extra729(){
# "Ensure there are no EBS Volumes unencrypted (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for EBS Volumes in all regions... "
for regx in $REGIONS; do
LIST_OF_EBS_NON_ENC_VOLUMES=$($AWSCLI ec2 describe-volumes $PROFILE_OPT --region $regx --query 'Volumes[?Encrypted==`false`].VolumeId' --output text)
if [[ $LIST_OF_EBS_NON_ENC_VOLUMES ]];then
for volume in $LIST_OF_EBS_NON_ENC_VOLUMES; do
textFail "$regx: $volume is not encrypted!" "$regx"
done
fi
LIST_OF_EBS_ENC_VOLUMES=$($AWSCLI ec2 describe-volumes $PROFILE_OPT --region $regx --query 'Volumes[?Encrypted==`true`].VolumeId' --output text)
if [[ $LIST_OF_EBS_ENC_VOLUMES ]];then
for volume in $LIST_OF_EBS_ENC_VOLUMES; do
textPass "$regx: $volume is encrypted" "$regx"
done
fi
done
}

154
checks/check_extra73 Normal file
View File

@@ -0,0 +1,154 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra73="7.3,7.03"
CHECK_TITLE_extra73="[extra73] Ensure there are no S3 buckets open to the Everyone or Any AWS user (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra73="NOT_SCORED"
CHECK_TYPE_extra73="EXTRA"
CHECK_ALTERNATE_extra703="extra73"
CHECK_ALTERNATE_check73="extra73"
CHECK_ALTERNATE_check703="extra73"
# Verified with AWS support that if get-bucket-acl doesn't return a grant
# for All and get-bucket-policy-status returns IsPublic false or bad request
# (no policy) then the bucket can be considered not public - though
# individual objects may still be. If in addition put-public-access-block is
# used to set IgnorePublicAcls and RestrictPublicBuckets to true then that
# causes Amazon S3 to ignore all public ACLs on a bucket and any objects that
# it contains.
#
# This check does not address legacy ACLs or policies that would give
# public access if not blocked at account or bucket level, instead it tries
# to reward the use of more broadly restrictive controls with quicker and less
# computational intensive checks.
#
# If we are assembling an inventory then maybe that is not what we want but
# for day to day usage that is probably desirable.
extra73(){
textInfo "Looking for open S3 Buckets (ACLs and Policies) in all regions... "
#
# If public ACLs disabled at account level then look no further
#
ACCOUNT_PUBLIC_ACCESS_BLOCK=$($AWSCLI s3control get-public-access-block $PROFILE_OPT --region $REGION --account-id $ACCOUNT_NUM --output json 2>&1)
if [[ $(echo "$ACCOUNT_PUBLIC_ACCESS_BLOCK" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Public Access Block for $bucket"
return
fi
if [[ $(echo "$ACCOUNT_PUBLIC_ACCESS_BLOCK" | grep NoSuchPublicAccessBlockConfiguration) ]]; then
ACCOUNTIGNOREPUBLICACLS=""
ACCOUNTRESTRICTPUBLICBUCKETS=""
else
ACCOUNTIGNOREPUBLICACLS=$(echo "$ACCOUNT_PUBLIC_ACCESS_BLOCK" | jq -r '.PublicAccessBlockConfiguration.IgnorePublicAcls')
ACCOUNTRESTRICTPUBLICBUCKETS=$(echo "$ACCOUNT_PUBLIC_ACCESS_BLOCK" | jq -r '.PublicAccessBlockConfiguration.RestrictPublicBuckets')
fi
if [[ $ACCOUNTIGNOREPUBLICACLS == "true" && $ACCOUNTRESTRICTPUBLICBUCKETS == "true" ]]; then
textPass "All S3 public access blocked at account level"
return
fi
#
# Otherwise start to iterate bucket
#
ALL_BUCKETS_LIST=$($AWSCLI s3api list-buckets --query 'Buckets[*].{Name:Name}' $PROFILE_OPT --output text 2>&1)
if [[ $(echo "$ALL_BUCKETS_LIST" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to List Buckets"
return
fi
if [[ "$ALL_BUCKETS_LIST" == "" ]]; then
textInfo "No buckets found"
return
fi
for bucket in $ALL_BUCKETS_LIST; do
#
# LOCATION - requests referencing buckets created after March 20, 2019
# must be made to S3 endpoints in the same region as the bucket was
# created.
#
BUCKET_LOCATION=$($AWSCLI s3api get-bucket-location --bucket $bucket $PROFILE_OPT --output text 2>&1)
if [[ $(echo "$BUCKET_LOCATION" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Location for $bucket"
continue
fi
if [[ "None" == $BUCKET_LOCATION ]]; then
BUCKET_LOCATION="us-east-1"
fi
if [[ "EU" == $BUCKET_LOCATION ]]; then
BUCKET_LOCATION="eu-west-1"
fi
#
# If public ACLs disabled at bucket level then look no further
#
BUCKET_PUBLIC_ACCESS_BLOCK=$($AWSCLI s3api get-public-access-block $PROFILE_OPT --region $BUCKET_LOCATION --bucket $bucket --output json 2>&1)
if [[ $(echo "$BUCKET_PUBLIC_ACCESS_BLOCK" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Public Access Block for $bucket"
continue
fi
if [[ $(echo "$BUCKET_PUBLIC_ACCESS_BLOCK" | grep NoSuchPublicAccessBlockConfiguration) ]]; then
BUCKETIGNOREPUBLICACLS=""
BUCKETRESTRICTPUBLICBUCKETS=""
else
BUCKETIGNOREPUBLICACLS=$(echo "$BUCKET_PUBLIC_ACCESS_BLOCK" | jq -r '.PublicAccessBlockConfiguration.IgnorePublicAcls')
BUCKETRESTRICTPUBLICBUCKETS=$(echo "$BUCKET_PUBLIC_ACCESS_BLOCK" | jq -r '.PublicAccessBlockConfiguration.RestrictPublicBuckets')
fi
if [[ $BUCKETIGNOREPUBLICACLS == "true" && $BUCKETRESTRICTPUBLICBUCKETS == "true" ]]; then
textPass "$BUCKET_LOCATION: $bucket bucket is not Public" "$BUCKET_LOCATION"
continue
fi
#
# Check for public ACL grants
#
BUCKET_ACL=$($AWSCLI s3api get-bucket-acl $PROFILE_OPT --region $BUCKET_LOCATION --bucket $bucket --output json 2>&1)
if [[ $(echo "$BUCKET_ACL" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Acl for $bucket"
continue
fi
ALLUSERS_ACL=$(echo "$BUCKET_ACL" | jq '.Grants[]|select(.Grantee.URI != null)|select(.Grantee.URI | endswith("/AllUsers"))')
if [[ $ALLUSERS_ACL != "" ]]; then
textFail "$BUCKET_LOCATION: $bucket bucket is Public!" "$BUCKET_LOCATION"
continue
fi
AUTHENTICATEDUSERS_ACL=$(echo "$BUCKET_ACL" | jq '.Grants[]|select(.Grantee.URI != null)|select(.Grantee.URI | endswith("/AuthenticatedUsers"))')
if [[ $AUTHENTICATEDUSERS_ACL != "" ]]; then
textFail "$BUCKET_LOCATION: $bucket bucket is Public!" "$BUCKET_LOCATION"
continue
fi
#
# Check for public access in policy
#
BUCKET_POLICY_STATUS=$($AWSCLI s3api get-bucket-policy-status $PROFILE_OPT --region $BUCKET_LOCATION --bucket $bucket --query PolicyStatus.IsPublic --output text 2>&1)
if [[ $(echo "$BUCKET_POLICY_STATUS" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Bucket Policy Status for $bucket"
continue
fi
if [[ $(echo "$BUCKET_POLICY_STATUS" | grep NoSuchBucketPolicy) ]]; then
BUCKET_POLICY_STATUS="False"
fi
if [[ $BUCKET_POLICY_STATUS != "" && $BUCKET_POLICY_STATUS != "False" ]]; then
textFail "$BUCKET_LOCATION: $bucket bucket is Public!" "$BUCKET_LOCATION"
continue
fi
textPass "$BUCKET_LOCATION: $bucket bucket is not Public" "$BUCKET_LOCATION"
done
}

43
checks/check_extra730 Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
DAYS_TO_EXPIRE_THRESHOLD="7"
CHECK_ID_extra730="7.30"
CHECK_TITLE_extra730="[extra730] Check if ACM Certificates are about to expire in $DAYS_TO_EXPIRE_THRESHOLD days or less (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra730="NOT_SCORED"
CHECK_TYPE_extra730="EXTRA"
CHECK_ALTERNATE_check730="extra730"
extra730(){
# "Check if ACM Certificates are about to expire in $DAYS_TO_EXPIRE_THRESHOLD days or less"
for regx in $REGIONS; do
LIST_OF_ACM_CERTS=$($AWSCLI acm list-certificates $PROFILE_OPT --region $regx --query 'CertificateSummaryList[].CertificateArn' --output text)
if [[ $LIST_OF_ACM_CERTS ]];then
for cert in $LIST_OF_ACM_CERTS; do
CERT_DATA=$($AWSCLI acm describe-certificate $PROFILE_OPT --region $regx --certificate-arn $cert --query 'Certificate.[DomainName,NotAfter]' --output text)
echo "$CERT_DATA" | while read FQDN NOTAFTER; do
EXPIRES_DATE=$(timestamp_to_date $NOTAFTER)
COUNTER_DAYS=$(how_many_days_from_today $EXPIRES_DATE)
if [[ $COUNTER_DAYS -le $DAYS_TO_EXPIRE_THRESHOLD ]]; then
textFail "$regx: Certificate for $FQDN is about to expire in $COUNTER_DAYS days!" "$regx"
else
textPass "$regx: Certificate for $FQDN expires in $COUNTER_DAYS days" "$regx"
fi
done
done
else
textInfo "$regx: No certificates found" "$regx"
fi
done
}

47
checks/check_extra731 Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra731="7.31"
CHECK_TITLE_extra731="[extra731] Check if SNS topics have policy set as Public (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra731="NOT_SCORED"
CHECK_TYPE_extra731="EXTRA"
CHECK_ALTERNATE_check731="extra731"
extra731(){
for regx in $REGIONS; do
LIST_SNS=$($AWSCLI sns list-topics $PROFILE_OPT --region $regx --query Topics --output text |grep -v ^None)
if [[ $LIST_SNS ]]; then
for topic in $LIST_SNS; do
SHORT_TOPIC=$(echo $topic| cut -d: -f6)
SNS_POLICY=$($AWSCLI sns get-topic-attributes --topic-arn $topic $PROFILE_OPT --region $regx --query Attributes.Policy 2>/dev/null)
SNS_POLICY_ALLOW_ALL=$(echo $SNS_POLICY \
| jq '. | fromjson' | jq '.Statement[] | select(.Effect=="Allow") | select(.Principal=="*" or .Principal.AWS=="*" or .Principal.CanonicalUser=="*")')
if [[ $SNS_POLICY_ALLOW_ALL ]]; then
SNS_POLICY_ALLOW_ALL_WITHOUT_CONDITION=$(echo $SNS_POLICY \
| jq '. | fromjson' | jq '.Statement[] | select(.Effect=="Allow") | select(.Principal=="*" or .Principal.AWS=="*" or .Principal.CanonicalUser=="*") | select(has("Condition") | not)')
if [[ $SNS_POLICY_ALLOW_ALL_WITHOUT_CONDITION ]]; then
SNS_POLICY_ALLOW_ALL_WITHOUT_CONDITION_DETAILS=$(echo $SNS_POLICY_ALLOW_ALL_WITHOUT_CONDITION \
| jq '"[Principal: " + (.Principal|tostring) + " Action: " + (.Action|tostring) + "]"' )
textFail "$regx: SNS topic $SHORT_TOPIC's policy with public access: $SNS_POLICY_ALLOW_ALL_WITHOUT_CONDITION_DETAILS" "$SHORT_TOPIC" "$regx"
else
textPass "$regx: SNS topic $SHORT_TOPIC's policy with public access but has a Condition" "$SHORT_TOPIC" "$regx"
fi
else
textPass "$regx: SNS topic without public access" "$SHORT_TOPIC" "$regx"
fi
done
else
textInfo "$regx: No SNS topic found" "$SHORT_TOPIC" "$regx"
fi
done
}

34
checks/check_extra732 Normal file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra732="7.32"
CHECK_TITLE_extra732="[extra732] Check if Geo restrictions are enabled in CloudFront distributions (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra732="NOT_SCORED"
CHECK_TYPE_extra732="EXTRA"
CHECK_ALTERNATE_check732="extra732"
extra732(){
LIST_DISTRIBUTIONS=$($AWSCLI cloudfront list-distributions $PROFILE_OPT --query 'DistributionList.Items[*].Id' --output text |grep -v ^None)
if [[ $LIST_DISTRIBUTIONS ]]; then
for dist in $LIST_DISTRIBUTIONS; do
GEO_ENABLED=$($AWSCLI cloudfront get-distribution-config $PROFILE_OPT --id $dist --query DistributionConfig.Restrictions.GeoRestriction.RestrictionType --output text)
if [[ $GEO_ENABLED == "none" ]]; then
textFail "CloudFront distribution $dist has not Geo restrictions"
else
textPass "CloudFront distribution $dist has Geo restrictions enabled"
fi
done
else
textInfo "No CloudFront distributions found"
fi
}

30
checks/check_extra733 Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra733="7.33"
CHECK_TITLE_extra733="[extra733] Check if there are SAML Providers then STS can be used (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra733="NOT_SCORED"
CHECK_TYPE_extra733="EXTRA"
CHECK_ALTERNATE_check733="extra733"
extra733(){
LIST_SAML_PROV=$($AWSCLI iam list-saml-providers $PROFILE_OPT --query 'SAMLProviderList[*].Arn' --output text |grep -v ^None)
if [[ $LIST_SAML_PROV ]]; then
for provider in $LIST_SAML_PROV; do
PROVIDER_NAME=$(echo $provider| cut -d/ -f2)
textInfo "SAML Provider $PROVIDER_NAME has been found"
done
else
textInfo "No SAML Provider found, add one and use STS"
fi
}

74
checks/check_extra734 Normal file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra734="7.34"
CHECK_TITLE_extra734="[extra734] Check if S3 buckets have default encryption (SSE) enabled or use a bucket policy to enforce it (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra734="NOT_SCORED"
CHECK_TYPE_extra734="EXTRA"
CHECK_ALTERNATE_check734="extra734"
extra734(){
LIST_OF_BUCKETS=$($AWSCLI s3api list-buckets $PROFILE_OPT --query Buckets[*].Name --output text|xargs -n1)
if [[ $LIST_OF_BUCKETS ]]; then
for bucket in $LIST_OF_BUCKETS;do
# For this test to pass one of the following must be present:
# - Configure ServerSideEncryptionConfiguration rule for AES256 or aws:kms
# OR
# - Have bucket policy denying s3:PutObject when s3:x-amz-server-side-encryption is absent
# query to get if has encryption enabled or not
RESULT=$($AWSCLI s3api get-bucket-encryption $PROFILE_OPT --bucket $bucket --query ServerSideEncryptionConfiguration.Rules[].ApplyServerSideEncryptionByDefault[].SSEAlgorithm --output text 2>&1)
if [[ $(echo "$RESULT" | grep AccessDenied) ]]; then
textFail "Access Denied Trying to Get Encryption for $bucket"
continue
fi
if [[ $RESULT == "AES256" || $RESULT == "aws:kms" ]];
then
textPass "Bucket $bucket is enabled for default encryption with $RESULT"
continue
fi
TEMP_SSE_POLICY_FILE=$(mktemp -t prowler-${ACCOUNT_NUM}-${bucket}.policy.XXXXXXXXXX)
# get bucket policy
$AWSCLI s3api get-bucket-policy $PROFILE_OPT --bucket $bucket --output text --query Policy > $TEMP_SSE_POLICY_FILE 2>&1
if [[ $(grep AccessDenied $TEMP_SSE_POLICY_FILE) ]]; then
textFail "Access Denied Trying to Get Bucket Policy for $bucket"
rm -f $TEMP_SSE_POLICY_FILE
continue
fi
if [[ $(grep NoSuchBucketPolicy $TEMP_SSE_POLICY_FILE) ]]; then
textFail "No bucket policy for $bucket"
rm -f $TEMP_SSE_POLICY_FILE
continue
fi
# check if the S3 policy forces SSE s3:x-amz-server-side-encryption:true
CHECK_BUCKET_SSE_POLICY_PRESENT=$(cat $TEMP_SSE_POLICY_FILE | jq --arg arn "arn:aws:s3:::${bucket}/*" '.Statement[]|select(.Effect=="Deny" and ((.Principal|type == "object") and .Principal.AWS == "*") or ((.Principal|type == "string") and .Principal == "*") and .Action=="s3:PutObject" and .Resource==$arn and .Condition.StringEquals."s3:x-amz-server-side-encryption" != null)')
if [[ $CHECK_BUCKET_SSE_POLICY_PRESENT == "" ]]; then
textFail "Bucket $bucket does not enforce encryption!"
rm -f $TEMP_SSE_POLICY_FILE
continue
fi
CHECK_BUCKET_SSE_POLICY_VALUE=$(echo "$CHECK_BUCKET_SSE_POLICY_PRESENT" | jq -r '.Condition.StringNotEquals."s3:x-amz-server-side-encryption"')
textPass "Bucket $bucket has S3 bucket policy to enforce encryption with $CHECK_BUCKET_SSE_POLICY_VALUE"
rm -f $TEMP_SSE_POLICY_FILE
done
else
textInfo "No S3 Buckets found"
fi
}

36
checks/check_extra735 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra735="7.35"
CHECK_TITLE_extra735="[extra735] Check if RDS instances storage is encrypted (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra735="NOT_SCORED"
CHECK_TYPE_extra735="EXTRA"
CHECK_ALTERNATE_check735="extra735"
extra735(){
textInfo "Looking for RDS Volumes in all regions... "
for regx in $REGIONS; do
LIST_OF_RDS_INSTANCES=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --query 'DBInstances[*].DBInstanceIdentifier' --output text)
if [[ $LIST_OF_RDS_INSTANCES ]];then
for rdsinstance in $LIST_OF_RDS_INSTANCES; do
IS_ENCRYPTED=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --db-instance-identifier $rdsinstance --query 'DBInstances[*].StorageEncrypted' --output text)
if [[ $IS_ENCRYPTED == "False" ]]; then
textFail "$regx: RDS instance $rdsinstance is not encrypted!" "$regx"
else
textPass "$regx: RDS instance $rdsinstance is encrypted" "$regx"
fi
done
else
textInfo "$regx: No RDS instances found" "$regx"
fi
done
}

36
checks/check_extra736 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra736="7.36"
CHECK_TITLE_extra736="[extra736] Check exposed KMS keys (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra736="NOT_SCORED"
CHECK_TYPE_extra736="EXTRA"
CHECK_ALTERNATE_check736="extra736"
extra736(){
textInfo "Looking for KMS keys in all regions... "
for regx in $REGIONS; do
LIST_OF_CUSTOMER_KMS_KEYS=$($AWSCLI kms list-aliases $PROFILE_OPT --region $regx --output text |grep -v :alias/aws/ |awk '{ print $4 }')
if [[ $LIST_OF_CUSTOMER_KMS_KEYS ]];then
for key in $LIST_OF_CUSTOMER_KMS_KEYS; do
CHECK_POLICY=$($AWSCLI kms get-key-policy --key-id $key --policy-name default $PROFILE_OPT --region $regx --output text|awk '/Principal/{n=NR+1} n>=NR' |grep AWS\"\ :\ \"\\*\"$)
if [[ $CHECK_POLICY ]]; then
textFail "$regx: KMS key $key may be publicly accessible!" "$regx"
else
textPass "$regx: KMS key $key is not exposed to Public" "$regx"
fi
done
else
textInfo "$regx: No KMS keys found" "$regx"
fi
done
}

36
checks/check_extra737 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra737="7.37"
CHECK_TITLE_extra737="[extra737] Check KMS keys with key rotation disabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra737="NOT_SCORED"
CHECK_TYPE_extra737="EXTRA"
CHECK_ALTERNATE_check737="extra737"
extra737(){
textInfo "Looking for KMS keys in all regions... "
for regx in $REGIONS; do
LIST_OF_CUSTOMER_KMS_KEYS=$($AWSCLI kms list-aliases $PROFILE_OPT --region $regx --output text |grep -v :alias/aws/ |awk '{ print $4 }')
if [[ $LIST_OF_CUSTOMER_KMS_KEYS ]];then
for key in $LIST_OF_CUSTOMER_KMS_KEYS; do
CHECK_ROTATION=$($AWSCLI kms get-key-rotation-status --key-id $key $PROFILE_OPT --region $regx --output text)
if [[ $CHECK_ROTATION == "False" ]]; then
textFail "$regx: KMS key $key has rotation disabled!" "$regx"
else
textPass "$regx: KMS key $key has rotation enabled" "$regx"
fi
done
else
textInfo "$regx: No KMS keys found" "$regx"
fi
done
}

35
checks/check_extra738 Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra738="7.38"
CHECK_TITLE_extra738="[extra738] Check if CloudFront distributions are set to HTTPS (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra738="NOT_SCORED"
CHECK_TYPE_extra738="EXTRA"
CHECK_ALTERNATE_check738="extra738"
extra738(){
LIST_OF_DISTRIBUTIONS=$($AWSCLI cloudfront list-distributions --query 'DistributionList.Items[*].Id' $PROFILE_OPT --output text|grep -v ^None)
if [[ $LIST_OF_DISTRIBUTIONS ]];then
for dist in $LIST_OF_DISTRIBUTIONS; do
CHECK_HTTPS_STATUS=$($AWSCLI cloudfront get-distribution --id $dist --query Distribution.DistributionConfig.DefaultCacheBehavior.ViewerProtocolPolicy $PROFILE_OPT --output text)
if [[ $CHECK_HTTPS_STATUS == "allow-all" ]]; then
textFail "CloudFront distribution $dist viewers can use HTTP or HTTPS!" "$regx"
elif [[ $CHECK_HTTPS_STATUS == "redirect-to-https" ]]; then
textPass "CloudFront distribution $dist has redirect to HTTPS" "$regx"
else
textPass "CloudFront distribution $dist has HTTPS only" "$regx"
fi
done
else
textInfo "No CloudFront distributions found" "$regx"
fi
}

36
checks/check_extra739 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra739="7.39"
CHECK_TITLE_extra739="[extra739] Check if RDS instances have backup enabled (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra739="NOT_SCORED"
CHECK_TYPE_extra739="EXTRA"
CHECK_ALTERNATE_check739="extra739"
extra739(){
for regx in $REGIONS; do
LIST_OF_RDS_INSTANCES=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --query 'DBInstances[*].DBInstanceIdentifier' --output text)
if [[ $LIST_OF_RDS_INSTANCES ]];then
for rdsinstance in $LIST_OF_RDS_INSTANCES; do
# if retention is 0 then is disabled
BACKUP_RETENTION=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --db-instance-identifier $rdsinstance --query 'DBInstances[*].BackupRetentionPeriod' --output text)
if [[ $BACKUP_RETENTION == "0" ]]; then
textFail "$regx: RDS instance $rdsinstance has not backup enabled!" "$regx"
else
textPass "$regx: RDS instance $rdsinstance has backup enabled with retention period $BACKUP_RETENTION days " "$regx"
fi
done
else
textInfo "$regx: No RDS instances found" "$regx"
fi
done
}

35
checks/check_extra74 Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra74="7.4,7.04"
CHECK_TITLE_extra74="[extra74] Ensure there are no Security Groups without ingress filtering being used (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra74="NOT_SCORED"
CHECK_TYPE_extra74="EXTRA"
CHECK_ALTERNATE_extra704="extra74"
CHECK_ALTERNATE_check74="extra74"
CHECK_ALTERNATE_check704="extra74"
extra74(){
# "Ensure there are no Security Groups without ingress filtering being used (Not Scored) (Not part of CIS benchmark)"
textInfo "Looking for Security Groups in all regions... "
for regx in $REGIONS; do
LIST_OF_SECURITYGROUPS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --filters "Name=ip-permission.cidr,Values=0.0.0.0/0" --query "SecurityGroups[].[GroupId]" --output text --max-items $MAXITEMS)
for SG_ID in $LIST_OF_SECURITYGROUPS; do
SG_NO_INGRESS_FILTER=$($AWSCLI ec2 describe-network-interfaces $PROFILE_OPT --region $regx --filters "Name=group-id,Values=$SG_ID" --query "length(NetworkInterfaces)" --output text)
if [[ $SG_NO_INGRESS_FILTER -ne 0 ]];then
textFail "$regx: $SG_ID has no ingress filtering and it is being used!" "$regx"
else
textInfo "$regx: $SG_ID has no ingress filtering but it is not being used" "$regx"
fi
done
done
}

36
checks/check_extra740 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2018) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra740="7.40"
CHECK_TITLE_extra740="[extra740] Check if EBS snapshots are encrypted (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra740="NOT_SCORED"
CHECK_TYPE_extra740="EXTRA"
CHECK_ALTERNATE_check740="extra740"
extra740(){
textInfo "Looking for EBS Snapshots in all regions... "
for regx in $REGIONS; do
LIST_OF_EBS_SNAPSHOTS=$($AWSCLI ec2 describe-snapshots $PROFILE_OPT --region $regx --owner-ids $ACCOUNT_NUM --output text --query 'Snapshots[*].{ID:SnapshotId}' --max-items $MAXITEMS | grep -v None 2> /dev/null)
if [[ $LIST_OF_EBS_SNAPSHOTS ]];then
for snapshot in $LIST_OF_EBS_SNAPSHOTS; do
SNAPSHOT_IS_ENCRYPTED=$($AWSCLI ec2 describe-snapshots $PROFILE_OPT --region $regx --output text --snapshot-id $snapshot --query Snapshots[*].Encrypted|grep False)
if [[ $SNAPSHOT_IS_ENCRYPTED ]];then
textFail "$regx: $snapshot is currently not encrypted!" "$regx"
else
textPass "$regx: $snapshot is encrypted" "$regx"
fi
done
else
textInfo "$regx: No EBS Snapshots found" "$regx"
fi
done
}

68
checks/check_extra741 Normal file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra741="7.41"
CHECK_TITLE_extra741="[extra741] Find secrets in EC2 User Data (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra741="NOT_SCORED"
CHECK_TYPE_extra741="EXTRA"
CHECK_ALTERNATE_check741="extra741"
extra741(){
SECRETS_TEMP_FOLDER="$PROWLER_DIR/secrets-$ACCOUNT_NUM"
if [[ ! -d $SECRETS_TEMP_FOLDER ]]; then
# this folder is deleted once this check is finished
mkdir $SECRETS_TEMP_FOLDER
fi
textInfo "Looking for secrets in EC2 User Data in instances across all regions... (max 100 instances per region use -m to increase it) "
for regx in $REGIONS; do
LIST_OF_EC2_INSTANCES=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query Reservations[*].Instances[*].InstanceId --output text --max-items $MAXITEMS | grep -v None)
if [[ $LIST_OF_EC2_INSTANCES ]];then
for instance in $LIST_OF_EC2_INSTANCES; do
EC2_USERDATA_FILE="$SECRETS_TEMP_FOLDER/extra741-$instance-userData.decoded"
EC2_USERDATA=$($AWSCLI ec2 describe-instance-attribute --attribute userData $PROFILE_OPT --region $regx --instance-id $instance --query UserData.Value --output text| grep -v ^None | decode_report > $EC2_USERDATA_FILE)
if [ -s $EC2_USERDATA_FILE ];then
FILE_FORMAT_ASCII=$(file -b $EC2_USERDATA_FILE|grep ASCII)
# This finds ftp or http URLs with credentials and common keywords
# FINDINGS=$(egrep -i '[[:alpha:]]*://[[:alnum:]]*:[[:alnum:]]*@.*/|key|secret|token|pass' $EC2_USERDATA_FILE |wc -l|tr -d '\ ')
# New implementation using https://github.com/Yelp/detect-secrets
if [[ $FILE_FORMAT_ASCII ]]; then
FINDINGS=$(secretsDetector file $EC2_USERDATA_FILE)
if [[ $FINDINGS -eq 0 ]]; then
textPass "$regx: No secrets found in $instance" "$regx"
# delete file if nothing interesting is there
rm -f $EC2_USERDATA_FILE
else
textFail "$regx: Potential secret found in $instance" "$regx"
# delete file to not leave trace, user must look at the instance User Data
rm -f $EC2_USERDATA_FILE
fi
else
mv $EC2_USERDATA_FILE $EC2_USERDATA_FILE.gz ; gunzip $EC2_USERDATA_FILE.gz
FINDINGS=$(secretsDetector file $EC2_USERDATA_FILE)
if [[ $FINDINGS -eq 0 ]]; then
textPass "$regx: No secrets found in $instance User Data" "$regx"
rm -f $EC2_USERDATA_FILE
else
textFail "$regx: Potential secret found in $instance" "$regx"
fi
fi
else
textPass "$regx: No secrets found in $instance User Data or it is empty" "$regx"
fi
done
else
textInfo "$regx: No EC2 instances found" "$regx"
fi
done
rm -rf $SECRETS_TEMP_FOLDER
}

56
checks/check_extra742 Normal file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra742="7.42"
CHECK_TITLE_extra742="[extra742] Find secrets in CloudFormation outputs (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra742="NOT_SCORED"
CHECK_TYPE_extra742="EXTRA"
CHECK_ALTERNATE_check742="extra742"
extra742(){
SECRETS_TEMP_FOLDER="$PROWLER_DIR/secrets-$ACCOUNT_NUM"
if [[ ! -d $SECRETS_TEMP_FOLDER ]]; then
# this folder is deleted once this check is finished
mkdir $SECRETS_TEMP_FOLDER
fi
textInfo "Looking for secrets in CloudFormation output across all regions... "
for regx in $REGIONS; do
LIST_OF_CFN_STACKS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx --query Stacks[*].[StackName] --output text)
if [[ $LIST_OF_CFN_STACKS ]];then
for stack in $LIST_OF_CFN_STACKS; do
CFN_OUTPUTS_FILE="$SECRETS_TEMP_FOLDER/extra742-$stack-$regx-outputs.txt"
CFN_OUTPUTS=$($AWSCLI $PROFILE_OPT --region $regx cloudformation describe-stacks --query "Stacks[?StackName==\`$stack\`].Outputs[*].[OutputKey,OutputValue]" --output text > $CFN_OUTPUTS_FILE)
if [ -s $CFN_OUTPUTS_FILE ];then
# This finds ftp or http URLs with credentials and common keywords
# FINDINGS=$(egrep -i '[[:alpha:]]*://[[:alnum:]]*:[[:alnum:]]*@.*/|key|secret|token|pass' $CFN_OUTPUTS_FILE |wc -l|tr -d '\ ')
# New implementation using https://github.com/Yelp/detect-secrets
FINDINGS=$(secretsDetector file $CFN_OUTPUTS_FILE)
if [[ $FINDINGS -eq 0 ]]; then
textPass "$regx: No secrets found in stack $stack Outputs" "$regx"
# delete file if nothing interesting is there
rm -f $CFN_OUTPUTS_FILE
else
textFail "$regx: Potential secret found in stack $stack Outputs" "$regx"
# delete file to not leave trace, user must look at the CFN Stack
rm -f $CFN_OUTPUTS_FILE
fi
else
textInfo "$regx: CloudFormation stack $stack has no Outputs" "$regx"
fi
done
else
textInfo "$regx: No CloudFormation stacks found" "$regx"
fi
done
rm -rf $SECRETS_TEMP_FOLDER
}

41
checks/check_extra743 Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra743="7.43"
CHECK_TITLE_extra743="[extra743] Check if API Gateway has client certificate enabled to access your backend endpoint (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra743="NOT_SCORED"
CHECK_TYPE_extra743="EXTRA"
CHECK_ALTERNATE_check743="extra743"
extra743(){
for regx in $REGIONS; do
LIST_OF_REST_APIS=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-rest-apis --query 'items[*].id' --output text)
if [[ $LIST_OF_REST_APIS ]];then
for api in $LIST_OF_REST_APIS; do
API_GW_NAME=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query "items[?id==\`$api\`].name" --output text)
LIST_OF_STAGES=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-stages --rest-api-id $api --query 'item[*].stageName' --output text)
if [[ $LIST_OF_STAGES ]]; then
for stage in $LIST_OF_STAGES; do
CHECK_CERTIFICATE=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-stages --rest-api-id $api --query "item[?stageName==\`$stage\`].clientCertificateId" --output text)
if [[ $CHECK_CERTIFICATE ]]; then
textPass "$regx: API Gateway $API_GW_NAME ID $api in $stage has client certificate enabled" "$regx"
else
textFail "$regx: API Gateway $API_GW_NAME ID $api in $stage has not client certificate enabled" "$regx"
fi
done
fi
done
else
textInfo "$regx: No API Gateways found" "$regx"
fi
done
}

41
checks/check_extra744 Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra744="7.44"
CHECK_TITLE_extra744="[extra744] Check if API Gateway has a WAF ACL attached (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra744="NOT_SCORED"
CHECK_TYPE_extra744="EXTRA"
CHECK_ALTERNATE_check744="extra744"
extra744(){
for regx in $REGIONS; do
LIST_OF_REST_APIS=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-rest-apis --query 'items[*].id' --output text)
if [[ $LIST_OF_REST_APIS ]];then
for api in $LIST_OF_REST_APIS; do
API_GW_NAME=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query "items[?id==\`$api\`].name" --output text)
LIST_OF_STAGES=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-stages --rest-api-id $api --query 'item[*].stageName' --output text)
if [[ $LIST_OF_STAGES ]]; then
for stage in $LIST_OF_STAGES; do
CHECK_WAFACL=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-stages --rest-api-id $api --query "item[?stageName==\`$stage\`].webAclArn" --output text)
if [[ $CHECK_WAFACL ]]; then
textPass "$regx: API Gateway $API_GW_NAME ID $api in $stage has $CHECK_WAFACL WAF ACL attached" "$regx"
else
textFail "$regx: API Gateway $API_GW_NAME ID $api in $stage has not WAF ACL attached" "$regx"
fi
done
fi
done
else
textInfo "$regx: No API Gateways found" "$regx"
fi
done
}

43
checks/check_extra745 Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra745="7.45"
CHECK_TITLE_extra745="[extra745] Check if API Gateway endpoint is public or private (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra745="NOT_SCORED"
CHECK_TYPE_extra745="EXTRA"
CHECK_ALTERNATE_check745="extra745"
extra745(){
for regx in $REGIONS; do
LIST_OF_REST_APIS=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-rest-apis --query 'items[*].id' --output text)
if [[ $LIST_OF_REST_APIS ]];then
for api in $LIST_OF_REST_APIS; do
API_GW_NAME=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query "items[?id==\`$api\`].name" --output text)
ENDPOINT_CONFIG_TYPE=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-rest-api --rest-api-id $api --query endpointConfiguration.types --output text)
if [[ $ENDPOINT_CONFIG_TYPE ]]; then
case $ENDPOINT_CONFIG_TYPE in
PRIVATE )
textPass "$regx: API Gateway $API_GW_NAME ID $api is set as $ENDPOINT_CONFIG_TYPE" "$regx"
;;
REGIONAL )
textFail "$regx: API Gateway $API_GW_NAME ID $api is internet accesible as $ENDPOINT_CONFIG_TYPE" "$regx"
;;
EDGE )
textFail "$regx: API Gateway $API_GW_NAME ID $api is internet accesible as $ENDPOINT_CONFIG_TYPE" "$regx"
esac
fi
done
else
textInfo "$regx: No API Gateways found" "$regx"
fi
done
}

36
checks/check_extra746 Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
CHECK_ID_extra746="7.46"
CHECK_TITLE_extra746="[extra746] Check if API Gateway has configured authorizers (Not Scored) (Not part of CIS benchmark)"
CHECK_SCORED_extra746="NOT_SCORED"
CHECK_TYPE_extra746="EXTRA"
CHECK_ALTERNATE_check746="extra746"
extra746(){
for regx in $REGIONS; do
LIST_OF_REST_APIS=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-rest-apis --query 'items[*].id' --output text)
if [[ $LIST_OF_REST_APIS ]];then
for api in $LIST_OF_REST_APIS; do
API_GW_NAME=$($AWSCLI apigateway get-rest-apis $PROFILE_OPT --region $regx --query "items[?id==\`$api\`].name" --output text)
AUTHORIZER_CONFIGURED=$($AWSCLI $PROFILE_OPT --region $regx apigateway get-authorizers --rest-api-id $api --query items[*].type --output text)
if [[ $AUTHORIZER_CONFIGURED ]]; then
textPass "$regx: API Gateway $API_GW_NAME ID $api has authorizer configured" "$regx"
else
textFail "$regx: API Gateway $API_GW_NAME ID $api has not authorizer configured" "$regx"
fi
done
else
textInfo "$regx: No API Gateways found" "$regx"
fi
done
}

Some files were not shown because too many files have changed in this diff Show More