Compare commits

..

1783 Commits
1.4 ... 2.12.1

Author SHA1 Message Date
Sergio Garcia
e9b09790da feat(release): 2.12.1 2022-12-19 17:59:04 +01:00
Acknosyn
c74b4adf27 fix(): Fix CloudTrail trail S3 logging public bucket false positive result when trail bucket doesn't exist (#1505)
Co-authored-by: Francesco Badraun <francesco.badraun@zxsecurity.co.nz>
2022-12-14 16:32:38 +01:00
Kay Agahd
a769bb86d3 fix(check_extra723): Corrected some typos (#1511) 2022-11-22 08:55:38 +01:00
Nacho Rivera
f8a2527429 fix(README): include more details about db connector (#1507) 2022-11-21 09:38:04 +01:00
laura franzese
ae645718ad new copy pointing to prowlerpro (#1488) 2022-11-17 09:40:16 +01:00
Nacho Rivera
a0625dff2f fix(extra71): Modified wrong remediation (#1445) 2022-11-02 10:00:25 +01:00
Fennerr
37e9cbbabd fix(extra7195): Update title (#1440) 2022-10-31 14:33:25 +01:00
Pepe Fagoaga
8818f47333 fix(ecr): typo (#1438) 2022-10-27 19:47:06 +02:00
Pepe Fagoaga
3cffe72273 fix(ecr): Platform (#1437) 2022-10-27 19:30:59 +02:00
Nacho Rivera
135aaca851 fix(): delete old commented versions (#1436) 2022-10-27 16:19:33 +02:00
Nacho Rivera
cf8df051de feat(README): Include versions info (#1435)
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-10-27 12:51:53 +02:00
Pepe Fagoaga
bef42f3f2d feat(release): Prowler 2.12.0 (#1434) 2022-10-27 12:10:37 +02:00
Nacho Rivera
3d86bf1705 fix(): Cloudtrail checks (#1433) 2022-10-27 11:47:00 +02:00
Olivier Gendron
5a43ec951a docs(spelling): Typo corrections (#1394) 2022-10-24 12:58:44 +02:00
Nacho Rivera
b0e6ab6e31 feat(stable tag): Inclusion of stable tag point to last release (#1419) 2022-10-20 08:01:00 +02:00
Nacho Rivera
b7fb38cc9e fix(extra7184): Error handling GetSnapshotLimits api call (#1411) 2022-10-17 14:03:55 +02:00
Nacho Rivera
f29f7fc239 fix(extra7183): Exception handling error UnsupportedOperationException (#1410) 2022-10-17 13:39:17 +02:00
Nacho Rivera
2997ff0f1c fix(extra77): Deleted resource id from exception results (#1409) 2022-10-17 13:17:51 +02:00
Nacho Rivera
11dc0aa5b2 feat(extra7111): Exception handling (#1408) 2022-10-17 12:51:09 +02:00
Sergio Garcia
8bddb9b265 fix(extra740): Remove additional info and fix max_items (#1405) 2022-10-14 11:37:31 +02:00
Sergio Garcia
689e292585 fix(region_bugs): Remove duplicate outputs (#1390) 2022-10-13 13:18:37 +02:00
Sergio Garcia
bff2aabda6 fix(missing permissions): Add missing permissions of checks (#1403) 2022-10-13 12:59:48 +02:00
Kay Agahd
4b29293362 fix(check_extra77): Add missing check_resource_id to the report (#1402) 2022-10-13 09:53:31 +02:00
Sergio Garcia
4e24103dc6 feat(slack): add Slack badge to README (#1401) 2022-10-13 09:42:06 +02:00
Sergio Garcia
3b90347849 fix(inventory): quick inventory input fixed (#1397)
Co-authored-by: sergargar <sergio@verica.io>
2022-10-10 17:21:46 +02:00
Pepe Fagoaga
6a7a037cec delete(shortcut.sh): Remove ScoutSuite (#1388) 2022-10-06 16:42:09 +02:00
Gábor Lipták
927c13b9c6 chore(actions): Bump Trufflehog to v3.13.0 (#1382) 2022-10-06 09:24:54 +02:00
Nacho Rivera
11cc8e998b fix(checks): Handle checks not returning result (#1383)
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-10-05 13:50:49 +02:00
Nacho Rivera
4a71739c56 Prwlr 879 fix prowler 2 x checks (#1380)
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-10-03 10:19:02 +02:00
Pepe Fagoaga
aedc5cd0ad fix(postgresql): Missing space (#1374) 2022-09-22 15:25:32 +02:00
Pepe Fagoaga
3d81307e56 fix(postgresql): Connector field (#1372) 2022-09-20 10:26:20 +02:00
Andrew Walker
918661bd7a Dockerfile build instructions (#1370) 2022-09-16 11:14:37 +02:00
Nacho Rivera
99f9abe3f6 feat(db-connector): Include UUID for findings ID (#1368) 2022-09-14 17:23:38 +02:00
Sergio Garcia
f2950764f0 feat(audit_id): add optional audit_id field to postgres connector (#1362)
Co-authored-by: sergargar <sergio@verica.io>
2022-09-13 13:29:19 +02:00
Pepe Fagoaga
d9777a68c7 chore(lint&test): Prowler 3.0 (#1357) 2022-09-01 16:37:10 +02:00
Richard Carpenter
2a4cc9a5f8 feat(group): CIS Critical Security Controls v8 (#1347)
Co-authored-by: sergargar <sergio@verica.io>
2022-08-31 15:14:04 +02:00
Ignacio Dominguez
1f0c210926 feat(extra7195): Added check for dependency confusion in codeartifact (#1329)
Co-authored-by: sergargar <sergio@verica.io>
2022-08-31 09:49:50 +02:00
JArmandoG
dd64c7d226 fix(check120): correct AWS support policy name (#1328)
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-08-23 11:34:25 +01:00
JArmandoG
865f79f5b3 fix(quick_inventory): Handle math expression (#1283) 2022-08-05 12:55:07 +02:00
Pepe Fagoaga
1f8a4c1022 fix(credential_report): Do not generate for 117 and 118 (#1322) 2022-08-05 11:03:59 +02:00
Pepe Fagoaga
1e422f20aa fix(security-groups): Include TCP as the IpProtocol (#1323) 2022-08-05 11:02:35 +02:00
Pepe Fagoaga
29eda28bf3 docs(outputs): structure (#1313) 2022-08-04 10:05:08 +02:00
Pepe Fagoaga
f67f0cc66d chore(issues): Link Q&A (#1305) 2022-08-03 12:46:51 +02:00
Pepe Fagoaga
721cafa0cd fix(appstream): Handle timeout errors (#1296) 2022-08-02 12:30:53 +02:00
Kay Agahd
c1d60054e9 feat(extra780): Check for Cognito or SAML authentication on OpenSearch (#1291)
* extend check_extra780 to check for cognito or SAML authentication on opensearch

* chore(extra780): Error handling

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-08-02 09:51:38 +02:00
Pepe Fagoaga
b95b3f68d3 fix(permissions): Include missing appstream:DescribeFleets permission (#1278)
* fix(permissions): AWS AppStream

Include missing appstream:DescribeFleets permission

* fix(permissions): AWS AppStream
2022-08-02 09:47:04 +02:00
Jonathan Jenkyn
81b6e27eb8 feat(checks): Adding commands for checks 117 and 118 (#1289)
* Adding commands for checks 117 and 118

* fix(check118): Minor fixes and error handling

* fix(check117): Minor fixes and error handling

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-08-02 09:18:46 +02:00
William
d69678424b fix(extra712): changed Macie service detection (#1286)
* changed Macie service detection

* fix(regions): add region context and more.

Co-authored-by: sergargar <sergio@verica.io>
2022-07-28 13:53:54 -04:00
Pepe Fagoaga
a43c1aceec fix(check12): Improve remediation (#1281) 2022-07-26 14:37:35 -04:00
Pepe Fagoaga
f70cf8d81e fix(ci): Release edited (#1276) 2022-07-21 17:44:26 +02:00
Pepe Fagoaga
83b6c79203 fix(ci): Remove check-update (#1275) 2022-07-21 17:33:28 +02:00
Andrew
1192c038b2 docs(readme): Fix spelling errors (#1274) 2022-07-21 17:06:03 +02:00
Pepe Fagoaga
4ebbf6553e chore(release): 2.11.0 (#1272) 2022-07-21 10:48:32 +02:00
r8bhavneet
c501d63382 docs(readme): Fix spelling (#1271) 2022-07-21 10:42:40 +02:00
Toni de la Fuente
72d6d3f535 feat(inventory): Prowler quick inventory including IAM resources (#1258)
* chore(inventory): option included in main

* chore(inventory): quick inventory

* chore(inventory): functional version

* chore(inventory): functional version without echo

* Update include/quick_inventory

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* Update prowler

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>

* Added new line at report line

* Added more information from IAM

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-07-21 10:37:28 +02:00
Mitch
ddd34dc9cc fix(extra7173): Correct check and alternative name (#1270) 2022-07-20 08:36:34 +02:00
Sergio Garcia
03b1c10d13 fix(codebuild): expired token error using Instance Metadata
Co-authored-by: sergargar <sergio@verica.io>
2022-07-14 07:32:01 +02:00
Sergio Garcia
4cd5b8fd04 fix(codebuild): expired token error (#1262) 2022-07-12 07:38:44 +02:00
Phil Massyn
f0ce17182b feat(ecr_lifecycle): Check Lifecycle policy (#1260)
* Create checks_7194

ECR Repositories contain docker containers.  When automated processes create containers, the old ones tend to take up space.  With a lot of containers on the system, the account owner will be paying additional fees for images that are no longer in use.  By defining a lifecycle policy, a best practice is followed by reducing the total volume of data being consumed.

* Minor changes

* fix: Include bash header

Co-authored-by: n4ch04 <nachor1992@gmail.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-07-11 13:03:31 +02:00
Sergio Garcia
2a8a7d844b fix(apigatewayv2): handle BadRequestException (#1261)
Co-authored-by: sergargar <sergio@verica.io>
2022-07-11 12:21:39 +02:00
Pepe Fagoaga
ff33f426e5 docs(readme): Update inventory and checks (#1257)
* docs(readme): Update inventory and checks

* docs(readme): inventory path

Co-authored-by: Toni de la Fuente <toni@blyx.com>

* Update README.md

Co-authored-by: Toni de la Fuente <toni@blyx.com>

Co-authored-by: Toni de la Fuente <toni@blyx.com>
2022-07-08 12:42:46 +02:00
Toni de la Fuente
f691046c1f feat(inventory): Prowler quick inventory (#1245)
* chore(inventory): option included in main

* chore(inventory): quick inventory

* chore(inventory): functional version

* chore(inventory): functional version without echo

* Update include/quick_inventory

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* Update prowler

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>

* Added new line at report line

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-07-08 12:41:54 +02:00
Pepe Fagoaga
9fad8735b8 fix(Dockerfile): Prowler path (#1254) 2022-07-07 10:03:07 +02:00
Pepe Fagoaga
c632055517 fix(dockerfile): Python path (#1250) 2022-07-06 07:54:37 +02:00
Sergio Garcia
fd850790d5 fix(add-checks-regions): Missing regions in checks (#1247)
* add regions to checks

* add root as resource

Co-authored-by: sergargar <sergio@verica.io>
2022-07-04 09:46:08 +02:00
Sergio Garcia
912d5d7f8c fix(postgres): Fix postgres connector issues. (#1244)
* fix(postgres): Fix postgres connector issues.

* fix(postgres): Update documentation

Co-authored-by: sergargar <sergio@verica.io>
2022-06-30 18:12:33 +02:00
Pepe Fagoaga
d88a136ac3 feat(db-connector): Include env variables (#1236)
* feat(db-connector): Include env variables

* fix(typo)

* fix(psql-test): Remove PGPASSWORD
2022-06-30 08:43:41 +02:00
Pepe Fagoaga
172484cf08 feat(dockerfile): Include psql client in the Prowler scanner image (#1238)
* fix(dockerignore): Include files

* fix(dockerfile): Keep python2 and organize

* feat(db-connector): Include postgres dependencies

* feat(dockerfile): Include hadolint pre-commit
2022-06-30 08:28:29 +02:00
Pepe Fagoaga
821083639a fix(bckCredentials): Do nothing if no initial creds (#1239) 2022-06-29 16:52:08 +02:00
rajarshidas
e4f0f3ec87 feat(check): Ensure default internet access from Amazon AppStream fleet should be disabled. (#1233)
Co-authored-by: sergargar <sergio@verica.io>
2022-06-29 12:51:58 +02:00
rajarshidas
cc6302f7b8 feat(checks): Amazon AppStream checks (#1216)
Co-authored-by: sergargar <sergio@verica.io>
2022-06-29 12:31:42 +02:00
Bayron Carranza
c89fd82856 feat(check7164): 365 days or more in a Cloudwatch log retention should be consider PASS (#1240)
* 365 DAYS or More Retention log group in cloudwatch

* fix(extra7162): Fix comparison errors

Also include minor changes to texts

* fix(extra7162): Set as Pass log groups that never expires

* fix(typo)

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-06-28 08:58:41 +02:00
Pepe Fagoaga
0e29a92d42 fix(extra7162): Query AWS log groups using LOG_GROUP_RETENTION_PERIOD_DAYS (#1232) 2022-06-27 09:18:39 +02:00
Sergio Garcia
835d8ffe5d feat(Actions): Update refresh_aws_services_regions.yml (#1227) 2022-06-23 11:21:50 +02:00
Sergio Garcia
21ee2068a6 feat(actions): Create refresh_aws_services_regions.yml (#1225) 2022-06-23 11:07:26 +02:00
Sergio Garcia
0ad149942b fix(security_hub_integration): Treat failed findings as failed in Security Hub (#1219)
Co-authored-by: sergargar <sergio@verica.io>
2022-06-22 14:03:16 +02:00
Nacho Rivera
66305768c0 fix(instance metadata): Missing raw flag in JQ parser (#1214) 2022-06-21 10:14:12 +02:00
Sergio Garcia
05f98fe993 fix(junit_xml output): Fix XML output integration (#1210)
Co-authored-by: sergargar <sergio@verica.io>
2022-06-20 13:27:54 +02:00
rajarshidas
89416f37af feat(check): Directory Service - Ensure Radius server is using the recommended security protocol (#1203)
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-06-20 11:37:02 +02:00
Pepe Fagoaga
7285ddcb4e feat(actions): Trigger (#1209) 2022-06-20 10:38:19 +02:00
Pepe Fagoaga
8993a4f707 fix(actions): Dockerfile path (#1208) 2022-06-20 09:22:40 +02:00
Sergio Garcia
633d7bd8a8 fix(instance-metadata): Credentials recovering (#1207)
* fix(instance-metadata): Credentials recovering

* fix(expr): Dockerfile to root and expr in SESSION_TIME_REMAINING.

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: sergargar <sergio@verica.io>
2022-06-17 14:23:56 +02:00
Pepe Fagoaga
3944ea2055 fix(session_duration): Use jq with TZ=UTC (#1195) 2022-06-15 13:25:43 +02:00
zsecducna
d85d0f5877 fix(extra767): Remove false positive (#1198)
* Remove fail positive

Exclude distributions that does not support `POST` requests

* fix(extra767): Overall changes

- Quoted and braced variables
- Fix DefaultCacheBehavior twice in a AWS CLI query
- Use regex =~ to match values

* fix(check767): Change textInfo for textPass

* fix(extra767): Include AWS CLI error handling

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-06-15 09:38:56 +02:00
Pepe Fagoaga
d32a7986a5 fix(shellcheck): Main variables (#1194) 2022-06-14 10:43:15 +02:00
Pepe Fagoaga
71813425bd fix(pre-commit): Recover shellcheck (#1193) 2022-06-14 07:46:12 +02:00
Pepe Fagoaga
da000b54ca refactor(Prowler): Main logic refactor (#1189)
* fix(aws_profile_loader): New functions

* fix(shellcheck): Temporary remove Shellcheck

* fix(aws_cli_detector): new function

* fix(jq_detector): New function

* fix(os_detector): New function

* fix(output_bucket): Output bucket input check in main

* fix(python_detector): deleted unused python detector

* fix(credentials): credentials check out of whoami

* [break]refactor(main)

* [BREAK] Get list of checks parsing all input options

* [break]refactor(main): execute checks functions

* [break]refactor(main): move functions to libs

* fix(validations): custom check validation and typos

* refactor(validate_options): Include comments

* fix(custom_checks): Minor fixes

* refactor(closing_files): include libraries

* refactor(loader): Include ignored checks

* refactor(main): Fix shellcheck

* refactor(loader): beautify

* refactor(monochrome): without variables

* refactor(modes): MODES array not needed

* refactor(whoami): get error from AWSCLI

* refactor(secrets-detector)

* refactor(secrets-detector)

* fix(html_scoring): html scoring was fixed.

* fix(load_checks_from_file)

* fix(color-code): Print if not mono

* fix(not extra): Fixed if EXCLUDE_CHECK_ID is empty

* fix(IFS): Restore default IFS once modes are parsed

* fix(bucket): validate before whoami

* fix(bucket): validate before whoami

Co-authored-by: n4ch04 <nachor1992@gmail.com>
Co-authored-by: sergargar <sergio@verica.io>
Co-authored-by: Nacho Rivera <59198746+n4ch04@users.noreply.github.com>
2022-06-13 17:34:31 +02:00
Sergio Garcia
74a9b42d9f Update codebuild-prowler-audit-account-cfn.yaml (#1192) 2022-06-13 12:17:31 +02:00
Nacho Rivera
f9322ab3aa fix(outputs): Replace each comma occurrence before sending to csv file (#1188) 2022-06-08 09:19:50 +02:00
Pepe Fagoaga
5becaca2c4 fix(extra7187): Remove commas from the metadata (#1187) 2022-06-08 09:02:38 +02:00
Sergio Garcia
50a670fbc4 fix(codebuild_update): AWS CLI and permissions update. (#1183) 2022-06-07 14:49:22 +02:00
Sergio Garcia
48f405a696 fix(check119_remediation): Update check remediation text. (#1185) 2022-06-07 14:48:13 +02:00
Nacho Rivera
bc56c4242e refactor(outputs): Consolidate Prowler output functions (#1180)
* chore(db providers): db providers first version

* chore(db provider): added db provider setup into Readme

* fix(csv_line): csv_line out of conditional

* fix(README): text instead of varchar in table

* fix(help): help message extended

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>

* fix(typo): Update README.md

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(table): add if not exists

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(typo): Readme postgreSQL

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(db_connector): details to add a new provider

* fix(typo): Uppercase Prowler

Co-authored-by: Toni de la Fuente <toni@blyx.com>

* fix(prowler): deleted unused variable

* chore(checks): test db connector previous to send data

* chore(input tests): input tests moved to main

* fix(typo): Readme typos

* chore(table): table name from pgpass file

* fix(grep test): Added missing -E flag

* chore(table): check of table name and Readme

* chore(error colors): Added error colors

* chore(inputcheck): checks about mode and output inputs into main

* fix(inputs) custom output file name

* fix(outputs): comment profile

* chore(textXXX): both 3 textfunctions using general

* fix(allowlist): allowlist check included as function

* fix(headers): Add headers to certain output files

* fix(reformulate): change structure and delete comments

* fix(testing): Input test after load includes

* fix(variables): Added named vars

* fix(colors): Deleted unused colors

* fix(outputs): fine tuning

* fix(outputs): allowlist parameters read

* fix(allowlist): allowlist logic reformulated

* fix(REPREGION): REPREGION change by REGION_FROM_CHECK

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Toni de la Fuente <toni@blyx.com>
2022-06-06 12:56:21 +02:00
Pepe Fagoaga
1b63256b9c fix(assume_role): Use date instead of jq (#1181)
* fix(date): Use  instead of date

* fix(assume_role): Use date instead of jq

JQ parses datetimes using the local timezone and not UTC
2022-06-03 08:31:43 -07:00
Sergio Garcia
7930b449b3 fix(apigateway_iam): Error handling and permissions for extra745. (#1176)
* fix(apigateway_iam): Error handling and permissions for extra745.

* Update check_extra745

Co-authored-by: sergargar <sergio@verica.io>
2022-06-02 15:16:43 +02:00
Pepe Fagoaga
e5cd42da55 fix(typo): Max session duration error message (#1179) 2022-06-02 15:08:30 +02:00
Sergio Garcia
2a54bbf901 fix(SQS_encryption_type): Add SQS encryption types to extra728. (#1175)
* fix(SQS_encryption_type): Add SQS encryption types to extra728.

* Update check_extra728

* Update check_extra728

Co-authored-by: sergargar <sergio@verica.io>
2022-06-02 15:01:02 +02:00
Nacho Rivera
2e134ed947 feat(db_connector): Create a PostgreSQL connector for Prowler (#1171)
* chore(db providers): db providers first version

* chore(db provider): added db provider setup into Readme

* fix(csv_line): csv_line out of conditional

* fix(README): text instead of varchar in table

* fix(help): help message extended

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>

* fix(typo): Update README.md

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(table): add if not exists

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(typo): Readme postgreSQL

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* fix(db_connector): details to add a new provider

* fix(typo): Uppercase Prowler

Co-authored-by: Toni de la Fuente <toni@blyx.com>

* fix(prowler): deleted unused variable

* chore(checks): test db connector previous to send data

* chore(input tests): input tests moved to main

* fix(typo): Readme typos

* chore(table): table name from pgpass file

* fix(grep test): Added missing -E flag

* chore(table): check of table name and Readme

* chore(error colors): Added error colors

* fix(tablename): table name in readme

* fix(typo)

* fix(db_provider): Exact match

* fix(error): One line message

* chore(pgpass check): Check added for pgpass file

* fix(pgpass): pgpass file and permissions test

* fix(unused vars): Deleted unused vars

* fix(TOP_PID): Deleted TOP_PID unused var and comment

* chore(db tests): Credentials, database and table tests added

* fix(empty pgpass): Look for empty fields at pgpass file

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Toni de la Fuente <toni@blyx.com>
2022-06-02 13:15:14 +02:00
Sergio Garcia
ba727391db fix(runtimes_extra762): Detect nodejs versions correctly. (#1177)
Co-authored-by: sergargar <sergio@verica.io>
2022-06-02 13:14:22 +02:00
Sergio Garcia
d4346149fa fix(severity): High severity for check extra7185 (#1178) 2022-06-01 14:04:36 +02:00
Pepe Fagoaga
2637fc5132 feat(checks): New IAM privilege escalation check (#1168) 2022-06-01 13:58:31 +02:00
Sergio Garcia
ac5135470b fix(update_deprecate_runtimes): Deprecated runtimes for lambda were updated (#1170) 2022-05-31 17:03:11 +02:00
rajarshidas
613966aecf feat(check): Amazon WorkSpaces storage volumes are encrypted
If the value listed in the Volume Encryption column is Disabled, the selected AWS WorkSpaces instance volumes (root and user volumes) are not encrypted
2022-05-31 17:01:20 +02:00
Pepe Fagoaga
83ddcb9c39 feat(check): PublicAccessBlockConfiguration (#1167) 2022-05-31 16:54:05 +02:00
Lucas L Lopes
957c2433cf feat(checks): New checks for Directory Service (#1164) 2022-05-30 14:24:44 +02:00
Pepe Fagoaga
c10b367070 fix(actions): Bad PRO repository (#1163) 2022-05-25 12:47:22 +02:00
Pepe Fagoaga
432416d09e fix(checks): Severity for Lambda URL checks (#1162) 2022-05-25 12:22:42 +02:00
Pepe Fagoaga
dd7d25dc10 release: Prowler 2.10 (#1161) 2022-05-25 12:03:05 +02:00
Pepe Fagoaga
24c60a0ef6 fix(checks): Handle AWS Gov Cloud regions (#1160) 2022-05-25 12:01:58 +02:00
Andrea Di Fabio
f616c17bd2 feat(new): New custom check extra9999 to build a custom check on the fly (#1103) 2022-05-25 09:16:36 +02:00
Pepe Fagoaga
5628200bd4 fix(remediation): Fix remediation fields for checks (#1157) 2022-05-23 15:48:26 +02:00
Pepe Fagoaga
ae93527a6f fix(BucketLocation): Recover bucket policy using the right region endpoint (#1156) 2022-05-23 15:45:30 +02:00
Pepe Fagoaga
2939d5cadd feat(lambda-function): Checks for misconfigured function's URLs (#1148) 2022-05-23 10:46:19 +02:00
Pepe Fagoaga
e2c7bc2d6d fix(IllegalLocationConstraintException): Recover bucket policy using the right region endpoint (#1155) 2022-05-23 09:37:46 +02:00
Nacho Rivera
f4bae78730 Timestamp to date casting issues solved (#1154)
* fix(date): Deleted @ char before date argument

* fix(date): Use @ only when input is epoch
2022-05-23 09:28:56 +02:00
1vicente
d307898289 Update README.md (#1153)
pretty README.md
2022-05-19 12:14:11 +02:00
Pepe Fagoaga
879ac3ccb1 fix(actions): Ignore changes on Readme (#1149) 2022-05-17 16:09:55 +02:00
Sergio Garcia
cd41e73cbe fix(readme): Correct permissions for DynamoDB allowlist (#1147) 2022-05-17 12:33:49 +02:00
Pepe Fagoaga
47f1ca646e fix(typo): ArtifactBucket tags (#1145) 2022-05-17 09:08:11 +02:00
Charles Josiah Rusch Alandt
a18b18e530 K8s cronjob sample files (#1140) 2022-05-16 10:58:50 +02:00
Pepe Fagoaga
4d1ffbb652 fix(actions): tag and push (#1142) 2022-05-13 11:20:30 +02:00
Pepe Fagoaga
13423b137e fix(actions): Include AWS region (#1141)
* fix(actions): Include AWS regions

* fix(zip): Quiet output
2022-05-13 10:13:03 +02:00
Sergio Garcia
d60eea5e2f fix(copyToS3): Upload to S3 only when indicated (#1134)
Co-authored-by: sergargar <sergio@verica.io>
2022-05-12 17:30:49 +02:00
Pepe Fagoaga
39c7d3b69f fix(typo) (#1139) 2022-05-12 17:28:30 +02:00
Pepe Fagoaga
2de04f1374 fix(actions): Job permissions (#1138) 2022-05-12 17:24:15 +02:00
Pepe Fagoaga
5fb39ea316 fix(actions): Trigger on PR (#1136)
* fix(actions): Include checkout

* fix(actions): version name

* fix(actions): fix branch

* fix(actions): version name

* fix(actions): PR trigger
2022-05-12 17:20:11 +02:00
Pepe Fagoaga
55640ecad2 fix(actions): Github token permissions (#1135) 2022-05-12 16:46:06 +02:00
Pepe Fagoaga
69d3867895 feat(actions): Upload Prowler containers to registries (#1132)
* feat(actions): Upload Prowler latest to dockerhub

* feat(upload-container): Action to Public Registries

* feat(upload-container): Include env secrets

* feat(actions): Include Docker linters

* feat(linters): include pre-commit

* fix(names)
2022-05-12 16:37:46 +02:00
Sergio Garcia
210f44f66f fix(custom-file-in-bucket): Custom file names are also support for S3 output. (#1129) 2022-05-11 10:16:29 +02:00
Sergio Garcia
b78e4ad6a1 fix(allowlist_db): Improve DynamoDB regex for allowlisting. (#1127) 2022-05-06 13:46:53 +02:00
stof
4146566f92 feat(assume-role): Properly handle External ID variable 2022-05-05 16:10:52 +02:00
Sergio Garcia
4e46dfb068 feat(add_prowler_pro_banner): include Prowler Pro banner in README (#1119)
* feat(add_prowler_pro_banner): include Prowler Pro banner in README

Context
Include Prowler Pro banner in README.md

Description
Add Prowler Pro banner in README.md for giving visibility to the Enterprise version of Prowler.

License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* Update README.md
2022-05-03 16:24:23 +02:00
Milton Torasso
13c96a80db feat(deployment): Serverless multi account Prowler with SecurityHub Integration (#1113) 2022-05-03 13:41:56 +02:00
Sergio Garcia
de77a33341 fix(allowlist_db): Improve DynamoDB regex for allowlisting. (#1126)
Co-authored-by: sergargar <sergio@verica.io>
2022-05-03 11:57:23 +02:00
ChrisGoKim
295bb74acf fix(additions-policy): Updated multi-org ProwlerRole.yaml (#1123) 2022-05-03 11:34:12 +02:00
Jens Brey
59abd2bd5b check_extra7113: Fix wrong listing of RDS instances in regions without databases (#1124)
Co-authored-by: Jens Brey <jens.brey@allcloud.io>
2022-05-03 11:31:23 +02:00
Sergio Garcia
ecbfbfb960 fix(allowlist_db): Improve DynamoDB regex for allowlisting. (#1125)
Co-authored-by: sergargar <sergio@verica.io>
2022-05-03 11:31:12 +02:00
Justin Plock
04e5804665 Update CloudFormation template for CodeBuild (#1114) 2022-05-03 09:14:38 +02:00
Pepe Fagoaga
681d0d9538 feat(group7): Include extra7178 (#1121) 2022-04-29 14:26:19 +02:00
Pepe Fagoaga
8bfd9c0e62 feat(emr): Check BlockPublicAccessConfiguration for EMR (#1120) 2022-04-29 14:23:54 +02:00
Divyanshu
95df9bc316 feat(checks): New group and checks for Codebuild and EMR (#1112) 2022-04-29 14:19:04 +02:00
Sergio Garcia
d08576f672 feat(add_prowler_pro_banner): include Prowler Pro banner in README.md (#1117) 2022-04-28 17:28:52 +02:00
Sergio Garcia
aa16bf4084 feat(dynamodb_allowlist): Support DynamoDB tables ARN for allowlist input (#1118)
* feat(dynamodb_allowlist): Support dynamodb tables arn for allowlist input.

* feat(allowlist): Include logging messages for input file

* fix(allowlist): Modify DynamoDB key name

Co-authored-by: sergargar <sergio@verica.io>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-04-28 17:04:44 +02:00
Pepe Fagoaga
432632d981 chore(release): 2.9.0 (#1109) 2022-04-13 13:54:53 +02:00
Pepe Fagoaga
d6ade7694e chore(allowlist): Rename references (#1108)
* chore(allowlist): rename file

* chore(allowlist): remove old references
2022-04-13 11:31:50 +02:00
n4ch04
c9e282f236 IAM check116 and check122 modified to log also PASS results (#1107)
* fix(check116): Fixed logic to include resource_id of passed users

* fix(check122): Changed logic check to include explicit pass records
2022-04-12 19:54:51 +02:00
carterjones
5b902a1329 fix typo: publiccly -> publicly (#1106) 2022-04-12 18:12:26 +02:00
Pepe Fagoaga
fc7c932169 fix(extra7147): Handle unsupported AWS regions for Glacier (#1101) 2022-04-11 16:10:23 +02:00
n4ch04
819b52687c Replace comma from csv input info (#1102)
* fix(output): replace comma from csv input info

* fix(outputs): parameter expansion done in echo to csv
2022-04-11 16:04:47 +02:00
Sergio Garcia
28fff104a1 feat(S3_in_w_x_flags): Support S3 URIs for custom checks paths and whitelist files. (#1090)
* feat(S3_in_w_x_flags): Support S3 URIs for custom checks paths and whitelist files.

* feat(S3_in_w_x_flags): README document was updated.

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Toni de la Fuente <toni@blyx.com>
Co-authored-by: Sergio Garcia Garcia
2022-04-07 14:37:02 -04:00
n4ch04
07b2b0de5a fix(extra764): Deleted temp file refs (#1089) 2022-04-07 17:03:32 +02:00
nealalan
4287b7ac61 check empty array in SECURITYGROUPS object (#1099)
* check empty array in SECURITYGROUPS object

Logic is only checking an object to see if it is null. This should be checking for the array in the object to see if it is empty.

* Replace new conditional with the old one

* Update check_extra75

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
2022-04-07 10:57:29 -04:00
Sergio Garcia
734331d5bc fix(extra764): NoSuchBucket error properly handled. (#1094) 2022-03-31 15:35:17 +02:00
Sergio Garcia
5de2bf7a83 fix(extra7172): IllegalLocationConstraintException properly handled. (#1093) 2022-03-31 14:40:32 +02:00
Sergio Garcia
1744921a0a fix(extra792): TLS1.3 policies added as secure (#1091) 2022-03-30 17:50:00 +02:00
Andrew Grangaard
d4da64582c docs(tf-quickstart): Update example code for terraform-quickstart (#1086)
+ use primary repository rather than fork.
+ use default branch.
+ fixed a missing character typos.
+ remove blank end-of-line spaces.

@singergs: thanks for adding this code and the video.
2022-03-30 09:15:38 +02:00
Andrea Di Fabio
d94acfeb17 New Extra Check - Detect SGs created by the EC2 Launch Wizard (#1081)
* new check

* added check to group

* fixed name

* added testpass logic

* Fixed a few issues

* Fixed more issues

* Updated to add extended information

* Added new line at end of file

* Fixed Spelling

* fix(title): Update title name

* refactor(style): Minor changes

Co-authored-by: Andrea Di Fabio <adifabio@amazon.com>
2022-03-29 10:06:44 +02:00
soffensive
fcc14012da Update check_extra736, is missing $PROFILE_OPT (#1084)
$PROFILE_OPT was missing in one aws command
2022-03-29 09:11:41 +02:00
Lucas Moura
cc8cbc89fd Fix typo extra729 and extra740 (#1083)
* Fix typo on remediation

* Fix typo on remediation description
2022-03-29 08:58:06 +02:00
Sergio Garcia
8582e40edf fix(secrets_library): Verify if detect-secrets library is missing (#1080) 2022-03-25 13:19:05 +01:00
Toni de la Fuente
1e87ef12ee feat(new_version): Prowler 2.8.1 (#1082) 2022-03-25 12:58:06 +01:00
Pepe Fagoaga
565200529f fix(detect-secrets): Include missing colon to link values (#1078) 2022-03-22 13:53:36 +01:00
Sergio Garcia
198c7f48ca fix(bucket_region): check extra764 doesn't handle bucket region properly (#1077)
* fix(bucket_region): check extra764 doesn't handle bucket region properly
2022-03-18 11:51:42 +01:00
Toni de la Fuente
8105e63b79 fix(extras-group): Add extra7172 to group extras (#1074) 2022-03-16 18:39:16 +01:00
Sergio Garcia
3932296fcf feat(new_version): Prowler 2.8.0 (#1073) 2022-03-16 18:15:57 +01:00
David Childs
cb0d9d3392 fix(filter-region): Support comma separated regions (#1071)
* regions separated by a comma deliminator

* Update README.md

Co-authored-by: Toni de la Fuente <toni@blyx.com>

* Update README.md

Co-authored-by: David Childs <d.childs@elsevier.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Toni de la Fuente <toni@blyx.com>
2022-03-16 17:49:04 +01:00
Pepe Fagoaga
4b90eca21e docs(readme): Fix typo (#1072) 2022-03-16 16:54:27 +01:00
Toni de la Fuente
365b396f9a feat(metadata): Include account metadata in Prowler assessments (#1049)
* Add support for organizations accounts metadata part 1

* Add support for organizations accounts metadata part 2

* Add gathering account metadata from org

* chore(prowler): get accounts metadata

Use assume_role backing up normal assumed credentials to assume management account and then restore it to old ones

* fix(orgs metadata): deleted assume_role_orgs

* refactor(organization_metadata)

Reformulate to extract AWS Organizations metadata

* doc(org_metadata): include required -R in usage

* docs(org-metadata): Update README

Co-authored-by: n4ch04 <nachor1992@gmail.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-03-16 16:27:19 +01:00
plarso
c526c61d5e Fix(check122): Error when policy name contains commas (#1067)
* check122 - Support policy names with commas

* Requested changes
2022-03-16 15:06:12 +01:00
Leonardo Azize Martins
c4aff56f23 fix(extra760): Improve error handling (#1055)
* Fix AccessDenied issue

* fix(extra760): Error handling

* Fix merge conflict

* Improve code style

* Fix grep filter

* Fix bash variable expansion

* Fix grep logic to handle zip file
2022-03-16 14:57:37 +01:00
n4ch04
d9e0ed1cc9 fix(check_extra7161): fixed check title (#1068) 2022-03-15 12:30:57 +01:00
Leonardo Azize Martins
e77cd6b2b2 fix: Change lower case from bash variable expansion to tr (#1064)
* fix(extra715): Change lower case from bash variable expansion to tr command

* fix: Change from bash variable expansion to tr command

* Change the way to handle lower case
2022-03-15 08:22:22 +01:00
n4ch04
f04b174e67 fix(whitelist): Whitelist logic reformulated (#1061)
* fix(whitelist): Whitelist logic reformulated again

* chore(whitelist): reformulate style
2022-03-11 10:15:58 +01:00
Pepe Fagoaga
0c1c641765 fix(extra776): Handle image tag commas and json output (#1063) 2022-03-08 19:08:40 +01:00
xxxMinoo
d44f6bf20f fix: extra7167 Advanced Shield and CloudFront bug parsing None output without distributions (#1062)
* fix: not to flag as finding for account without cloudfront distributions

* fix: output empty for None from cloudfront list-distributions

* fix: extra7167 Advanced Shield and CloudFront bug parsing None output without distributions

Co-authored-by: moo.xin.foo <moo.xin.foo@accenture.com>
2022-03-08 14:09:20 +01:00
Leonardo Azize Martins
1fa62cf417 fix(extra758): Reduce API calls. Print correct instance state. (#1057)
* fix(extra758): Reduce API calls. Print correct instance state.

* feat(oldage-format): Include comment

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-03-08 10:45:02 +01:00
Toni de la Fuente
d8d2ddd9e7 Revert "fix: extra7167 Advanced Shield and CloudFront bug parsing None output without distributions (#1053)" (#1054)
This reverts commit f3ff8369c3.
2022-03-04 13:12:03 +01:00
xxxMinoo
f3ff8369c3 fix: extra7167 Advanced Shield and CloudFront bug parsing None output without distributions (#1053)
* fix: not to flag as finding for account without cloudfront distributions

* fix: output empty for None from cloudfront list-distributions

Co-authored-by: moo.xin.foo <moo.xin.foo@accenture.com>
2022-03-04 10:25:47 +01:00
Roman Mueller
99d1868827 Add right region to CSV if access is denied (#1045) 2022-03-02 16:32:35 +01:00
Andrea Di Fabio
31cefa5b3c Make python3 default in Dockerfile (#1043) 2022-03-02 16:21:28 +01:00
Andrea Di Fabio
2d5ac8238b Added Timestamp to secrets related 5 checks (#1041) 2022-03-02 15:56:02 +01:00
Leonardo Azize Martins
248cc9d68b Fix(extra771): jq fail when policy action is an array (#1031)
* Fix error handling and policy output

* Fix jq filter when Action is an array

Fix jq select condition to handle Action as string or as array.
Add error handling.
When fail, print policies as just one line.

* Double quote variables to prevent globbing and word splitting

* Replace comma character from json by word comma
2022-03-02 15:04:18 +01:00
Leonardo Azize Martins
5f0a5b57f9 Fix(ES): Improve AWS CLI query and add error handling for ElasticSearch/OpenSearch checks (#1032)
* Fix CLI query and add error handling

Check extra781, extra782, extra783, extra784 and extra785

* Fix CLI query, add error handling, combine AWS CLI calls when possible

Checks related to Opensearch/ElasticSearch.

* Fix CLI query, add error handling, combine AWS CLI calls when possible

Checks related to Opensearch/ElasticSearch.
2022-03-02 12:44:24 +01:00
Pepe Fagoaga
86367fca3f fix: remove PR automatic labels (#1044) 2022-02-15 08:19:40 +01:00
Pepe Fagoaga
07be3c21bf docs(templates): Include triage label (#1042) 2022-02-14 17:47:53 +01:00
n4ch04
3097ba6c66 fix(include/outputs):Rolling back whitelist checking to RE check (#1037)
* fix(include/outputs):Rolling back whitelist checking to RE check

* fix(include/ouputs): Clarified variable assignation coming from argument
2022-02-14 13:04:47 +01:00
n4ch04
b4669a2a72 fix(check41/42): Added tcp protocol filter to query (#1035)
* fix(check41/42): Added tcp protocol filter to query

* Include {} in vars

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

* Include {} in vars

Co-authored-by: Pepe Fagoaga <pepe@verica.io>

Co-authored-by: Pepe Fagoaga <pepe@verica.io>
2022-02-11 10:54:32 +01:00
Leonardo Azize Martins
e8848ca261 docs: Improve check_sample examples, add general comments (#1039) 2022-02-10 17:58:50 +01:00
Pepe Fagoaga
5c6902b459 fix(extra730): Handle invalid date formats checking ACM certificates (#1033) 2022-02-09 17:56:55 +01:00
Leonardo Azize Martins
9b772a70a1 Fix(extra7141): Error handling and include missing policy (#1024)
* Fix AccessDenied issue when get document

Add check to validate access denied when get document from SSM.
Add missing action permission to allow ssm:GetDocument.

* Double quote variables to prevent globbing and word splitting
2022-02-09 16:01:01 +01:00
Pepe Fagoaga
6c12a3e1e0 fix(extra736): Recover Customer Managed KMS keys (#1036) 2022-02-09 10:05:57 +01:00
jeffmaley
c6f0351e9c feat(check): New check7172 for S3 Bucket ACLs (#1023)
* added check7172 for s3 bucket acls

* Added more errors to error handling and an access check for s3

* Removed extra api call

Co-authored-by: Jeff Maley <jeff.maley@symmetry-systems.com>
2022-02-07 16:58:18 -05:00
Martin Muller
7e90389dab fix: CFN codebuild example (#1030)
Since 2.7.0 this template failed:

```
An error occurred (AccessDeniedException) when calling the GetSubscriptionState operation: User: arn:aws:sts::863046042023:assumed-role/prowler-codebuild-role/AWSCodeBuild-2c3151c9-7c5d-4618-94e5-0234bddce775 is not authorized to perform: shield:GetSubscriptionState on resource: arn:aws:shield::863046042023:subscription/* because no identity-based policy allows the shield:GetSubscriptionState action
       INFO! No AWS Shield Advanced subscription found. Skipping check. 
7.167 [extra7167] Check if Cloudfront distributions are protected by AWS Shield Advanced - shield [Medium]
```

I aligned it with https://github.com/prowler-cloud/prowler/blob/master/iam/prowler-additions-policy.json#L19 .
2022-02-04 12:09:53 -05:00
n4ch04
30ce25300f fix(include/outputs): Whitelist logic reformulated to exactly match input (#1029)
* fix(inlcude/outputs) Whitelist logic reformulated to exactly match input

* fix(include/outputs): Changed name of iterative variable that browses whitelisted values

* fix(include/outputs): Deleted missing echo and include and put variables in brackets
2022-02-04 12:07:48 -05:00
Pepe Fagoaga
26caf51619 fix(CODEOWNERS): Rename team (#1027) 2022-02-04 12:05:43 -05:00
Leonardo Azize Martins
3ecb5dbce6 Fix AccessDenied issue (#1025) 2022-02-04 12:05:10 -05:00
Toni de la Fuente
1d409d04f2 Fix (extra7148 and add action #1017 (#1021) 2022-02-04 11:58:22 -05:00
Daniel Lorch
679414418e Fix: when prowler exits with a non-zero status, the remainder of the block is not executed (#1015)
* Fix: when prowler exits with a non-zero status, the remainder of the block is not executed

* Fix: do not trigger exit code 3 on failed checks, so that the remainder of the block is executed
2022-02-02 17:45:56 +01:00
Daniel Lorch
b26370d508 Typo (breaking change) (#1010)
Co-authored-by: Daniel Lorch <lorchda@amazon.ch>
2022-02-02 11:13:31 -05:00
Daniel Lorch
72b30aa45f Skip packages with broken dependencies when upgrading system (#1009)
Co-authored-by: Daniel Lorch <lorchda@amazon.ch>
2022-02-02 11:12:58 -05:00
n4ch04
d9561d5d22 fix(check32): filterName base64encoded to avoid space problems in filter names (#1020)
* fix(check32): filterName base64encoded to avoid space problems in filter names

* fix(check32): base64 decoding atomic expression

* fix(check32): Variable enclosing

Co-authored-by: Nacho Rivera <nachor1992@gmail>
2022-02-02 11:09:38 -05:00
Mike Stewart
3d0ab4684f docs(docker): Docker hub references (#1018) 2022-02-02 16:45:07 +01:00
Daniel Lorch
29a071c98e docs(whitelist): Add examples for Control Tower resources (#1013) 2022-02-02 13:36:02 +01:00
Daniel Lorch
0ac7064d80 fix(ftr-group): Visual formatting (#1012) 2022-02-02 13:17:46 +01:00
Toni de la Fuente
dcd55dbb8f Add badges 2022-01-28 12:12:59 +01:00
Jan Sepke
441dc11963 Fix issue #1002 (#1007)
regression in extra793

Co-authored-by: Jan Sepke <jan.sepke@jungheinrich.de>
2022-01-28 11:01:32 +01:00
Jan Sepke
21a8193510 Fix issue #1001 (#1006)
regression in extra75

Co-authored-by: Jan Sepke <jan.sepke@jungheinrich.de>
2022-01-27 15:13:07 +01:00
Pepe Fagoaga
3b9a3ff6be Include codeowners template (#1005)
* docs(templates): include Codeowners

* docs(templates): update PR template
2022-01-27 12:58:14 +01:00
Toni de la Fuente
c5f12f0a6c Fix issue #1002 (#1004) 2022-01-27 12:27:41 +01:00
Pepe Fagoaga
90565099bd Change references from toniblyx to prowler-cloud (#1003)
Co-authored-by: Toni de la Fuente <toni@blyx.com>
2022-01-27 12:17:38 +01:00
Toni de la Fuente
2b2814723f Prowler 2.7.0 - Brave (#998)
* Extra7161 EFS encryption at rest check

* Added check_extra7162 which checks if Log groups have 365 days retention

* fixed code to handle all regions and formatted output

* changed check title, resource type and service name as well as making the code more dynamic

* Extra7161 EFS encryption at rest check

* New check_extra7163 Secrets Manager key rotation enabled

* New check7160 Enabled AutomaticVersionUpgrade on RedShift Cluster

* Update ProwlerRole.yaml to have same permissions as util/org-multi-account/ProwlerRole.yaml

* Fix link to quicksight dashboard

* Install detect-secrets (e.g. for check_extra742)

* Updating check_extra7163 with requested changes

* fix(assumed-role): Check if -T and -A options are set

* docs(Readme): `-T` option is not mandatory

* fix(assume-role): Handle AWS STS CLI errors

* fix(assume-role): Handle AWS STS CLI errors

* Update group25_FTR

When trying to run the group 25 (Amazon FTR related security checks) nothing happens, after looking at the code there is a misconfiguration in 2 params: GROUP_RUN_BY_DEFAULT[9] and GROUP_CHECKS[9]. Updating values to 25 fixed the issue.

* Update README.md

broken link for capital letters in group file (group25_FTR)

* #938 issue assume_role multiple times should be fixed

* Label 2.7.0-1December2021 for tests

* Fixed error that appeared if the number of findings was very high.

* Adjusted the batch to only do 50 at a time. 100 caused capacity issues. Also added a check for an edge case where if the updated findings was a multiple of the batch size, it would throw an error for attempting to import 0 findings.

* Added line to delete the temp folder after everything is done.

* New check 7164 Check if Cloudwatch log groups are protected by AWS KMS@maisenhe

* updated CHECK_RISK

* Added checks extra7160,extra7161,extra7162,extra7163 to group Extras

* Added checks extra7160,extra7161,extra7162,extra7163 to group Extras

* Added issue templates

* New check 7165 DynamoDB: DAX encrypted at rest @Daniel-Peladeau

* New check 7165 DynamoDB: DAX encrypted at rest @Daniel-Peladeau

* Fix #963 check 792 to force json in ELB queries

* Fix #957 check 763 had us-east-1 region hardcoded

* Fix #962 check 7147 ALTERNATE NAME

* Fix #940 handling error when can not list functions

* Added new checks 7164 and 7165 to group extras

* Added invalid check or group id to the error message #962

* Fix Broken Link

* Add docker volume example to README.md

* Updated Dockerfile to use amazonlinux container

* Updated Dockerfile with AWS cli v2

* Added upgrade to the RUN

* Added cache purge to Dockerfile

* Backup AWS Credentials before AssumeRole and Restore them before CopyToS3

* exporting the ENV variables

* fixed bracket

* Improved documentation for install process

* fix checks with comma issues

* Added -D option to copy to S3 with the initial AWS credentials

* Cosmetic variable name change

* Added $PROFILE_OPT to CopyToS3 commands

* remove commas

* removed file as it is not needed

* Improved help usage options -h

* Fixed CIS LEVEL on 7163 through 7165

* When performing a restoreInitialAWSCredentials, unset the credentials ENV variables if they were never set

* New check 7166 Elastic IP addresses with associations are protected by AWS Shield Advanced

* New check 7167 Cloudfront distributions are protected by AWS Shield Advanced

* New check 7168 Route53 hosted zones are protected by AWS Shield Advanced

* New check 7169 Global accelerators are protected by AWS Shield Advanced

* New check 7170 Application load balancers are protected by AWS Shield Advanced

* New check 7171 Classic load balancers are protected by AWS Shield Advanced

* Include example for global resources

* Add AWS Advance Shield protection checks corrections

* Added Shield actions GetSubscriptionState and DescribeProtection

* Added Shield actions GetSubscriptionState and DescribeProtection

* docs(templates): Improve bug template with more info (#982)

* Removed echoes after role chaining fix

* Changed Route53 checks7152 and 7153 to INFO when no domains found

* Changed Route53 checks 7152 and 7153 title to clarify

* Added passed security groups in output to check 778

* Added passed security groups and updated title to check 777

* Added FAIL as error handling when SCP prevents queries to regions

* Label version 2.7.0-6January2022

* Updated .dockerignore with .github/

* Fix: issue #758 and #984

* Fix: issue #741 CloudFront and real-time logs

* Fix issues #971 set all as INFO instead of FAIL when no access to resource

* Fix: issue #986

* Add additional action permissions for Glue and Shield Advanced checks @lazize

* Add extra shield action permission

Allows the shield:GetSubscriptionState action

* Add permission actions

Make sure all files where permission actions are necessary will have the same actions

* Fix: Credential chaining from environment variables @lazize #996f

If profile is not defined, restore original credentials from environment variables,
if they exists, before assume-role

* Lable version 2.7.0-24January2022

Co-authored-by: Lee Myers <ichilegend@gmail.com>
Co-authored-by: Chinedu Obiakara <obiakac@amazon.com>
Co-authored-by: Daniel Peladeau <dcpeladeau@gmail.com>
Co-authored-by: Jonathan Lozano <jonloza@amazon.com>
Co-authored-by: Daniel Lorch <dlorch@gmail.com>
Co-authored-by: Pepe Fagoaga <jose.fagoaga@smartprotection.com>
Co-authored-by: Israel <6672089+lopmoris@users.noreply.github.com>
Co-authored-by: root <halfluke@gmail.com>
Co-authored-by: nikirby <nikirby@amazon.com>
Co-authored-by: Joel Maisenhelder <maisenhe@gmail.com>
Co-authored-by: RT <35173068+rtcms@users.noreply.github.com>
Co-authored-by: Andrea Di Fabio <39841198+sectoramen@users.noreply.github.com>
Co-authored-by: Joseph de CLERCK <clerckj@amazon.fr>
Co-authored-by: Michael Dickinson <45626543+michael-dickinson-sainsburys@users.noreply.github.com>
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
Co-authored-by: Leonardo Azize Martins <lazize@users.noreply.github.com>
2022-01-24 13:49:47 +01:00
Toni de la Fuente
42e54c42cf Label new version 2.6.1-15November2021 2021-11-15 19:12:06 +01:00
Toni de la Fuente
f0c12bbf93 Merge pull request #928 from toniblyx/2.6.1
2.6.1
2021-11-15 18:56:16 +01:00
Toni de la Fuente
d272fad4c2 Enhancement IAM assumed role session duration error handling by @jfagoagas
Enhancement IAM assumed role session duration error handling by @jfagoagas
2021-11-15 18:17:09 +01:00
Toni de la Fuente
3e78f017e2 Fix Terraform Kickstarter path in README by @z0ph
Fix Terraform Kickstarter path in README
2021-11-15 17:05:37 +01:00
Toni de la Fuente
cee6437ae1 Fix issue #926 resource id and remediation typo 2021-11-15 16:49:40 +01:00
Toni de la Fuente
b251f31da9 Fix issue #925 replace sensible by sensitive 2021-11-15 15:59:13 +01:00
Toni de la Fuente
50de9f2ab4 Fix output for checks check3x when no CW group is in place 2021-11-15 15:49:33 +01:00
Toni de la Fuente
a6ba580344 Fix severity case variable 2021-11-15 15:45:33 +01:00
Pepe Fagoaga
563cd71060 fix(iam-role): Delete temporary prowler.sts_assumed* if error 2021-11-13 16:25:43 +01:00
Victor GRENU
32e5738c46 fix readme for terraform kickstarter 2021-11-13 14:48:16 +01:00
Pepe Fagoaga
e4edb5e39e fix(iam-role): IAM assumed role session duration 2021-11-12 18:32:02 +01:00
Toni de la Fuente
cbd1c31424 Merge pull request #922 from toniblyx/2.6
2.6
2021-11-12 13:23:42 +01:00
Toni de la Fuente
df6e3f9462 Merge branch 'master' into 2.6 2021-11-12 13:21:18 +01:00
Toni de la Fuente
79c32a3c0b Label new version 2.6.0-12November2021 2021-11-12 10:34:32 +01:00
Toni de la Fuente
9cf076899e Updated screenshots and minor changes 2021-11-12 10:33:45 +01:00
Toni de la Fuente
dd398a994b Fix issue #904 2021-11-11 14:05:14 +01:00
Toni de la Fuente
82b7eca80a Fix CIS LEVEL variable in check21 2021-11-11 14:00:33 +01:00
Toni de la Fuente
140e96e5e1 Fix issue #848 CIS LEVEL added to CSV and other formats 2021-11-11 13:40:40 +01:00
Toni de la Fuente
34aba53649 Consolidate Apache License file in LICENSE 2021-11-11 12:52:57 +01:00
Toni de la Fuente
6921eaa6e9 Fix issue #868 2021-11-11 11:25:12 +01:00
Toni de la Fuente
4b205e2cdd Add badges for Docker Hub and AWS ECR public registry 2021-11-10 18:49:06 +01:00
Toni de la Fuente
5d79bd6b0f Add extra7158,extra7159 to extras 2021-11-10 16:55:17 +01:00
Toni de la Fuente
a5dfa788a6 New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05
New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05
2021-11-10 16:49:10 +01:00
Toni de la Fuente
afed5eb4b2 New check 7158 ELBV2 has listeners underneath @kbgoll05
New check 7158 ELBV2 has listeners underneath @kbgoll05
2021-11-10 16:48:45 +01:00
Toni de la Fuente
aecb784eca Merge pull request #918 from toniblyx/revert-911-check7158
Revert "New check 7158 ELBV2 has listeners underneath @kbgoll05"
2021-11-10 14:27:36 +01:00
Toni de la Fuente
1ee7f4f276 Revert "New check 7158 ELBV2 has listeners underneath @kbgoll05" 2021-11-10 14:27:27 +01:00
Toni de la Fuente
98d465b84b Merge pull request #917 from toniblyx/revert-912-check7159
Revert "New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05"
2021-11-10 14:27:12 +01:00
Toni de la Fuente
24c3da2a60 Revert "New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05" 2021-11-10 14:27:01 +01:00
Toni de la Fuente
69164c5176 New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05
New check 7159 ELB Classic Load balancer has listeners underneath @kbgoll05
2021-11-10 14:26:23 +01:00
Toni de la Fuente
fa5c5773f7 New check 7158 ELBV2 has listeners underneath @kbgoll05
New check 7158 ELBV2 has listeners underneath @kbgoll05
2021-11-10 14:25:58 +01:00
Toni de la Fuente
950f14c845 Fix issue #886 2021-11-09 15:47:09 +01:00
Toni de la Fuente
48d7381822 Fix issue #871 2021-11-09 14:21:32 +01:00
Toni de la Fuente
2c81b383e8 Fix scoring check counter 2021-11-09 12:59:36 +01:00
Toni de la Fuente
60d89fa98d Enhanced scoring when only INFO is detected 2021-11-08 22:44:41 +01:00
Toni de la Fuente
7b6e4ccd13 Added Discord link to README.md 2021-11-08 21:21:39 +01:00
Toni de la Fuente
9ec4db456c Added Discord link to README.md 2021-11-08 21:19:48 +01:00
Toni de la Fuente
918dd9eb07 Added Discord link to README.md 2021-11-08 20:34:16 +01:00
Toni de la Fuente
83dc0a0987 Fixes issue #906 2021-11-08 20:05:50 +01:00
kbgoll05
226b016557 Add files via upload 2021-11-05 16:02:25 -05:00
kbgoll05
41c6131d10 Add files via upload 2021-11-05 15:50:54 -05:00
Toni de la Fuente
623e62ad3f Fix service name string with bash colors in html report 2021-11-05 18:33:24 +01:00
Toni de la Fuente
98e7e543fd Fix issue #827 2021-11-05 17:36:34 +01:00
Toni de la Fuente
5d5250076b Updated documentation about detect-secrets version to use issue #806 2021-11-04 19:50:33 +01:00
Toni de la Fuente
12f49a2795 Fixed typo in README.md @bevel-zgates
Fixed typo in README.md @bevel-zgates
2021-11-04 19:15:33 +01:00
Zach
2e0695112d Update README.md
fixed typo in `readme.md`
2021-11-04 12:29:36 -05:00
Toni de la Fuente
89e87c713b Added extra7157 to group extras 2021-10-26 14:34:44 +02:00
Toni de la Fuente
2c1fd8aeb4 New Check 7157 API Gateway V2 has Configured Authorizers @qumei
New Check 7157 API Gateway V2 has Configured Authorizers @qumei
2021-10-26 14:31:10 +02:00
Toni de la Fuente
7fe2946241 New checks group FTR (AWS Foundational Technical Review) @jfagoagas
New checks group FTR (AWS Foundational Technical Review) @jfagoagas
2021-10-26 14:19:52 +02:00
Pepe Fagoaga
bb068f1c7a feat(group): include new AWS FTR checks group 2021-10-26 14:06:34 +02:00
Toni de la Fuente
1c7d3c452f Fix Shodan typo in -h usage text @jfagoagas
Fix Shodan typo in -h usage text @jfagoagas
2021-10-26 12:42:44 +02:00
Pepe Fagoaga
12c6f726e9 fix(lambda-secrets): change aws cli output format to extract keys and values (#4) 2021-10-26 12:31:25 +02:00
Pepe Fagoaga
7a3e353d54 docs(usage): Fix Shodan typo (#3) 2021-10-25 14:49:51 +02:00
Zaid Qumei
dfdcd107fc Fixed servicename and fail text 2021-10-22 10:48:01 -04:00
Toni de la Fuente
a3a5d7cc4d Delete main.yml 2021-10-21 12:35:42 +02:00
Toni de la Fuente
c7c76a0581 Create main.yml 2021-10-21 12:15:09 +02:00
Toni de la Fuente
f06168f490 Fix check extra734 about S3 buckets default encryption with StringNotEquals @rustic
Fix check extra734 about S3 buckets default encryption with StringNotEquals @rustic
2021-10-19 16:54:53 +02:00
Lee Myers
fc07fa44ee check_extra734 update to StringNotEquals 2021-10-15 15:09:56 -04:00
Toni de la Fuente
8f265dca68 Updated parts from check7152 @jarrettandrulis
Updated parts from check7152 @jarrettandrulis
2021-10-15 14:30:17 +02:00
Jarrett Andrulis
7ff9dcd65e Updated link 2021-10-14 16:39:49 -05:00
Jarrett Andrulis
64a162fca1 Updated parts from check7152 accidentally left in 2021-10-14 16:37:47 -05:00
Zaid Qumei
e284a56f0d Added extracheck 7157 2021-10-14 09:46:03 -04:00
Toni de la Fuente
9d9a3ef761 Removed dot in title for consistency in new checks 2021-10-07 16:49:10 +02:00
Toni de la Fuente
571a714a82 Updated with right service name for consistency 2021-10-07 16:42:30 +02:00
Toni de la Fuente
b6fdbaba01 New feature: adding the ability to provide a file for checks to be ran @Kirizan
New feature: adding the ability to provide a file for checks to be ran @Kirizan
2021-10-07 14:31:34 +02:00
nikirby
6874fa4793 Fixed sample file to be what it's looking for. 2021-10-06 10:48:13 -04:00
nikirby
e23b24099d Added -C option to provide a file with the checklist to be checked against. Also added checklist.txt to provide a sample file 2021-10-06 10:41:40 -04:00
Toni de la Fuente
d3b04d3ed9 Update group extras with new checks 2021-10-05 17:39:52 +02:00
Toni de la Fuente
ea1d0c4dfa New check 7148 EFS File systems have backup enabled @georgie969 2021-10-05 17:39:22 +02:00
Toni de la Fuente
a9b2bc1167 New check 7155 Application Load Balancer is configured with defensive or strictest desync mitigation mode @ShubhamShah11 2021-10-05 17:31:59 +02:00
Toni de la Fuente
6fb49a46bf New check 7153 Route53 transfer lock for domains enabled @jarrettandrulis 2021-10-05 17:31:30 +02:00
Toni de la Fuente
221f6038d7 Restore group extras 2021-10-05 17:22:53 +02:00
Toni de la Fuente
f4045c6d97 New Check 7156 API Gateway V2 has Access Logging enabled @dsensibaugh
New Check 7156 API Gateway V2 has Access Logging enabled @dsensibaugh
2021-10-05 16:55:08 +02:00
Toni de la Fuente
53e5681f35 New check 7154 CloudFormation stack termination protection enabled @ShubhamShah11
New check 7154 CloudFormation stack termination protection enabled @ShubhamShah11
2021-10-05 16:52:38 +02:00
Toni de la Fuente
ca96addd92 New check 7152 Route53 domain privacy protection enabled @jarrettandrulis
New check 7152 Route53 domain privacy protection enabled @jarrettandrulis
2021-10-05 16:49:15 +02:00
Jarrett Andrulis
27ab868e49 Update check_extra7152 2021-10-04 15:26:05 -05:00
Toni de la Fuente
bffc9799c1 Updated documentation regarding a confusion with the -q option (issue #884) @w0rmr1d3r
Updated documentation regarding a confusion with the `-q` option (issue #884) @w0rmr1d3r
2021-10-04 13:28:37 +02:00
Toni de la Fuente
d704f1003c New check 7151 DynamoDB tables point-in-time recovery (PITR) enabled @ManuelUgarte
New check 7151 DynamoDB tables point-in-time recovery (PITR) enabled @ManuelUgarte
2021-10-04 13:24:01 +02:00
Toni de la Fuente
af7c4393d2 New check 7149 Redshift automated snapshots enabled @georgie969
New check 7149 Redshift automated snapshots enabled @georgie969
2021-10-04 13:22:14 +02:00
Toni de la Fuente
13d8c94053 New check 7150 ELB deletion protection enabled @ManuelUgarte
New check 7150 ELB deletion protection enabled @ManuelUgarte
2021-10-04 13:21:32 +02:00
Ramon
2f4a5c7c51 updated documentation regarding a confusion with the -q option 2021-10-04 13:13:24 +02:00
David Sensibaugh
fec9c9c976 Update check_extra7156 2021-10-03 18:59:52 -04:00
EC2 Default User
4f7d75598d Changed ',' with ';' in check variables 2021-10-01 15:24:14 +00:00
EC2 Default User
babbf065de Changed ',' with ';' in variables 2021-10-01 15:21:02 +00:00
Shubham Shah
f74414532d Update check_extra7154 2021-10-01 11:14:26 -04:00
Shubham Shah
44d40e4f0d Update check_extra7154 2021-09-28 16:34:44 -04:00
EC2 Default User
cff8f4a8d2 variable ends with just the value of key 'PointInTimeRecoveryStatus' if it is ENABLED. 2021-09-28 18:54:33 +00:00
Toni de la Fuente
34dd6842c4 New check 7148 EFS File systems have backup enabled @georgie969
New check 7148 EFS File systems have backup enabled @georgie969
2021-09-28 17:29:46 +02:00
Toni de la Fuente
70c6e5c7af Fix duplicated region in textFail message for extra741 @pablopagani
Fix duplicated region in textFail message for extra741 @pablopagani
2021-09-28 17:27:51 +02:00
Pablo Pagani
11deceb9e6 Bugfix: duplicated region in textFail message. 2021-09-23 14:05:20 -03:00
Toni de la Fuente
7c0d53a0e6 Delete group7_extras 2021-09-23 10:16:26 +02:00
Toni de la Fuente
e4ecbcbd54 Delete group7_extras 2021-09-23 10:08:26 +02:00
Toni de la Fuente
db6363e89f Delete randomFile.txt 2021-09-23 10:08:03 +02:00
Toni de la Fuente
fad06ef5c0 New feature added flags Z to control if Prowler returns exit code 3 on a failed check @Kirizan
New feature added flags `Z` to control if Prowler returns exit code 3 on a failed check @Kirizan
2021-09-23 09:30:56 +02:00
Toni de la Fuente
473e0fbc3a Fix doc reference link in check23 @FallenAtticus
Fix doc reference link in check23 @FallenAtticus
2021-09-23 09:27:14 +02:00
Toni de la Fuente
254cb0cf63 Fix Security Hub conflict with duplicated findings in the management account #711 @xeroxnir
Fix Security Hub conflict with duplicated findings in the management account #711 @xeroxnir
2021-09-21 17:03:04 +02:00
Shubham Shah
73c65cf323 Update group7_extras 2021-09-20 20:07:43 -04:00
Shubham Shah
052a36207c Update check_extra7154 2021-09-20 20:06:48 -04:00
Shubham Shah
ff3ef0b8c0 Update check_extra7154 2021-09-20 19:11:23 -04:00
Shubham Shah
e42a2f8249 Merge pull request #1 from ShubhamShah11/ShubhamShah11-patch-1
Shubham shah11 patch 1
2021-09-20 19:02:53 -04:00
Shubham Shah
6201a2a3fb Update check_extra7154 2021-09-20 19:02:28 -04:00
Shubham Shah
c6c730a81e Update check_extra7154 2021-09-20 17:21:19 -04:00
Shubham Shah
7d79532c1f Adding check_extra7154 2021-09-20 17:20:13 -04:00
Shubham Shah
af38286a15 Create check_extra7154 2021-09-20 17:06:33 -04:00
Jarrett Andrulis
6566e80a3c renamed as extra7152 2021-09-20 10:59:30 -05:00
Jarrett Andrulis
397a44e3f9 Adding check_extra7151 2021-09-20 10:16:52 -05:00
EC2 Default User
9d76ba0c7b Removed xargs from line 30, not needed. Tested code against resources. 2021-09-16 13:29:06 +00:00
Joaquin Rinaudo
504b27b47a #711 fix Security Hub management account
* Filter by AWS account Id to avoid importing findings from other accounts.
2021-09-16 15:15:15 +02:00
EC2 Default User
ee5ae4fc5e Check if DynamoDB tables point-in-time recovery (PITR) is enabled. 2021-09-15 20:38:24 +00:00
EC2 Default User
df7a2c6ef3 Added EOL and updated some variables to make it easier to read. 2021-09-15 18:12:11 +00:00
Toni de la Fuente
48b45bbf95 Terraform Kickstarter @singergs
Terraform Kickstarter @singergs
2021-09-15 14:52:21 +02:00
George
9776c412c9 New Prowler check 7149 added 2021-09-14 16:50:07 -04:00
George
7b645a4a34 New Prowler check 7149 added 2021-09-14 16:36:17 -04:00
EC2 Default User
5c6b81dd8b elb deletion protection enabled checkextra 7150 2021-09-14 19:57:40 +00:00
Geoff Singer
0437c10dfd Update: Documentation reference
Removed gifs in git repo and moved to S3 for storage.  Effort to reduce the size of the git repo.

Moved artifacts to the util dir
2021-09-13 16:14:35 -05:00
Toni de la Fuente
9fc9e43172 Fix typo and HTTP capitalisation in extra7142 @acknosyn
Fix typo and HTTP capitalisation in extra7142 @acknosyn
2021-09-13 19:23:41 +02:00
Toni de la Fuente
c1403dc140 Fix support policy arn in check120 @hersh86
Fix support policy arn in check120 @hersh86
2021-09-13 19:20:15 +02:00
Toni de la Fuente
a827504d58 Added feature to allow role ARN while using -R parameter @mmuller88
Added feature to allow role ARN while using -R parameter @mmuller88 #859
2021-09-13 19:01:15 +02:00
Toni de la Fuente
f3dcfe9f8e Added a new way to deploy Prowler at Organizational level with serverless @bella-kwon
Added a new way to deploy Prowler at Organizational level with serverless @bella-kwon
2021-09-13 18:57:36 +02:00
Geoff Singer
8617c77889 Remove: Link
Removed the hardlink to repo video file
2021-09-13 11:53:50 -05:00
Toni de la Fuente
28b97058ad Fix bug in extra784 @tayivan-sg
Fix bug in extra784 @tayivan-sg
2021-09-13 18:52:28 +02:00
Geoff Singer
8769783b75 Remove: Video File
Uploaded video file to youtube and removed it from the repo
2021-09-13 11:38:08 -05:00
Geoff Singer
1f1d7b2954 Update: Video Reference 2021-09-13 11:37:02 -05:00
georgie969
8586b1073d Delete extra_check7149
This file (7149) was committed in error
2021-09-10 10:52:15 -04:00
George
e17d6e580f New Prowler Check 7149 by George O. submitted for review 2021-09-10 09:22:21 -04:00
George
b3aa82a3b0 New Prowler Check 7148 by George O. submitted for review 2021-09-08 16:01:18 -04:00
Jarrett Andrulis
c23ba56313 commit 2021-09-08 14:43:54 -05:00
sascha.duwe
aadc7640b1 Removed the trailing space 2021-09-07 15:30:17 +02:00
nikirby
c901233199 Added CLI flags Z for selecting which checks should generate exit code 3, and z to stop exit code 3 being generated at all. 2021-09-07 08:54:47 -04:00
Sascha Duwe
ecec784113 Update check23
Fixed reference link
2021-09-07 11:13:42 +02:00
Acknosyn
d2c75d8d71 Fix typo and HTTP capitalisation 2021-09-06 11:24:34 +12:00
Alex Hershey
56fd096620 Quick fix for check120 2021-09-03 17:01:08 -04:00
Geoff Singer
1a2fd87777 Update: Create tf files for variables, output, etc.
Separated the variables, outputs, and data into separate tf files
2021-09-02 12:01:39 -05:00
Geoff Singer
859d78a204 Merge remote-tracking branch 'origin/terraform-kickstarter' into terraform-kickstarter 2021-09-02 09:29:30 -05:00
Geoff Singer
ea337993c3 Update: buildspec.yml
- removed the branch checkout
- moved all the commands to the install phase
per comments by w0rmr1d3r
2021-09-02 09:29:24 -05:00
Geoff Singer
21694f866e Update:
- removed the branch checkout
- moved all the commands to the install phase
per comments by w0rmr1d3r
2021-09-02 09:28:22 -05:00
Martin Mueller
36c4040a7f improve doc for -R 2021-09-02 07:32:42 +02:00
Toni de la Fuente
5757767b25 Fixed typo in risk description for check29 @kamiryo
Fixed typo in risk description for check29 @kamiryo
2021-09-01 19:14:03 +02:00
Geoff Singer
74a2f5ba03 Documentation: Updates 2021-09-01 11:33:31 -05:00
Martin Mueller
8d8ec38c60 feat: allow role arn for R parameter 2021-09-01 08:06:59 +02:00
Geoff Singer
8280ff619a Update: Documentation 2021-08-31 10:21:26 -05:00
Geoff Singer
77a732b8b3 Buildspec: parameter change 2021-08-31 09:43:57 -05:00
Geoff Singer
dc8e3b0028 Update: IAM role 2021-08-31 09:16:36 -05:00
Geoff Singer
066c90028f Update: IAM role 2021-08-31 09:05:16 -05:00
Geoff Singer
e621ae465a Updated: install commands 2021-08-31 08:25:28 -05:00
Geoff Singer
66cb830b66 Added: terraform artifacts 2021-08-31 08:21:37 -05:00
kamiryo
9f9d82adef Update check29
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Fixed typo
2021-08-30 16:43:42 +09:00
bella-kwon
12c52625c5 Readme and doc resources added 2021-08-30 11:00:31 +09:00
bella-kwon
f33342aef9 Prowler execution script added 2021-08-30 10:59:33 +09:00
bella-kwon
9f435b45fa Organizational prowler template added 2021-08-30 10:59:08 +09:00
Ivan Tay
13b93c81ea Changes to fix bug in extra 784 2021-08-26 09:55:27 +08:00
Toni de la Fuente
06f790858b Fix title, remediation and doc link for check extra768 @w0rmr1d3r
Fix title, remediation and doc link for check extra768 @w0rmr1d3r
2021-08-25 11:28:40 +02:00
Toni de la Fuente
a72a2e9b48 Ignore archived findings in GuardDuty for check extra7139 @chbiel
Ignore archived findings in GuardDuty for check extra7139 @chbiel
2021-08-25 11:26:31 +02:00
Ramon
c14593a40e fix check_extra768 texts 2021-08-20 16:22:52 +02:00
Christopher Biel
321c79a374 Ignore archvived findings, as the check should only look at active findings, not those that were moved to the archive of guardduty 2021-08-19 11:50:16 +02:00
Toni de la Fuente
49261840d0 Fix extra737 remove false positives due to policies with condition @rinaudjaws
Fix extra737 remove false positives due to policies with condition @rinaudjaws
2021-08-18 20:31:26 +02:00
Toni de la Fuente
06157bcb87 Updated prowler-codebuild-role name for CFN StackSets name length limit @varunirv
Updated prowler-codebuild-role name for CFN StackSets name length limit @varunirv
2021-08-18 20:29:17 +02:00
rinaudjaws
38df162976 Remove KMS with conditions false positives
CDK for example implements callerAccount as a condition for the KMS policy resulting in too many false positives.
2021-08-18 08:52:46 +02:00
Rajat
3df5ee330d Updated prowler-codebuild-role name
This change is to fix the issue as reported at
https://github.com/toniblyx/prowler/issues/845
2021-08-13 14:55:12 -04:00
Ramon
fbf7bb0bfe Merge pull request #1 from toniblyx/master
Updating with Upstream
2021-08-13 11:33:04 +02:00
Toni de la Fuente
3b6bc7fa64 2.5 - See release notes https://github.com/toniblyx/prowler/releases/tag/2.5.0
2.5 - See release notes https://github.com/toniblyx/prowler/releases/tag/2.5.0
2021-08-13 11:03:49 +02:00
Toni de la Fuente
e0f60114f4 Consolidated license file 2021-08-13 10:05:56 +02:00
Toni de la Fuente
e39ff9683c Set new version 2.5.0-12August2021 2021-08-12 10:38:59 +02:00
Toni de la Fuente
63233c9333 Changed check textTitle format for default output 2021-08-12 10:37:36 +02:00
Toni de la Fuente
3297fba209 Added new checks to extras 2021-08-10 23:11:50 +02:00
Toni de la Fuente
9c3ab79510 Removed Scored from title 2021-08-10 18:45:39 +02:00
Toni de la Fuente
24dec21aa4 Merge branch '2.5-new-checks' into 2.5 2021-08-10 17:28:48 +02:00
Toni de la Fuente
c8e9cf2e77 Tested new checks 7143 to 7147 2021-08-10 17:00:18 +02:00
Toni de la Fuente
5d4a96c35b Adding custom security checks @nayabpatel
Adding custom security checks @nayabpatel
2021-08-10 15:29:29 +02:00
Toni de la Fuente
4607e519a9 Merge branch '2.5-new-checks' into custom-checks 2021-08-10 15:25:31 +02:00
Toni de la Fuente
eba79e265e Merge branch '2.5' of https://github.com/toniblyx/prowler into 2.5 2021-08-10 15:13:26 +02:00
Toni de la Fuente
f418c706b5 Removed extra756 from extras as duplicated 2021-08-10 15:13:14 +02:00
Toni de la Fuente
7b9a7ccb8a Merge pull request #841 from toniblyx/2.5
2.5
2021-08-10 15:09:11 +02:00
Toni de la Fuente
ad23bddabe Ignore secrets folder in git @w0rmr1d3r
Ignore secrets folder in git @w0rmr1d3r
2021-08-10 15:04:50 +02:00
Toni de la Fuente
d869c748fb Now shows default output regardless custom outputs called with -M 2021-08-10 14:07:31 +02:00
Toni de la Fuente
cdf99c9600 Removed scored info from title 2021-08-10 14:03:13 +02:00
Toni de la Fuente
c6203bf9e3 Clean up redentials report output 2021-08-10 14:02:21 +02:00
Toni de la Fuente
62050e2e34 Added PROWLER_START_TIME to CSV for reports 2021-08-10 14:01:40 +02:00
Ramon
558a9b5f2e ignore secrets folder when scanning for secrets 2021-08-06 11:46:45 +02:00
Toni de la Fuente
d71e4a0214 Updated html report colour contrast for WCAG 2.1 accessibility standards @danielperez660
Updated html report colour contrast for WCAG 2.1 accessibility standards @danielperez660
2021-08-02 15:15:57 +02:00
danielperez660
9c24ae59cf Merge branch '2.5' into master 2021-08-02 14:10:14 +01:00
Toni de la Fuente
98f0755a0f Fix grammar issue in scoring @w0rmr1d3r
Fix grammar issue in scoring @w0rmr1d3r
2021-08-02 15:01:50 +02:00
Toni de la Fuente
38ebad4f00 Delete duplicated check extra737 and its references @w0rmr1d3r
Delete duplicated check extra737 and its references @w0rmr1d3r
2021-08-02 14:15:45 +02:00
Toni de la Fuente
5685cb8959 Merge branch '2.5' into delete_check_extra737_is_duplicated 2021-08-02 14:14:45 +02:00
Toni de la Fuente
ad28cf4671 Delete duplicated check extra756 and its references @w0rmr1d3r
Delete duplicated check extra756 and its references @w0rmr1d3r
2021-08-02 14:12:38 +02:00
daniel
3a66ca336a changes made so there is enough colour contrast for WCAG 2.1 accessibility standards 2021-08-02 13:23:16 +02:00
Toni de la Fuente
26d310e35b Updated Prowler additions policy 2021-07-29 18:37:57 +02:00
Toni de la Fuente
52e04406dc Added servicename to the title for ASFF 2021-07-29 17:03:04 +02:00
Toni de la Fuente
3f63b83179 Added section with info about regions 2021-07-27 15:12:14 +02:00
Toni de la Fuente
4d6285f167 Added s3 and glue required permissions and removed obsoletes 2021-07-27 14:52:23 +02:00
Toni de la Fuente
ffe147b5b5 Added s3 and glue required permissions and removed obsoletes 2021-07-27 14:49:58 +02:00
Toni de la Fuente
c32fa9aa1f Added s3 and glue required permissions 2021-07-27 14:43:20 +02:00
Ramon
9ddb31f9c3 fix grammar issue 2021-07-16 12:26:46 +02:00
Ramon
0d9ec6320e delete check extra737 and its references 2021-07-16 12:09:54 +02:00
Ramon
8c70efde5f delete check extra756 and its references 2021-07-16 12:03:39 +02:00
Toni de la Fuente
065483a8b6 Update check12 - Missing MFA at the beginning of remediation @thorkill
Update check12 - Missing MFA at the beginning of remediation @thorkill
2021-07-16 10:17:28 +02:00
Rafał Leśniak
0a4ca0d2ed Update check12
Added missing MFA in remediation description.
2021-07-16 01:35:46 +02:00
Toni de la Fuente
ab1407217d Enhanced Dockerfile with py3-pip 2021-07-09 13:57:35 +02:00
Toni de la Fuente
265f494b0d Fixed check21 to fail if trail is off 2021-07-08 17:09:22 +02:00
Toni de la Fuente
85cb2085b9 Output consolidation 2021-07-07 16:15:53 +02:00
Toni de la Fuente
5670e4a972 Removed CSV header stdout and add bucket-owner-full-control 2021-07-07 16:00:09 +02:00
Toni de la Fuente
c09385976a Consolidated titles and outputs including resource ID in ASFF 2021-07-05 20:17:27 +02:00
Toni de la Fuente
a9f277e131 Delete util/dashboard directory 2021-07-05 20:16:22 +02:00
Toni de la Fuente
f540758e36 Delete util/ec2-automation directory 2021-07-05 20:15:48 +02:00
Toni de la Fuente
90ae53a976 Delete util/quicksight directory 2021-07-05 20:15:33 +02:00
Toni de la Fuente
24a02c1f71 Merge branch '2.5' of https://github.com/toniblyx/prowler into 2.5 2021-07-05 20:14:03 +02:00
Toni de la Fuente
3936a7b17a Changed how color codes are shown in text mode 2021-07-05 20:11:35 +02:00
Toni de la Fuente
bc959a23f1 License file and banner cosolidation 2021-07-04 12:32:50 +02:00
Toni de la Fuente
d53e6eb3a9 Fixed aws organizations multi-account deployment s3 upload issue @owlvat
Fixed aws organizations multi-account deployment s3 upload issue @owlvat
2021-06-30 10:30:04 +02:00
IB (AWS)
8c74ef102f fixed aws organizations multi-account s3 upload issue 2021-06-28 14:49:54 -07:00
Toni de la Fuente
706d20b5f6 Updated document title 2021-06-24 17:55:46 +02:00
Toni de la Fuente
4e9e421c84 Updated README to include reference to CloudShelld 2021-06-24 17:49:33 +02:00
Patel
800bcb0016 renaming extra checkId, change in text message format, adding more metadata variables, lowercase servicename, adding checks in extras group 2021-06-24 15:47:29 +05:30
Toni de la Fuente
3441b34f01 Add ResourceID to all checks output for ASFF and other output formats @singergs
Add ResourceID to all checks output for ASFF and other output formats @singergs
2021-06-23 23:25:05 +02:00
Toni de la Fuente
dc47d32a36 Update: Add data to the ASFF @singergs
Update: Add data to the ASFF @singergs
2021-06-23 23:18:41 +02:00
Toni de la Fuente
a8ae0bc845 Adding code for running in AWS CloudShell @hackersifu
Adding code for running in AWS CloudShell @hackersifu
2021-06-23 10:34:55 +02:00
Joshua McKiddy
74ddaf8087 Adding code for running in cloudshell 2021-06-22 11:07:14 -07:00
Patel
8a2d2924b4 Fixed typo issues, removed commented line, change in severity 2021-06-17 11:43:19 +05:30
Geoff
4961498562 Added parameter to report resource name
Added a third parameter to checks textFail and textPass to identify resource name in finding.
2021-06-16 22:25:44 -05:00
Geoff
b14ac340bb Update: Add data to the ASFF
Added in the ASFF ProductFields ProwlerResourceName.  The resource name is passed into the fining from the third parameter in the Prowler checks
2021-06-16 09:12:17 -05:00
Toni de la Fuente
86aa9c317f HTML Report: Filtering and other nice things @nickmalcolm
HTML Report: Filtering and other nice things @nickmalcolm
2021-06-14 14:31:48 +02:00
Toni de la Fuente
7dec9f3d52 Merge branch '2.5' into nicer-html 2021-06-14 14:30:04 +02:00
Nick Malcolm
da45af78bc Disable ordering so that it sticks with the order the HTML was generated 2021-06-14 21:13:19 +12:00
Nick Malcolm
01663e4e0d Page width improvements. Use the 'link' icon for the link to docs, to cut down on page width. Remove the status column to save width, and also remove redundancy (colour coding and Result column serve the same purpose). Remove the column widths that added to over 100%. 2021-06-14 21:00:40 +12:00
Nick Malcolm
34e27131fd Refactor the HTML outputs so that they reuse code and are easier to change 2021-06-14 20:46:14 +12:00
Nick Malcolm
89af81ed22 Use DataTable's SearchPanes extension to allow easy filtering by result, severity, region, service, or check. 2021-06-14 20:33:38 +12:00
Nick Malcolm
f5a4e357b9 Consolidate javascript at the bottom of the template. Remove duplicate bootstrap includes - you only need bundle to get Popper (see https://getbootstrap.com/docs/4.0/getting-started/contents/#js-files) and you don't need both plain bootstrap and bundled bootstrap. Remove dupe jQuery too. 2021-06-14 20:27:16 +12:00
Patel
8e9ef841e5 Adding custom security checks 2021-06-14 12:43:21 +05:30
Toni de la Fuente
1229815c04 Add WAF CLASSIC check for extra7129 @kamiryo
Add WAF CLASSIC check for extra7129 @kamiryo
2021-06-11 17:17:28 +02:00
kamiryo
79a0eb622d Add WAF CLASSIC check for extra7129 2021-06-10 23:13:17 +09:00
Toni de la Fuente
f38f99e786 Corrected bug on groups when listing checks @pablopagani
Corrected bug on groups when listing checks @pablopagani
2021-06-10 10:29:37 +02:00
Pablo Pagani
aa3edbc636 corrected bug on groups when listing checks
corrected bug on groups when listing checks (option -l)
Previous regular expression will include groups when it matched half of the check_id
2021-06-09 14:01:27 -03:00
Toni de la Fuente
3f07afd7d4 Added custom file option @yangsec888
Added custom file option @yangsec888
2021-06-08 15:46:47 +02:00
Toni de la Fuente
701d5687be Fixed issue #811 @h1008
Fixed issue #811 @h1008
2021-06-08 14:50:59 +02:00
Toni de la Fuente
382e9c8e00 Align group21 title with the rest @w0rmr1d3r
Align group21 title with the rest @w0rmr1d3r
2021-06-08 14:49:52 +02:00
Ramon
c74faa6d07 add missing * to align with the rest of the titles 2021-06-08 14:18:46 +02:00
h1008
5aeb670a84 Fixed issue #811 2021-06-05 11:57:04 +02:00
Toni de la Fuente
124ae0fd2e Fixed kms keys compatibility in cli v2 and v1 2021-06-02 17:53:12 +02:00
Toni de la Fuente
4ddf0aff86 Added extra7142 to group extras 2021-06-01 12:28:30 +02:00
Toni de la Fuente
96b9accea8 New check extra7142 ALB Header Check request smuggling @Outrun207
New check extra7142 ALB Header Check request smuggling @Outrun207
2021-06-01 12:27:07 +02:00
Toni de la Fuente
324a1002a5 Fix finding customer kms keys in cli v2 for checks extra737 extra736 @dbellizzi
Fix finding customer kms keys in cli v2 for checks extra737 extra736 @dbellizzi
2021-06-01 12:24:19 +02:00
Toni de la Fuente
311d21546d Enhanced -f <filterregion> usage info 2021-06-01 09:10:51 +02:00
Toni de la Fuente
5f1fa558c9 Changes in text output with severity and service name 2021-06-01 09:09:25 +02:00
Toni de la Fuente
9b6198d5b0 Merge branch '2.5' of https://github.com/toniblyx/prowler into 2.5 2021-05-31 18:48:10 +02:00
Toni de la Fuente
55e703540e Fixed typo in check extra7141 ID 2021-05-31 18:47:56 +02:00
Dom Bellizzi
baf5232cbc Fix finding customer kms keys in cli v2 for checks extra737 extra736
Key id is in position 6 in aws cli version 2.2.5, but in position 4 in aws cli 1.x
Use --query to select only the data necessary and output in a consistent format
2021-05-29 22:27:15 +00:00
Josh Moss
e3893c7d5b Update check_extra7142 2021-05-25 13:49:27 -04:00
Sam (Yang) Li
a711b482df Fix #795 custom file option 2021-05-20 14:49:53 -04:00
Josh Moss
229d9ba00c ALB Header Check 2021-05-20 12:36:30 -04:00
Toni de la Fuente
51617df6c9 Bump Alpine to 3.13 in Dockerfile @gliptak
Bump Alpine to 3.13 in Dockerfile @gliptak
2021-05-20 17:10:28 +02:00
Toni de la Fuente
78e5dc5dba Added new check extra7141 to detect secrets in SSM Documents 2021-05-18 18:28:15 +02:00
Toni de la Fuente
1655bdb902 Added resource id to RDS checks and in json,csv,html outputs 2021-05-18 16:57:37 +02:00
Toni de la Fuente
30442b2da7 Added new check extra7140 for public SSM Documents 2021-05-18 16:10:55 +02:00
Toni de la Fuente
501082876c Fixed alias of extra7139 2021-05-18 16:08:10 +02:00
Toni de la Fuente
8d9ca987b5 Added link to doc for check45 check46 extra7138 and extras 2021-05-18 15:41:45 +02:00
Toni de la Fuente
f4cd84afd2 Merge pull request #785 from jfagoagas/new-acls-checks
Added new checks to test Network ACLs open to 22, 3389 and any port
2021-05-18 15:35:33 +02:00
Toni de la Fuente
46c6f44055 Merge branch '2.5' into new-acls-checks 2021-05-18 15:34:27 +02:00
Gábor Lipták
b72f66469e Bump Alpine to 3.13 in Dockerfile 2021-05-17 11:23:51 -04:00
Toni de la Fuente
cf4034c3b4 Improved error handling sts get-caller-identity @pablopagani
Improved error handling sts get-caller-identity @pablopagani
2021-05-04 15:43:29 +02:00
Toni de la Fuente
7c65430508 Improved error handling when listing regions @pablopagani
Improved error handling when listing regions @pablopagani
2021-05-04 15:39:25 +02:00
Toni de la Fuente
497b473431 Added check extra7139 shows number of GuardDuty critical findings @pablopagani
Added check extra7139 shows number of GuardDuty critical findings @pablopagani
2021-05-04 15:35:36 +02:00
Pablo Pagani
5385c4e546 Improved error handling sts get-caller-identity
Instead of looking for a fixed error string, it uses error codes from aws cli
Previos condition was not catching this error message:
An error occurred (ExpiredToken) when calling the GetCallerIdentity operation: The security token included in the request is expired
Also forced the output of the command to json. In some tests I was doing was failing becuase it was sending output as text
2021-05-01 17:54:11 -03:00
Pablo Pagani
9ac8c78fdb improved error handling when listing regions 2021-05-01 17:47:08 -03:00
Pablo Pagani
ce00f3a019 improved error handling. Added check 7139 . 2021-05-01 17:33:54 -03:00
Pepe Fagoaga
2727b7e8e2 fix(network-acls): update resource type to match AWS documentation 2021-04-28 18:50:20 +02:00
Pepe Fagoaga
2dc1ce61ec fix(network-acls): fix line typo 2021-04-26 12:30:44 +02:00
Pepe Fagoaga
625384ad6d feat(network-acls): include checks in networking and internetexposed checks 2021-04-24 13:38:36 +02:00
Pepe Fagoaga
056190cfc9 feat(network-acls): change textFail to textInfo because NACLs are stateless 2021-04-24 13:24:33 +02:00
Pepe Fagoaga
8f784a4548 feat(network-acls): include checks to test NetworkACLs open to 22, 3389 and any port 2021-04-24 13:13:41 +02:00
Pepe Fagoaga
f1185213e8 Merge branch 'master' of github.com:toniblyx/prowler 2021-04-22 18:30:48 +02:00
Pepe Fagoaga
cb60085779 New Networking checks for FTP, Telnet, SQL Server and Kafka (#2)
* feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to FTP ports 20 or 21

* feat(aws-securitygroups): include extra control 7134 in extra group

* feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Kafka port 9092

* feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Telnet port 23

* feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Microsoft SQL Server ports 1433 or 1434

* feat(aws-securitygroups): include extra controls 7135, 7136 and 7137 in extra and internet-exposed groups
2021-04-22 18:29:12 +02:00
Toni de la Fuente
0e33e066cd Added 4 new checks to look for FTP, Telnet, SQL Server and Kafka open ports @jfagoagas
Added 4 new checks to look for FTP, Telnet, SQL Server and Kafka open ports @jfagoagas
2021-04-20 17:23:48 +02:00
Pepe Fagoaga
672f3833fc feat(aws-securitygroups): include extra controls 7135, 7136 and 7137 in extra and internet-exposed groups 2021-04-19 19:31:06 +02:00
Pepe Fagoaga
4327333d00 feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Microsoft SQL Server ports 1433 or 1434 2021-04-19 19:28:10 +02:00
Pepe Fagoaga
ab43a8b717 feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Telnet port 23 2021-04-19 19:26:10 +02:00
Pepe Fagoaga
595bcba1d9 feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to Kafka port 9092 2021-04-19 19:24:31 +02:00
Pepe Fagoaga
68b3e1fa06 feat(aws-securitygroups): include extra control 7134 in extra group 2021-04-19 19:19:24 +02:00
Pepe Fagoaga
2ac96cf29a feat(aws-securitygroups): include new control to test ingress from 0.0.0.0/0 or ::/0 to FTP ports 20 or 21 2021-04-19 19:18:23 +02:00
Toni de la Fuente
49533de21b Added support for custom output folder and S3 bucket 2021-04-15 23:51:21 +02:00
Toni de la Fuente
583cffaefb 2.4.1 @toniblyx
2.4.1 @toniblyx
2021-04-15 10:22:00 +02:00
Toni de la Fuente
721b15d105 Fixed issue #776 2021-04-15 09:30:31 +02:00
Toni de la Fuente
53117819fc Fixed credentials renew issue #775 2021-04-14 11:47:38 +02:00
Toni de la Fuente
2552f2977d Fixed issue #775 2021-04-12 21:23:28 +02:00
Toni de la Fuente
8a04f40a80 Fixed issue #774 2021-04-12 20:20:04 +02:00
Toni de la Fuente
b0fd6ce60f Merge pull request #773 from toniblyx/2.4
v2.4
2021-04-09 15:51:44 +02:00
Toni de la Fuente
e4edc2fa2c Improved feature to refresh assume role credentials before it expires 2021-04-09 15:13:13 +02:00
Toni de la Fuente
10d062960e Updated screenshots 2021-04-08 00:35:12 +02:00
Toni de la Fuente
7f24aab715 Updated README 2021-04-08 00:22:07 +02:00
Toni de la Fuente
3dfca9c9dd Improved html output with scoring information 2021-04-08 00:14:24 +02:00
Toni de la Fuente
dacfea6b32 Included Risk, Remediation and Link support for CSV and HTML outputs 2021-04-07 18:42:44 +02:00
Toni de la Fuente
574a9c94b0 Added Risk, Remediation and Link to html report 2021-04-07 18:40:50 +02:00
Toni de la Fuente
7bace94e08 Fixed servicename variable in extra72 2021-04-07 18:39:14 +02:00
Toni de la Fuente
778910eff3 Added new logo to README.md header 2021-04-06 17:32:55 +02:00
Toni de la Fuente
755f7d952f Added new logo 2021-04-06 17:15:33 +02:00
Toni de la Fuente
d02e1967dc Improved PublicIP discovery used in Shodan check_extra7102 @as-km
Improved PublicIP discovery used in Shodan check_extra7102 @as-km
2021-04-06 13:05:27 +02:00
Mateusz
d77001356a use describe-network-interfaces instead of describe-addresses in order to get public IPs #768 2021-04-06 12:57:11 +02:00
Toni de la Fuente
e85d8b2a9d Add check23 to group17_internetexposed group @RyanJarv
Add check23 to group17_internetexposed group @RyanJarv
2021-04-06 12:01:52 +02:00
Toni de la Fuente
4f16c8dec5 Merge pull request #766 from toniblyx/revert-765-patch-2
Revert "Add check23 to group17_internetexposed group"
2021-04-05 21:17:35 +02:00
Toni de la Fuente
236ce1fb21 Revert "Add check23 to group17_internetexposed group" 2021-04-05 21:16:58 +02:00
Toni de la Fuente
15230ae6f3 Add check23 to group17_internetexposed @RyanJarv
Add check23 to group17_internetexposed @RyanJarv
2021-04-05 21:16:54 +02:00
Ryan Gerstenkorn
6c5776106f Add check23 to group17_internetexposed group
This add's the following check to group17.

* 2.3 [check23] Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)
2021-04-05 12:07:08 -07:00
Toni de la Fuente
4100d1dbfd Replace empty space with '\s' in check43 regex @frannovo
Replace empty space with '\s' in check43 regex @frannovo
2021-04-05 15:49:04 +02:00
Toni de la Fuente
abcd299559 Add get_regions function in order to call after assume_role @HG00
Add get_regions function in order to call after assume_role @HG00
2021-04-05 15:35:54 +02:00
Toni de la Fuente
f6049a0597 Merge branch '2.4' into master 2021-04-05 15:27:31 +02:00
HG00
bb397baa8a Add get_regions function in order to call after assume_role 2021-03-30 11:53:24 +00:00
Toni de la Fuente
c0f3265754 Better handle permissions and errors 2021-03-24 15:41:51 +01:00
Toni de la Fuente
9614b6fc82 Merge branch '2.4' of https://github.com/toniblyx/prowler into 2.4 2021-03-24 15:12:48 +01:00
Toni de la Fuente
a9d56be81a Added risk, remediation, doc link and caf epic to checks 742 to 7133 2021-03-24 15:12:32 +01:00
Toni de la Fuente
0c4111efda Moved assume role before listing regions fixes issue #744 2021-03-24 15:11:00 +01:00
Toni de la Fuente
5fb2e496a9 Added risk, remediation, doc link and caf epics to controls 1 to 741 @pablopagani
Added risk, remediation, doc link and caf epics to controls 1 to 741 @pablopagani
2021-03-24 14:36:54 +01:00
Pablo Pagani
7b4dae634e Merge branch '2.4' of https://github.com/pablopagani/prowler into 2.4 2021-03-24 10:23:04 -03:00
Pablo Pagani
35a22a71cd added risk remediation doc and epics to controls 1 to 741 2021-03-24 10:22:29 -03:00
Toni de la Fuente
21f817b087 Removed textInfo extra information on extra712 2021-03-24 12:30:59 +01:00
Toni de la Fuente
923dc3403b Added risk, remediation, doc link and epics to first 3 checks @pablopagani
Added risk, remediation, doc link and epics to first 3 checks
2021-03-24 09:08:19 +01:00
Pablo Pagani
68d240939c added risk, remediation doc and epics to firts 3 checks 2021-03-23 15:23:55 -03:00
Pablo Pagani
a9d0649122 added risk, remediation doc and epics to firts 3 checks 2021-03-23 15:19:23 -03:00
Fran Novo
3eeba2ef4e Replace empty space with '\s' in check43 regex 2021-03-15 17:45:49 +01:00
Toni de la Fuente
806eaa0b98 Updated ProwlerExecRoleAdditionalViewPrivileges Policy with lambda:GetFunction
Updated ProwlerExecRoleAdditionalViewPrivileges Policy with lambda:GetFunction
2021-03-11 14:27:52 +01:00
Pepe Fagoaga
2cd8d15410 Merge pull request #1 from toniblyx/master
Include missing AWS function policy to check AWS Lambda
2021-03-11 13:33:11 +01:00
Toni de la Fuente
d8473cfe87 Include missing AWS function lambda:GetFunction policy in prowler-additions-policy.json to check AWS Lambda @jfagoagas
Include missing AWS function lambda:GetFunction policy in prowler-additions-policy.json to check AWS Lambda @jfagoagas
2021-03-11 13:13:06 +01:00
Pepe Fagoaga
34625ff4e7 fix: include lambda:GetFunction in prowler policy to check AWS Lambda related controls: extra720,extra759,extra760,extra762,extra798 2021-03-11 12:48:32 +01:00
Toni de la Fuente
097ddbb957 Added extra7133 RDS multi-AZ 2021-03-04 20:29:40 +01:00
Toni de la Fuente
db1380422f Added high level architecture 2021-02-25 11:56:45 +01:00
Toni de la Fuente
669cb6f1a9 Added IAM to extra7100 title 2021-02-25 11:56:22 +01:00
Toni de la Fuente
fa2a40f5c0 Fix output on extra731 2021-02-23 18:27:38 +01:00
Toni de la Fuente
80b94eb667 Fix output on extra731 2021-02-23 18:24:26 +01:00
Toni de la Fuente
b633ec8bef Added more checks mappings to ISO27001 group and reordered the list @mario-platt
Added more checks mappings to ISO27001 group and reordered the list @mario-platt
2021-02-22 23:21:32 +01:00
Toni de la Fuente
a6ee7922c6 Cloudtrail metrics (check3x) pass if found on any, not every, cloudtrail log @zfLQ2qx2
Cloudtrail metrics (check3x) pass if found on any, not every, cloudtrail log @zfLQ2qx2
2021-02-22 23:18:31 +01:00
Toni de la Fuente
2883de016e Ensure check28 only looks at symmetric keys 2021-02-22 23:15:06 +01:00
Toni de la Fuente
f94bf38bdc Merge pull request #752 from toniblyx/revert-742-check28-asymmetric-keys
Revert "check28 only look at symmetric keys"
2021-02-22 23:05:52 +01:00
Toni de la Fuente
5d7d9efa69 Revert "check28 only look at symmetric keys" 2021-02-22 23:05:05 +01:00
Toni de la Fuente
1d0887ac89 Make check28 only look at symmetric keys @mdop-wh
Make check28 only look at symmetric keys @mdop-wh. Asymmetric keys don't support automatic rotation.
2021-02-22 22:36:53 +01:00
Toni de la Fuente
e0dbfaaa37 Merge branch 'master' into check28-asymmetric-keys 2021-02-22 22:35:32 +01:00
Toni de la Fuente
b68cf876bc Merge pull request #751 from toniblyx/revert-736-universal_epoch_time
Revert "Implement OS neutral method of converting rfc3339 dates to epoch"
2021-02-22 21:54:08 +01:00
Toni de la Fuente
97a7471f24 Revert "Implement OS neutral method of converting rfc3339 dates to epoch" 2021-02-22 21:52:19 +01:00
Toni de la Fuente
5d3c526ba7 Implement OS neutral method of converting rfc3339 dates to epoch @zfLQ2qx2
Implement OS neutral method of converting rfc3339 dates to epoch
2021-02-22 21:47:06 +01:00
Toni de la Fuente
3d834fae42 Fix typos and add to extras extra7132 2021-02-22 21:44:48 +01:00
Toni de la Fuente
aa3f8a6b5c Add check for RDS enhanced monitoring @mpratsch
Add check for RDS enhanced monitoring @mpratsch
2021-02-22 21:41:24 +01:00
Toni de la Fuente
bddf71d5e6 Add access checks for several checks @zfLQ2qx2
Add access checks for several checks @zfLQ2qx2 (21,22,23,24,25,26,27,28,29,720,725)
2021-02-22 21:38:39 +01:00
Toni de la Fuente
8a32d8ae5f Force default AWS CLI output issue #696 @Kirizan
Force default AWS CLI output issue #696 @Kirizan
2021-02-22 21:31:32 +01:00
Mario Platt
78c2cacfd9 added more checks mappings to ISO27001 group, and reordered the list of comment mappings to go from lower to highest requirements in ISO 2021-02-19 14:23:26 +00:00
C.J
7e6291c51d Cloudtrail metrics pass if found on any, not every, cloudtrail log 2021-02-09 12:29:43 -05:00
Toni de la Fuente
138ece153e Adjusted severity to secrets and Shodan checks 2021-02-05 08:39:02 +01:00
Toni de la Fuente
5d04febf81 Adjusted severity like in Security Hub 2021-02-05 08:34:34 +01:00
Martina Rath
696a776e2e Move extra7132 to rd group and add CHECK_SERVICENAME to check 2021-02-05 08:32:06 +01:00
Martina Rath
073d2ab727 Add check if Enhanced monitoring is enabled on RDS instances 2021-02-05 08:12:11 +01:00
Michael Dop
7e8de8adb8 check28 only look at symmetric keys
AWS doesn't support the automatic rotation of asymmetric keys
2021-02-04 10:07:27 -05:00
C.J
de87de3b39 Add access checks for several checks 2021-02-03 17:07:02 -05:00
Toni de la Fuente
e91e2cfee6 Updated extra73 with service name
Updated extra73 with service name
2021-02-03 14:55:15 +01:00
Toni de la Fuente
d33c82cd00 Merge branch 'master' into patch-1 2021-02-03 14:54:22 +01:00
Toni de la Fuente
0e3e4a9227 Updated
added CHECK_SERVICENAME_extra73="s3"
2021-02-03 14:51:11 +01:00
Toni de la Fuente
bea84ad6d3 Fix title grammar in check_extra73 @CenturionGamer
Fix title grammar in check_extra73 @CenturionGamer
2021-02-03 14:49:35 +01:00
Toni de la Fuente
79c4a65ba8 Improved to consider services and severity 2021-02-02 17:36:35 +01:00
Toni de la Fuente
e6d175d62e Check for errors generating credential report, limit loop iterations @zfLQ2qx2
Check for errors generating credential report, limit loop iterations @zfLQ2qx2
2021-02-02 15:28:32 +01:00
CenturionGamer
880523880d Update check_extra73
Fixed the grammar by removing "the" in the description.
2021-01-28 13:06:44 -05:00
C.J
cbcc8c61a5 Implement OS neutral method of converting rfc3339 dates to epoch 2021-01-26 14:54:27 -05:00
Toni de la Fuente
f9c2e0cf26 Revert PR #718 2021-01-22 16:17:26 +01:00
Toni de la Fuente
6f371744dc Added AWS service name to json, csv and html outputs 2021-01-22 10:56:59 +01:00
Toni de la Fuente
dfdff6e863 Added service name to all checks 2021-01-22 00:23:53 +01:00
Toni de la Fuente
8ed40791ad Added service name to sample check 2021-01-22 00:21:26 +01:00
Toni de la Fuente
f85845c26b Added service name to all checks 2021-01-22 00:19:45 +01:00
Toni de la Fuente
73cac580f3 Added severity field to CSV and HTML output reports 2021-01-21 22:42:40 +01:00
Toni de la Fuente
6bb49fd162 Merge branch 'master' of https://github.com/toniblyx/prowler 2021-01-21 22:40:50 +01:00
Toni de la Fuente
478cb4aa54 Adjusted severity variable 2021-01-21 22:40:25 +01:00
Toni de la Fuente
47aa6998f4 Update check_extra7130 profile parameter was not set @soffensive
Update check_extra7130 profile parameter was not set @soffensive
2021-01-18 17:07:00 +01:00
soffensive
f7e4a1f6a4 Update check_extra7130
Profile was not set
2021-01-18 16:41:18 +01:00
Toni de la Fuente
b1332f1154 Fix regex in check43 @ilyas28
Fix regex in check43 @ilyas28
2021-01-15 13:05:29 +01:00
İlyas Apaydın
8e35e63359 fix regex in check43 2021-01-14 13:38:33 +03:00
C.J
be3e771454 Check for errors generating credential report, limit loop iterations 2021-01-14 04:41:16 -05:00
Toni de la Fuente
f5b26387f0 Clear AWS_DEFAULT_OUTPUT on start @zfLQ2qx2
Clear AWS_DEFAULT_OUTPUT on start @zfLQ2qx2
2021-01-14 10:19:07 +01:00
C.J
ed0f01b617 Clear AWS_DEFAULT_OUTPUT on start 2021-01-14 04:01:40 -05:00
Toni de la Fuente
d047cd807a Fix check extra73 fail message omits bucket name @zfLQ2qx2
Fix check extra73 fail message omits bucket name @zfLQ2qx2
2021-01-14 09:28:44 +01:00
C.J
6a9a47e549 Fix for issue 713 2021-01-13 19:16:48 -05:00
Toni de la Fuente
6cbee3b16c Fix log metric filter check3x with multiple trails @bridgecrewio
Fix log metric filter check3x with multiple trails @bridgecrewio
2021-01-13 23:08:17 +01:00
Toni de la Fuente
a53aeff0e8 Catch errors assuming role and describing regions @zfLQ2qx2
Catch errors assuming role and describing regions @zfLQ2qx2
2021-01-13 22:50:11 +01:00
Toni de la Fuente
81787d1946 Add check for AccessDenied when calling GetBucketLocation in extra73,extra734,extra764 @zfLQ2qx2
Add check for AccessDenied when calling GetBucketLocation in extra73,extra734,extra764 @zfLQ2qx2
2021-01-13 22:35:20 +01:00
Toni de la Fuente
b23f9b3b5d Fix changes made in check27 2021-01-13 22:21:45 +01:00
Toni de la Fuente
51d6fc99ed Handle shadow CloudTrails more gracefully in checks check21,check22,check24,check27 @zfLQ2qx2
Handle shadow CloudTrails more gracefully in checks check21,check22,check24,check27 @zfLQ2qx2
2021-01-13 21:35:07 +01:00
Toni de la Fuente
0d4988b874 Additional check for location of awscli @zfLQ2qx2
Additional check for location of awscli @zfLQ2qx2
2021-01-13 21:25:04 +01:00
Toni de la Fuente
17c0409d35 Fix date command for busybox @zfLQ2qx2
Fix date command for busybox @zfLQ2qx2
2021-01-13 21:19:07 +01:00
C.J
1d9c1eaece Catch errors assuming role and describing regions 2021-01-13 09:44:15 -05:00
Toni de la Fuente
d77f1ea651 Add new check extra7131 RDS minor version upgrade 2021-01-13 12:58:23 +01:00
Toni de la Fuente
2bc3fcf7ee Add new check extra7131 RDS minor version upgrade 2021-01-13 12:57:08 +01:00
Toni de la Fuente
bcdd12bf84 Add new check extra7131 RDS minor version upgrade 2021-01-13 12:51:49 +01:00
C.J
733c99c1e0 Add check for AccessDenied when calling GetBucetLocation 2021-01-12 15:38:47 -05:00
C.J
ecc08722e1 Handle shadow cloudtrails more gracefully 2021-01-12 13:37:30 -05:00
C.J
f53a32ae26 Additional check for location of awscli 2021-01-12 11:03:30 -05:00
C.J
bf1bd505c5 Fix for busybox date command 2021-01-12 09:11:52 -05:00
Toni de la Fuente
eac59cade8 Add new check extra_7130 to check encryption of a SNS topic @mpratsch
Add new check extra_7130 to check encryption of a SNS topic @mpratsch
2021-01-08 13:54:55 +01:00
Martina Rath
994abe8fa3 Add check7130 to group7_extras and fix some issues 2021-01-08 13:43:46 +01:00
Toni de la Fuente
6ad1816e37 Fix EKS related checks regarding us-west-1 @njgibbon
Fix EKS related checks regarding us-west-1 @njgibbon
2021-01-07 19:29:22 +01:00
Toni de la Fuente
20b8b1eb1f Enhance check extra792 to accept current most restrictive TLSv1.2 @bazbremner
Enhance check extra792 to accept current most restrictive TLSv1.2 @bazbremner
2021-01-07 19:22:20 +01:00
Martina Rath
9a060a3c43 Add new extras check (7130) to check encryption of a SNS topic 2020-12-30 08:46:13 +01:00
Barrie Bremner
75e5de9c37 Accept current most restrictive TLSv1.2-only ALB security policy as secure
The `ELBSecurityPolicy-FS-1-2-Res-2020-10` policy is the most
restrictive TLS v1.2 only SSL/TLS security policy available, and is a
subset of the already accepted `ELBSecurityPolicy-FS-1-2-Res-2019-08`
policy - this commit adds `ELBSecurityPolicy-FS-1-2-Res-2020-10` to
the list of acceptable "secure" security policies.

`ELBSecurityPolicy-FS-1-2-Res-2020-10` has a very limited set of
ciphers, is TLS v1.2 only and supports Forward Secrecy.

Current SSL Labs tests gives it an "A" rating for another source of
confirmation.
2020-12-24 16:52:01 +00:00
njgibbon
4adc7f5864 feat - fix - taking out eks check condition because california region 2020-12-24 00:00:06 +00:00
Toni de la Fuente
0ddb045ca2 Update README.md 2020-12-18 15:27:59 +01:00
Toni de la Fuente
297eeea783 Label version 2.3.0-18122020 2020-12-18 13:09:47 +01:00
Toni de la Fuente
d540cefc23 Fix FreeBSD $OSTYPE check @ring-pete
Fix FreeBSD $OSTYPE check @ring-pete
2020-12-18 10:24:48 +01:00
Toni de la Fuente
953bdf3034 Merge branch 'master' into master 2020-12-18 10:24:25 +01:00
Toni de la Fuente
823c7d4b61 Enhanced check extra740: reworked to consider all snapshots, use JMESPath query @pacohope
Enhanced check extra740: reworked to consider all snapshots, use JMESPath query
2020-12-18 10:17:52 +01:00
Toni de la Fuente
e298158bcd Enhanced error handling without credentials 2020-12-17 17:15:17 +01:00
Toni de la Fuente
810801fb3d Fix error handling for SubscriptionRequiredException in extra77 2020-12-17 16:52:18 +01:00
Toni de la Fuente
91ce905a5a Fix issue assuming role in regions with STS disabled 2020-12-17 16:34:10 +01:00
Toni de la Fuente
6ed6a47f8f Add sleep to extra7102 to avoid Shodan API limits 2020-12-17 15:27:00 +01:00
Toni de la Fuente
347872a6de Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
2020-12-17 15:24:06 +01:00
Toni de la Fuente
8c19583ac7 Update prowler
Adapted execute_check to renew creds
2020-12-17 15:21:50 +01:00
Toni de la Fuente
5c620949f0 Update os_detector
Change above is because epoch time generator in BSD is 1h less than in Linux
2020-12-17 15:20:20 +01:00
Toni de la Fuente
5be38a15d9 Update os_detector bsd_convert_date_to_timestamp 2020-12-17 10:24:25 +01:00
Toni de la Fuente
5e38c61286 Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
2020-12-16 20:04:21 +00:00
Toni de la Fuente
de3e2c3a2b Added support to run inside AWS CloudShell 2020-12-16 13:41:54 +01:00
Toni de la Fuente
687cfd0a34 Merge pull request #709 from toniblyx/revert-694-master
Revert "Refresh assumed role credentials to avoid role chaining limitations"
2020-12-15 17:38:00 +01:00
Toni de la Fuente
aa0440e426 Revert "Refresh assumed role credentials to avoid role chaining limitations" 2020-12-15 17:37:42 +01:00
Toni de la Fuente
31182059e4 Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
Refresh assumed role credentials to avoid role chaining limitations @michael-dickinson-sainsburys
2020-12-15 17:29:11 +01:00
Toni de la Fuente
e047dc8764 Added latest checks to extras group 2020-12-15 15:10:33 +01:00
Toni de la Fuente
7f1df739c4 Added -N <shodan_api_key> support for extra7102 2020-12-15 12:25:47 +01:00
Toni de la Fuente
9ed576b09d Fix issue in extra776 when ECR Scanning imageDigest @adamcanzuk
Fix issue in extra776 when ECR Scanning imageDigest @adamcanzuk
2020-12-14 12:59:19 +01:00
Paco Hope
f3dbecbe89 reworked check740 to consider all snapshots, use JMESPath query, and to limit its output according to max-items 2020-12-10 09:27:43 -05:00
Toni de la Fuente
3d62aedf29 New RC6 including ENS as a new compliance type all formats 2020-12-01 10:03:59 +01:00
Toni de la Fuente
30937c3275 Updated ENS group with new checks 2020-12-01 09:56:08 +01:00
Toni de la Fuente
63040e1c07 New 7 checks required for ENS 2020-12-01 09:55:20 +01:00
Michael Dickinson
30eb447919 docs: Update Organizations command to only incude active accounts 2020-11-23 21:05:27 +00:00
Michael Dickinson
5da54467b5 fix: Refresh assumed role credentials if session is nearing expiration 2020-11-23 21:05:20 +00:00
Michael Dickinson
8ab91e9f8e fix: Store assumed role expiry time for later checking 2020-11-23 21:05:11 +00:00
mikeurbanski1
4fddb7fa63 Fix log metric filter checks (#33)
* debug statements for issue demonstration

* use separate array elements

* add debug and comments

* clean up debug statements
2020-11-23 09:26:44 -06:00
Pete Wright
65bbdfdd83 Fix FreeBSD $OSTYPE check
As per this bug report:
https://github.com/toniblyx/prowler/issues/693

Add detection for freebsd releases which should be similar to darwin
in that it will use GNU coreutils for date and base64.
2020-11-20 13:29:21 -08:00
nikirby
013b106564 Merge branch 'master' of github.com:Kirizan/prowler 2020-11-20 15:22:31 -05:00
nikirby
fa72e7c21f Ensures JSON is the default AWS command output. 2020-11-20 15:16:22 -05:00
Toni de la Fuente
25a04cd59e Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-11-20 15:07:48 +01:00
Toni de la Fuente
72303ea126 Fixed syntax typo 2020-11-20 15:04:47 +01:00
Toni de la Fuente
600a7c9f2f Adapt check119 to exclude instances shutting down @stku1985
Adapt check119 to exclude instances shutting down @stku1985
2020-11-18 15:30:57 +01:00
Toni de la Fuente
53e95ac9f3 Improved CodeBuild CFN template with scheduler and documentation 2020-11-18 15:12:44 +01:00
Toni de la Fuente
1f6931a591 Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-11-18 14:48:47 +01:00
Toni de la Fuente
fdc8c1ce36 Added session durantion option to 12h 2020-11-18 14:48:34 +01:00
Toni de la Fuente
a8fed14cea Fixed extra7116 extra7117 outputs and added to extras @ramondiez
Fixed extra7116 extra7117 outputs and added to extras @ramondiez
2020-11-18 13:41:12 +01:00
Toni de la Fuente
f3d4cc8514 Fixed extra7116 extra7117 outputs and added to extras 2020-11-18 13:31:20 +01:00
Stefan Kunkel
7397126794 adapt check119 to exclude instances shutting down
brain fart: used logical 'or' instead of correct '&&'
2020-11-18 13:25:28 +01:00
Toni de la Fuente
11bf35d993 Enhancement check119 to exclude instances shutting-down @stku1985
Enhancement check119 to exclude instances shutting-down in addition to terminated ones
2020-11-18 13:21:52 +01:00
Stefan Kunkel
147fac0777 adapt check119 to exclude instances shutting down 2020-11-18 13:20:55 +01:00
Ramon Diez
49423dee4a fixing check_extra7116 and check_extra7117 2020-11-18 12:42:01 +01:00
Toni de la Fuente
345a8d48c4 Added group for ENS - Spanish Esquema Nacional de Seguridad 2020-11-18 11:45:07 +01:00
Toni de la Fuente
1576f2ba39 Added start build automatically 2020-11-16 20:15:41 +01:00
Toni de la Fuente
0bd1fefd7d Glue checks additional @dlpzx
Glue checks additional  @dlpzx
2020-11-16 18:32:09 +01:00
Toni de la Fuente
c2a2e393cb Merge branch 'master' into dlpzx-master 2020-11-16 18:31:18 +01:00
Toni de la Fuente
7cd1413c93 Glue grup 2 corrections 2020-11-16 18:29:16 +01:00
Toni de la Fuente
9c39f69210 Glue checks part 1 @ramondiez
Glue checks part 1 @ramondiez
2020-11-16 17:55:50 +01:00
Toni de la Fuente
6e604e1834 Some corrections for glue related checks 2020-11-16 17:51:53 +01:00
Toni de la Fuente
b702990ea6 Fix: Security Hub eventual consistency + PREFIX query bug + Archive PASSED @xeroxnir
Fix: Security Hub eventual consistency + PREFIX query bug + Archive PASSED
2020-11-13 19:16:58 +01:00
Toni de la Fuente
594215661d Fix for check_extra764 @grzegorznittner
Fix for check_extra764 fix #680
2020-11-13 19:10:41 +01:00
Toni de la Fuente
b32538b7e5 Glue review 2 2020-11-13 19:05:19 +01:00
Toni de la Fuente
8c9d843813 Glue review 1 2020-11-13 19:02:26 +01:00
Toni de la Fuente
c934e788b7 Center logo in html report 2020-11-13 18:22:09 +01:00
Grzegorz Nittner
c9ca8d48b1 #680 - fix for check_extra764 2020-11-13 14:56:22 +00:00
Joaquin Rinaudo
f6d17ba6e0 fix(securityhub): consistency + prefix bug + PASSED
fix(securityhub): consistency + prefix bug + PASSED
2020-11-12 21:48:21 +01:00
Ramon Diez
0bfa263ad9 Fixing some descriptions 2020-11-12 12:30:22 +01:00
dlpzx
943b096f35 checks for glue - 7119, 7121, 7123 2020-11-12 12:06:43 +01:00
dlpzx
888133e986 checks for glue - 7119, 7121, 7123,7124,7125 2020-11-10 13:06:03 +01:00
dlpzx
39a7c3b18e checks for glue - 7119, 7121, 7123,7124,7125 2020-11-10 13:05:22 +01:00
dlpzx
ebe2594456 checks for glue - 7119, 7121, 7123,7124,7125 2020-11-09 19:17:00 +01:00
dlpzx
e0a8e0f318 checks for glue - 7119, 7121, 7123,7124,7125 2020-11-09 18:48:11 +01:00
Toni de la Fuente
7dbed63143 Added CodeBuild deployment section 2020-11-05 21:49:05 +01:00
Toni de la Fuente
2304d14f28 Added CodeBuild template - original from @stevecjones 2020-11-05 00:35:05 +01:00
Ramon Diez
954848c6e8 Glue checks part 1 2020-11-04 10:44:43 +01:00
Toni de la Fuente
97055e84b4 Fix quotes in check extra78 for public RDS instances @goldfiglabs
Fix quotes in check extra78 for public RDS instances @goldfiglabs
2020-11-03 23:31:44 +01:00
Toni de la Fuente
6188021e63 Adding fix to generate test summary so reports display graphs correctly @stevecjones
Adding fix to generate test summary so reports display graphs correctly @stevecjones
2020-11-03 21:14:05 +01:00
dlpzx
65c63d5bdd checks for glue - 7119,7121,7123,7124. 7125 not done yet 2020-11-03 19:18:40 +01:00
Toni de la Fuente
180f12d625 Fix extra7111 parser error 2020-11-03 13:48:39 +01:00
Toni de la Fuente
62fcbf2f05 Fix extra7103 parser error 2020-11-03 13:44:24 +01:00
Toni de la Fuente
3844c2151b Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-11-03 13:34:05 +01:00
Toni de la Fuente
5d4648c812 Fix extra7108 parser error 2020-11-03 13:33:51 +01:00
Stephen Jones
e7f837eb7b Correct typo and simplify count 2020-11-03 22:45:27 +11:00
Toni de la Fuente
f0949f6ec6 Enable Security Hub official integration and version 2.3.0RC5 @toniblyx
Enable Security Hub official integration and version 2.3.0RC5 @toniblyx
2020-10-30 19:36:45 +01:00
Stephen Jones
87f91cf467 Removing gnarly code and add refined counters for summary metrics in output 2020-10-30 22:51:11 +11:00
Toni de la Fuente
ae1d7be7f2 Enable Security Hub official integration 2020-10-29 22:40:38 +01:00
Greg Soltis
7585ad7d57 Fix check for public rds instances 2020-10-26 11:39:37 -07:00
Stephen Jones
2756f16c87 Adding fix to generate test summary so reports display graphs correctly 2020-10-22 02:15:15 +11:00
Toni de la Fuente
d6760f15b7 fix extra7110 title 2020-10-20 13:30:26 +02:00
Toni de la Fuente
b8e1ef6b33 Fix check_extra7107 condition 2020-10-20 13:20:15 +02:00
Toni de la Fuente
79808fbe30 Fix syntax in extra7110 2020-10-20 09:29:30 +02:00
Toni de la Fuente
c34535f585 Fix report metadata in html output 2020-10-15 22:01:28 +02:00
Toni de la Fuente
fa925bdef2 Fix account id in output file name 2020-10-15 21:56:44 +02:00
Toni de la Fuente
a05aba84e1 Added GovCloud usage information 2020-10-14 22:29:51 +02:00
Toni de la Fuente
19b894c14b Added extra7113: Check RDS instances deletion protection @gchib297
Added extra7113: Check RDS instances deletion protection @gchib297
2020-10-08 22:46:31 +02:00
gchib
23df3dd8d0 Add extra7113: Check RDS deletion protection 2020-10-08 17:21:26 +05:30
gchib
5994700c09 Add check extra7113 2020-10-08 17:19:58 +05:30
gchib
ba7c3a3124 Add extra7113: Check RDS deletion protection 2020-10-08 17:18:56 +05:30
Toni de la Fuente
b512585d80 Added all new Sagemaker checks to extras 2020-10-06 16:43:21 +02:00
Toni de la Fuente
645ea25ddc New group for Sagemaker with 10 new controls 2020-10-06 16:40:19 +02:00
Toni de la Fuente
923267c3e5 extra7102 increased severity to medium 2020-10-06 16:39:39 +02:00
Toni de la Fuente
2fb9588883 Add extra7102 to groups extras and internetexposed 2020-10-02 19:14:37 +02:00
Toni de la Fuente
ffcb6a0b69 Added extra7102 ElasticIP Shodan integration 2020-10-02 19:10:00 +02:00
Toni de la Fuente
ad45035ad3 Updated README.md 2020-09-30 23:43:48 +02:00
Toni de la Fuente
62a87d961c Add SOC2 compliance group @gchib297
Add SOC2 compliance group @gchib297
2020-09-30 22:59:51 +02:00
Toni de la Fuente
6aa8dd643d Add check extra798 to gdpr and pci groups @gchib297
Add check extra798 to gdpr and pci groups @gchib297
2020-09-30 22:58:28 +02:00
Toni de la Fuente
f674868dd9 Add check extra798 to iso27001 @gchib297
Add check extra798 to iso27001 @gchib297
2020-09-30 22:57:35 +02:00
Toni de la Fuente
859951a63c Add FFIEC cybersecurity assessment group @gchib297
Add FFIEC cybersecurity assessment group @gchib297
2020-09-30 22:56:37 +02:00
gchib
a3a71f499c Add SOC2 compliance group 2020-09-30 17:44:19 +05:30
gchib
cf62f2bb05 Add check extra798 to PCI 2020-09-30 17:36:20 +05:30
gchib
dd05575508 Add check extra798 to GDPR 2020-09-30 17:33:41 +05:30
gchib
ff19182cf1 Add check extra798 to iso27001 2020-09-30 17:19:06 +05:30
gchib
58c4af98d1 Add FFIEC group
Add FFIEC Cybersecurity assessment checks
2020-09-30 17:10:56 +05:30
Toni de la Fuente
8e1fac1b7c Added checks about EKS to groups internet-exposed and forensics 2020-09-28 09:41:40 +02:00
Toni de la Fuente
d620754bae Added extra796 EKS control plane access to internet-exposed group 2020-09-28 09:36:04 +02:00
Toni de la Fuente
cf926e6f5a Added coreutils to Dockerfile 2020-09-24 14:58:10 +02:00
Toni de la Fuente
60c741a202 Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-09-24 14:55:20 +02:00
Toni de la Fuente
c14799915c Fix issue #659 2020-09-24 14:55:10 +02:00
Toni de la Fuente
9165d3a8ba Fix SecurityHub: other os/check fixes + batch in 100 findings @xeroxnir
fix(securityhub): other os/check fixes + batch in 100 findings
2020-09-24 10:29:04 +02:00
Joaquin Rinaudo
321401f755 fix(securityhub): other os/check fixes + batch in 100 findings 2020-09-24 09:34:09 +02:00
Toni de la Fuente
5182403041 Improved documentation about SecurityHub integration and region filter 2020-09-23 15:30:08 +02:00
Toni de la Fuente
4d9473881f Fixed title id for eks-cis 2020-09-18 18:47:14 +02:00
Toni de la Fuente
88e67cc42d Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-09-18 18:44:11 +02:00
Toni de la Fuente
0f84181d89 Added new check [extra7101] Check if Amazon Elasticsearch Service (ES) domains have audit logging enabled 2020-09-18 18:44:01 +02:00
Toni de la Fuente
4c0dd42214 Fix security-hub integration: Race condition timestamp xeroxnir
Fix(security-hub): Race condition timestamp
2020-09-18 18:19:50 +02:00
Joaquin Rinaudo
660bbf5676 fix(security-hub): race condition timestamp 2020-09-18 18:14:05 +02:00
Toni de la Fuente
a9b946b4e6 Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-09-18 15:29:12 +02:00
Toni de la Fuente
903840970b Merge pull request #657 from xeroxnir/master
Security Hub: Bugfix missing ","
2020-09-18 15:28:18 +02:00
Joaquin Rinaudo
65638af6a1 bugfix(securityhub): missing , 2020-09-18 15:25:51 +02:00
Toni de la Fuente
a6bd8a59bf Security Hub: Mark as ARCHIVED + fix race condition @xeroxnir
Security Hub: Mark as ARCHIVED + fix race condition @xeroxnir
2020-09-18 15:19:12 +02:00
Joaquin Rinaudo
09212add77 fix(debug): resolveSecurityHubPreviousFails 2020-09-18 15:09:38 +02:00
Joaquin Rinaudo
b7c1823ec9 fix(securityhub): add RecordState outputs 2020-09-18 14:59:28 +02:00
Joaquin Rinaudo
c1b09b6b9d bugfix(securityhub): race condition fix 2020-09-18 14:52:32 +02:00
Joaquin Rinaudo
0f3e6ee90b feature(security-hub): archive finding instead of mark as PASSED 2020-09-18 14:07:00 +02:00
Toni de la Fuente
70aed72aff Added parameters and made the template parameterised @pacohope
Added parameters and made the template parameterised @pacohope
2020-09-18 11:57:35 +02:00
Paco Hope
d012342422 added parameters and made the template parameterised. 2020-09-17 12:06:33 -04:00
Toni de la Fuente
7bfeebe2a2 Title adjustments for internetexposed iso27001 and eks-cis groups 2020-09-17 16:51:48 +02:00
Toni de la Fuente
448f506882 Merge pull request #654 from marcjay/patch-1
Add GetFindings action to example IAM policy for Security Hub
2020-09-17 09:39:45 +02:00
Marc Jay
7e2110dc4e Add GetFindings action to example IAM policy for Security Hub
Following the merge of #651, prowler now calls the GetFindings API when using Security Hub integration - this action needs to be added to the required policy
2020-09-17 01:37:45 +01:00
Toni de la Fuente
0dc4c316a2 Merge branch 'master' of https://github.com/toniblyx/prowler into master 2020-09-16 23:32:28 +02:00
Toni de la Fuente
392da158e7 Labeled 2.3.0RC4, time for a final GA version... 2020-09-16 23:32:13 +02:00
Toni de la Fuente
ac0d90cee7 Whitelist feature improvements @QuinnStevens
Whitelist feature improvements @QuinnStevens
2020-09-16 23:28:40 +02:00
Toni de la Fuente
d66a8d0ac6 Fix execute_group_by_id @xeroxnir
Fix execute_group_by_id @xeroxnir
2020-09-16 23:26:33 +02:00
Toni de la Fuente
7eff48715c Security Hub integration improvement and adding severity for checks @xeroxnir
Security Hub integration improvement and adding severity for checks @xeroxnir
2020-09-16 23:19:06 +02:00
Toni de la Fuente
66a9525d23 Support custom folder checks when running all checks @xeroxnir
Support custom folder checks when running all checks @xeroxnir
2020-09-16 23:13:24 +02:00
Toni de la Fuente
7e9a5dc8f5 Allow list checks and groups without credentials 2020-09-16 23:11:33 +02:00
Joaquin Rinaudo
24c80c8548 Fix: If is never called (also under execute_check) 2020-09-07 16:33:45 +02:00
Joaquin Rinaudo
e1fb89838a Fix execute_group_by_id
* All other group checks for IAM have no credential report.
* ${GROUP_ID[$1]} is invalid as first parameter is group_id
2020-09-07 16:09:10 +02:00
Joaquin Rinaudo
69609b08c2 Fix: Json output 2020-09-07 14:26:02 +02:00
Quinn Stevens
801be49523 Return default behaviour to previous, remove distinction between strict & non-strict matching 2020-09-04 13:20:21 +01:00
Quinn Stevens
28b3604b1c Improve whitelisting to allow regexes and fuzzy/strict matching 2020-09-04 13:19:00 +01:00
Joaquin Rinaudo
7b634de36b Update securityhub_integration 2020-09-03 16:57:59 +02:00
Joaquin Rinaudo
981497e0e2 Update securityhub_integration 2020-09-03 16:55:07 +02:00
Joaquin Rinaudo
ebf5d5f449 Update securityhub_integration 2020-09-03 16:53:26 +02:00
Joaquin Rinaudo
054e296501 Update outputs 2020-09-03 15:32:46 +02:00
Joaquin Rinaudo
f642926f50 fix(severity): missing check 2020-09-03 08:23:17 +02:00
Joaquin Rinaudo
e93bb654f8 cleanup outputs 2020-09-03 08:09:52 +02:00
Joaquin Rinaudo
dce3cb0ead cleanup: working 2020-09-03 08:08:11 +02:00
Joaquin Rinaudo
0f3994a135 fix(error-handling): security-hub 2020-09-03 08:05:49 +02:00
Joaquin Rinaudo
ecbe997084 severity+security_hub 2020-09-03 08:04:13 +02:00
Joaquin Rinaudo
20decaafd5 fix(security_hub): remove echo 2020-09-02 12:05:39 +02:00
Joaquin Rinaudo
c53804a3eb fixes(security_hub): missing region and rename variables 2020-09-02 12:04:24 +02:00
Joaquin Rinaudo
bed61c9ee7 remove comment 2020-09-01 17:08:47 +02:00
Joaquin Rinaudo
ea914e47d7 remove debug statements 2020-09-01 17:07:53 +02:00
Joaquin Rinaudo
ae4940a7d8 revert-custom-branch 2020-09-01 17:05:37 +02:00
Joaquin Rinaudo
ebc3c4d4e4 WIP remove comments 2020-09-01 17:04:30 +02:00
Joaquin Rinaudo
2a4cebaa1e WIP: security hub integration 2020-09-01 17:03:25 +02:00
Joaquin Rinaudo
6c0e1a13e3 feature: Only when custom checks are set 2020-09-01 16:36:07 +02:00
Joaquin Rinaudo
0eab753620 feature: Execute custom checks in execute_all 2020-09-01 16:34:19 +02:00
Joaquin Rinaudo
118ff0819e Merge branch 'master' of github.com:xeroxnir/prowler 2020-09-01 16:32:34 +02:00
Joaquin Rinaudo
9baa6d6ae9 revert: master 2020-09-01 16:26:16 +02:00
Joaquin Rinaudo
43f3365bb4 revert: master 2020-09-01 16:22:32 +02:00
Joaquin Rinaudo
580523fde4 fix(all_checks): also run custom folder 2020-09-01 16:17:19 +02:00
Toni de la Fuente
2186f648c8 Ensure that checks are sorted numerically when listing checks @marcjay
Ensure that checks are sorted numerically when listing checks @marcjay
2020-09-01 09:13:04 +02:00
Marc Jay
e3ecee83af Ensure that checks are sorted numerically when listing checks
Sort first by section, then by check within each section
Fix group IDs in documentation

Relates to #545 and #561
2020-09-01 00:21:48 +01:00
Joaquin Rinaudo
17e74a355f Merge branch 'master' of https://github.com/toniblyx/prowler 2020-08-28 07:13:16 +02:00
Joaquin Rinaudo
9283fb59b4 Merge branch 'master' of github.com:xeroxnir/prowler 2020-08-27 17:09:16 +02:00
Joaquin Rinaudo
c65fc3b989 fix(security-hub): unique finding id, if status not changed, comment otherwise resolve older findings 2020-08-27 17:08:37 +02:00
Toni de la Fuente
7f03ef0e7e Adding back extra798 2020-08-27 16:50:48 +02:00
Toni de la Fuente
1496e3ab60 New check 7.98 [extra798] Ensure that no custom policies exist which allow permissive role assumption (e.g. sts:AssumeRole on *) @nickmalcolm
New check 7.98 [extra798] Ensure that no custom policies exist which allow permissive role assumption (e.g. sts:AssumeRole on *) @nickmalcolm
2020-08-27 16:31:18 +02:00
Toni de la Fuente
36a291c4a9 Rename check_extra798 to check_extra7100 2020-08-27 16:30:20 +02:00
Toni de la Fuente
0b9d3e39d4 Merge branch 'master' into master 2020-08-27 16:28:35 +02:00
Toni de la Fuente
1d4563f60d Added extra799 and extra7100 to group extras
Added extra799 and extra7100 to group extras
2020-08-27 16:23:08 +02:00
Toni de la Fuente
565edf7b4b Change check ID to extra7100
Change check ID to extra7100
2020-08-27 16:21:56 +02:00
Toni de la Fuente
5552ea1eb6 Fix getops OPTARG for custom checks @xeroxnir
Fix getops OPTARG for custom checks @xeroxnir
2020-08-27 16:12:59 +02:00
Joaquin Rinaudo
7868904c3b Fix getops OPTARG for custom checks
Custom checks in folder are not being sourced. `./prowler -c extra800 -x custom` results in empty EXTERNAL_CHECKS_PATH variables due to missing colon.

The fix was tested in both OSX and toniblyx/prowler:latest Docker.

Regards,
2020-08-26 23:59:02 +02:00
Toni de la Fuente
9647d80fc1 Fix check12 when MFA is enabled and user contains true in the name @xeroxnir
Fix check12 when MFA is enabled and user contains true in the name @xeroxnir
2020-08-26 18:41:51 +02:00
Toni de la Fuente
89db9d4b70 Update check12 2020-08-26 18:40:11 +02:00
Toni de la Fuente
553faf72ec Added [extra736] Check exposed KMS keys to group internet-exposed 2020-08-26 16:57:20 +02:00
Toni de la Fuente
33a53663db Added [extra799] Check if Security Hub is enabled and its standard subscriptions 2020-08-25 19:54:57 +02:00
Toni de la Fuente
ca471700c2 Added [extra798] Check if Lambda functions have resource-based policy set as Public 2020-08-25 19:06:06 +02:00
Toni de la Fuente
03b1d898a6 Added AWS partition variable to the ASFF output format 2020-08-25 16:54:22 +02:00
Toni de la Fuente
97e6a80bdc Added AWS partition variable to the ASFF output format 2020-08-25 16:49:20 +02:00
Joaquin Rinaudo
024190dd8a [Check12] Bugfix: Remove $ from grep
Check is failing to detect users without MFA, solved by removing `$` sign addresses the issue.
2020-08-21 10:35:50 +02:00
Nick Malcolm
ba87f437d5 This check will identify IAM Policies which allow an IAM Principal (a Role or User) to escalate their privileges due to insecure STS permissions. It is AWS best practice to only use explicitly defined Resources (Role ARNs) for an sts:AssumeRole action.
See more: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_permissions-to-switch.html#roles-usingrole-createpolicy
2020-08-20 21:08:00 +12:00
Toni de la Fuente
cd0b5d29dd Added html to -M in usage 2020-08-18 11:59:53 +02:00
Toni de la Fuente
c1992ef2a7 Added html to -M in usage 2020-08-18 11:52:49 +02:00
Toni de la Fuente
7aa0864bd2 Adding EKS checks to eks-cis and extras group @jonjozwiak
Adding EKS checks to eks-cis and extras group @jonjozwiak
2020-08-05 19:03:55 +02:00
Jon Jozwiak
022df45ae1 Adding EKS checks to eks-cis and extras group 2020-08-03 08:02:21 -05:00
Toni de la Fuente
f5ec2bceda Adding 4 new EKS checks @jonjozwiak
Adding 4 new EKS checks @jonjozwiak
2020-07-31 21:40:38 +02:00
Toni de la Fuente
85efe3e342 Fixed extra737 now doesn't fail for keys scheduled for deletion @QuinnStevens
Fixed extra737 now doesn't fail for keys scheduled for deletion @QuinnStevens
2020-07-31 21:33:06 +02:00
Quinn Stevens
93c89530ff Explicitly set output --json for aws call 2020-07-31 20:30:20 +01:00
Toni de la Fuente
4a02d54ec1 Add additional GDPR checks to GDPR group @gchib297
Add additional GDPR checks to GDPR group @gchib297
2020-07-31 21:15:30 +02:00
jonjozwiak
a2c92c2e7b Adding 4 EKS checks 2020-07-31 10:42:16 -05:00
gchib
04fae53da5 Add additional GDPR checks
Added checks:
check11,check110,check111,check112,check116,check120,check122,check13,check14,check15,check16,check17,check18,check19,check28,check29,check31,check310,check311,check312,check313,check314,check32,check33,check34,check36,check37,check38,check41,check42,extra711,extra72,extra723,extra730,extra739,extra76,extra763,extra778,extra78,extra792
2020-07-24 22:26:09 +05:30
Toni de la Fuente
43d95ac18c Set version label PROWLER_VERSION=2.3.0RC3 2020-07-24 15:22:28 +02:00
Toni de la Fuente
19c68980fe fix typo on title group18 2020-07-24 15:18:46 +02:00
Toni de la Fuente
19bd281c78 Added group18 for ISO27001 thanks to @gchib297 issue #637 2020-07-24 15:16:35 +02:00
Toni de la Fuente
9eb6a6d1fe Add additional checks to HIPAA group @gchib297
Add additional checks to HIPAA group @gchib297
2020-07-24 14:58:29 +02:00
Quinn Stevens
e58d8cbc8d Don't fail check extra737 for keys scheduled for deletion 2020-07-24 12:44:57 +01:00
gchib
a8026ba3c3 Add additional HIPAA checks
Added checks:
check112,check13,check15,check16,check17,check18,check19,check21,check24,check28,check31,check310,check311,check312,check313,check314,check32,check33,check34,check35,check36,check37,check39,extra792.
2020-07-23 19:10:17 +05:30
Toni de la Fuente
9b1c152607 New check extra793 for SSL listeners on load balancers @jonjozwiak
New check extra793 for SSL listeners on load balancers
2020-07-21 16:57:20 +02:00
jonjozwiak
6ba9be46fb Adding check for SSL load balancers 2020-07-17 09:59:53 -05:00
Toni de la Fuente
b3a2f850cf extra792 - skip check if no HTTPS/SSL Listener plus add NLB Support @jonjozwiak
extra792 - skip check if no HTTPS/SSL Listener plus add NLB Support
2020-07-17 11:48:28 +02:00
jonjozwiak
1c970b0387 extra792 skip check if no HTTPS/SSL Listener and add NLB support 2020-07-16 16:08:33 -05:00
Toni de la Fuente
206b675179 Added group for pci-dss as reference 2020-07-13 17:33:07 +02:00
Toni de la Fuente
c3c5971ff2 Fix listing configurations if default output format is not JSON check119,extra742,extra75 and extra772 @anthirian
Fix listing configurations if default output format is not JSON
2020-07-08 15:48:05 +02:00
Toni de la Fuente
1fefc11d8e CFN template helper for role 2020-06-29 15:06:54 +02:00
Toni de la Fuente
9732e5be70 Reduce needed actions in additions policy @ 2020-06-29 13:59:19 +02:00
Geert Smelt
d3553b642e Fix listing Elastic IPs if default output format is not JSON 2020-06-26 12:50:09 +02:00
Geert Smelt
63d06212db Fix listing CloudFormation stacks if default output format is not JSON 2020-06-26 11:55:12 +02:00
Geert Smelt
a0c58e1cb2 Fix listing EC2 Security Groups if default output format is not JSON 2020-06-26 11:25:16 +02:00
Geert Smelt
0878511abf Fix listing EC2 instances if default output format is not JSON 2020-06-26 11:16:59 +02:00
Toni de la Fuente
01be8520b9 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-06-25 15:16:14 +02:00
Toni de la Fuente
9e9535def8 Delete _config.yml 2020-06-25 15:15:59 +02:00
Toni de la Fuente
64a617d26d delete _config.yml 2020-06-25 15:15:14 +02:00
Toni de la Fuente
4a593df142 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-06-25 15:13:47 +02:00
Toni de la Fuente
8686547ebb Allow list All findings in single view in html report 2020-06-25 15:03:45 +02:00
Toni de la Fuente
6acde2c843 Set theme jekyll-theme-hacker 2020-06-23 20:18:33 +02:00
Toni de la Fuente
facc2a7b30 Added script to generate html report from multiple csv outputs 2020-06-23 20:08:12 +02:00
Toni de la Fuente
dac24b3aa8 Fix issue #624 ID of check_extra792 2020-06-23 19:34:41 +02:00
Toni de la Fuente
84060db013 Added group internet-exposed 2020-06-16 18:01:14 +02:00
Toni de la Fuente
2d927f333a Fixed profile and region settings for extra792 - ELB SSL ciphers @jonjozwiak
Fixing profile and region settings for extra792 - ELB SSL ciphers
2020-06-11 09:05:50 +02:00
jonjozwiak
4db109bb26 Fixing profile and region settings for check_extra792 - ELB SSL ciphers 2020-06-10 15:46:34 -05:00
Toni de la Fuente
f1690e8ddc Added old multiaccount sample info to util/other-contrib folder 2020-06-08 13:27:19 +02:00
Toni de la Fuente
acab5d11ed Update README.md with link to new org-multi-account 2020-06-08 13:23:15 +02:00
Toni de la Fuente
f42358f361 AWS Organizational Prowler Deployment @tekdj7
AWS Organizational Prowler Deployment
2020-06-08 13:16:42 +02:00
Julio Delgado Jr
9e2580cc34 removed ansi2html, added -M html 2020-06-05 12:06:33 -04:00
Toni de la Fuente
7a46d23820 Import Security Hub finding into the same region as the related resource @marcjay
Import Security Hub finding into the same region as the related resource
2020-06-05 15:07:11 +02:00
Marc Jay
4dac3aab55 Import Security Hub finding into the same region as the related resource
Force the batch-import-findings AWS CLI call to be directed at the region the currently reporting resource is located in, as Security Hub enforces this requirement

When checking that Security Hub is enabled, check for all regions that are in scope, e.g. all regions, unless '-f <region>' is used

Fixes #618
2020-06-05 12:55:53 +01:00
Toni de la Fuente
26665a4645 Fix extra734 - handle us-east-1 @nimrodkor
Fix extra734 - handle us-east-1
2020-06-05 11:09:44 +02:00
Toni de la Fuente
94378726bc Fix extra764 - handle us-east-1 & check validity of policy @nimrodkor
Fix extra764 - handle us-east-1 & check validity of policy
2020-06-05 10:48:28 +02:00
Nimrod Kor
4dae0718c1 Fix extra764 - handle us-east-1 & check validity of policy
(cherry picked from commit 89bd8a90d5)
2020-06-04 23:18:08 +03:00
Nimrod Kor
ef4d2d33be Fix extra734 - handle us-east-1
(cherry picked from commit 5f2eb7f82e)
2020-06-04 23:15:21 +03:00
Toni de la Fuente
99d1de8c15 Improved whitelisting by splitting ignores by newline instead of spaces only @urjitbhatia
Split ignores by newline instead of spaces only
2020-05-29 11:40:44 +02:00
Julio Delgado Jr
a58ee251b5 adhoc & switch user in session manager 2020-05-28 13:43:55 -04:00
Urjit Singh Bhatia
2fca2a49fd Split ignores by newline instead of spaces only 2020-05-27 13:58:55 -07:00
Toni de la Fuente
e69b079220 Fix typo on PR #601 2020-05-27 10:02:32 +02:00
Toni de la Fuente
75cd911b0f Removed ansi2html from Pipfile, Dockerfile and README 2020-05-27 09:55:17 +02:00
Toni de la Fuente
2dda3f1ec1 Removed ansi2html from Pipfile 2020-05-27 09:52:34 +02:00
Toni de la Fuente
46a8a3ca82 Adding support for IRSA @GabrielCastro
Adding support for IRSA
2020-05-27 09:44:52 +02:00
Toni de la Fuente
69e2e19e7d Added extra791 and extra792 to group extras 2020-05-27 09:37:10 +02:00
Toni de la Fuente
b7c8f7a7ef New checks for insecure SSL in CloudFront and ELB @jonjozwiak
Adding insecure SSL checks for CloudFront and ELB, extra791 and extra792
2020-05-27 09:32:13 +02:00
Adam
ad1d4874c4 add fixes for none digest and multi-value digest return 2020-05-26 17:16:14 -04:00
Jon Jozwiak
06e81a7f33 Update check_extra792 ASFF resource tye 2020-05-26 09:35:48 -05:00
Jon Jozwiak
70337ecd84 Add ASFF resource type 2020-05-26 09:34:37 -05:00
jonjozwiak
df15388577 Adding insecure SSL checks for CloudFront and CLB/ALB
(cherry picked from commit c9a60c07a2)
2020-05-26 16:33:18 +03:00
Toni de la Fuente
485b7d90bc Added native html report - upgrade to 21st century ;) 2020-05-25 21:29:29 +02:00
Toni de la Fuente
78b26a022a Added native html report - upgrade to 21st century ;) 2020-05-25 21:24:33 +02:00
Gabriel Castro
3e19ed44e5 Feature: add support for IRSA
IAM roles for service accounts (IRSA) allows prowler to be used from
inside a kubernetes cluster.
2020-05-25 13:14:15 -04:00
Toni de la Fuente
3e6f29c3fd Support Ctrl-C/SIG INT stopping Prowler when running in Docker @marcjay
Support Ctrl-C/SIG INT stopping Prowler when running in Docker
2020-05-21 18:08:00 +02:00
Toni de la Fuente
e5ce06e761 Write output files to a directory relative to Prowler @marcjay
Write output files to a directory relative to Prowler
2020-05-21 18:06:46 +02:00
Toni de la Fuente
e3d5b89531 Delete prowler-logo.png 2020-05-21 14:40:06 +02:00
Toni de la Fuente
7987ee3011 Added Prowler logo to util/html/ 2020-05-21 14:38:33 +02:00
Toni de la Fuente
2b336d08de Added ENV to output when credentials are env variables 2020-05-19 15:06:57 +02:00
Toni de la Fuente
c7ed6a6693 Improved region handing for extra734 and extra764 2020-05-19 15:03:42 +02:00
Toni de la Fuente
48b6c290b1 Enhance handing region on assume role when default is not us-east-1 2020-05-11 16:32:43 +02:00
Toni de la Fuente
e0c2ca2436 Fixed issue #596 for extra71 2020-05-11 13:21:06 +02:00
Toni de la Fuente
38fb596e94 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-05-11 13:16:53 +02:00
Toni de la Fuente
c79d346961 Fixed issue #596 on check114 2020-05-11 13:16:38 +02:00
Marc Jay
0f9783791b Support Ctrl-C/SIG INT stopping Prowler when running in Docker
Trap Ctrl-C/SIG INT, call cleanup function and then exit, using the appropriate exit code

Fixes #594
2020-05-08 12:34:03 +01:00
Marc Jay
802d1151c2 Write output files to a directory relative to Prowler
Write output files (CSV, JSON, etc.) to an `output` directory that is relative to prowler itself, no matter where prowler is invoked from.
Simplify Dockerfile by specifying a WORKDIR
Replace ADD command with the more recommended COPY command
Update README to cover how to run in Docker and access saved reports
Add a .dockerignore file to ignore .git and output directories

This partially addresses #570 - previously, within Docker, Prowler was attempting to write
reports to the root `/` directory in the container, which it did not have permission to do.
Instead, reports are now written to a path relative to Prowler
2020-05-08 11:46:53 +01:00
Toni de la Fuente
2a9f6c67a8 Change value of FAIL to FAILED for jsonAsff output type @wildtangent
Change value of FAIL to FAILED for jsonAsff output type
2020-05-07 17:55:01 +02:00
Stephen Connor
2a54a180da Change value of FAIL to FAILED for jsonAsff output type (incompatible with AWS Security Hub) 2020-05-07 14:47:09 +01:00
Toni de la Fuente
7ab9962e08 Show failures that are ignored due to whitelisting as skipped checks in JUnit output @marcjay
Show failures that are ignored due to whitelisting as skipped checks in JUnit output
2020-05-07 09:22:48 +02:00
Marc Jay
6279dc1517 Show failures that are ignored due to whitelisting as skipped checks in JUnit output
Continue to show (unwhitelisted) failed checks as failures in JUnit output, but rather than exclude failing whitelisted checks from JUnit, mark them as skipped

Fixes #590
2020-05-07 01:00:42 +01:00
Toni de la Fuente
376cc0ff08 Usage update 2020-05-07 00:48:14 +02:00
Toni de la Fuente
a37160bf41 Usage update 2020-05-07 00:46:43 +02:00
Toni de la Fuente
b72501f691 Usage update 2020-05-07 00:45:45 +02:00
Toni de la Fuente
733aa439ec Usage update 2020-05-07 00:44:27 +02:00
Toni de la Fuente
24fcfb1066 v2.3.0RC 2020-05-06 23:27:30 +02:00
Toni de la Fuente
977fe7408e Added whitelist option to README and recuce output for -w 2020-05-06 23:24:42 +02:00
Toni de la Fuente
f618a16075 Fixed AWS partition variable on generateJsonAsffOutput 2020-05-06 22:57:26 +02:00
Toni de la Fuente
68ad3a7461 Support whitelists per check @urjitbhatia
Support whitelists per check using option -w whitelistfile.txt
2020-05-06 22:46:57 +02:00
Toni de la Fuente
412c9c1e5a added back LIST_OF_CHECKS_AND_GROUPS.md 2020-05-06 22:09:32 +02:00
Julio Delgado Jr
d6033e287d encryption of ebs volume 2020-05-06 10:55:42 -04:00
Toni de la Fuente
3df27862ac Support setting entropy limit for detect-secrets from env BASE64_LIMIT and HEX_LIMIT @yumminhuang
Support setting entropy limit for detect-secrets from env:
export BASE64_LIMIT=4.5
export HEX_LIMIT=3.0
2020-05-06 14:37:23 +02:00
Huang Yaming
bc07c95bda Support setting entropy limit for detect-secrets from env 2020-05-06 17:53:23 +08:00
Urjit Singh Bhatia
8cdf3838a0 Print warnings with the right color code 2020-05-04 16:33:50 -07:00
Urjit Singh Bhatia
5ac9be3292 correct color info line for warning 2020-05-04 14:48:04 -07:00
Urjit Singh Bhatia
103782f72b Fix warning handling with changes to official master 2020-05-04 14:37:30 -07:00
Urjit Singh Bhatia
5886f8524a Merge remote-tracking branch 'official/master' into whitelistSupport 2020-05-04 13:56:14 -07:00
Julio Delgado Jr
49456424fa example 2020-05-03 13:02:46 -04:00
Julio Delgado Jr
d095ea75d8 intro 2020-05-03 12:14:36 -04:00
Julio Delgado Jr
23dc8ce883 . 2020-05-03 12:12:57 -04:00
Julio Delgado Jr
378dd88808 . 2020-05-03 12:09:29 -04:00
Julio Delgado Jr
8fd2c17b5d . 2020-05-03 12:08:56 -04:00
Julio Delgado Jr
d2503ad1d3 more links, formatting 2020-05-03 12:07:31 -04:00
Julio Delgado Jr
159ae3ac32 removed ingress rule 2020-05-03 12:07:15 -04:00
Julio Delgado Jr
bb46702d37 updates 2020-05-03 11:50:05 -04:00
Julio Delgado Jr
95135305d7 updated links 2020-05-03 11:48:44 -04:00
Julio Delgado Jr
8728815704 . 2020-05-03 11:46:37 -04:00
Julio Delgado Jr
f4af505270 better markdown for code, more documentation 2020-05-03 11:45:20 -04:00
Julio Delgado Jr
25cb42e3c4 added parallel_accounts variable 2020-05-03 11:44:50 -04:00
Julio Delgado Jr
29378a1339 Updated Patterns,Defaults,Tags,BucketPolicy 2020-05-03 11:43:50 -04:00
Julio Delgado Jr
ac5212990a Updated Patterns,Descriptions,Defaults,Tags 2020-05-03 11:42:56 -04:00
Julio Delgado Jr
1be68b1e00 Updated Patterns,Descriptions,Defaults,Tags 2020-05-03 11:42:30 -04:00
Julio Delgado Jr
4230e9dc13 added elapsed times, support run prower parallel 2020-04-30 20:12:19 -04:00
Julio Delgado Jr
36e9f5174d reduced sts calls, updated comments 2020-04-30 17:24:00 -04:00
Julio Delgado Jr
d716cf2664 more documentation and links 2020-04-30 17:23:28 -04:00
Julio Delgado Jr
299cb7e541 Renamed Parameters, Updated Descriptions 2020-04-30 17:22:29 -04:00
Julio Delgado Jr
7816fd0648 Renamed Parameters, Updated Descriptions 2020-04-30 17:21:52 -04:00
Julio Delgado Jr
0cf97a99b3 Renamed Parameters, Updated Descriptions 2020-04-30 17:21:42 -04:00
Toni de la Fuente
996f785af6 Improve check21 If no account cloudtrail trail is found, check org trail @nimrodkor @bridgecrewio
check21 - If no account CloudTrail trail is found, check org trail
2020-04-29 22:24:24 +02:00
Nimrod Kor
dd0ef8c0b4 If no local cloudtrail trail is found - check org trail 2020-04-29 21:39:27 +03:00
Toni de la Fuente
a2cbcc00eb Fix issue with aws-cli v2 and timestamp on check24 #585 2020-04-29 18:10:41 +02:00
Toni de la Fuente
5450bf949e Fix check12's grep to find users with true in their name who really have password access @nimrodkor @bridgecrewio
Fix check12's grep to find users with true in their name who really have password access @nimrodkor @bridgecrewio
2020-04-29 13:02:26 +02:00
Toni de la Fuente
e4ae0a403a Ensure that hyphen is at end of tr string to prevent 'reverse collating sequence order' error in GNU tr @marcjay
Ensure that hyphen is at end of tr string to prevent 'reverse collating sequence order' error in GNU tr
2020-04-29 12:09:53 +02:00
Toni de la Fuente
1f949b4175 Improved AWS partition handle 2020-04-29 12:06:47 +02:00
Julio Delgado Jr
129a22e9c3 updated cron job settings 2020-04-28 18:53:04 -04:00
Julio Delgado Jr
e0b6d4a21d Added Adhoc: Run Prowler Interactively 2020-04-28 18:33:29 -04:00
Julio Delgado Jr
94b978a934 renamed 2020-04-28 12:36:10 -04:00
Julio Delgado Jr
09e4feb095 stopped embedding script into CF, download script 2020-04-28 12:35:57 -04:00
Nimrod Kor
dbca70ef2e Add $ to end of regex 2020-04-28 14:28:59 +03:00
Nimrod Kor
54f2b72cb6 Fix check12's grep to find users who really have password access
(cherry picked from commit 4006c581a0)
2020-04-28 14:13:32 +03:00
Julio Delgado Jr
200bbf9a7d org-multi-account initial commit 2020-04-28 00:47:42 -04:00
Marc Jay
af3afa8c8f Merge branch 'master' into fix-tr-error-on-centos-573 2020-04-27 17:24:03 +01:00
Toni de la Fuente
684473327a Fix output modes strings to ensure correct outputs are selected @marcjay
Wrap all mode checks with whitespace, along with comparison strings to ensure correct outputs are selected
2020-04-27 16:20:56 +02:00
Marc Jay
f84b843388 Wrap all mode checks with whitespace, along with comparison strings, so only exact string matches are allowed, preventing clashes when output modes are named similarly, e.g. 'json' and 'json-asff'
Fixes #571
2020-04-26 01:02:39 +01:00
Marc Jay
e25125fbfc Ensure that hyphen is at end of tr string to prevent 'reverse collating sequence order' error in GNU tr
Stop echo from adding newlines using `-n`, removing the need to stop replacing new-line characters with underscores

Fixes #573
2020-04-26 00:40:27 +01:00
Toni de la Fuente
33523885f1 Delete LIST_OF_CHECKS_AND_GROUPS.md 2020-04-23 16:27:59 +02:00
Toni de la Fuente
13ca147d02 Updated checks with hardcoded arn to support GovCloud partition 2020-04-22 23:23:17 +02:00
Toni de la Fuente
dbb3ed9663 Improved extra734 for GovCloud 2020-04-22 22:19:21 +02:00
Toni de la Fuente
1beb483be3 Fixed issue with govcloud on extra764 #536 2020-04-22 20:40:18 +02:00
Toni de la Fuente
7dc790a3f5 Fixed issue with govcloud on extra764 #536 2020-04-22 20:05:39 +02:00
Toni de la Fuente
8c9aea1231 Improved GetCallerIdentity handling / credentials 2020-04-22 13:54:17 +02:00
Toni de la Fuente
9f03bd7545 Added txt output as mono for -M 2020-04-22 12:58:54 +02:00
Toni de la Fuente
2eb41ff910 Added account id to the output filename 2020-04-22 12:32:05 +02:00
Toni de la Fuente
2d64a1182e Added account id to the output filename 2020-04-22 12:31:27 +02:00
Toni de la Fuente
43fb877109 Added account id to the output filename 2020-04-22 12:28:31 +02:00
Toni de la Fuente
ef952ce9cc Simplified caller id info on outputs 2020-04-22 12:07:20 +02:00
Toni de la Fuente
0cca77a141 Check if gbase64 (GNU) is available on Mac and use it in preference to BSD base64 @marcjay
Check if gbase64 (GNU) is available on Mac and use it in preference to BSD base64
2020-04-22 12:01:40 +02:00
Toni de la Fuente
5b9cf7fa99 Fix -E flag no longer excluding checks @marcjay
Fix -E flag no longer excluding checks
2020-04-22 11:55:01 +02:00
Marc Jay
5805576dce Check if gbase64 (GNU) is available on Mac and use it in preference to BSD base64
Previously it was switching to GNU versions of base64 even if base64 was the BSD version

Fixes #568
2020-04-22 10:35:33 +01:00
Toni de la Fuente
9cbdefc2de Adds CSV header to the output file too #565 2020-04-22 11:27:08 +02:00
Marc Jay
c2669622cf Fix -E flag no longer excluding checks
Remove re-declaration of TOTAL_CHECKS variable

Bug introduced by #561

Fixes #566
2020-04-22 09:58:33 +01:00
Toni de la Fuente
b9051e6fc9 Merge pull request #563 from marcjay/correct-check13-496
Extend check13 to meet all CIS rules and consolidate with extra774
2020-04-22 10:46:37 +02:00
Toni de la Fuente
92091d9ecd Rollback #562 fix issue #564 2020-04-22 10:31:30 +02:00
Marc Jay
ad66254b45 Extend check13 to meet all CIS rules and consolidate with extra774
Create `include/check_creds_last_used` and move all logic for checking last usages of passwords and access keys there
Modify check13 and extra774 to call new function, specifying time-range of last 90 days and last 30 days respectively
Modify messages in check14 and check121 so that all mentions of 'access key's are consistent

Fixes #496
2020-04-21 01:21:55 +01:00
Toni de la Fuente
d6374f8bc8 Updated textInfo message on extra712 2020-04-20 19:27:39 +02:00
Toni de la Fuente
0c7805356e Enhancement: extra712 improved with Macie API call instead of IAM @eko0126
using api commands to check if macie is enabled instead of looking ia…
2020-04-20 19:20:13 +02:00
Toni de la Fuente
86ea46d77c Update check_extra712 2020-04-20 19:19:05 +02:00
Toni de la Fuente
3feac6f75b Improve listing of Checks and Groups @marcjay
Improve listing of Checks and Groups
2020-04-20 19:14:50 +02:00
Marc Jay
71bf414faf Merge branch 'master' into improve-listing-of-checks-and-groups-545 2020-04-20 18:11:06 +01:00
Toni de la Fuente
38a970f4fc Enhancement: extra768 only check latest version of ECS task definition
Only check latest version of task definition
2020-04-20 19:00:26 +02:00
Toni de la Fuente
3dae201a80 Merge branch 'marcjay-add-junit-xml-output-mode-log-duration-537' 2020-04-20 18:57:27 +02:00
Toni de la Fuente
d45b739b1e Merge branch 'add-junit-xml-output-mode-log-duration-537' of https://github.com/marcjay/prowler into marcjay-add-junit-xml-output-mode-log-duration-537 2020-04-20 18:51:26 +02:00
Toni de la Fuente
ce56f0cb24 git push origin masterMerge branch 'nalansitan-extra725' 2020-04-20 18:49:37 +02:00
Toni de la Fuente
d02d9e1c95 Merge branch 'extra725' of https://github.com/nalansitan/prowler into nalansitan-extra725 2020-04-20 18:46:39 +02:00
Alex Gray
5b8370179a Get the list of families and then get latest task definition 2020-04-20 09:15:15 -04:00
He.Longfei
b42cc33a6c using api commands to check if macie is enabled instead of looking iam role 2020-04-20 15:01:38 +08:00
Marc Jay
8f179338d8 Fix invalid references to $i when it should reference a local $group_index variable 2020-04-20 01:30:37 +01:00
Marc Jay
47a05c203a Improve listing of Checks and Groups
Change `-l` flag to print a unique list of every single check (assuming none are orphaned outside of all groups)
Allow `-g <group_id>` to be specified in combination with `-l`, to only print checks that are referenced by the specified group
When listing all checks with `-l` only, print out all groups that reference each check

Fixes: #545
2020-04-20 01:12:53 +01:00
Toni de la Fuente
6747b208ce Improved extra716 and extra788 2020-04-17 15:16:55 +02:00
Marc Jay
78f649bd65 Replace -J flag with junit-xml output format
Rearrange output functions so they support outputting text alongside other formats, if specified
Add a convenience function for checking if JUnit output is enabled
Move monochrome setting into loop so it better supports multiple formats
Update README
2020-04-15 23:36:40 +01:00
Alex Gray
172f4b2681 Only check latest version of task definition 2020-04-15 15:19:44 -04:00
Marc Jay
dc31adcc18 Rename JUnit XML files to match the Java convention - with a 'TEST-' prefix 2020-04-15 13:42:33 +01:00
Marc Jay
fa17829832 Fix arithmetic expression for calculating test duration 2020-04-15 12:52:48 +01:00
Marc Jay
994390351e Add the ability to generate JUnit XML reports with a -J flag
If the -J flag is passed, generate JUnit XML reports for each check, in-line with how Java tools generate JUnit reports.
Check section numbers equate to 'root packages', checks are second-level packages, each check equates to a testsuite (mirroring Java where each test class is a testsuite) and each pass/fail of a check equates to a testcase
Time the execution of each check and include this in the report
Include properties (Prowler version, check level etc.) in-line with standard JUnit files
XML escape all strings for safety

Detect if a user has GNU coreutils installed on Mac OS X, but not as their default, switching to using gdate for date commands if so, as it has more features, including getting dates in milliseconds
Add prowler-output, junit-reports and VSCode files to .gitignore
Update README to include JUnit info, address markdownlint warnings
Remove unused arguments to jq in generateJsonAsffOutput

Fixes #537
2020-04-15 02:36:16 +01:00
Urjit Singh Bhatia
bf72025b9b Ignore inline whitelist comments, pass checkid to filter ignores specifically for checks 2020-04-14 17:29:36 -07:00
Toni de la Fuente
462527015c Merge branch 'marcjay-simplify-check-id-variables' 2020-04-15 00:24:17 +02:00
Toni de la Fuente
3311acf82c Merge branch 'simplify-check-id-variables' of https://github.com/marcjay/prowler into marcjay-simplify-check-id-variables 2020-04-15 00:23:54 +02:00
Toni de la Fuente
f065beb93b Fixed title in group16_trustboundaries 2020-04-14 23:57:55 +02:00
Toni de la Fuente
2de49c3940 Added more sample commands and updates 2020-04-14 23:55:02 +02:00
Toni de la Fuente
f3664b56ec Open 2020-04-14 22:46:44 +02:00
Toni de la Fuente
4ea1864365 Allow multiple report types at once #345 2020-04-14 22:28:58 +02:00
Toni de la Fuente
e6fe5addbc Added section for Security Hub integration 2020-04-14 18:52:48 +02:00
Toni de la Fuente
58d793ec2a Added section for Security Hub integration 2020-04-14 18:51:13 +02:00
Toni de la Fuente
973f6b39a0 Merge branch 'master' of https://github.com/toniblyx/prowler 2020-04-14 16:45:54 +02:00
Toni de la Fuente
11c182c5fe Fixed issue with regions on check21 2020-04-14 16:45:37 +02:00
nalansitan
036ae640e5 support arn:aws:s3::: on extra725 2020-04-14 10:38:01 +08:00
Marc Jay
7e5a4a1de4 Adjust execute_check() now that check71's ID has changed
Fix minor typo in a comment
2020-04-14 02:17:28 +01:00
Marc Jay
0f49468601 Limit CHECK_ID to a single value, handing the left-pad formatting in one place
Remove the second entry in any comma-separated check IDs from each check, formatting
the check ID with leading zeros in `include/outputs` if the `-n` flag is active
2020-04-14 02:02:48 +01:00
Toni de la Fuente
df52057287 Fix: extra741 - Check if User Data is a valid GZIP file before attempting to gunzip @marcjay
Extra741 - Check if User Data is a valid GZIP file before attempting to gunzip
2020-04-13 23:53:39 +02:00
Marc Jay
460f65618b Add clarifying text to pass/fail messages 2020-04-13 22:43:22 +01:00
Marc Jay
c4374a2818 Extra741 - Check if User Data is a valid GZIP file before attempting to gunzip
Test if the user data is a valid GZIP file using `gunzip -t` and only then attempt to gunzip it
Remove some code duplication

Fixes #535
2020-04-13 22:27:22 +01:00
Toni de la Fuente
9be0b3f749 Prowler IAM Policy Enhancements and README Updates @tekdj7
Prowler IAM Policy Enhancements and README Updates @tekdj7
2020-04-13 18:52:28 +02:00
Julio Delgado Jr
05247a2ccb Prowler IAM Policy Enhancements and ReadMe Updates 2020-04-13 12:39:20 -04:00
Toni de la Fuente
a4264628cb Extra725 - Improved support cross account and region cloudtrail @patdowney
Extra725 - Support cross account and region cloudtrail
2020-04-13 18:34:31 +02:00
Toni de la Fuente
8a7344ef86 Extra720 - Support cross account and cross-region cloudtrail @patdowney 2020-04-13 18:33:38 +02:00
Toni de la Fuente
4cf66a2f32 Merge pull request #527 from yumminhuang/master
Remove --output text in CLOUDTRAILBUCKET_LOGENABLED
2020-04-13 18:18:55 +02:00
Toni de la Fuente
7f2e097205 Merge pull request #518 from bridgecrewio/bugfix/check_23_error_fails
check23 - on failure, output info and not failure
2020-04-13 16:50:30 +02:00
Toni de la Fuente
67504e8591 Merge pull request #519 from bridgecrewio/bugfix/check_26_error_fails
check26 - on failure, output info and not failure
2020-04-13 16:50:05 +02:00
Toni de la Fuente
958a54e337 Merge pull request #530 from marcjay/aws-security-hub-output-524
Add 'json-asff' output mode and ability to send output to AWS Security Hub
2020-04-13 14:03:50 +02:00
Toni de la Fuente
d39bad2ee2 Merge pull request #541 from marcjay/sort-checks-correctly-when-excludes-in-place-492
Avoid changing the execution order of checks when some checks are excluded
2020-04-13 13:40:20 +02:00
Toni de la Fuente
3c77130f65 Merge pull request #540 from marcjay/check121-filter-out-password-access-513
check121 - Filter out users who do not have a console password
2020-04-13 13:31:33 +02:00
Toni de la Fuente
d855432f28 Merge pull request #538 from marcjay/fix-no-information-extra774-501
Extra 774 - Handle IAM credential report containing 'no_information' for a user's last console login date
2020-04-13 13:30:24 +02:00
Toni de la Fuente
3e1d9ea0d3 Merge pull request #539 from marcjay/handle-gnu-date-as-default-on-mac-osx-534
Detect when GNU coreutils is installed on Mac OS X and use the correct date functions
2020-04-13 13:27:42 +02:00
Marc Jay
24e691901e Convert tabs to spaces within modified function 2020-04-12 17:17:46 +01:00
Marc Jay
57c15c2cc9 Avoid changing the execution order of checks when some checks are excluded
Replace the use of `sort -u` to remove duplicate checks, which has the side-effect of reordering checks alphabetically when one or more are excluded with awk, which preserves the check order

Adjust indentation and formatting to be more consistent with the rest of the file

Fixes #492
2020-04-12 17:12:54 +01:00
Marc Jay
4f623b4e31 check121 - Filter out users who do not have a console password
According to the benchmark, only users with a console password should be considered for this check,
therefore filter out any users who do not have a console password

Fixes #513
2020-04-12 02:18:42 +01:00
Marc Jay
d9588f4de0 Detect when GNU coreutils is installed on Mac OS X and use the correct date functions
As some users may have installed GNU coreutils on Mac OS X, e.g. `brew install coreutils`, it's possible that
the `date` command uses the GNU version, instead of the standard BSD version.

- Detect if GNU coreutils is installed on Mac and if it is, use the GNU variants of date functions
- Reduce some of the duplication in the file, which resolves a bug where the cygwin version of `how_many_days_from_today()`
had the operands switched around, leading to a positive result instead of negative
- Add test_tcp_connectivity function for cygwin (uses the GNU variant)

Fixes #534
2020-04-12 01:28:11 +01:00
Marc Jay
ce1058dfed Remove the varying number of days in the message so that message stays consistent over time 2020-04-12 01:22:34 +01:00
Marc Jay
8d9c7e8ab0 Handle IAM credential report containing 'no_information' for a user's last console login date
A user who has never logged into the console, or not logged in since Oct 2014 will present as 'no_information' in the
'password_last_used' column of the credential report. Handle this scenario and output a failed message if it has been
more than MAX_DAYS days since the user was created, or an info message if it is less than MAX_DAYS

Fixes #501
2020-04-11 20:07:03 +01:00
Marc Jay
c02811f411 Add CHECK_ASFF_RESOURCE_TYPE variables for recently added checks 2020-04-11 03:34:32 +01:00
Marc Jay
4bae0ca5f5 Merge branch 'master' into aws-security-hub-output-524 2020-04-11 03:16:23 +01:00
Marc Jay
5bab65c56d - Remove securityhub output mode and replace with '-S' flag to send findings to Security Hub
- Move Security Hub related code to a dedicated include/securityhub_integration file
- Check that Security Hub is enabled in the target region before beginning checks when -S is specified
- Add error handling to the batch-import-findings call
- Add CHECK_ASFF_TYPE variables to all CIS checks to override the default
- Add support for CHECK_ASFF_RESOURCE_TYPE variables which override the default 'AwsAccount' value for the resource a finding relates to.
- Add CHECK_ASFF_RESOURCE_TYPE variables to all checks where there is a suitable value in the schema
- Remove json-asff output for info messages as they are not appropriate for possible submission to Security Hub
- Update the README to cover Security Hub integration
- Add an IAM policy JSON document that provides the necessary BatchImportFindings permission for Security Hub
- Remove trailing whitespace and periods in pass/fail messages to be consistent with the majority of messages, to prevent future tidy-up from changing the finding IDs
2020-04-11 03:04:03 +01:00
Huang Yaming
7982cc462a Remove --output text in CLOUDTRAILBUCKET_LOGENABLED
When adding `--output text`, aws cli will return `None` instead of
`null`. It makes the following if check misjudge LoggingEnabled
status.
2020-04-10 10:18:20 +08:00
Toni de la Fuente
8f83da985a PR #511 2020-04-08 18:00:54 +02:00
Patrick Downey
b6adfd58ec Support cross-region and cross-account object-level cloudtrail logs for S3
Buckets that log to one or more trails are logged as `PASS!` for each trail they are associated with.
Buckets that aren't associated with any trails are logged as `FAIL!` once.

```
...
PASS! : S3 bucket bucket-one has Object-level logging enabled in trails: arn:aws:cloudtrail:eu-west-2:123456789012:trail/central-trail
PASS! : S3 bucket bucket-two has Object-level logging enabled in trails: arn:aws:cloudtrail:eu-west-2:9876543210989:trail/trail-two
PASS! : S3 bucket bucket-two has Object-level logging enabled in trails: arn:aws:cloudtrail:eu-west-2:123456789012:trail/central-trail
PASS! : S3 bucket bucket-three has Object-level logging enabled in trails: arn:aws:cloudtrail:eu-west-2:123456789012:trail/central-trail
...
```

This change should also address #387
2020-04-08 15:50:52 +01:00
Patrick Downey
78ccc7d953 Remove HomeRegion predicate from describe-trails in extras725
So we can look at cross-region trails too
2020-04-08 13:28:18 +01:00
Patrick Downey
fc83a9896c Use TrailARN property to query get-event-selectors in checks_extra725
This will work to query cloudtrail's that are in different accounts.
e.g. in the case of organisation managed cloudtrails.
2020-04-08 13:27:09 +01:00
Toni de la Fuente
effc3eb14d Added new checks to group extras 2020-04-08 14:06:11 +02:00
Toni de la Fuente
6ea37b05ca Improvements and new checks for elasticsearch 2020-04-08 14:00:12 +02:00
Patrick Downey
84711d1ef5 Remove HomeRegion predicate from describe-trails to look for cross-region trails too
This will hopefully address #455
2020-04-08 12:52:13 +01:00
Patrick Downey
4ff685635e Use TrailARN property to query get-event-selectors
This will work to query cloudtrail's that are in different accounts.
e.g. in the case of organisation managed cloudtrails.
2020-04-08 12:52:13 +01:00
Toni de la Fuente
9c4e629647 Fixed typo in extra786 2020-04-07 20:28:38 +02:00
Marc Jay
92e1f17a80 Adds 'json-asff' and 'securityhub' output modes
json-asff mode outputs JSON, similar to the standard 'json' mode with one check per line, but in AWS Security Finding Format - used by AWS Security Hub
Currently uses a generic Type, Resources and ProductArn value, but sets the Id to a unique value that includes the details of the message, in order to separate out checks that run against multiple resources and output one result per resource per check. This ensures that findings can be updated, should the resource move in or out of compliance

securityhub mode generates the ASFF JSON and then passes it to an 'aws securityhub batch-import-findings' call, once per resource per check. Output to the screen is similar to the standard mode, but prints whether or not the finding was submitted successfully

Fixes #524
2020-04-07 16:08:07 +01:00
Toni de la Fuente
bd432fed92 New check for Metadata Service Version 2 #413 2020-04-07 16:46:46 +02:00
Toni de la Fuente
b5e1c9002a Improved policy handling on extra716 2020-04-03 17:54:55 +02:00
Toni de la Fuente
afb908f190 Improved policy handling on extra716 2020-04-03 17:54:25 +02:00
Toni de la Fuente
e567ccb828 v2.2.1 with new function and Improved extra779 and extra716 2020-04-02 15:31:43 +02:00
Toni de la Fuente
2c580dd750 Fix issue #488 only works if CloudWatchLog configuration 2020-04-02 00:19:43 +02:00
Toni de la Fuente
9dec4e6eb3 Fix issue #488 only works if IsMultiRegionTrail 2020-04-02 00:02:42 +02:00
Toni de la Fuente
2e2fe96ff5 Improved extra716 filters and auth check 2020-04-01 21:57:20 +02:00
Toni de la Fuente
2e2e9b85af Merge branch 'master' of https://github.com/toniblyx/prowler 2020-04-01 16:53:04 +02:00
Toni de la Fuente
1ae5d5d725 Added custom ports variable to extra779 2020-04-01 16:52:52 +02:00
Toni de la Fuente
71c9d12184 Merge pull request #526 from dhirajdatar/change-in-usage
Updated extra in usage of extra for multiple checks
2020-03-31 13:24:23 +02:00
dhirajdatar
059c701923 Update README.md 2020-03-31 16:46:38 +05:30
Toni de la Fuente
d24e824735 Merge pull request #522 from yumminhuang/master
Ignore imported ACM Certificate in check_extra724
2020-03-27 15:03:45 +01:00
Huang Yaming
1419d4887a Ignore imported ACM Certificate in check_extra724 2020-03-27 14:49:52 +08:00
Toni de la Fuente
ba75d89911 Added connection test for port 9300 in both linux and macosx on extra779 2020-03-25 18:20:20 +01:00
Toni de la Fuente
8faf1f45c4 Added connection test for port 9300 in both linux and macosx on extra779 2020-03-25 18:19:41 +01:00
Toni de la Fuente
eae4722499 Updated ES check titles and results 2020-03-25 17:25:38 +01:00
Toni de la Fuente
8c18533752 Updated check titles 2020-03-25 17:18:43 +01:00
Toni de la Fuente
ee82424869 Enhanced extra779 with better authentication test and TEST_ES_AUTHENTICATION disabled 2020-03-25 12:44:10 +01:00
Toni de la Fuente
b4aaf0b81e Added initial PCI group without checks yet, issue #296 2020-03-25 10:53:55 +01:00
Toni de la Fuente
f809f2fa1d Modify group names header to clarify what is CIS only 2020-03-25 10:53:05 +01:00
Toni de la Fuente
1615478444 Fixed query on extra779 2020-03-25 09:40:03 +01:00
Toni de la Fuente
568bba4c38 Add Elasticsearch checks issue #521 2020-03-24 23:46:11 +01:00
Toni de la Fuente
705d75606d Merge pull request #520 from bridgecrewio/bugfix/extra774_fixes
extra774 requires credential report to run successfully
2020-03-23 15:50:08 +01:00
Toni de la Fuente
3ff4acf648 Merge branch 'lanhhuyet510-patch-2' 2020-03-23 15:09:45 +01:00
Toni de la Fuente
e082ef05f0 Merge branch 'patch-2' of https://github.com/lanhhuyet510/prowler into lanhhuyet510-patch-2 2020-03-23 15:09:15 +01:00
Toni de la Fuente
2db9151939 Merge pull request #508 from renuez/checks/find_security_groups_with_wide_open_non_RFC1918_IPv4
Checks/find security groups with wide open non rfc1918 IPv4 addresses
2020-03-23 14:50:05 +01:00
Toni de la Fuente
db3ac2361c Merge branch 'master' into checks/find_security_groups_with_wide_open_non_RFC1918_IPv4 2020-03-23 14:48:05 +01:00
Toni de la Fuente
30941c355c Added extra777 - Security Groups with too many rules @renuez 2020-03-23 14:39:23 +01:00
Nimrod Kor
25bc8699b3 check_extra774 - revert changes
(cherry picked from commit 87fd299cdb)
2020-03-22 11:24:07 +02:00
Nimrod Kor
d62027440d extra774 - check correct date, consolidate files and fix report generation
(cherry picked from commit 75d66df940)
2020-03-22 11:24:07 +02:00
Nimrod Kor
b704568b23 check26 - on failure, output info and not failure
(cherry picked from commit f80c2e28b7)
2020-03-22 11:23:41 +02:00
Nimrod Kor
259f24ee06 check23 - on failure, output info and not failure
(cherry picked from commit 168c71cd5f)
2020-03-22 11:23:18 +02:00
Urjit Singh Bhatia
56a4fd813c Support whitelists per check 2020-03-10 18:55:28 -07:00
Ngọ Anh Đức
0979f421c3 Update check21 2020-03-09 13:00:43 +07:00
Ngọ Anh Đức
89514a1fa8 Update check21 2020-03-09 12:59:47 +07:00
Ngọ Anh Đức
ba13f25c9e Update check21 2020-03-09 12:57:49 +07:00
Ngọ Anh Đức
53ee538e0f add $PROFILE_OPT to the CLI 2020-03-09 12:57:00 +07:00
Ngọ Anh Đức
3116adf86e Update check21 2020-03-09 12:46:16 +07:00
Ngọ Anh Đức
263926a53b Improve check21
- Add ISLOGGING_STATUS, INCLUDEMANAGEMENTEVENTS_STATUS, READWRITETYPE_STATUS to check
- Remove ` --no-include-shadow-trails ` from CLI
2.1 Ensure CloudTrail is enabled in all regions (Scored):
Via CLI
1. ` aws cloudtrail describe-trails `
Ensure `IsMultiRegionTrail` is set to true
2. `aws cloudtrail get-trail-status --name <trailname shown in describe-trails>`
Ensure `IsLogging` is set to true
3. `aws cloudtrail get-event-selectors --trail-name <trailname shown in describetrails>`
Ensure there is at least one Event Selector for a Trail with `IncludeManagementEvents` set to
`true` and `ReadWriteType` set to `All`
2020-03-09 12:44:23 +07:00
Philipp Zeuner
cb5858d08a Updated check_extra778 to use PROFILE_OPT and AWSCLI 2020-03-08 09:56:52 +01:00
Philipp Zeuner
1b2b52e6a7 Fixed check_extra778 reference CHECK_ID 2020-03-08 09:22:11 +01:00
Philipp Zeuner
f5d083f781 Updated check_extra778 to exclude 0.0.0.0/0 edge case 2020-03-08 09:21:17 +01:00
Philipp Zeuner
f585ca54d1 Fixed check_extra788 logic bug related to SECURITY_GROUP and improved check_cidr() isolation 2020-03-08 09:20:05 +01:00
Philipp Zeuner
f149fb7535 Refactored check name to check_extra778 2020-03-08 08:15:20 +01:00
Toni de la Fuente
530bacac5b Merge pull request #510 from jonjozwiak/master
Improve performance of check_extra742 by limiting to one AWS CLI call per region
2020-03-05 21:33:26 +01:00
Toni de la Fuente
0b2c3c9f4f Merge pull request #509 from nexeck/new_check_ecr_findings
fix: Enable check extra776 in extra group
2020-03-05 21:26:34 +01:00
jonjozwiak
8173c20941 Improve performance of check_extra742 by limiting to one AWS CLI call 2020-03-04 16:46:28 +02:00
Marcel Beck
95cb26fb2b fix: Enable check extra776 in extra group 2020-03-04 07:27:40 +01:00
Toni de la Fuente
c0d8258283 [new check] Check if ECR image scan found vulnerabilities in the newest image version
[new check] Check if ECR image scan found vulnerabilities in the newest image version
2020-03-03 23:06:44 +01:00
Toni de la Fuente
4646dbcd0b Updated check_extra776 title 2020-03-03 23:04:09 +01:00
Marcel Beck
db260da8b0 feat: New check for ecr image scan findings
This will check if there is any ecr image with findings.
2020-03-03 22:53:26 +01:00
Philipp Zeuner
162ff05e42 Updated check_extra777 to fix CHECK_ALTERNATE variable 2020-03-02 22:53:32 +01:00
Philipp Zeuner
6ea863ac3b Initial commit 2020-03-01 20:26:51 +01:00
Toni de la Fuente
655aae7014 Merge pull request #499 from nexeck/check119_ignore_terminated
fix: check119 needs to ignore terminated instances
2020-02-28 18:51:52 +01:00
Marcel Beck
5257ce6c0b docs: Fix typo 2020-02-28 17:58:10 +01:00
Marcel Beck
c9508c28b3 fix: check119 needs to ignore terminated instances
Terminated does not seem to have an instance profile. And its not
possible to start a terminated instance again.
2020-02-25 09:23:55 +01:00
Toni de la Fuente
50b10c4018 Minor fixes for checks 774 and 775
Faraz minor fixes
2020-02-24 18:53:20 +01:00
Faraz Angabini
2321655503 fixed check numbers for 774,775 2020-02-22 22:16:59 -08:00
Faraz Angabini
7358e9cd75 added .gitignore for .DS_Store 2020-02-22 22:12:44 -08:00
Faraz Angabini
020374b6f9 deleted .DS_Store 2020-02-22 22:10:52 -08:00
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
382 changed files with 25242 additions and 2487 deletions

17
.dockerignore Normal file
View File

@@ -0,0 +1,17 @@
# Ignore git files
.git/
.github/
# Ignore Dodckerfile
Dockerfile
# Ignore hidden files
.pre-commit-config.yaml
.dockerignore
.gitignore
.pytest*
.DS_Store
# Ignore output directories
output/
junit-reports/

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @prowler-cloud/prowler-team

50
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,50 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]: "
labels: bug, status/needs-triage
assignees: ''
---
<!--
Please use this template to create your bug report. By providing as much info as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefore, take a couple of extra minutes to make sure you have provided all info needed.
PROTIP: record your screen and attach it as a gif to showcase the issue.
- How to record and attach gif: https://bit.ly/2Mi8T6K
-->
**What happened?**
A clear and concise description of what the bug is or what is not working as expected
**How to reproduce it**
Steps to reproduce the behavior:
1. What command are you running?
2. Environment you have, like single account, multi-account, organizations, etc.
3. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots or Logs**
If applicable, add screenshots to help explain your problem.
Also, you can add logs (anonymize them first!). Here a command that may help to share a log
`bash -x ./prowler -options > debug.log 2>&1` then attach here `debug.log`
**From where are you running Prowler?**
Please, complete the following information:
- Resource: [e.g. EC2 instance, Fargate task, Docker container manually, EKS, Cloud9, CodeBuild, workstation, etc.)
- OS: [e.g. Amazon Linux 2, Mac, Alpine, Windows, etc. ]
- AWS-CLI Version [`aws --version`]:
- Prowler Version [`./prowler -V`]:
- Shell and version:
- Others:
**Additional context**
Add any other context about the problem here.

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Help
url: https://github.com/prowler-cloud/prowler/discussions/categories/q-a
about: Please ask and answer questions here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, status/needs-triage
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

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

@@ -0,0 +1,13 @@
### Context
Please include relevant motivation and context for this PR.
### Description
Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.
### License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

View File

@@ -0,0 +1,209 @@
name: build-lint-push-containers
on:
push:
branches:
- 'master'
paths-ignore:
- '.github/**'
- 'README.md'
release:
types: [published, edited]
env:
AWS_REGION_STG: eu-west-1
AWS_REGION_PLATFORM: eu-west-1
AWS_REGION_PRO: us-east-1
IMAGE_NAME: prowler
LATEST_TAG: latest
STABLE_TAG: stable
TEMPORARY_TAG: temporary
DOCKERFILE_PATH: ./Dockerfile
jobs:
# Lint Dockerfile using Hadolint
# dockerfile-linter:
# runs-on: ubuntu-latest
# steps:
# -
# name: Checkout
# uses: actions/checkout@v3
# -
# name: Install Hadolint
# run: |
# VERSION=$(curl --silent "https://api.github.com/repos/hadolint/hadolint/releases/latest" | \
# grep '"tag_name":' | \
# sed -E 's/.*"v([^"]+)".*/\1/' \
# ) && curl -L -o /tmp/hadolint https://github.com/hadolint/hadolint/releases/download/v${VERSION}/hadolint-Linux-x86_64 \
# && chmod +x /tmp/hadolint
# -
# name: Run Hadolint
# run: |
# /tmp/hadolint util/Dockerfile
# Build Prowler OSS container
container-build:
# needs: dockerfile-linter
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/build-push-action@v2
with:
# Without pushing to registries
push: false
tags: ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }}
file: ${{ env.DOCKERFILE_PATH }}
outputs: type=docker,dest=/tmp/${{ env.IMAGE_NAME }}.tar
-
name: Share image between jobs
uses: actions/upload-artifact@v2
with:
name: ${{ env.IMAGE_NAME }}.tar
path: /tmp/${{ env.IMAGE_NAME }}.tar
# Lint Prowler OSS container using Dockle
# container-linter:
# needs: container-build
# runs-on: ubuntu-latest
# steps:
# -
# name: Get container image from shared
# uses: actions/download-artifact@v2
# with:
# name: ${{ env.IMAGE_NAME }}.tar
# path: /tmp
# -
# name: Load Docker image
# run: |
# docker load --input /tmp/${{ env.IMAGE_NAME }}.tar
# docker image ls -a
# -
# name: Install Dockle
# run: |
# VERSION=$(curl --silent "https://api.github.com/repos/goodwithtech/dockle/releases/latest" | \
# grep '"tag_name":' | \
# sed -E 's/.*"v([^"]+)".*/\1/' \
# ) && curl -L -o dockle.deb https://github.com/goodwithtech/dockle/releases/download/v${VERSION}/dockle_${VERSION}_Linux-64bit.deb \
# && sudo dpkg -i dockle.deb && rm dockle.deb
# -
# name: Run Dockle
# run: dockle ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }}
# Push Prowler OSS container to registries
container-push:
# needs: container-linter
needs: container-build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read # This is required for actions/checkout
steps:
-
name: Get container image from shared
uses: actions/download-artifact@v2
with:
name: ${{ env.IMAGE_NAME }}.tar
path: /tmp
-
name: Load Docker image
run: |
docker load --input /tmp/${{ env.IMAGE_NAME }}.tar
docker image ls -a
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to Public ECR
uses: docker/login-action@v2
with:
registry: public.ecr.aws
username: ${{ secrets.PUBLIC_ECR_AWS_ACCESS_KEY_ID }}
password: ${{ secrets.PUBLIC_ECR_AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ env.AWS_REGION_PRO }}
-
name: Configure AWS Credentials -- STG
if: github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION_STG }}
role-to-assume: ${{ secrets.STG_IAM_ROLE_ARN }}
role-session-name: build-lint-containers-stg
-
name: Login to ECR -- STG
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
registry: ${{ secrets.STG_ECR }}
-
name: Configure AWS Credentials -- PLATFORM
if: github.event_name == 'release'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION_PLATFORM }}
role-to-assume: ${{ secrets.STG_IAM_ROLE_ARN }}
role-session-name: build-lint-containers-pro
-
name: Login to ECR -- PLATFORM
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
registry: ${{ secrets.PLATFORM_ECR }}
-
# Push to master branch - push "latest" tag
name: Tag (latest)
if: github.event_name == 'push'
run: |
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ env.LATEST_TAG }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
-
# Push to master branch - push "latest" tag
name: Push (latest)
if: github.event_name == 'push'
run: |
docker push ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ env.LATEST_TAG }}
docker push ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
docker push ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
-
# Tag the new release (stable and release tag)
name: Tag (release)
if: github.event_name == 'release'
run: |
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ github.event.release.tag_name }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ env.STABLE_TAG }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.STABLE_TAG }}
docker tag ${{ env.IMAGE_NAME }}:${{ env.TEMPORARY_TAG }} ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.STABLE_TAG }}
-
# Push the new release (stable and release tag)
name: Push (release)
if: github.event_name == 'release'
run: |
docker push ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ github.event.release.tag_name }}
docker push ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
docker push ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
docker push ${{ secrets.PLATFORM_ECR }}/${{ secrets.PLATFORM_ECR_REPOSITORY }}:${{ env.STABLE_TAG }}
docker push ${{ secrets.DOCKER_HUB_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.STABLE_TAG }}
docker push ${{ secrets.PUBLIC_ECR_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.STABLE_TAG }}
-
name: Delete artifacts
if: always()
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ env.IMAGE_NAME }}.tar

18
.github/workflows/find-secrets.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: find-secrets
on: pull_request
jobs:
trufflehog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@v3.13.0
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD

41
.github/workflows/pull-request.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Lint & Test
on:
push:
branches:
- 'prowler-3.0-dev'
pull_request:
branches:
- 'prowler-3.0-dev'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install
- name: Bandit
run: |
pipenv run bandit -q -lll -x '*_test.py,./contrib/' -r .
- name: Safety
run: |
pipenv run safety check
- name: Vulture
run: |
pipenv run vulture --exclude "contrib" --min-confidence 100 .
- name: Test with pytest
run: |
pipenv run pytest -n auto

View File

@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions
name: Refresh regions of AWS services
on:
schedule:
- cron: "0 9 * * *" #runs at 09:00 UTC everyday
env:
GITHUB_BRANCH: "prowler-3.0-dev"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_BRANCH }}
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.9 #install the python needed
# Runs a single command using the runners shell
- name: Run a one-line script
run: python3 util/update_aws_services_regions.py
# Create pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "feat(regions_update): Update regions for AWS services."
branch: "aws-services-regions-updated"
labels: "status/waiting-for-revision, severity/low"
title: "feat(regions_update): Changes in regions for AWS services."
body: |
### Description
This PR updates the regions for AWS services.
### License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

40
.gitignore vendored Normal file
View File

@@ -0,0 +1,40 @@
# 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~
# MacOs DS_Store
*.DS_Store
# Prowler output
output/
# Prowler found secrets
secrets-*/
# JUnit Reports
junit-reports/
# VSCode files
.vscode/
terraform-kickstarter/.terraform.lock.hcl
terraform-kickstarter/.terraform/providers/registry.terraform.io/hashicorp/aws/3.56.0/darwin_amd64/terraform-provider-aws_v3.56.0_x5
terraform-kickstarter/terraform.tfstate

29
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-merge-conflict
- id: check-yaml
args: ['--unsafe']
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: 'README.md'
- id: no-commit-to-branch
- id: pretty-format-json
args: ['--autofix']
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
- repo: https://github.com/hadolint/hadolint
rev: v2.10.0
hooks:
- id: hadolint
name: Lint Dockerfiles
description: Runs hadolint to lint Dockerfiles
language: system
types: ["dockerfile"]
entry: hadolint

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

64
Dockerfile Normal file
View File

@@ -0,0 +1,64 @@
# Build command
# docker build --platform=linux/amd64 --no-cache -t prowler:latest -f ./Dockerfile .
# hadolint ignore=DL3007
FROM public.ecr.aws/amazonlinux/amazonlinux:latest
LABEL maintainer="https://github.com/prowler-cloud/prowler"
ARG USERNAME=prowler
ARG USERID=34000
# Prepare image as root
USER 0
# System dependencies
# hadolint ignore=DL3006,DL3013,DL3033
RUN yum upgrade -y && \
yum install -y python3 bash curl jq coreutils py3-pip which unzip shadow-utils && \
yum clean all && \
rm -rf /var/cache/yum
RUN amazon-linux-extras install -y epel postgresql14 && \
yum clean all && \
rm -rf /var/cache/yum
# Create non-root user
RUN useradd -l -s /bin/bash -U -u ${USERID} ${USERNAME}
USER ${USERNAME}
# Python dependencies
# hadolint ignore=DL3006,DL3013,DL3042
RUN pip3 install --upgrade pip && \
pip3 install --no-cache-dir boto3 detect-secrets==1.0.3 && \
pip3 cache purge
# Set Python PATH
ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
USER 0
# Install AWS CLI
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip && \
unzip -q awscliv2.zip && \
aws/install && \
rm -rf aws awscliv2.zip
# Keep Python2 for yum
RUN sed -i '1 s/python/python2.7/' /usr/bin/yum
# Set Python3
RUN rm /usr/bin/python && \
ln -s /usr/bin/python3 /usr/bin/python
# Set working directory
WORKDIR /prowler
# Copy all files
COPY . ./
# Set files ownership
RUN chown -R prowler .
USER ${USERNAME}
ENTRYPOINT ["./prowler"]

561
LICENSE
View File

@@ -1,360 +1,201 @@
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.
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 2018 Netflix, Inc.
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.

View File

@@ -0,0 +1,5 @@
```
./prowler -l # to see all available checks and their groups.
./prowler -L # to see all available groups only.
./prowler -l -g groupname # to see checks in a particular group
```

13
Pipfile Normal file
View File

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

1443
README.md

File diff suppressed because it is too large Load Diff

29
allowlist_example.txt Normal file
View File

@@ -0,0 +1,29 @@
# Each line is a (checkid:item) tuple
# Example: Will not consider a myignoredbucket failures as full failure. (Still printed as a warning)
check26:myignoredbucket
# Note that by default, this searches for the string appearing *anywhere* in the resource name.
# For example:
# extra718:ci-logs # Will block bucket "ci-logs" AND ALSO bucket "ci-logs-replica"
# extra718:logs # Will block EVERY BUCKET containing the string "logs"
# line starting with # are ignored as comments
# add a line per resource as here:
#<checkid1>:<resource to ignore 1>
#<checkid1>:<resource to ignore 2>
# checkid2
#<checkid2>:<resource to ignore 1>
# REGEXES
# This allowlist works with regexes (ERE, the same style of regex as grep -E and bash's =~ use)
# therefore:
# extra718:[[:alnum:]]+-logs # will ignore all buckets containing the terms ci-logs, qa-logs, etc.
# EXAMPLE: CONTROL TOWER
# When using Control Tower, guardrails prevent access to certain protected resources. The allowlist
# below ensures that warnings instead of errors are reported for the affected resources.
#extra734:aws-controltower-logs-[[:digit:]]+-[[:alpha:]\-]+
#extra734:aws-controltower-s3-access-logs-[[:digit:]]+-[[:alpha:]\-]+
#extra764:aws-controltower-logs-[[:digit:]]+-[[:alpha:]\-]+
#extra764:aws-controltower-s3-access-logs-[[:digit:]]+-[[:alpha:]\-]+

6
checklist.txt Normal file
View File

@@ -0,0 +1,6 @@
# You can add a comma seperated list of checks like this:
check11,check12
extra72 # You can also use newlines for each check
check13 # This way allows you to add inline comments
# Both of these can be combined if you have a standard list and want to add
# inline comments for other checks.

51
checks/check11 Normal file
View File

@@ -0,0 +1,51 @@
#!/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_check11="1.1"
CHECK_TITLE_check11="[check11] Avoid the use of the root account"
CHECK_SCORED_check11="SCORED"
CHECK_CIS_LEVEL_check11="LEVEL1"
CHECK_SEVERITY_check11="High"
CHECK_ASFF_TYPE_check11="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check101="check11"
CHECK_SERVICENAME_check11="iam"
CHECK_RISK_check11='The "root" account has unrestricted access to all resources in the AWS account. It is highly recommended that the use of this account be avoided.'
CHECK_REMEDIATION_check11='Follow the remediation instructions of the Ensure IAM policies are attached only to groups or roles recommendation.'
CHECK_DOC_check11='http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html'
CHECK_CAF_EPIC_check11='IAM'
check11(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks."
else
# "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 "$REGION: Root user in the account was last accessed ${MAX_DAYS#-} day ago" "$REGION" "root"
break
fi
fi
done
if [[ $failures == 0 ]]; then
textPass "$REGION: Root user in the account wasn't accessed in the last ${MAX_DAYS#-} days" "$REGION" "root"
fi
fi
}

39
checks/check110 Normal file
View File

@@ -0,0 +1,39 @@
#!/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_check110="1.10"
CHECK_TITLE_check110="[check110] Ensure IAM password policy prevents password reuse: 24 or greater"
CHECK_SCORED_check110="SCORED"
CHECK_CIS_LEVEL_check110="LEVEL1"
CHECK_SEVERITY_check110="Medium"
CHECK_ASFF_TYPE_check110="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check110="check110"
CHECK_SERVICENAME_check110="iam"
CHECK_RISK_check110='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check110='Ensure "Number of passwords to remember" is set to 24.'
CHECK_DOC_check110='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check110='IAM'
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 "$REGION: Password Policy limits reuse" "$REGION" "password policy"
else
textFail "$REGION: Password Policy has weak reuse requirement (lower than 24)" "$REGION" "password policy"
fi
else
textFail "$REGION: Password Policy missing reuse requirement" "$REGION" "password policy"
fi
}

39
checks/check111 Normal file
View File

@@ -0,0 +1,39 @@
#!/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_check111="1.11"
CHECK_TITLE_check111="[check111] Ensure IAM password policy expires passwords within 90 days or less"
CHECK_SCORED_check111="SCORED"
CHECK_CIS_LEVEL_check111="LEVEL1"
CHECK_SEVERITY_check111="Medium"
CHECK_ASFF_TYPE_check111="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check111="check111"
CHECK_SERVICENAME_check111="iam"
CHECK_RISK_check111='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check111='Ensure "Password expiration period (in days):" is set to 90 or less.'
CHECK_DOC_check111='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check111='IAM'
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 "$REGION: Password Policy includes expiration (Value: $COMMAND111)" "$REGION" "password policy"
else
textFail "$REGION: Password expiration is set greater than 90 days" "$REGION" "password policy"
fi
else
textFail "$REGION: Password expiration is not set" "$REGION" "password policy"
fi
}

42
checks/check112 Normal file
View File

@@ -0,0 +1,42 @@
#!/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_check112="1.12"
CHECK_TITLE_check112="[check112] Ensure no root account access key exists"
CHECK_SCORED_check112="SCORED"
CHECK_CIS_LEVEL_check112="LEVEL1"
CHECK_SEVERITY_check112="Critical"
CHECK_ASFF_TYPE_check112="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check112="check112"
CHECK_SERVICENAME_check112="iam"
CHECK_RISK_check112='The root account is the most privileged user in an AWS account. AWS Access Keys provide programmatic access to a given AWS account. It is recommended that all access keys associated with the root account be removed. Removing access keys associated with the root account limits vectors by which the account can be compromised. Removing the root access keys encourages the creation and use of role based accounts that are least privileged.'
CHECK_REMEDIATION_check112='Use the credential report to that the user and ensure the access_key_1_active and access_key_2_active fields are set to FALSE .'
CHECK_DOC_check112='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html'
CHECK_CAF_EPIC_check112='IAM'
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 "$REGION: No access key 1 found for root" "$REGION" "root access key1"
else
textFail "$REGION: Found access key 1 for root" "$REGION" "root access key1"
fi
if [ "$ROOTKEY2" == "false" ];then
textPass "$REGION: No access key 2 found for root" "$REGION" "root access key2"
else
textFail "$REGION: Found access key 2 for root" "$REGION" "root access key2"
fi
}

39
checks/check113 Normal file
View File

@@ -0,0 +1,39 @@
#!/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_check113="1.13"
CHECK_TITLE_check113="[check113] Ensure MFA is enabled for the root account"
CHECK_SCORED_check113="SCORED"
CHECK_CIS_LEVEL_check113="LEVEL1"
CHECK_SEVERITY_check113="Critical"
CHECK_ASFF_TYPE_check113="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check113="check113"
CHECK_SERVICENAME_check113="iam"
CHECK_RISK_check113='The root account is the most privileged user in an AWS account. MFA adds an extra layer of protection on top of a user name and password. With MFA enabled when a user signs in to an AWS website they will be prompted for their user name and password as well as for an authentication code from their AWS MFA device. When virtual MFA is used for root accounts it is recommended that the device used is NOT a personal device but rather a dedicated mobile device (tablet or phone) that is managed to be kept charged and secured independent of any individual personal devices. ("non-personal virtual MFA") This lessens the risks of losing access to the MFA due to device loss / trade-in or if the individual owning the device is no longer employed at the company.'
CHECK_REMEDIATION_check113='Using IAM console navigate to Dashboard and expand Activate MFA on your root account.'
CHECK_DOC_check113='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user_manage_mfa'
CHECK_CAF_EPIC_check113='IAM'
check113(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks."
else
# "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 "$REGION: Virtual MFA is enabled for root" "$REGION" "MFA"
else
textFail "$REGION: MFA is not ENABLED for root account" "$REGION" "MFA"
fi
fi
}

44
checks/check114 Normal file
View File

@@ -0,0 +1,44 @@
#!/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_check114="1.14"
CHECK_TITLE_check114="[check114] Ensure hardware MFA is enabled for the root account"
CHECK_SCORED_check114="SCORED"
CHECK_CIS_LEVEL_check114="LEVEL2"
CHECK_SEVERITY_check114="Critical"
CHECK_ASFF_TYPE_check114="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check114="check114"
CHECK_SERVICENAME_check114="iam"
CHECK_RISK_check114='The root account is the most privileged user in an AWS account. MFA adds an extra layer of protection on top of a user name and password. With MFA enabled when a user signs in to an AWS website they will be prompted for their user name and password as well as for an authentication code from their AWS MFA device. For Level 2 it is recommended that the root account be protected with a hardware MFA.'
CHECK_REMEDIATION_check114='Using IAM console navigate to Dashboard and expand Activate MFA on your root account.'
CHECK_DOC_check114='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user_manage_mfa'
CHECK_CAF_EPIC_check114='IAM'
check114(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks."
else
# "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_PARTITION}:iam::[0-9]\{12\}:mfa/root-account-mfa-device$")
if [[ "$COMMAND114" ]]; then
textFail "$REGION: Only Virtual MFA is enabled for root" "$REGION" "MFA"
else
textPass "$REGION: Hardware MFA is enabled for root" "$REGION" "MFA"
fi
else
textFail "$REGION: MFA is not ENABLED for root account" "$REGION" "MFA"
fi
fi
}

34
checks/check115 Normal file
View File

@@ -0,0 +1,34 @@
#!/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_check115="1.15"
CHECK_TITLE_check115="[check115] Ensure security questions are registered in the AWS account"
CHECK_SCORED_check115="NOT_SCORED"
CHECK_CIS_LEVEL_check115="LEVEL1"
CHECK_SEVERITY_check115="Medium"
CHECK_ASFF_TYPE_check115="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check115="check115"
CHECK_SERVICENAME_check115="support"
CHECK_RISK_check115='The AWS support portal allows account owners to establish security questions that can be used to authenticate individuals calling AWS customer service for support. It is recommended that security questions be established. When creating a new AWS account a default super user is automatically created. This account is referred to as the "root" account. It is recommended that the use of this account be limited and highly controlled. During events in which the root password is no longer accessible or the MFA token associated with root is lost/destroyed it is possible through authentication using secret questions and associated answers to recover root login access.'
CHECK_REMEDIATION_check115='Login as root account and from My Account configure Security questions.'
CHECK_DOC_check115='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys_retrieve.html'
CHECK_CAF_EPIC_check115='IAM'
check115(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks." "$REGION" "root"
else
# "Ensure security questions are registered in the AWS account (Not Scored)"
textInfo "${REGION}: No command available for check 1.15. Login to the AWS Console as root & click on the Account. Name -> My Account -> Configure Security Challenge Questions." "$REGION" "root"
fi
}

54
checks/check116 Normal file
View File

@@ -0,0 +1,54 @@
#!/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_check116="1.16"
CHECK_TITLE_check116="[check116] Ensure IAM policies are attached only to groups or roles"
CHECK_SCORED_check116="SCORED"
CHECK_CIS_LEVEL_check116="LEVEL1"
CHECK_SEVERITY_check116="Low"
CHECK_ASFF_TYPE_check116="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check116="AwsIamUser"
CHECK_ALTERNATE_check116="check116"
CHECK_ASFF_COMPLIANCE_TYPE_check116="ens-op.acc.3.aws.iam.1"
CHECK_SERVICENAME_check116="iam"
CHECK_RISK_check116='By default IAM users; groups; and roles have no access to AWS resources. IAM policies are the means by which privileges are granted to users; groups; or roles. It is recommended that IAM policies be applied directly to groups and roles but not users. Assigning privileges at the group or role level reduces the complexity of access management as the number of users grow. Reducing access management complexity may in-turn reduce opportunity for a principal to inadvertently receive or retain excessive privileges.'
CHECK_REMEDIATION_check116='Remove any policy attached directly to the user. Use groups or roles instead.'
CHECK_DOC_check116='https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html'
CHECK_CAF_EPIC_check116='IAM'
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)
if [[ "${LIST_USERS}" ]]
then
for user in $LIST_USERS;do
USER_ATTACHED_POLICY=$($AWSCLI iam list-attached-user-policies --output text $PROFILE_OPT --region $REGION --user-name $user)
USER_INLINE_POLICY=$($AWSCLI iam list-user-policies --output text $PROFILE_OPT --region $REGION --user-name $user)
if [[ $USER_ATTACHED_POLICY ]] || [[ $USER_INLINE_POLICY ]]
then
if [[ $USER_ATTACHED_POLICY ]]
then
textFail "$REGION: $user has managed policy directly attached" "$REGION" "$user"
fi
if [[ $USER_INLINE_POLICY ]]
then
textFail "$REGION: $user has inline policy directly attached" "$REGION" "$user"
fi
else
textPass "$REGION: No policies attached to user $user" "$REGION" "$user"
fi
done
else
textPass "$REGION: No users found" "$REGION" "No users found"
fi
}

43
checks/check117 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_check117="1.17"
CHECK_TITLE_check117="[check117] Maintain current contact details"
CHECK_SCORED_check117="SCORED"
CHECK_CIS_LEVEL_check117="LEVEL1"
CHECK_SEVERITY_check117="Medium"
CHECK_ASFF_TYPE_check117="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check117="check117"
CHECK_SERVICENAME_check117="support"
CHECK_RISK_check117='Ensure contact email and telephone details for AWS accounts are current and map to more than one individual in your organization. An AWS account supports a number of contact details; and AWS will use these to contact the account owner if activity judged to be in breach of Acceptable Use Policy. If an AWS account is observed to be behaving in a prohibited or suspicious manner; AWS will attempt to contact the account owner by email and phone using the contact details listed. If this is unsuccessful and the account behavior needs urgent mitigation; proactive measures may be taken; including throttling of traffic between the account exhibiting suspicious behavior and the AWS API endpoints and the Internet. This will result in impaired service to and from the account in question.'
CHECK_REMEDIATION_check117='Using the Billing and Cost Management console complete contact details.'
CHECK_DOC_check117='https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-account-payment.html#contact-info'
CHECK_CAF_EPIC_check117='IAM'
check117(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks." "${REGION}" "root"
else
# "Maintain current contact details (Scored)"
GET_CONTACT_DETAILS=$($AWSCLI account get-contact-information --output text $PROFILE_OPT --region "${REGION}" 2>&1)
if grep -E -q 'AccessDenied|UnauthorizedOperation|AuthorizationError' <<< "${GET_CONTACT_DETAILS}"; then
textInfo "${REGION}: Access Denied trying to get account contact information" "${REGION}"
else
if [[ ${GET_CONTACT_DETAILS} ]];then
textPass "${REGION}: Account has contact information. Perhaps check for freshness of these details." "${REGION}" "root"
else
textFail "${REGION}: Unable to get account contact details. See section 1.17 on the CIS Benchmark guide for details." "${REGION}" "root"
fi
fi
fi
}

43
checks/check118 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_check118="1.18"
CHECK_TITLE_check118="[check118] Ensure security contact information is registered"
CHECK_SCORED_check118="SCORED"
CHECK_CIS_LEVEL_check118="LEVEL1"
CHECK_SEVERITY_check118="Medium"
CHECK_ASFF_TYPE_check118="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check118="check118"
CHECK_SERVICENAME_check118="support"
CHECK_RISK_check118='AWS provides customers with the option of specifying the contact information for accounts security team. It is recommended that this information be provided. Specifying security-specific contact information will help ensure that security advisories sent by AWS reach the team in your organization that is best equipped to respond to them.'
CHECK_REMEDIATION_check118='Go to the My Account section and complete alternate contacts.'
CHECK_DOC_check118='https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-account-payment.html'
CHECK_CAF_EPIC_check118='IAM'
check118(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks." "${REGION}" "root"
else
# "Ensure security contact information is registered (Scored)"
GET_SECURITY_CONTACT_DETAILS=$("${AWSCLI}" account get-alternate-contact --alternate-contact-type SECURITY --output text ${PROFILE_OPT} --region "${REGION}" 2>&1)
if grep -E -q 'AccessDenied|UnauthorizedOperation|AuthorizationError' <<< "${GET_SECURITY_CONTACT_DETAILS}"; then
textInfo "${REGION}: Access Denied trying to get account contact information" "${REGION}"
else
if grep "SECURITY" <<< "${GET_SECURITY_CONTACT_DETAILS}"; then
textPass "${REGION}: Account has security contact information. Perhaps check for freshness of these details." "${REGION}" "root"
else
textFail "${REGION}: Account has not security contact information, or it was unable to capture. See section 1.18 on the CIS Benchmark guide for details." "${REGION}" "root"
fi
fi
fi
}

54
checks/check119 Normal file
View File

@@ -0,0 +1,54 @@
#!/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_check119="1.19"
CHECK_TITLE_check119="[check119] Ensure IAM instance roles are used for AWS resource access from instances"
CHECK_SCORED_check119="NOT_SCORED"
CHECK_CIS_LEVEL_check119="LEVEL2"
CHECK_SEVERITY_check119="Medium"
CHECK_ASFF_TYPE_check119="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check119="AwsEc2Instance"
CHECK_ALTERNATE_check119="check119"
CHECK_SERVICENAME_check119="ec2"
CHECK_RISK_check119='AWS access from within AWS instances can be done by either encoding AWS keys into AWS API calls or by assigning the instance to a role which has an appropriate permissions policy for the required access. AWS IAM roles reduce the risks associated with sharing and rotating credentials that can be used outside of AWS itself. If credentials are compromised; they can be used from outside of the AWS account.'
CHECK_REMEDIATION_check119='Create an IAM instance role if necessary and attach it to the corresponding EC2 instance.'
CHECK_DOC_check119='http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html'
CHECK_CAF_EPIC_check119='IAM'
check119(){
for regx in $REGIONS; do
EC2_DATA=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[].Instances[].[InstanceId, IamInstanceProfile.Arn, State.Name]' --output json 2>&1)
if [[ $(echo "$EC2_DATA" | grep UnauthorizedOperation) ]]; then
textInfo "$regx: Unauthorized Operation error trying to describe instances" "$regx"
continue
else
EC2_DATA=$(echo $EC2_DATA | jq '.[]|{InstanceId: .[0], ProfileArn: .[1], StateName: .[2]}')
INSTANCE_LIST=$(echo $EC2_DATA | jq -r '.InstanceId')
fi
if [[ $INSTANCE_LIST ]]; then
for instance in $INSTANCE_LIST; do
STATE_NAME=$(echo $EC2_DATA | jq -r --arg i "$instance" 'select(.InstanceId==$i)|.StateName')
if [[ $STATE_NAME != "terminated" && $STATE_NAME != "shutting-down" ]]; then
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" "$instance"
else
textPass "$regx: Instance $instance associated with role ${PROFILEARN##*/}" "$regx" "$instance"
fi
fi
done
else
textInfo "$regx: No EC2 instances found" "$regx" "$instance"
fi
done
}

44
checks/check12 Normal file
View File

@@ -0,0 +1,44 @@
#!/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_check12="1.2"
CHECK_TITLE_check12="[check12] Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password"
CHECK_SCORED_check12="SCORED"
CHECK_CIS_LEVEL_check12="LEVEL1"
CHECK_SEVERITY_check12="High"
CHECK_ASFF_TYPE_check12="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check12="AwsIamUser"
CHECK_ALTERNATE_check102="check12"
CHECK_ASFF_COMPLIANCE_TYPE_check12="ens-op.acc.5.aws.iam.1"
CHECK_SERVICENAME_check12="iam"
CHECK_RISK_check12='Unauthorized access to this critical account if password is not secure or it is disclosed in any way.'
CHECK_REMEDIATION_check12='Enable MFA for all IAM users that have a console password. MFA is a simple best practice that adds an extra layer of protection on top of your user name and password. Recommended to use hardware keys over virtual MFA.'
CHECK_DOC_check12='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_enable_virtual.html'
CHECK_CAF_EPIC_check12='IAM'
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 "$REGION: User $u has Password enabled but MFA disabled" "$REGION" "$u"
done
else
textPass "$REGION: No users found with Password enabled and MFA disabled" "$REGION" "$u"
fi
}

49
checks/check120 Normal file
View File

@@ -0,0 +1,49 @@
#!/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_check120="1.20"
CHECK_TITLE_check120="[check120] Ensure a support role has been created to manage incidents with AWS Support"
CHECK_SCORED_check120="SCORED"
CHECK_CIS_LEVEL_check120="LEVEL1"
CHECK_SEVERITY_check120="Medium"
CHECK_ASFF_TYPE_check120="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check120="AwsIamRole"
CHECK_ALTERNATE_check120="check120"
CHECK_ASFF_COMPLIANCE_TYPE_check120="ens-op.acc.1.aws.iam.4"
CHECK_SERVICENAME_check120="iam"
CHECK_RISK_check120='AWS provides a support center that can be used for incident notification and response; as well as technical support and customer services. Create an IAM Role to allow authorized users to manage incidents with AWS Support.'
CHECK_REMEDIATION_check120='Create an IAM role for managing incidents with AWS.'
CHECK_DOC_check120='https://docs.aws.amazon.com/awssupport/latest/user/accessing-support.html'
CHECK_CAF_EPIC_check120='IAM'
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 $policyarn $PROFILE_OPT --region $REGION --output text | awk -F$'\t' '{ print $3 }')
if [[ $POLICYROLES ]];then
for name in $POLICYROLES; do
textPass "$REGION: Support Policy attached to $name" "$REGION" "$name"
done
# for user in $(echo "$POLICYUSERS" | grep UserName | cut -d'"' -f4) ; do
# textInfo "User $user has support access via $policyarn"
# done
else
textFail "$REGION: Support Policy not applied to any Role" "$REGION" "$name"
fi
done
else
textFail "$REGION: No Support Policy found" "$REGION" "$name"
fi
}

54
checks/check121 Normal file
View File

@@ -0,0 +1,54 @@
#!/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_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"
CHECK_SCORED_check121="NOT_SCORED"
CHECK_CIS_LEVEL_check121="LEVEL1"
CHECK_SEVERITY_check121="Medium"
CHECK_ASFF_TYPE_check121="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check121="AwsIamUser"
CHECK_ALTERNATE_check121="check121"
CHECK_ASFF_COMPLIANCE_TYPE_check121="ens-op.acc.1.aws.iam.5"
CHECK_SERVICENAME_check121="iam"
CHECK_RISK_check121='AWS console defaults the checkbox for creating access keys to enabled. This results in many access keys being generated unnecessarily. In addition to unnecessary credentials; it also generates unnecessary management work in auditing and rotating these keys. Requiring that additional steps be taken by the user after their profile has been created will give a stronger indication of intent that access keys are (a) necessary for their work and (b) once the access key is established on an account that the keys may be in use somewhere in the organization.'
CHECK_REMEDIATION_check121='From the IAM console: generate credential report and disable not required keys.'
CHECK_DOC_check121='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html'
CHECK_CAF_EPIC_check121='IAM'
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 of USERS with KEY1 active, last_used_date as N/A and have a console password
LIST_USERS_KEY1_ACTIVE=$(for user in $LIST_USERS_KEY1_NA; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$4,$9 }'|grep "true true$"|awk '{ print $1 }'|sed 's/[[:blank:]]+/,/g' ; done)
if [[ $LIST_USERS_KEY1_ACTIVE ]]; then
for user in $LIST_USERS_KEY1_ACTIVE; do
textFail "$REGION: User $user has never used access key 1" "$REGION" "$user"
done
else
textPass "$REGION: No users found with access key 1 never used" "$REGION" "$user"
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 of USERS with KEY2 active, last_used_date as N/A and have a console password
LIST_USERS_KEY2_ACTIVE=$(for user in $LIST_USERS_KEY2_NA; do grep "^${user}," $TEMP_REPORT_FILE|awk -F, '{ print $1,$4,$14 }'|grep "true true$" |awk '{ print $1 }' ; done)
if [[ $LIST_USERS_KEY2_ACTIVE ]]; then
for user in $LIST_USERS_KEY2_ACTIVE; do
textFail "$REGION: User $user has never used access key 2" "$REGION" "$user"
done
else
textPass "$REGION: No users found with access key 2 never used" "$REGION" "$user"
fi
}

50
checks/check122 Normal file
View File

@@ -0,0 +1,50 @@
#!/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_check122="1.22"
CHECK_TITLE_check122="[check122] Ensure IAM policies that allow full \"*:*\" administrative privileges are not created"
CHECK_SCORED_check122="SCORED"
CHECK_CIS_LEVEL_check122="LEVEL1"
CHECK_SEVERITY_check122="Medium"
CHECK_ASFF_TYPE_check122="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check122="AwsIamPolicy"
CHECK_ALTERNATE_check122="check122"
CHECK_SERVICENAME_check122="iam"
CHECK_RISK_check122='IAM policies are the means by which privileges are granted to users; groups; or roles. It is recommended and considered a standard security advice to grant least privilege—that is; granting only the permissions required to perform a task. Determine what users need to do and then craft policies for them that let the users perform only those tasks instead of allowing full administrative privileges. Providing full administrative privileges instead of restricting to the minimum set of permissions that the user is required to do exposes the resources to potentially unwanted actions.'
CHECK_REMEDIATION_check122='It is more secure to start with a minimum set of permissions and grant additional permissions as necessary; rather than starting with permissions that are too lenient and then trying to tighten them later. List policies an analyze if permissions are the least possible to conduct business activities.'
CHECK_DOC_check122='http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html'
CHECK_CAF_EPIC_check122='IAM'
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
for policy in $LIST_CUSTOM_POLICIES; do
POLICY_ARN=$(awk 'BEGIN{FS=OFS=","}{NF--; print}' <<< "${policy}")
POLICY_VERSION=$(awk -F ',' '{print $(NF)}' <<< "${policy}")
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"
else
textPass "$REGION: Policy ${policy//,/[comma]} that does not allow full \"*:*\" administrative privileges" "${REGION}" "${policy}"
fi
done
if [[ $POLICIES_ALLOW_LIST ]]; then
for policy in $POLICIES_ALLOW_LIST; do
textFail "$REGION: Policy ${policy//,/[comma]} allows \"*:*\"" "${REGION}" "${policy}"
done
fi
else
textPass "$REGION: No custom policies found" "$REGION"
fi
}

31
checks/check13 Normal file
View File

@@ -0,0 +1,31 @@
#!/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_check13="1.3"
CHECK_TITLE_check13="[check13] Ensure credentials unused for 90 days or greater are disabled"
CHECK_SCORED_check13="SCORED"
CHECK_CIS_LEVEL_check13="LEVEL1"
CHECK_SEVERITY_check13="Medium"
CHECK_ASFF_TYPE_check13="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check13="AwsIamUser"
CHECK_ALTERNATE_check103="check13"
CHECK_ASFF_COMPLIANCE_TYPE_check13="ens-op.acc.1.aws.iam.3 ens-op.acc.5.aws.iam.4"
CHECK_SERVICENAME_check13="iam"
CHECK_RISK_check13='AWS IAM users can access AWS resources using different types of credentials (passwords or access keys). It is recommended that all credentials that have been unused in 90 or greater days be removed or deactivated.'
CHECK_REMEDIATION_check13='Use the credential report to ensure password_last_changed is less than 90 days ago.'
CHECK_DOC_check13='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html'
CHECK_CAF_EPIC_check13='IAM'
check13(){
check_creds_used_in_last_days 90
}

71
checks/check14 Normal file
View File

@@ -0,0 +1,71 @@
#!/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_check14="1.4"
CHECK_TITLE_check14="[check14] Ensure access keys are rotated every 90 days or less"
CHECK_SCORED_check14="SCORED"
CHECK_CIS_LEVEL_check14="LEVEL1"
CHECK_SEVERITY_check14="Medium"
CHECK_ASFF_TYPE_check14="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check14="AwsIamUser"
CHECK_ALTERNATE_check104="check14"
CHECK_ASFF_COMPLIANCE_TYPE_check14="ens-op.acc.1.aws.iam.4 ens-op.acc.5.aws.iam.3"
CHECK_SERVICENAME_check14="iam"
CHECK_RISK_check14='Access keys consist of an access key ID and secret access key which are used to sign programmatic requests that you make to AWS. AWS users need their own access keys to make programmatic calls to AWS from the AWS Command Line Interface (AWS CLI)- Tools for Windows PowerShell- the AWS SDKs- or direct HTTP calls using the APIs for individual AWS services. It is recommended that all access keys be regularly rotated.'
CHECK_REMEDIATION_check14='Use the credential report to ensure access_key_X_last_rotated is less than 90 days ago.'
CHECK_DOC_check14='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html'
CHECK_CAF_EPIC_check14='IAM'
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 "$REGION: $user has not rotated access key 1 in over 90 days" "$REGION" "$user"
C14_NUM_USERS1=$(expr $C14_NUM_USERS1 + 1)
fi
done
if [[ $C14_NUM_USERS1 -eq 0 ]]; then
textPass "$REGION: No users with access key 1 older than 90 days" "$REGION" "$user"
fi
else
textPass "$REGION: No users with access key 1" "$REGION" "$user"
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 "$REGION: $user has not rotated access key 2 in over 90 days" "$REGION" "$user"
C14_NUM_USERS2=$(expr $C14_NUM_USERS2 + 1)
fi
done
if [[ $C14_NUM_USERS2 -eq 0 ]]; then
textPass "$REGION: No users with access key 2 older than 90 days" "$REGION" "$user"
fi
else
textPass "$REGION: No users with access key 2" "$REGION" "$user"
fi
}

35
checks/check15 Normal file
View File

@@ -0,0 +1,35 @@
#!/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_check15="1.5"
CHECK_TITLE_check15="[check15] Ensure IAM password policy requires at least one uppercase letter"
CHECK_SCORED_check15="SCORED"
CHECK_CIS_LEVEL_check15="LEVEL1"
CHECK_SEVERITY_check15="Medium"
CHECK_ASFF_TYPE_check15="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check105="check15"
CHECK_SERVICENAME_check15="iam"
CHECK_RISK_check15='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check15='Ensure "Requires at least one uppercase letter" is checked under "Password Policy".'
CHECK_DOC_check15='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check15='IAM'
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 "$REGION: Password Policy requires upper case" "$REGION" "password policy"
else
textFail "$REGION: Password Policy missing upper-case requirement" "$REGION" "password policy"
fi
}

35
checks/check16 Normal file
View File

@@ -0,0 +1,35 @@
#!/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_check16="1.6"
CHECK_TITLE_check16="[check16] Ensure IAM password policy require at least one lowercase letter"
CHECK_SCORED_check16="SCORED"
CHECK_CIS_LEVEL_check16="LEVEL1"
CHECK_SEVERITY_check16="Medium"
CHECK_ASFF_TYPE_check16="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check106="check16"
CHECK_SERVICENAME_check16="iam"
CHECK_RISK_check16='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check16='Ensure "Requires at least one lowercase letter" is checked under "Password Policy".'
CHECK_DOC_check16='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check16='IAM'
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 "$REGION: Password Policy requires lower case" "$REGION" "password policy"
else
textFail "$REGION: Password Policy missing lower-case requirement" "$REGION" "password policy"
fi
}

35
checks/check17 Normal file
View File

@@ -0,0 +1,35 @@
#!/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_check17="1.7"
CHECK_TITLE_check17="[check17] Ensure IAM password policy require at least one symbol"
CHECK_SCORED_check17="SCORED"
CHECK_CIS_LEVEL_check17="LEVEL1"
CHECK_SEVERITY_check17="Medium"
CHECK_ASFF_TYPE_check17="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check107="check17"
CHECK_SERVICENAME_check17="iam"
CHECK_RISK_check17='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check17='Ensure "Require at least one non-alphanumeric character" is checked under "Password Policy".'
CHECK_DOC_check17='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check17='IAM'
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 "$REGION: Password Policy requires symbol" "$REGION" "password policy"
else
textFail "$REGION: Password Policy missing symbol requirement" "$REGION" "password policy"
fi
}

35
checks/check18 Normal file
View File

@@ -0,0 +1,35 @@
#!/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_check18="1.8"
CHECK_TITLE_check18="[check18] Ensure IAM password policy require at least one number"
CHECK_SCORED_check18="SCORED"
CHECK_CIS_LEVEL_check18="LEVEL1"
CHECK_SEVERITY_check18="Medium"
CHECK_ASFF_TYPE_check18="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check108="check18"
CHECK_SERVICENAME_check18="iam"
CHECK_RISK_check18='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check18='Ensure "Require at least one number " is checked under "Password Policy".'
CHECK_DOC_check18='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check18='IAM'
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 "$REGION: Password Policy requires number" "$REGION" "password policy"
else
textFail "$REGION: Password Policy missing number requirement" "$REGION" "password policy"
fi
}

35
checks/check19 Normal file
View File

@@ -0,0 +1,35 @@
#!/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_check19="1.9"
CHECK_TITLE_check19="[check19] Ensure IAM password policy requires minimum length of 14 or greater"
CHECK_SCORED_check19="SCORED"
CHECK_CIS_LEVEL_check19="LEVEL1"
CHECK_SEVERITY_check19="Medium"
CHECK_ASFF_TYPE_check19="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check109="check19"
CHECK_SERVICENAME_check19="iam"
CHECK_RISK_check19='Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure password are comprised of different character sets. It is recommended that the password policy require at least one uppercase letter.'
CHECK_REMEDIATION_check19='Ensure "Minimum password length" is set to 14 or greater.'
CHECK_DOC_check19='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html'
CHECK_CAF_EPIC_check19='IAM'
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 "$REGION: Password Policy requires more than 13 characters" "$REGION" "password policy"
else
textFail "$REGION: Password Policy missing or weak length requirement" "$REGION" "password policy"
fi
}

66
checks/check21 Normal file
View File

@@ -0,0 +1,66 @@
#!/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_check21="2.1"
CHECK_TITLE_check21="[check21] Ensure CloudTrail is enabled in all regions"
CHECK_SCORED_check21="SCORED"
CHECK_CIS_LEVEL_check21="LEVEL1"
CHECK_SEVERITY_check21="High"
CHECK_ASFF_TYPE_check21="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check21="AwsCloudTrailTrail"
CHECK_ALTERNATE_check201="check21"
CHECK_ASFF_COMPLIANCE_TYPE_check21="ens-op.acc.7.aws.iam.1 ens-op.mon.1.aws.trail.1"
CHECK_SERVICENAME_check21="cloudtrail"
CHECK_RISK_check21='AWS CloudTrail is a web service that records AWS API calls for your account and delivers log files to you. The recorded information includes the identity of the API caller; the time of the API call; the source IP address of the API caller; the request parameters; and the response elements returned by the AWS service.'
CHECK_REMEDIATION_check21='Ensure Logging is set to ON on all regions (even if they are not being used at the moment.'
CHECK_DOC_check21='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrailconcepts.html#cloudtrail-concepts-management-events'
CHECK_CAF_EPIC_check21='Logging and Monitoring'
check21(){
for regx in $REGIONS; do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion, Multiregion:IsMultiRegionTrail, ARN:TrailARN}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_ARN TRAIL_HOME_REGION IS_MULTIREGION TRAIL_NAME
do
TRAIL_ON_OFF_STATUS=$(${AWSCLI} cloudtrail get-trail-status ${PROFILE_OPT} --region ${regx} --name ${TRAIL_ARN} --query IsLogging --output text)
if [[ "$TRAIL_ON_OFF_STATUS" == "False" ]]
then
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textFail "$regx: Trail ${TRAIL_NAME} is multiregion configured from region "${TRAIL_HOME_REGION}" but it is not logging" "${regx}" "${TRAIL_NAME}"
else
textFail "$regx: Trail ${TRAIL_NAME} is not a multiregion trail and it is not logging" "${regx}" "${TRAIL_NAME}"
fi
elif [[ "$TRAIL_ON_OFF_STATUS" == "True" ]]
then
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textPass "$regx: Trail ${TRAIL_NAME} is multiregion configured from region "${TRAIL_HOME_REGION}" and it is logging" "${regx}" "${TRAIL_NAME}"
else
textFail "$regx: Trail ${TRAIL_NAME} is not a multiregion trail and it is logging" "${regx}" "${TRAIL_NAME}"
fi
fi
done <<< "${REGION_TRAIL}"
done
else
textFail "$regx: No CloudTrail trails were found for the region" "${regx}" "No trails found"
fi
done
}

66
checks/check22 Normal file
View File

@@ -0,0 +1,66 @@
#!/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_check22="2.2"
CHECK_TITLE_check22="[check22] Ensure CloudTrail log file validation is enabled"
CHECK_SCORED_check22="SCORED"
CHECK_CIS_LEVEL_check22="LEVEL2"
CHECK_SEVERITY_check22="Medium"
CHECK_ASFF_TYPE_check22="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check22="AwsCloudTrailTrail"
CHECK_ALTERNATE_check202="check22"
CHECK_ASFF_COMPLIANCE_TYPE_check22="ens-op.exp.10.aws.trail.1"
CHECK_SERVICENAME_check22="cloudtrail"
CHECK_RISK_check22='Enabling log file validation will provide additional integrity checking of CloudTrail logs. '
CHECK_REMEDIATION_check22='Ensure LogFileValidationEnabled is set to true for each trail.'
CHECK_DOC_check22='http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-filevalidation-enabling.html'
CHECK_CAF_EPIC_check22='Logging and Monitoring'
check22(){
for regx in $REGIONS
do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion, Multiregion:IsMultiRegionTrail, LogFileValidation:LogFileValidationEnabled}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_HOME_REGION LOG_FILE_VALIDATION IS_MULTIREGION TRAIL_NAME
do
if [[ "${LOG_FILE_VALIDATION}" == "True" ]]
then
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textPass "$regx: Multiregion trail ${TRAIL_NAME} configured from region ${TRAIL_HOME_REGION} log file validation enabled" "$regx" "$TRAIL_NAME"
else
textPass "$regx: Single region trail ${TRAIL_NAME} log file validation enabled" "$regx" "$TRAIL_NAME"
fi
else
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textFail "$regx: Multiregion trail ${TRAIL_NAME} configured from region ${TRAIL_HOME_REGION} log file validation disabled" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Single region trail ${TRAIL_NAME} log file validation disabled" "$regx" "$TRAIL_NAME"
fi
fi
done <<< "${REGION_TRAIL}"
done
else
textPass "$regx: No trails found in the region" "$regx"
fi
done
}

92
checks/check23 Normal file
View File

@@ -0,0 +1,92 @@
#!/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_check23="2.3"
CHECK_TITLE_check23="[check23] Ensure the S3 bucket CloudTrail logs to is not publicly accessible"
CHECK_SCORED_check23="SCORED"
CHECK_CIS_LEVEL_check23="LEVEL1"
CHECK_SEVERITY_check23="Critical"
CHECK_ASFF_TYPE_check23="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check23="AwsS3Bucket"
CHECK_ALTERNATE_check203="check23"
CHECK_ASFF_COMPLIANCE_TYPE_check23="ens-op.exp.10.aws.trail.3 ens-op.exp.10.aws.trail.4"
CHECK_SERVICENAME_check23="cloudtrail"
CHECK_RISK_check23='Allowing public access to CloudTrail log content may aid an adversary in identifying weaknesses in the affected accounts use or configuration.'
CHECK_REMEDIATION_check23='Analyze Bucket policy to validate appropriate permissions. Ensure the AllUsers principal is not granted privileges. Ensure the AuthenticatedUsers principal is not granted privileges.'
CHECK_DOC_check23='https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html'
CHECK_CAF_EPIC_check23='Logging and Monitoring'
check23(){
for regx in $REGIONS
do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion, Multiregion:IsMultiRegionTrail, BucketName:S3BucketName}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_BUCKET TRAIL_HOME_REGION IS_MULTIREGION TRAIL_NAME
do
if [[ ! "${TRAIL_BUCKET}" ]]
then
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textFail "$regx: Multiregion trail ${TRAIL_NAME} configured from region ${TRAIL_HOME_REGION} does not publish to S3" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Single region trail ${TRAIL_NAME} does not publish to S3" "$regx" "$TRAIL_NAME"
fi
continue
fi
BUCKET_LOCATION=$($AWSCLI s3api get-bucket-location $PROFILE_OPT --region $regx --bucket $TRAIL_BUCKET --output text 2>&1)
if [[ $(echo "$BUCKET_LOCATION" | grep AccessDenied) ]]
then
textInfo "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} Access Denied getting bucket location for bucket $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
continue
fi
if [[ $(echo "$BUCKET_LOCATION" | grep NoSuchBucket) ]]
then
textInfo "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} S3 logging bucket $TRAIL_BUCKET does not exist" "$regx" "$TRAIL_NAME"
continue
fi
if [[ $BUCKET_LOCATION == "None" ]]; then
BUCKET_LOCATION="us-east-1"
fi
if [[ $BUCKET_LOCATION == "EU" ]]; then
BUCKET_LOCATION="eu-west-1"
fi
CLOUDTRAILBUCKET_HASALLPERMISIONS=$($AWSCLI s3api get-bucket-acl --bucket $TRAIL_BUCKET $PROFILE_OPT --region $BUCKET_LOCATION --query 'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers`]' --output text 2>&1)
if [[ $(echo "$CLOUDTRAILBUCKET_HASALLPERMISIONS" | grep AccessDenied) ]]; then
textInfo "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} Access Denied getting bucket acl for bucket $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
continue
fi
if [[ ! $CLOUDTRAILBUCKET_HASALLPERMISIONS ]]; then
textPass "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} S3 logging bucket $TRAIL_BUCKET is not publicly accessible" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} S3 logging bucket $TRAIL_BUCKET is publicly accessible" "$regx" "$TRAIL_NAME"
fi
done <<< "${REGION_TRAIL}"
done
else
textPass "$regx: No trails found in the region" "$regx"
fi
done
}

60
checks/check24 Normal file
View File

@@ -0,0 +1,60 @@
#!/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_check24="2.4"
CHECK_TITLE_check24="[check24] Ensure CloudTrail trails are integrated with CloudWatch Logs"
CHECK_SCORED_check24="SCORED"
CHECK_CIS_LEVEL_check24="LEVEL1"
CHECK_SEVERITY_check24="Low"
CHECK_ASFF_TYPE_check24="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check24="AwsCloudTrailTrail"
CHECK_ALTERNATE_check204="check24"
CHECK_ASFF_COMPLIANCE_TYPE_check24="ens-op.exp.8.aws.cw.1"
CHECK_SERVICENAME_check24="cloudtrail"
CHECK_RISK_check24='Sending CloudTrail logs to CloudWatch Logs will facilitate real-time and historic activity logging based on user; API; resource; and IP address; and provides opportunity to establish alarms and notifications for anomalous or sensitivity account activity.'
CHECK_REMEDIATION_check24='Validate that the trails in CloudTrail has an arn set in the CloudWatchLogsLogGroupArn property.'
CHECK_DOC_check24='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/send-cloudtrail-events-to-cloudwatch-logs.html'
CHECK_CAF_EPIC_check24='Logging and Monitoring'
check24(){
for regx in $REGIONS; do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion, ARN:TrailARN}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_ARN TRAIL_HOME_REGION TRAIL_NAME
do
LATESTDELIVERY_TIMESTAMP=$(${AWSCLI} cloudtrail get-trail-status ${PROFILE_OPT} --region ${regx} --name ${TRAIL_ARN} --query LatestCloudWatchLogsDeliveryTime --output text|grep -v None)
if [[ ! $LATESTDELIVERY_TIMESTAMP ]];then
textFail "$regx: $TRAIL_NAME trail is not logging in the last 24h or not configured (its home region is $TRAIL_HOME_REGION)" "$regx" "$trail"
else
LATESTDELIVERY_DATE=$(timestamp_to_date $LATESTDELIVERY_TIMESTAMP)
HOWOLDER=$(how_older_from_today $LATESTDELIVERY_DATE)
if [ $HOWOLDER -gt "1" ];then
textFail "$regx: $TRAIL_NAME trail is not logging in the last 24h or not configured" "$regx" "$TRAIL_NAME"
else
textPass "$regx: $TRAIL_NAME trail has been logging during the last 24h" "$regx" "$TRAIL_NAME"
fi
fi
done <<< "${REGION_TRAIL}"
done
else
textFail "$regx: No CloudTrail trails were found for the region" "${regx}" "No trails found"
fi
done
}

47
checks/check25 Normal file
View File

@@ -0,0 +1,47 @@
#!/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_check25="2.5"
CHECK_TITLE_check25="[check25] Ensure AWS Config is enabled in all regions"
CHECK_SCORED_check25="SCORED"
CHECK_CIS_LEVEL_check25="LEVEL1"
CHECK_SEVERITY_check25="Medium"
CHECK_ASFF_TYPE_check25="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ALTERNATE_check205="check25"
CHECK_ASFF_COMPLIANCE_TYPE_check25="ens-op.exp.1.aws.cfg.1"
CHECK_SERVICENAME_check25="configservice"
CHECK_RISK_check25='The AWS configuration item history captured by AWS Config enables security analysis; resource change tracking; and compliance auditing.'
CHECK_REMEDIATION_check25='It is recommended to enable AWS Config be enabled in all regions.'
CHECK_DOC_check25='https://aws.amazon.com/blogs/mt/aws-config-best-practices/'
CHECK_CAF_EPIC_check25='Logging and Monitoring'
check25(){
# "Ensure AWS Config is enabled in all regions (Scored)"
for regx in $REGIONS; do
CHECK_AWSCONFIG_RECORDING=$($AWSCLI configservice describe-configuration-recorder-status $PROFILE_OPT --region $regx --query 'ConfigurationRecordersStatus[*].recording' --output text 2>&1)
CHECK_AWSCONFIG_STATUS=$($AWSCLI configservice describe-configuration-recorder-status $PROFILE_OPT --region $regx --query 'ConfigurationRecordersStatus[*].lastStatus' --output text 2>&1)
if [[ $(echo "$CHECK_AWSCONFIG_STATUS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe configuration recorder status" "$regx" "recorder"
continue
fi
if [[ $CHECK_AWSCONFIG_RECORDING == "True" ]]; then
if [[ $CHECK_AWSCONFIG_STATUS == "SUCCESS" ]]; then
textPass "$regx: AWS Config recorder enabled" "$regx" "recorder"
else
textFail "$regx: AWS Config recorder in failure state" "$regx" "recorder"
fi
else
textFail "$regx: AWS Config recorder disabled" "$regx" "recorder"
fi
done
}

87
checks/check26 Normal file
View File

@@ -0,0 +1,87 @@
#!/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_check26="2.6"
CHECK_TITLE_check26="[check26] Ensure S3 bucket access logging is enabled on the CloudTrail S3 bucket"
CHECK_SCORED_check26="SCORED"
CHECK_CIS_LEVEL_check26="LEVEL1"
CHECK_SEVERITY_check26="Medium"
CHECK_ASFF_TYPE_check26="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check26="AwsS3Bucket"
CHECK_ALTERNATE_check206="check26"
CHECK_SERVICENAME_check26="s3"
CHECK_RISK_check26='Server access logs can assist you in security and access audits; help you learn about your customer base; and understand your Amazon S3 bill.'
CHECK_REMEDIATION_check26='Ensure that S3 buckets have Logging enabled. CloudTrail data events can be used in place of S3 bucket logging. If that is the case; this finding can be considered a false positive.'
CHECK_DOC_check26='https://docs.aws.amazon.com/AmazonS3/latest/dev/security-best-practices.html'
CHECK_CAF_EPIC_check26='Logging and Monitoring'
check26(){
for regx in $REGIONS
do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, HomeRegion:HomeRegion, Multiregion:IsMultiRegionTrail, BucketName:S3BucketName}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_BUCKET TRAIL_HOME_REGION IS_MULTIREGION TRAIL_NAME
do
if [[ ! "${TRAIL_BUCKET}" ]]
then
if [[ "${IS_MULTIREGION}" == "True" ]]
then
textFail "$regx: Multiregion trail ${TRAIL_NAME} configured from region ${TRAIL_HOME_REGION} does not publish to S3" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Single region trail ${TRAIL_NAME} does not publish to S3" "$regx" "$TRAIL_NAME"
fi
continue
fi
BUCKET_LOCATION=$($AWSCLI s3api get-bucket-location $PROFILE_OPT --region $regx --bucket $TRAIL_BUCKET --output text 2>&1)
if [[ $(echo "$BUCKET_LOCATION" | grep AccessDenied) ]]
then
textInfo "$regx: Trail ${TRAIL_NAME} with home region ${TRAIL_HOME_REGION} Access Denied getting bucket location for bucket $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
continue
fi
if [[ $BUCKET_LOCATION == "None" ]]; then
BUCKET_LOCATION="us-east-1"
fi
if [[ $BUCKET_LOCATION == "EU" ]]; then
BUCKET_LOCATION="eu-west-1"
fi
CLOUDTRAILBUCKET_LOGENABLED=$($AWSCLI s3api get-bucket-logging --bucket $TRAIL_BUCKET $PROFILE_OPT --region $BUCKET_LOCATION --query 'LoggingEnabled.TargetBucket' --output text 2>&1)
if [[ $(echo "$CLOUDTRAILBUCKET_LOGENABLED" | grep AccessDenied) ]]; then
textInfo "$regx: Trail $TRAIL_NAME Access Denied getting bucket logging for $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
continue
fi
if [[ $CLOUDTRAILBUCKET_LOGENABLED != "None" ]]; then
textPass "$regx: Trail $TRAIL_NAME S3 bucket access logging is enabled for $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Trail $TRAIL_NAME S3 bucket access logging is not enabled for $TRAIL_BUCKET" "$regx" "$TRAIL_NAME"
fi
done <<< "${REGION_TRAIL}"
done
else
textPass "$regx: No trails found in the region" "$regx"
fi
done
}

54
checks/check27 Normal file
View File

@@ -0,0 +1,54 @@
#!/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_check27="2.7"
CHECK_TITLE_check27="[check27] Ensure CloudTrail logs are encrypted at rest using KMS CMKs"
CHECK_SCORED_check27="SCORED"
CHECK_CIS_LEVEL_check27="LEVEL2"
CHECK_SEVERITY_check27="Medium"
CHECK_ASFF_TYPE_check27="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check27="AwsCloudTrailTrail"
CHECK_ALTERNATE_check207="check27"
CHECK_ASFF_COMPLIANCE_TYPE_check27="ens-op.exp.10.aws.trail.5"
CHECK_SERVICENAME_check27="cloudtrail"
CHECK_RISK_check27='By default; the log files delivered by CloudTrail to your bucket are encrypted by Amazon server-side encryption with Amazon S3-managed encryption keys (SSE-S3). To provide a security layer that is directly manageable; you can instead use server-side encryption with AWS KMSmanaged keys (SSE-KMS) for your CloudTrail log files.'
CHECK_REMEDIATION_check27='This approach has the following advantages: You can create and manage the CMK encryption keys yourself. You can use a single CMK to encrypt and decrypt log files for multiple accounts across all regions. You have control over who can use your key for encrypting and decrypting CloudTrail log files. You can assign permissions for the key to the users. You have enhanced security.'
CHECK_DOC_check27='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html'
CHECK_CAF_EPIC_check27='Logging and Monitoring'
check27(){
for regx in $REGIONS; do
TRAILS_DETAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $regx --query 'trailList[*].{Name:Name, KeyID:KmsKeyId}' --output text 2>&1)
if [[ $(echo "$TRAILS_DETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to describe trails" "$regx"
continue
fi
if [[ $TRAILS_DETAILS ]]
then
for REGION_TRAIL in "${TRAILS_DETAILS}"
do
while read -r TRAIL_KEY_ID TRAIL_NAME
do
if [[ "${TRAIL_KEY_ID}" != "None" ]]
then
textPass "$regx: Trail $TRAIL_NAME has encryption enabled" "$regx" "$TRAIL_NAME"
else
textFail "$regx: Trail $TRAIL_NAME has encryption disabled" "$regx" "$TRAIL_NAME"
fi
done <<< "${REGION_TRAIL}"
done
else
textPass "$regx: No CloudTrail trails were found for the region" "${regx}" "No trails found"
fi
done
}

80
checks/check28 Normal file
View File

@@ -0,0 +1,80 @@
#!/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_check28="2.8"
CHECK_TITLE_check28="[check28] Ensure rotation for customer created KMS CMKs is enabled"
CHECK_SCORED_check28="SCORED"
CHECK_CIS_LEVEL_check28="LEVEL2"
CHECK_SEVERITY_check28="Medium"
CHECK_ASFF_TYPE_check28="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check28="AwsKmsKey"
CHECK_ALTERNATE_check208="check28"
CHECK_SERVICENAME_check28="kms"
CHECK_RISK_check28='Cryptographic best practices discourage extensive reuse of encryption keys. Consequently; Customer Master Keys (CMKs) should be rotated to prevent usage of compromised keys.'
CHECK_REMEDIATION_check28='For every KMS Customer Master Keys (CMKs); ensure that Rotate this key every year is enabled.'
CHECK_DOC_check28='https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html'
CHECK_CAF_EPIC_check28='Data Protection'
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' --output text 2>&1)
if [[ $(echo "$CHECK_KMS_KEYLIST" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to list keys" "$regx" "$key"
continue
fi
if [[ $CHECK_KMS_KEYLIST ]]; then
cmk_count=0
for key in $CHECK_KMS_KEYLIST; do
KMSDETAILS=$($AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --query 'KeyMetadata.{key:KeyId,man:KeyManager,origin:Origin,spec:CustomerMasterKeySpec,state:KeyState}' --output text 2>&1 | grep SYMMETRIC)
if [[ $(echo "$KMSDETAILS" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied describing key $key" "$regx" "$key"
continue
fi
KEYID=$(echo $KMSDETAILS | awk '{print $1}')
KEYMANAGER=$(echo $KMSDETAILS | awk '{print $2}')
KEYORIGIN=$(echo $KMSDETAILS | awk '{print $3}')
KEYSTATE=$(echo $KMSDETAILS | awk '{print $5}')
if [[ "$KEYMANAGER" == "AWS" ]]; then
continue
fi
if [[ "$KEYSTATE" != "Enabled" ]]; then
continue
fi
cmk_count=$((cmk_count + 1))
if [[ "$KEYORIGIN" == "EXTERNAL" ]]; then
textPass "$regx: Key $key uses imported key material" "$regx" "$key"
else
CHECK_KMS_KEY_ROTATION=$($AWSCLI kms get-key-rotation-status --key-id $key $PROFILE_OPT --region $regx --output text 2>&1)
if [[ $(echo "$CHECK_KMS_KEY_ROTATION" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied getting key rotation status for $key " "$regx" "$key"
continue
fi
if [[ "$CHECK_KMS_KEY_ROTATION" == "True" ]];then
textPass "$regx: Key $key automatic rotation of the key material is enabled" "$regx" "$key"
else
textFail "$regx: Key $key automatic rotation of the key material is disabled" "$regx" "$key"
fi
fi
done
if [[ $cmk_count == 0 ]]; then
textInfo "$regx: This region has no customer managed keys" "$regx" "$key"
fi
else
textInfo "$regx: This region has no KMS keys" "$regx" "$key"
fi
done
}

52
checks/check29 Normal file
View File

@@ -0,0 +1,52 @@
#!/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_check29="2.9"
CHECK_TITLE_check29="[check29] Ensure VPC Flow Logging is Enabled in all VPCs"
CHECK_SCORED_check29="SCORED"
CHECK_CIS_LEVEL_check29="LEVEL2"
CHECK_SEVERITY_check29="Medium"
CHECK_ASFF_TYPE_check29="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check29="AwsEc2Vpc"
CHECK_ALTERNATE_check209="check29"
CHECK_ASFF_COMPLIANCE_TYPE_check29="ens-op.mon.1.aws.flow.1"
CHECK_SERVICENAME_check29="vpc"
CHECK_RISK_check29='VPC Flow Logs provide visibility into network traffic that traverses the VPC and can be used to detect anomalous traffic or insight during security workflows.'
CHECK_REMEDIATION_check29='It is recommended that VPC Flow Logs be enabled for packet "Rejects" for VPCs. '
CHECK_DOC_check29='http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html '
CHECK_CAF_EPIC_check29='Logging and Monitoring'
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 2>&1)
if [[ $(echo "$AVAILABLE_VPC" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe VPCs" "$regx" "$vpcx"
continue
fi
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 2>&1)
if [[ $(echo "$CHECK_FL" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe flow logs in VPC $vpcx" "$regx" "$vpcx"
continue
fi
if [[ $CHECK_FL ]]; then
for FL in $CHECK_FL; do
textPass "$regx: VPC $vpcx VPCFlowLog is enabled for LogGroupName: $FL" "$regx" "$vpcx"
done
else
textFail "$regx: VPC $vpcx VPCFlowLog is disabled" "$regx" "$vpcx"
fi
done
done
}

56
checks/check31 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.
#
# 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"
CHECK_TITLE_check31="[check31] Ensure a log metric filter and alarm exist for unauthorized API calls"
CHECK_SCORED_check31="SCORED"
CHECK_CIS_LEVEL_check31="LEVEL1"
CHECK_SEVERITY_check31="Medium"
CHECK_ASFF_TYPE_check31="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check31="AwsCloudTrailTrail"
CHECK_ALTERNATE_check301="check31"
CHECK_ASFF_COMPLIANCE_TYPE_check31="ens-op.exp.8.aws.trail.2"
CHECK_SERVICENAME_check31="iam"
CHECK_RISK_check31='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check31='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check31='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check31='Logging and Monitoring'
check31(){
check3x '\$\.errorCode\s*=\s*"\*UnauthorizedOperation".+\$\.errorCode\s*=\s*"AccessDenied\*"'
}

55
checks/check310 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_SCORED_check310="SCORED"
CHECK_CIS_LEVEL_check310="LEVEL2"
CHECK_SEVERITY_check310="Medium"
CHECK_ASFF_TYPE_check310="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check310="AwsCloudTrailTrail"
CHECK_ALTERNATE_check310="check310"
CHECK_SERVICENAME_check310="ec2"
CHECK_RISK_check310='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check310='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check310='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check310='Logging and Monitoring'
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'
}

55
checks/check311 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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)"
CHECK_SCORED_check311="SCORED"
CHECK_CIS_LEVEL_check311="LEVEL2"
CHECK_SEVERITY_check311="Medium"
CHECK_ASFF_TYPE_check311="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check311="AwsCloudTrailTrail"
CHECK_ALTERNATE_check311="check311"
CHECK_SERVICENAME_check311="vpc"
CHECK_RISK_check311='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check311='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check311='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check311='Logging and Monitoring'
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'
}

55
checks/check312 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_SCORED_check312="SCORED"
CHECK_CIS_LEVEL_check312="LEVEL1"
CHECK_SEVERITY_check312="Medium"
CHECK_ASFF_TYPE_check312="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check312="AwsCloudTrailTrail"
CHECK_ALTERNATE_check312="check312"
CHECK_SERVICENAME_check312="vpc"
CHECK_RISK_check312='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check312='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check312='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check312='Logging and Monitoring'
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'
}

55
checks/check313 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_SCORED_check313="SCORED"
CHECK_CIS_LEVEL_check313="LEVEL1"
CHECK_SEVERITY_check313="Medium"
CHECK_ASFF_TYPE_check313="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check313="AwsCloudTrailTrail"
CHECK_ALTERNATE_check313="check313"
CHECK_SERVICENAME_check313="vpc"
CHECK_RISK_check313='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check313='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check313='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check313='Logging and Monitoring'
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'
}

55
checks/check314 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_SCORED_check314="SCORED"
CHECK_CIS_LEVEL_check314="LEVEL1"
CHECK_SEVERITY_check314="Medium"
CHECK_ASFF_TYPE_check314="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check314="AwsCloudTrailTrail"
CHECK_ALTERNATE_check314="check314"
CHECK_SERVICENAME_check314="vpc"
CHECK_RISK_check314='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check314='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check314='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check314='Logging and Monitoring'
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'
}

56
checks/check32 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.
#
# 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"
CHECK_TITLE_check32="[check32] Ensure a log metric filter and alarm exist for Management Console sign-in without MFA"
CHECK_SCORED_check32="SCORED"
CHECK_CIS_LEVEL_check32="LEVEL1"
CHECK_SEVERITY_check32="Medium"
CHECK_ASFF_TYPE_check32="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check32="AwsCloudTrailTrail"
CHECK_ALTERNATE_check302="check32"
CHECK_ASFF_COMPLIANCE_TYPE_check32="ens-op.exp.8.aws.trail.4"
CHECK_SERVICENAME_check32="iam"
CHECK_RISK_check32='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check32='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check32='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check32='Logging and Monitoring'
check32(){
check3x '\$\.eventName\s*=\s*"ConsoleLogin".+\$\.additionalEventData\.MFAUsed\s*!=\s*"Yes"'
}

60
checks/check33 Normal file
View File

@@ -0,0 +1,60 @@
#!/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.
#
# 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"
CHECK_TITLE_check33="[check33] Ensure a log metric filter and alarm exist for usage of root account"
CHECK_SCORED_check33="SCORED"
CHECK_CIS_LEVEL_check33="LEVEL1"
CHECK_SEVERITY_check33="Medium"
CHECK_ASFF_TYPE_check33="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check33="AwsCloudTrailTrail"
CHECK_ALTERNATE_check303="check33"
CHECK_ASFF_COMPLIANCE_TYPE_check33="ens-op.exp.8.aws.trail.5"
CHECK_SERVICENAME_check33="iam"
CHECK_RISK_check33='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check33='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check33='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check33='Logging and Monitoring'
check33(){
if [[ "${REGION}" == "us-gov-west-1" || "${REGION}" == "us-gov-east-1" ]]; then
textInfo "${REGION}: This is an AWS GovCloud account and there is no root account to perform checks."
else
check3x '\$\.userIdentity\.type\s*=\s*"Root".+\$\.userIdentity\.invokedBy NOT EXISTS.+\$\.eventType\s*!=\s*"AwsServiceEvent"'
fi
}

56
checks/check34 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.
#
# 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"
CHECK_TITLE_check34="[check34] Ensure a log metric filter and alarm exist for IAM policy changes"
CHECK_SCORED_check34="SCORED"
CHECK_CIS_LEVEL_check34="LEVEL1"
CHECK_SEVERITY_check34="Medium"
CHECK_ASFF_TYPE_check34="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check34="AwsCloudTrailTrail"
CHECK_ALTERNATE_check304="check34"
CHECK_ASFF_COMPLIANCE_TYPE_check34="ens-op.exp.8.aws.trail.6"
CHECK_SERVICENAME_check34="iam"
CHECK_RISK_check34='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check34='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check34='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check34='IAM'
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'
}

56
checks/check35 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.
#
# 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"
CHECK_TITLE_check35="[check35] Ensure a log metric filter and alarm exist for CloudTrail configuration changes"
CHECK_SCORED_check35="SCORED"
CHECK_CIS_LEVEL_check35="LEVEL1"
CHECK_SEVERITY_check35="Medium"
CHECK_ASFF_TYPE_check35="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check35="AwsCloudTrailTrail"
CHECK_ALTERNATE_check305="check35"
CHECK_ASFF_COMPLIANCE_TYPE_check35="ens-op.exp.8.aws.trail.1"
CHECK_SERVICENAME_check35="cloudtrail"
CHECK_RISK_check35='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check35='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check35='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check35='Logging and Monitoring'
check35(){
check3x '\$\.eventName\s*=\s*CreateTrail.+\$\.eventName\s*=\s*UpdateTrail.+\$\.eventName\s*=\s*DeleteTrail.+\$\.eventName\s*=\s*StartLogging.+\$\.eventName\s*=\s*StopLogging'
}

56
checks/check36 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.
#
# 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"
CHECK_TITLE_check36="[check36] Ensure a log metric filter and alarm exist for AWS Management Console authentication failures"
CHECK_SCORED_check36="SCORED"
CHECK_CIS_LEVEL_check36="LEVEL2"
CHECK_SEVERITY_check36="Medium"
CHECK_ASFF_TYPE_check36="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check36="AwsCloudTrailTrail"
CHECK_ALTERNATE_check306="check36"
CHECK_ASFF_COMPLIANCE_TYPE_check36="ens-op.exp.8.aws.trail.3"
CHECK_SERVICENAME_check36="iam"
CHECK_RISK_check36='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check36='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check36='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check36='Logging and Monitoring'
check36(){
check3x '\$\.eventName\s*=\s*ConsoleLogin.+\$\.errorMessage\s*=\s*"Failed authentication"'
}

56
checks/check37 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.
#
# 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"
CHECK_TITLE_check37="[check37] Ensure a log metric filter and alarm exist for disabling or scheduled deletion of customer created KMS CMKs"
CHECK_SCORED_check37="SCORED"
CHECK_CIS_LEVEL_check37="LEVEL2"
CHECK_SEVERITY_check37="Medium"
CHECK_ASFF_TYPE_check37="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check37="AwsCloudTrailTrail"
CHECK_ALTERNATE_check307="check37"
CHECK_ASFF_COMPLIANCE_TYPE_check37="ens-op.exp.11.aws.kms.1"
CHECK_SERVICENAME_check37="kms"
CHECK_RISK_check37='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check37='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check37='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check37='Logging and Monitoring'
check37(){
check3x '\$\.eventSource\s*=\s*kms.amazonaws.com.+\$\.eventName\s*=\s*DisableKey.+\$\.eventName\s*=\s*ScheduleKeyDeletion'
}

55
checks/check38 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_TITLE_check38="[check38] Ensure a log metric filter and alarm exist for S3 bucket policy changes"
CHECK_SCORED_check38="SCORED"
CHECK_CIS_LEVEL_check38="LEVEL1"
CHECK_SEVERITY_check38="Medium"
CHECK_ASFF_TYPE_check38="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check38="AwsCloudTrailTrail"
CHECK_ALTERNATE_check308="check38"
CHECK_SERVICENAME_check38="s3"
CHECK_RISK_check38='Monitoring unauthorized API calls will help reveal application errors and may reduce time to detect malicious activity.'
CHECK_REMEDIATION_check38='It is recommended that a metric filter and alarm be established for unauthorized requests.'
CHECK_DOC_check38='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check38='Logging and Monitoring'
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'
}

55
checks/check39 Normal file
View File

@@ -0,0 +1,55 @@
#!/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.
#
# 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"
CHECK_TITLE_check39="[check39] Ensure a log metric filter and alarm exist for AWS Config configuration changes"
CHECK_SCORED_check39="SCORED"
CHECK_CIS_LEVEL_check39="LEVEL2"
CHECK_SEVERITY_check39="Medium"
CHECK_ASFF_TYPE_check39="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check39="AwsCloudTrailTrail"
CHECK_ALTERNATE_check309="check39"
CHECK_SERVICENAME_check39="configservice"
CHECK_RISK_check39='If not enabled important changes to accounts could go unnoticed or difficult to find.'
CHECK_REMEDIATION_check39='Use this service as a complement to implement detective controls that cannot be prevented. (e.g. a Security Group is modified to open to internet without restrictions or route changed to avoid going thru the network firewall). Ensure AWS Config is enabled in all regions in order to detect any not intended action. On the other hand if sufficient preventive controls to make changes in critical services are in place; the rating on this finding can be lowered or discarded depending on residual risk.'
CHECK_DOC_check39='https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudwatch-alarms-for-cloudtrail.html'
CHECK_CAF_EPIC_check39='Logging and Monitoring'
check39(){
check3x '\$\.eventSource\s*=\s*config.amazonaws.com.+\$\.eventName\s*=\s*StopConfigurationRecorder.+\$\.eventName\s*=\s*DeleteDeliveryChannel.+\$\.eventName\s*=\s*PutDeliveryChannel.+\$\.eventName\s*=\s*PutConfigurationRecorder'
}

45
checks/check41 Normal file
View File

@@ -0,0 +1,45 @@
#!/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_check41="4.1"
CHECK_TITLE_check41="[check41] Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 22"
CHECK_SCORED_check41="SCORED"
CHECK_CIS_LEVEL_check41="LEVEL2"
CHECK_SEVERITY_check41="High"
CHECK_ASFF_TYPE_check41="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check41="AwsEc2SecurityGroup"
CHECK_ALTERNATE_check401="check41"
CHECK_ASFF_COMPLIANCE_TYPE_check41="ens-mp.com.4.aws.sg.4"
CHECK_SERVICENAME_check41="ec2"
CHECK_RISK_check41='Even having a perimeter firewall; having security groups open allows any user or malware with vpc access to scan for well known and sensitive ports and gain access to instance.'
CHECK_REMEDIATION_check41='Apply Zero Trust approach. Implement a process to scan and remediate unrestricted or overly permissive security groups. Recommended best practices is to narrow the definition for the minimum ports required.'
CHECK_DOC_check41='https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html'
CHECK_CAF_EPIC_check41='Infrastructure Security'
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`)) && (IpProtocol==`tcp`)]) > `0`].{GroupId:GroupId}' $PROFILE_OPT --region "${regx}" --output text 2>&1)
if [[ $(echo "$SG_LIST" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe security groups" "$regx"
continue
fi
if [[ $SG_LIST ]];then
for SG in $SG_LIST;do
textFail "$regx: Found Security Group: $SG open to 0.0.0.0/0" "$regx" "$SG"
done
else
textPass "$regx: No Security Groups found with port 22 TCP open to 0.0.0.0/0" "$regx" "$SG"
fi
done
}

45
checks/check42 Normal file
View File

@@ -0,0 +1,45 @@
#!/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_check42="4.2"
CHECK_TITLE_check42="[check42] Ensure no security groups allow ingress from 0.0.0.0/0 or ::/0 to port 3389"
CHECK_SCORED_check42="SCORED"
CHECK_CIS_LEVEL_check42="LEVEL2"
CHECK_SEVERITY_check42="High"
CHECK_ASFF_TYPE_check42="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check42="AwsEc2SecurityGroup"
CHECK_ALTERNATE_check402="check42"
CHECK_ASFF_COMPLIANCE_TYPE_check42="ens-mp.com.4.aws.sg.5"
CHECK_SERVICENAME_check42="ec2"
CHECK_RISK_check42='Even having a perimeter firewall; having security groups open allows any user or malware with vpc access to scan for well known and sensitive ports and gain access to instance.'
CHECK_REMEDIATION_check42='Apply Zero Trust approach. Implement a process to scan and remediate unrestricted or overly permissive security groups. Recommended best practices is to narrow the definition for the minimum ports required.'
CHECK_DOC_check42='https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html'
CHECK_CAF_EPIC_check42='Infrastructure Security'
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`)) && (IpProtocol==`tcp`) ]) > `0`].{GroupId:GroupId}' $PROFILE_OPT --region "${regx}" --output text 2>&1)
if [[ $(echo "$SG_LIST" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe security groups" "$regx"
continue
fi
if [[ $SG_LIST ]];then
for SG in $SG_LIST;do
textFail "$regx: Found Security Group: $SG open to 0.0.0.0/0" "$regx" "$SG"
done
else
textPass "$regx: No Security Groups found with port 3389 TCP open to 0.0.0.0/0" "$regx" "$SG"
fi
done
}

46
checks/check43 Normal file
View File

@@ -0,0 +1,46 @@
#!/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_check43="4.3"
CHECK_TITLE_check43="[check43] Ensure the default security group of every VPC restricts all traffic"
CHECK_SCORED_check43="SCORED"
CHECK_CIS_LEVEL_check43="LEVEL2"
CHECK_SEVERITY_check43="High"
CHECK_ASFF_TYPE_check43="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check43="AwsEc2SecurityGroup"
CHECK_ALTERNATE_check403="check43"
CHECK_ASFF_COMPLIANCE_TYPE_check43="ens-mp.com.4.aws.sg.1"
CHECK_SERVICENAME_check43="ec2"
CHECK_RISK_check43='Even having a perimeter firewall; having security groups open allows any user or malware with vpc access to scan for well known and sensitive ports and gain access to instance.'
CHECK_REMEDIATION_check43='Apply Zero Trust approach. Implement a process to scan and remediate unrestricted or overly permissive security groups. Recommended best practices is to narrow the definition for the minimum ports required.'
CHECK_DOC_check43='https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html'
CHECK_CAF_EPIC_check43='Infrastructure Security'
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 2>&1)
if [[ $(echo "$CHECK_SGDEFAULT_IDS" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe security groups" "$regx"
continue
fi
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 '\s0.0.0.0|\:\:\/0')
if [[ $CHECK_SGDEFAULT_ID_OPEN ]];then
textFail "$regx: Default Security Groups ($CHECK_SGDEFAULT_ID) found that allow 0.0.0.0 IN or OUT traffic" "$regx" "$CHECK_SGDEFAULT_ID"
else
textPass "$regx: No Default Security Groups ($CHECK_SGDEFAULT_ID) open to 0.0.0.0 found" "$regx" "$CHECK_SGDEFAULT_ID"
fi
done
done
}

48
checks/check44 Normal file
View File

@@ -0,0 +1,48 @@
#!/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_check44="4.4"
CHECK_TITLE_check44="[check44] Ensure routing tables for VPC peering are \"least access\""
CHECK_SCORED_check44="NOT_SCORED"
CHECK_CIS_LEVEL_check44="LEVEL2"
CHECK_SEVERITY_check44="Medium"
CHECK_ASFF_TYPE_check44="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check44="AwsEc2Vpc"
CHECK_ALTERNATE_check404="check44"
CHECK_SERVICENAME_check44="vpc"
CHECK_RISK_check44='Being highly selective in peering routing tables is a very effective way of minimizing the impact of breach as resources outside of these routes are inaccessible to the peered VPC.'
CHECK_REMEDIATION_check44='Review routing tables of peered VPCs for whether they route all subnets of each VPC and whether that is necessary to accomplish the intended purposes for peering the VPCs.'
CHECK_DOC_check44='https://docs.aws.amazon.com/vpc/latest/peering/peering-configurations-partial-access.html'
CHECK_CAF_EPIC_check44='Infrastructure Security'
check44(){
# "Ensure routing tables for VPC peering are \"least access\" (Not Scored)"
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' 2>&1| sort | paste -s -d" " - )
if [[ $(echo "$LIST_OF_VPCS_PEERING_CONNECTIONS" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe vpc peering connections" "$regx"
continue
fi
if [[ $LIST_OF_VPCS_PEERING_CONNECTIONS ]];then
textInfo "$regx: $LIST_OF_VPCS_PEERING_CONNECTIONS - review routing tables" "$regx" "$LIST_OF_VPCS_PEERING_CONNECTIONS"
#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" "$LIST_OF_VPCS_PEERING_CONNECTIONS"
fi
done
}

43
checks/check45 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_check45="4.5"
CHECK_TITLE_check45="[check45] Ensure no Network ACLs allow ingress from 0.0.0.0/0 to SSH port 22"
CHECK_SCORED_check45="SCORED"
CHECK_CIS_LEVEL_check45="LEVEL2"
CHECK_SEVERITY_check45="High"
CHECK_ASFF_TYPE_check45="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check45="AwsEc2NetworkAcl"
CHECK_ALTERNATE_check401="check45"
CHECK_SERVICENAME_check45="ec2"
CHECK_RISK_check45='Even having a perimeter firewall; having network acls open allows any user or malware with vpc access to scan for well known and sensitive ports and gain access to instance.'
CHECK_REMEDIATION_check45='Apply Zero Trust approach. Implement a process to scan and remediate unrestricted or overly permissive network acls. Recommended best practices is to narrow the definition for the minimum ports required.'
CHECK_DOC_check45='https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html'
CHECK_CAF_EPIC_check45='Infrastructure Security'
check45(){
for regx in $REGIONS; do
NACL_LIST=$($AWSCLI ec2 describe-network-acls --query 'NetworkAcls[?Entries[?(((!PortRange) || (PortRange.From<=`22` && PortRange.To>=`22`)) && ((CidrBlock == `0.0.0.0/0`) && (Egress == `false`) && (RuleAction == `allow`)))]].{NetworkAclId:NetworkAclId}' $PROFILE_OPT --region $regx --output text 2>&1)
if [[ $(echo "$NACL_LIST" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe vpc network acls" "$regx"
continue
fi
if [[ $NACL_LIST ]];then
for NACL in $NACL_LIST;do
textInfo "$regx: Found Network ACL: $NACL open to 0.0.0.0/0 for SSH port 22" "$regx" "$NACL"
done
else
textPass "$regx: No Network ACL found with SSH port 22 open to 0.0.0.0/0" "$regx" "$NACL"
fi
done
}

43
checks/check46 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_check46="4.6"
CHECK_TITLE_check46="[check46] Ensure no Network ACLs allow ingress from 0.0.0.0/0 to Microsoft RDP port 3389"
CHECK_SCORED_check46="SCORED"
CHECK_CIS_LEVEL_check46="LEVEL2"
CHECK_SEVERITY_check46="High"
CHECK_ASFF_TYPE_check46="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_check46="AwsEc2NetworkAcl"
CHECK_ALTERNATE_check401="check46"
CHECK_SERVICENAME_check46="ec2"
CHECK_RISK_check46='Even having a perimeter firewall; having network acls open allows any user or malware with vpc access to scan for well known and sensitive ports and gain access to instance.'
CHECK_REMEDIATION_check46='Apply Zero Trust approach. Implement a process to scan and remediate unrestricted or overly permissive network acls. Recommended best practices is to narrow the definition for the minimum ports required.'
CHECK_DOC_check46='https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html'
CHECK_CAF_EPIC_check46='Infrastructure Security'
check46(){
for regx in $REGIONS; do
NACL_LIST=$($AWSCLI ec2 describe-network-acls --query 'NetworkAcls[?Entries[?(((!PortRange) || (PortRange.From<=`3389` && PortRange.To>=`3389`)) && ((CidrBlock == `0.0.0.0/0`) && (Egress == `false`) && (RuleAction == `allow`)))]].{NetworkAclId:NetworkAclId}' $PROFILE_OPT --region $regx --output text 2>&1)
if [[ $(echo "$NACL_LIST" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe vpc network acls" "$regx"
continue
fi
if [[ $NACL_LIST ]];then
for NACL in $NACL_LIST;do
textInfo "$regx: Found Network ACL: $NACL open to 0.0.0.0/0 for Microsoft RDP port 3389" "$regx" "$NACL"
done
else
textPass "$regx: No Network ACL found with Microsoft RDP port 3389 open to 0.0.0.0/0" "$regx" "$NACL"
fi
done
}

61
checks/check_extra71 Normal file
View File

@@ -0,0 +1,61 @@
#!/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"
CHECK_TITLE_extra71="[extra71] Ensure users of groups with AdministratorAccess policy have MFA tokens enabled"
CHECK_SCORED_extra71="NOT_SCORED"
CHECK_CIS_LEVEL_extra71="EXTRA"
CHECK_SEVERITY_extra71="High"
CHECK_ASFF_RESOURCE_TYPE_extra71="AwsIamUser"
CHECK_ALTERNATE_extra701="extra71"
CHECK_ALTERNATE_check71="extra71"
CHECK_ALTERNATE_check701="extra71"
CHECK_ASFF_COMPLIANCE_TYPE_extra71="ens-op.exp.10.aws.trail.2"
CHECK_SERVICENAME_extra71="iam"
CHECK_RISK_extra71='Any user with AdministratorAccess is allowed to perform any action on an AWS account, so it needs to have a multi factor authentication enabled to avoid impersonation through a potential credentials leak'
CHECK_REMEDIATION_extra71='Enable MFA for users belonging to groups with AdministratorAccess policies'
CHECK_DOC_extra71='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_enable_virtual.html'
CHECK_CAF_EPIC_extra71='Infrastructure Security'
extra71(){
# "Ensure users of groups with AdministratorAccess policy have MFA tokens enabled "
ADMIN_GROUPS=''
AWS_GROUPS=$($AWSCLI $PROFILE_OPT iam list-groups --output text --region $REGION --query 'Groups[].GroupName')
if [[ ${AWS_GROUPS} ]]
then
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 --region $REGION iam list-attached-group-policies --group-name $grp --output json --query 'AttachedPolicies[].PolicyArn' | grep "arn:${AWS_PARTITION}:iam::aws:policy/AdministratorAccess")
if [[ $CHECK_ADMIN_GROUP ]]; then
ADMIN_GROUPS="$ADMIN_GROUPS $grp"
textInfo "$REGION: $grp group provides administrative access" "$REGION" "$grp"
ADMIN_USERS=$($AWSCLI $PROFILE_OPT iam get-group --region $REGION --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 "$REGION: $auser / MFA Enabled / admin via group $grp" "$REGION" "$grp"
else
textFail "$REGION: $auser / MFA DISABLED / admin via group $grp" "$REGION" "$grp"
fi
done
else
textInfo "$REGION: $grp group provides non-administrative access" "$REGION" "$grp"
fi
done
else
textPass "$REGION: There is no IAM groups" "$REGION"
fi
}

45
checks/check_extra710 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_extra710="7.10"
CHECK_TITLE_extra710="[extra710] Check for internet facing EC2 Instances"
CHECK_SCORED_extra710="NOT_SCORED"
CHECK_CIS_LEVEL_extra710="EXTRA"
CHECK_SEVERITY_extra710="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra710="AwsEc2Instance"
CHECK_ALTERNATE_check710="extra710"
CHECK_ASFF_COMPLIANCE_TYPE_extra710="ens-mp.com.4.aws.vpc.1"
CHECK_SERVICENAME_extra710="ec2"
CHECK_RISK_extra710='Exposing an EC2 directly to internet increases the attack surface and therefore the risk of compromise.'
CHECK_REMEDIATION_extra710='Use an ALB and apply WAF ACL.'
CHECK_DOC_extra710='https://aws.amazon.com/blogs/aws/aws-web-application-firewall-waf-for-application-load-balancers/'
CHECK_CAF_EPIC_extra710='Infrastructure Security'
extra710(){
# "Check for internet facing EC2 Instances "
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 2>&1)
if [[ $(echo "$LIST_OF_PUBLIC_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe instances" "$regx"
continue
fi
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" "$INSTANCE_ID"
done <<< "$LIST_OF_PUBLIC_INSTANCES"
else
textPass "$regx: no Internet Facing EC2 Instances found" "$regx" "$INSTANCE_ID"
fi
done
}

81
checks/check_extra7100 Normal file
View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2019) by Toni de la Fuente
#
# This check was contributed by Nick Malcolm (github.com/nickmalcolm), building
# on the hard work of others.
#
# 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_extra7100="7.100"
CHECK_TITLE_extra7100="[extra7100] Ensure that no custom IAM policies exist which allow permissive role assumption (e.g. sts:AssumeRole on *)"
CHECK_SCORED_extra7100="NOT_SCORED"
CHECK_CIS_LEVEL_extra7100="EXTRA"
CHECK_SEVERITY_extra7100="Critical"
CHECK_ASFF_RESOURCE_TYPE_extra7100="AwsIamPolicy"
CHECK_ALTERNATE_check7100="extra7100"
CHECK_ASFF_COMPLIANCE_TYPE_extra7100="ens-op.acc.2.aws.iam.1"
CHECK_SERVICENAME_extra7100="iam"
CHECK_RISK_extra7100='If not restricted unintended access could happen.'
CHECK_REMEDIATION_extra7100='Use the least privilege principle when granting permissions.'
CHECK_DOC_extra7100='https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html'
CHECK_CAF_EPIC_extra7100='IAM'
extra7100(){
# "Ensure that no custom policies exist which permit assuming any role (e.g. sts:AssumeRole on *)"
#
# A permissive STS Role assumption policy is one where the Resource (ARN) is not explicitly defined
# This is most often seen as sts:assumeRole on *, but can take other forms.
#
# Learn more: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_permissions-to-switch.html#roles-usingrole-createpolicy
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
for policy in $LIST_CUSTOM_POLICIES; do
POLICY_ARN=$(echo $policy | awk -F ',' '{print $1}')
POLICY_VERSION=$(echo $policy | awk -F ',' '{print $2}')
POLICY_STATEMENTS_WITH_ALLOW=$($AWSCLI iam get-policy-version \
--output json \
--policy-arn $POLICY_ARN \
--version-id $POLICY_VERSION \
--query "[PolicyVersion.Document.Statement] | [] | [?Effect == 'Allow']" \
$PROFILE_OPT \
--region $REGION
)
# Identify permissive policies by:
# 1 & 2) Casting all the Resource and Action keys to Arrays (sometimes they're a single string)
# 3) Iterate over the policy statements
# 4) Narrow the scope to Actions which are sts:* or sts:assumeRole(WithSAML|WithWebIdentity)
# 5) Narrow the scope to Resources (IAM Roles) which include a wildcard
POLICY_WITH_PERMISSIVE_STS=$(echo $POLICY_STATEMENTS_WITH_ALLOW \
| jq 'map( .Resource |= (if type=="array" then . else [.] end) )' \
| jq 'map( .Action |= (if type=="array" then . else [.] end) )' \
| jq '.[]' \
| jq 'select(.Action[] | contains("sts:AssumeRole") or contains("sts:*"))' \
| jq 'select(.Resource[] | contains("*"))')
if [[ $POLICY_WITH_PERMISSIVE_STS ]]; then
PERMISSIVE_POLICIES_LIST="$PERMISSIVE_POLICIES_LIST $POLICY_ARN"
fi
done
if [[ $PERMISSIVE_POLICIES_LIST ]]; then
textInfo "STS AssumeRole Policies should only include the complete ARNs for the Roles that the user needs. Learn more: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_permissions-to-switch.html#roles-usingrole-createpolicy" "$REGION"
for policy in $PERMISSIVE_POLICIES_LIST; do
textFail "$REGION: Policy $policy allows permissive STS Role assumption" "$REGION" "$policy"
done
else
textPass "$REGION: No custom policies found that allow permissive STS Role assumption" "$REGION"
fi
else
textPass "$REGION: No custom policies found" "$REGION"
fi
}

51
checks/check_extra7101 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_extra7101="7.101"
CHECK_TITLE_extra7101="[extra7101] Check if Amazon Elasticsearch Service (ES) domains have audit logging enabled"
CHECK_SCORED_extra7101="NOT_SCORED"
CHECK_CIS_LEVEL_extra7101="EXTRA"
CHECK_SEVERITY_extra7101="Low"
CHECK_ASFF_RESOURCE_TYPE_extra7101="AwsElasticsearchDomain"
CHECK_ALTERNATE_check7101="extra7101"
CHECK_SERVICENAME_extra7101="es"
CHECK_RISK_extra7101='If logs are not enabled; monitoring of service use and threat analysis is not possible.'
CHECK_REMEDIATION_extra7101='Make sure you are logging information about Amazon Elasticsearch Service operations.'
CHECK_DOC_extra7101='https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/audit-logs.html'
CHECK_CAF_EPIC_extra7101='Logging and Monitoring'
extra7101(){
for regx in ${REGIONS}; do
LIST_OF_DOMAINS=$("${AWSCLI}" es list-domain-names ${PROFILE_OPT} --region "${regx}" --query 'DomainNames[].DomainName' --output text 2>&1)
if [[ $(echo "${LIST_OF_DOMAINS}" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "${regx}: Access Denied trying to list domain names" "${regx}"
continue
fi
if [[ "${LIST_OF_DOMAINS}" ]]; then
for domain in ${LIST_OF_DOMAINS}; do
AUDIT_LOGS_ENABLED=$("${AWSCLI}" es describe-elasticsearch-domain-config --domain-name "${domain}" ${PROFILE_OPT} --region "${regx}" --query 'DomainConfig.LogPublishingOptions.Options.AUDIT_LOGS.Enabled' --output text 2>&1)
if [[ $(echo "${AUDIT_LOGS_ENABLED}" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "${regx}: Access Denied trying to get ES domain config for ${domain}" "${regx}"
continue
fi
if [[ $(tr '[:upper:]' '[:lower:]' <<< "${AUDIT_LOGS_ENABLED}") == "true" ]]; then
textPass "${regx}: Amazon ES domain ${domain} AUDIT_LOGS enabled" "${regx}" "${domain}"
else
textFail "${regx}: Amazon ES domain ${domain} AUDIT_LOGS disabled!" "${regx}" "${domain}"
fi
done
else
textInfo "${regx}: No Amazon ES domain found" "${regx}"
fi
done
}

62
checks/check_extra7102 Normal file
View File

@@ -0,0 +1,62 @@
#!/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_extra7102="7.102"
CHECK_TITLE_extra7102="[extra7102] Check if any of the Elastic or Public IP are in Shodan (requires Shodan API KEY)"
CHECK_SCORED_extra7102="NOT_SCORED"
CHECK_CIS_LEVEL_extra7102="EXTRA"
CHECK_SEVERITY_extra7102="High"
CHECK_ASFF_RESOURCE_TYPE_extra7102="AwsEc2Eip"
CHECK_ALTERNATE_check7102="extra7102"
CHECK_SERVICENAME_extra7102="ec2"
CHECK_RISK_extra7102='Sites like Shodan index exposed systems and further expose them to wider audiences as a quick way to find exploitable systems.'
CHECK_REMEDIATION_extra7102='Check Identified IPs; consider changing them to private ones and delete them from Shodan.'
CHECK_DOC_extra7102='https://www.shodan.io/'
CHECK_CAF_EPIC_extra7102='Infrastructure Security'
# Watch out, always use Shodan API key, if you use `curl https://www.shodan.io/host/{ip}` massively
# your IP will be banned by Shodan
# This is the right way to do so
# curl -ks https://api.shodan.io/shodan/host/{ip}?key={YOUR_API_KEY}
# Each finding will be saved in prowler/output folder for further review.
extra7102(){
for regx in $REGIONS; do
if [[ ! $SHODAN_API_KEY ]]; then
textInfo "$regx: Requires a Shodan API key to work. Use -N <shodan_api_key>" "$regx"
else
LIST_OF_EIP=$($AWSCLI $PROFILE_OPT --region $regx ec2 describe-network-interfaces --query 'NetworkInterfaces[*].Association.PublicIp' --output text 2>&1)
if [[ $(echo "$LIST_OF_EIP" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to describe network interfaces" "$regx"
continue
fi
if [[ $LIST_OF_EIP ]]; then
for ip in $LIST_OF_EIP;do
SHODAN_QUERY=$(curl -ks https://api.shodan.io/shodan/host/$ip?key=$SHODAN_API_KEY)
# Shodan has a request rate limit of 1 request/second.
sleep 1
if [[ $SHODAN_QUERY == *"No information available for that IP"* ]]; then
textPass "$regx: IP $ip is not listed in Shodan" "$regx"
else
echo $SHODAN_QUERY > $OUTPUT_DIR/shodan-output-$ip.json
IP_SHODAN_INFO=$(cat $OUTPUT_DIR/shodan-output-$ip.json | jq -r '. | { ports: .ports, org: .org, country: .country_name }| @text' | tr -d \"\{\}\}\]\[ | tr , '\ ' )
textFail "$regx: IP $ip is listed in Shodan with data $IP_SHODAN_INFO. More info https://www.shodan.io/host/$ip and $OUTPUT_DIR/shodan-output-$ip.json" "$regx" "$ip"
fi
done
else
textInfo "$regx: No Public or Elastic IPs found" "$regx"
fi
fi
done
}

48
checks/check_extra7103 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7103="7.103"
CHECK_TITLE_extra7103="[extra7103] Check if Amazon SageMaker Notebook instances have root access disabled"
CHECK_SCORED_extra7103="NOT_SCORED"
CHECK_CIS_LEVEL_extra7103="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7103="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7103="extra7103"
CHECK_SEVERITY_extra7103="Medium"
CHECK_SERVICENAME_extra7103="sagemaker"
CHECK_RISK_extra7103='Users with root access have administrator privileges; users can access and edit all files on a notebook instance with root access enabled.'
CHECK_REMEDIATION_extra7103='set the RootAccess field to Disabled. You can also disable root access for users when you create or update a notebook instance in the Amazon SageMaker console.'
CHECK_DOC_extra7103='https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-root-access.html'
CHECK_CAF_EPIC_extra7103='IAM'
extra7103(){
for regx in ${REGIONS}; do
LIST_SM_NB_INSTANCES=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-notebook-instances --query 'NotebookInstances[*].NotebookInstanceName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list notebook instances" "$regx"
continue
fi
if [[ $LIST_SM_NB_INSTANCES ]];then
for nb_instance in $LIST_SM_NB_INSTANCES; do
SM_NB_ROOTACCESS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-notebook-instance --notebook-instance-name $nb_instance --query 'RootAccess' --output text)
if [[ "${SM_NB_ROOTACCESS}" == "Enabled" ]]; then
textFail "${regx}: Sagemaker Notebook instance $nb_instance has root access enabled" "${regx}" "$nb_instance"
else
textPass "${regx}: Sagemaker Notebook instance $nb_instance has root access disabled" "${regx}" "$nb_instance"
fi
done
else
textInfo "${regx}: No Sagemaker Notebook instances found" "${regx}"
fi
done
}

47
checks/check_extra7104 Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7104="7.104"
CHECK_TITLE_extra7104="[extra7104] Check if Amazon SageMaker Notebook instances have VPC settings configured"
CHECK_SCORED_extra7104="NOT_SCORED"
CHECK_CIS_LEVEL_extra7104="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7104="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7104="extra7104"
CHECK_SEVERITY_extra7104="Medium"
CHECK_SERVICENAME_extra7104="sagemaker"
CHECK_RISK_extra7104='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7104='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7104='https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html'
CHECK_CAF_EPIC_extra7104='Infrastructure Security'
extra7104(){
for regx in ${REGIONS}; do
LIST_SM_NB_INSTANCES=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-notebook-instances --query 'NotebookInstances[*].NotebookInstanceName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list notebook instances" "$regx"
continue
fi
if [[ $LIST_SM_NB_INSTANCES ]];then
for nb_instance in $LIST_SM_NB_INSTANCES; do
SM_NB_SUBNETID=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-notebook-instance --notebook-instance-name $nb_instance --query 'SubnetId' --output text)
if [[ "${SM_NB_SUBNETID}" == "None" ]]; then
textFail "${regx}: Sagemaker Notebook instance $nb_instance has VPC settings disabled" "${regx}" "$nb_instance"
else
textPass "${regx}: Sagemaker Notebook instance $nb_instance is in a VPC" "${regx}" "$nb_instance"
fi
done
else
textInfo "${regx}: No Sagemaker Notebook instances found" "${regx}"
fi
done
}

48
checks/check_extra7105 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7105="7.105"
CHECK_TITLE_extra7105="[extra7105] Check if Amazon SageMaker Models have network isolation enabled"
CHECK_SCORED_extra7105="NOT_SCORED"
CHECK_CIS_LEVEL_extra7105="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7105="AwsSageMakerModel"
CHECK_ALTERNATE_check7105="extra7105"
CHECK_SEVERITY_extra7105="Medium"
CHECK_SERVICENAME_extra7105="sagemaker"
CHECK_RISK_extra7105='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7105='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7105='https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html'
CHECK_CAF_EPIC_extra7105='Infrastructure Security'
extra7105(){
for regx in ${REGIONS}; do
LIST_SM_NB_MODELS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-models --query 'Models[*].ModelName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_MODELS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list models" "$regx"
continue
fi
if [[ $LIST_SM_NB_MODELS ]];then
for nb_model_name in $LIST_SM_NB_MODELS; do
SM_NB_NETWORKISOLATION=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-model --model-name $nb_model_name --query 'EnableNetworkIsolation' --output text)
if [[ $SM_NB_NETWORKISOLATION == False ]]; then
textFail "${regx}: SageMaker Model $nb_model_name has network isolation disabled" "${regx}" "$nb_model_name"
else
textPass "${regx}: SageMaker Model $nb_model_name has network isolation enabled" "${regx}" "$nb_model_name"
fi
done
else
textInfo "${regx}: No Sagemaker Models found" "${regx}"
fi
done
}

48
checks/check_extra7106 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7106="7.106"
CHECK_TITLE_extra7106="[extra7106] Check if Amazon SageMaker Models have VPC settings configured"
CHECK_SCORED_extra7106="NOT_SCORED"
CHECK_CIS_LEVEL_extra7106="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7106="AwsSageMakerModel"
CHECK_ALTERNATE_check7106="extra7106"
CHECK_SEVERITY_extra7106="Medium"
CHECK_SERVICENAME_extra7106="sagemaker"
CHECK_RISK_extra7106='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7106='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7106='https://docs.aws.amazon.com/sagemaker/latest/dg/studio-notebooks-and-internet-access.html'
CHECK_CAF_EPIC_extra7106='Infrastructure Security'
extra7106(){
for regx in ${REGIONS}; do
LIST_SM_NB_MODELS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-models --query 'Models[*].ModelName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_MODELS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list models" "$regx"
continue
fi
if [[ $LIST_SM_NB_MODELS ]];then
for nb_model_name in $LIST_SM_NB_MODELS; do
SM_NB_VPCCONFIG=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-model --model-name $nb_model_name --query 'VpcConfig.Subnets' --output text)
if [[ $SM_NB_VPCCONFIG == "None" ]]; then
textFail "${regx}: Amazon SageMaker Model $nb_model_name has VPC settings disabled" "${regx}" "$nb_model_name"
else
textPass "${regx}: Amazon SageMaker Model $nb_model_name has VPC settings enabled" "${regx}" "$nb_model_name"
fi
done
else
textInfo "${regx}: No Sagemaker Models found" "${regx}"
fi
done
}

48
checks/check_extra7107 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7107="7.107"
CHECK_TITLE_extra7107="[extra7107] Check if Amazon SageMaker Training jobs have intercontainer encryption enabled"
CHECK_SCORED_extra7107="NOT_SCORED"
CHECK_CIS_LEVEL_extra7107="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7107="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7107="extra7107"
CHECK_SEVERITY_extra7107="Medium"
CHECK_SERVICENAME_extra7107="sagemaker"
CHECK_RISK_extra7107='If not restricted unintended access could happen.'
CHECK_REMEDIATION_extra7107='Internetwork communications support TLS 1.2 encryption between all components and clients.'
CHECK_DOC_extra7107='https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html'
CHECK_CAF_EPIC_extra7107='Data Protection'
extra7107(){
for regx in ${REGIONS}; do
LIST_SM_NB_JOBS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-training-jobs --query 'TrainingJobSummaries[*].TrainingJobName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_JOBS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list training jobs" "$regx"
continue
fi
if [[ $LIST_SM_NB_JOBS ]];then
for nb_job_name in $LIST_SM_NB_JOBS; do
SM_NB_INTERCONTAINERENCRYPTION=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-training-job --training-job-name $nb_job_name --query 'EnableInterContainerTrafficEncryption' --output text)
if [[ $SM_NB_INTERCONTAINERENCRYPTION == "False" ]]; then
textFail "${regx}: SageMaker Training job $nb_job_name has intercontainer encryption disabled" "${regx}" "$nb_job_name"
else
textPass "${regx}: SageMaker Training jobs $nb_job_name has intercontainer encryption enabled" "${regx}" "$nb_job_name"
fi
done
else
textInfo "${regx}: No Sagemaker Training found" "${regx}"
fi
done
}

47
checks/check_extra7108 Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7108="7.108"
CHECK_TITLE_extra7108="[extra7108] Check if Amazon SageMaker Training jobs have volume and output with KMS encryption enabled"
CHECK_SCORED_extra7108="NOT_SCORED"
CHECK_CIS_LEVEL_extra7108="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7108="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7108="extra7108"
CHECK_SEVERITY_extra7108="Medium"
CHECK_SERVICENAME_extra7108="sagemaker"
CHECK_RISK_extra7108='Data exfiltration could happen if information is not protected. KMS keys provide additional security level to IAM policies.'
CHECK_REMEDIATION_extra7108='Specify AWS KMS keys to use for input and output from S3 and EBS.'
CHECK_DOC_extra7108='https://docs.aws.amazon.com/sagemaker/latest/dg/key-management.html'
CHECK_CAF_EPIC_extra7108='Data Protection'
extra7108(){
for regx in ${REGIONS}; do
LIST_SM_NB_JOBS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-training-jobs --query 'TrainingJobSummaries[*].TrainingJobName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_JOBS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list training jobs" "$regx"
continue
fi
if [[ $LIST_SM_NB_JOBS ]];then
for nb_job_name in $LIST_SM_NB_JOBS; do
SM_JOB_KMSENCRYPTION=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-training-job --training-job-name $nb_job_name --query 'ResourceConfig.VolumeKmsKeyId' --output text)
if [[ "${SM_JOB_KMSENCRYPTION}" == "None" ]];then
textFail "${regx}: Sagemaker Trainings job $nb_job_name has KMS encryption disabled" "${regx}" "$nb_job_name"
else
textPass "${regx}: Sagemaker Trainings job $nb_job_name has KSM encryption enabled" "${regx}" "$nb_job_name"
fi
done
else
textInfo "${regx}: No Sagemaker Trainings jobs found" "${regx}"
fi
done
}

48
checks/check_extra7109 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7109="7.109"
CHECK_TITLE_extra7109="[extra7109] Check if Amazon SageMaker Training jobs have network isolation enabled"
CHECK_SCORED_extra7109="NOT_SCORED"
CHECK_CIS_LEVEL_extra7109="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7109="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7109="extra7109"
CHECK_SEVERITY_extra7109="Medium"
CHECK_SERVICENAME_extra7109="sagemaker"
CHECK_RISK_extra7109='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7109='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7109='https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html'
CHECK_CAF_EPIC_extra7109='Infrastructure Security'
extra7109(){
for regx in ${REGIONS}; do
LIST_SM_NB_JOBS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-training-jobs --query 'TrainingJobSummaries[*].TrainingJobName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_JOBS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list training jobs" "$regx"
continue
fi
if [[ $LIST_SM_NB_JOBS ]];then
for nb_job_name in $LIST_SM_NB_JOBS; do
SM_NB_NETWORKISOLATION=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-training-job --training-job-name $nb_job_name --query 'EnableNetworkIsolation' --output text)
if [[ $SM_NB_NETWORKISOLATION == False ]]; then
textFail "${regx}: Sagemaker Training job $nb_job_name has network isolation disabled" "${regx}" "$nb_job_name"
else
textPass "${regx}: Sagemaker Training job $nb_job_name has network isolation enabled" "${regx}" "$nb_job_name"
fi
done
else
textInfo "${regx}: No Sagemaker Trainings jobs found" "${regx}"
fi
done
}

44
checks/check_extra711 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_extra711="7.11"
CHECK_TITLE_extra711="[extra711] Check for Publicly Accessible Redshift Clusters"
CHECK_SCORED_extra711="NOT_SCORED"
CHECK_CIS_LEVEL_extra711="EXTRA"
CHECK_SEVERITY_extra711="High"
CHECK_ASFF_RESOURCE_TYPE_extra711="AwsRedshiftCluster"
CHECK_ALTERNATE_check711="extra711"
CHECK_SERVICENAME_extra711="redshift"
CHECK_RISK_extra711='Publicly accessible services could expose sensitive data to bad actors.'
CHECK_REMEDIATION_extra711='List all shared Redshift clusters and make sure there is a business reason for them.'
CHECK_DOC_extra711='https://docs.aws.amazon.com/redshift/latest/mgmt/managing-clusters-vpc.html'
CHECK_CAF_EPIC_extra711='Data Protection'
extra711(){
# "Check for Publicly Accessible Redshift Clusters "
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 2>&1)
if [[ $(echo "$LIST_OF_PUBLIC_REDSHIFT_CLUSTERS" | grep -E 'AccessDenied|UnauthorizedOperation') ]]; then
textInfo "$regx: Access Denied trying to describe clusters" "$regx"
continue
fi
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" "$CLUSTER_ID"
done <<< "$LIST_OF_PUBLIC_REDSHIFT_CLUSTERS"
else
textPass "$regx: no Publicly Accessible Redshift Clusters found" "$regx" "$CLUSTER_ID"
fi
done
}

48
checks/check_extra7110 Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7110="7.110"
CHECK_TITLE_extra7110="[extra7110] Check if Amazon SageMaker Training job have VPC settings configured."
CHECK_SCORED_extra7110="NOT_SCORED"
CHECK_CIS_LEVEL_extra7110="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7110="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7110="extra7110"
CHECK_SEVERITY_extra7110="Medium"
CHECK_SERVICENAME_extra7110="sagemaker"
CHECK_RISK_extra7110='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7110='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7110='https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html'
CHECK_CAF_EPIC_extra7110='Infrastructure Security'
extra7110(){
for regx in ${REGIONS}; do
LIST_SM_NB_JOBS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-training-jobs --query 'TrainingJobSummaries[*].TrainingJobName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_JOBS" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list training jobs" "$regx"
continue
fi
if [[ $LIST_SM_NB_JOBS ]];then
for nb_job_name in $LIST_SM_NB_JOBS; do
SM_NB_SUBNETS=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-training-job --training-job-name $nb_job_name --query 'VpcConfig.Subnets' --output text)
if [[ $SM_NB_SUBNETS == "None" ]]; then
textFail "${regx}: Sagemaker Training job $nb_job_name has VPC settings for the training job volume and output disabled" "${regx}" "$nb_job_name"
else
textPass "${regx}: Sagemaker Training job $nb_job_name has VPC settings for the training job volume and output enabled" "${regx}" "$nb_job_name"
fi
done
else
textInfo "${regx}: No Sagemaker Trainings jobs found" "${regx}"
fi
done
}

51
checks/check_extra7111 Normal file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7111="7.111"
CHECK_TITLE_extra7111="[extra7111] Check if Amazon SageMaker Notebook instances have direct internet access"
CHECK_SCORED_extra7111="NOT_SCORED"
CHECK_CIS_LEVEL_extra7111="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7111="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7111="extra7111"
CHECK_SEVERITY_extra7111="Medium"
CHECK_SERVICENAME_extra7111="sagemaker"
CHECK_RISK_extra7111='This could provide an avenue for unauthorized access to your data.'
CHECK_REMEDIATION_extra7111='Restrict which traffic can access by launching Studio in a Virtual Private Cloud (VPC) of your choosing.'
CHECK_DOC_extra7111='https://docs.aws.amazon.com/sagemaker/latest/dg/interface-vpc-endpoint.html'
CHECK_CAF_EPIC_extra7111='Infrastructure Security'
extra7111(){
for regx in ${REGIONS}; do
LIST_SM_NB_INSTANCES=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-notebook-instances --query 'NotebookInstances[*].NotebookInstanceName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list notebook instances" "$regx"
continue
fi
if [[ $LIST_SM_NB_INSTANCES ]];then
for nb_instance in $LIST_SM_NB_INSTANCES; do
SM_NB_DIRECTINET=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-notebook-instance --notebook-instance-name $nb_instance --query 'DirectInternetAccess' --output text 2>&1)
if [[ $(echo "$SM_NB_DIRECTINET" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to describe notebook instances" "$regx"
continue
fi
if [[ "${SM_NB_DIRECTINET}" == "Enabled" ]]; then
textFail "${regx}: Sagemaker Notebook instance $nb_instance has direct internet access enabled" "${regx}" "$nb_instance"
else
textPass "${regx}: Sagemaker Notebook instance $nb_instance has direct internet access disabled" "${regx}" "$nb_instance"
fi
done
else
textInfo "${regx}: No Sagemaker Notebook instances found" "${regx}"
fi
done
}

47
checks/check_extra7112 Normal file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Prowler - the handy cloud security tool (copyright 2020) 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_extra7112="7.112"
CHECK_TITLE_extra7112="[extra7112] Check if Amazon SageMaker Notebook instances have data encryption enabled"
CHECK_SCORED_extra7112="NOT_SCORED"
CHECK_CIS_LEVEL_extra7112="EXTRA"
CHECK_ASFF_RESOURCE_TYPE_extra7112="AwsSageMakerNotebookInstance"
CHECK_ALTERNATE_check7112="extra7112"
CHECK_SEVERITY_extra7112="Medium"
CHECK_SERVICENAME_extra7112="sagemaker"
CHECK_RISK_extra7112='Data exfiltration could happen if information is not protected. KMS keys provide additional security level to IAM policies.'
CHECK_REMEDIATION_extra7112='Specify AWS KMS keys to use for input and output from S3 and EBS.'
CHECK_DOC_extra7112='https://docs.aws.amazon.com/sagemaker/latest/dg/key-management.html'
CHECK_CAF_EPIC_extra7112='Data Protection'
extra7112(){
for regx in ${REGIONS}; do
LIST_SM_NB_INSTANCES=$($AWSCLI $PROFILE_OPT --region $regx sagemaker list-notebook-instances --query 'NotebookInstances[*].NotebookInstanceName' --output text 2>&1)
if [[ $(echo "$LIST_SM_NB_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to list notebook instances" "$regx"
continue
fi
if [[ $LIST_SM_NB_INSTANCES ]];then
for nb_instance in $LIST_SM_NB_INSTANCES; do
SM_NB_KMSKEY=$($AWSCLI $PROFILE_OPT --region $regx sagemaker describe-notebook-instance --notebook-instance-name $nb_instance --query 'KmsKeyId' --output text)
if [[ "${SM_NB_KMSKEY}" == "None" ]]; then
textFail "${regx}: Sagemaker Notebook instance $nb_instance has data encryption disabled" "${regx}" "$nb_instance"
else
textPass "${regx}: Sagemaker Notebook instance $nb_instance has data encryption enabled" "${regx}" "$nb_instance"
fi
done
else
textInfo "${regx}: No Sagemaker Notebook instances found" "${regx}"
fi
done
}

58
checks/check_extra7113 Normal file
View File

@@ -0,0 +1,58 @@
#!/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.
# Remediation:
#
# https://www.cloudconformity.com/knowledge-base/aws/RDS/instance-deletion-protection.html
# https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html
#
# aws rds modify-db-instance \
# --region us-east-1 \
# --db-instance-identifier test-db \
# --deletion-protection \
# [--apply-immediately | --no-apply-immediately]
CHECK_ID_extra7113="7.113"
CHECK_TITLE_extra7113="[extra7113] Check if RDS instances have deletion protection enabled "
CHECK_SCORED_extra7113="NOT_SCORED"
CHECK_CIS_LEVEL_extra7113="EXTRA"
CHECK_SEVERITY_extra7113="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7113="AwsRdsDbInstance"
CHECK_ALTERNATE_check7113="extra7113"
CHECK_SERVICENAME_extra7113="rds"
CHECK_RISK_extra7113='You can only delete instances that do not have deletion protection enabled.'
CHECK_REMEDIATION_extra7113='Enable deletion protection using the AWS Management Console for production DB instances.'
CHECK_DOC_extra7113='https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html'
CHECK_CAF_EPIC_extra7113='Data Protection'
extra7113(){
for regx in $REGIONS; do
LIST_OF_RDS_INSTANCES=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --query "DBInstances[?Engine != 'docdb'].DBInstanceIdentifier" --output text 2>&1)
if [[ $(echo "$LIST_OF_RDS_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to describe DB instances" "$regx"
continue
fi
if [[ $LIST_OF_RDS_INSTANCES ]];then
for rdsinstance in $LIST_OF_RDS_INSTANCES; do
IS_DELETIONPROTECTION=$($AWSCLI rds describe-db-instances $PROFILE_OPT --region $regx --db-instance-identifier $rdsinstance --query 'DBInstances[*].DeletionProtection' --output text)
if [[ $IS_DELETIONPROTECTION == "False" ]]; then
textFail "$regx: RDS instance $rdsinstance deletion protection is not enabled!" "$regx" "$rdsinstance"
else
textPass "$regx: RDS instance $rdsinstance deletion protection is enabled" "$regx" "$rdsinstance"
fi
done
else
textInfo "$regx: No RDS instances found" "$regx"
fi
done
}

55
checks/check_extra7114 Normal file
View File

@@ -0,0 +1,55 @@
#!/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_extra7114="7.114"
CHECK_TITLE_extra7114="[extra7114] Check if Glue development endpoints have S3 encryption enabled."
CHECK_SCORED_extra7114="NOT_SCORED"
CHECK_CIS_LEVEL_extra7114="EXTRA"
CHECK_SEVERITY_extra7114="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7114="AwsGlue"
CHECK_ALTERNATE_check7114="extra7114"
CHECK_SERVICENAME_extra7114="glue"
CHECK_RISK_extra7114='Data exfiltration could happen if information is not protected. KMS keys provide additional security level to IAM policies.'
CHECK_REMEDIATION_extra7114='Specify AWS KMS keys to use for input and output from S3 and EBS.'
CHECK_DOC_extra7114='https://docs.aws.amazon.com/glue/latest/dg/encryption-security-configuration.html'
CHECK_CAF_EPIC_extra7114='Data Protection'
extra7114(){
for regx in $REGIONS; do
LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json 2>&1)
if [[ $(echo "$LIST_EP_SC" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get dev endpoints" "$regx"
continue
fi
if [[ $LIST_EP_SC != '[]' ]]; then
for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do
ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name')
ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty')
if [[ ! -z "$ENDPOINT_SC" ]]; then
ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.S3Encryption[0].S3EncryptionMode' --output text)
if [[ "$ENDPOINT_SC_ENCRYPTION" == "DISABLED" ]]; then
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have S3 encryption enabled!" "$regx" "$ENDPOINT_NAME"
else
textPass "$regx: Glue development endpoint $ENDPOINT_NAME has S3 encryption enabled" "$regx" "$ENDPOINT_NAME"
fi
else
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" "$ENDPOINT_NAME"
fi
done
else
textInfo "$regx: There are no Glue development endpoints" "$regx"
fi
done
}

47
checks/check_extra7115 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_extra7115="7.115"
CHECK_TITLE_extra7115="[extra7115] Check if Glue database connection has SSL connection enabled."
CHECK_SCORED_extra7115="NOT_SCORED"
CHECK_CIS_LEVEL_extra7115="EXTRA"
CHECK_SEVERITY_extra7115="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7115="AwsGlue"
CHECK_ALTERNATE_check7115="extra7115"
CHECK_SERVICENAME_extra7115="glue"
CHECK_RISK_extra7115='Data exfiltration could happen if information is not protected in transit.'
CHECK_REMEDIATION_extra7115='Configure encryption settings for crawlers; ETL jobs; and development endpoints using security configurations in AWS Glue.'
CHECK_DOC_extra7115='https://docs.aws.amazon.com/glue/latest/dg/encryption-in-transit.html'
CHECK_CAF_EPIC_extra7115='Data Protection'
extra7115(){
for regx in $REGIONS; do
CONNECTION_LIST=$($AWSCLI glue get-connections $PROFILE_OPT --region $regx --output json --query 'ConnectionList[*].{Name:Name,SSL:ConnectionProperties.JDBC_ENFORCE_SSL}' 2>&1)
if [[ $(echo "$CONNECTION_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get connections" "$regx"
continue
fi
if [[ $CONNECTION_LIST != '[]' ]]; then
for connection in $(echo "${CONNECTION_LIST}" | jq -r '.[] | @base64'); do
CONNECTION_NAME=$(echo $connection | base64 --decode | jq -r '.Name' )
CONNECTION_SSL_STATE=$(echo $connection | base64 --decode | jq -r '.SSL')
if [[ "$CONNECTION_SSL_STATE" == "false" ]]; then
textFail "$regx: Glue connection $CONNECTION_NAME has SSL connection disabled" "$regx" "$CONNECTION_NAME"
else
textPass "$regx: Glue connection $CONNECTION_NAME has SSL connection enabled" "$regx" "$CONNECTION_NAME"
fi
done
else
textInfo "$regx: There are no Glue connections" "$regx"
fi
done
}

44
checks/check_extra7116 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_extra7116="7.116"
CHECK_TITLE_extra7116="[extra7116] Check if Glue data catalog settings have metadata encryption enabled."
CHECK_SCORED_extra7116="NOT_SCORED"
CHECK_CIS_LEVEL_extra7116="EXTRA"
CHECK_SEVERITY_extra7116="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7116="AwsGlue"
CHECK_ALTERNATE_check7116="extra7116"
CHECK_SERVICENAME_extra7116="glue"
CHECK_RISK_extra7116='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7116='Enable Encryption. Use a CMK where possible. It will provide additional management and privacy benefits.'
CHECK_DOC_extra7116='https://docs.aws.amazon.com/glue/latest/dg/encrypt-glue-data-catalog.html'
CHECK_CAF_EPIC_extra7116='Data Protection'
extra7116(){
for regx in $REGIONS; do
TABLE_LIST=$($AWSCLI glue search-tables --max-results 1 $PROFILE_OPT --region $regx --output text --query 'TableList[*]' 2>&1)
if [[ $(echo "$TABLE_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to search tables" "$regx"
continue
fi
if [[ ! -z $TABLE_LIST ]]; then
METADATA_ENCRYPTED=$($AWSCLI glue get-data-catalog-encryption-settings $PROFILE_OPT --region $regx --output text --query "DataCatalogEncryptionSettings.EncryptionAtRest.CatalogEncryptionMode")
if [[ "$METADATA_ENCRYPTED" == "DISABLED" ]]; then
textFail "$regx: Glue data catalog settings have metadata encryption disabled" "$regx"
else
textPass "$regx: Glue data catalog settings have metadata encryption enabled" "$regx"
fi
else
textInfo "$regx: Glue data catalog settings metadata encryption does not apply since there are no tables" "$regx"
fi
done
}

44
checks/check_extra7117 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_extra7117="7.117"
CHECK_TITLE_extra7117="[extra7117] Check if Glue data catalog settings have encrypt connection password enabled."
CHECK_SCORED_extra7117="NOT_SCORED"
CHECK_CIS_LEVEL_extra7117="EXTRA"
CHECK_SEVERITY_extra7117="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7117="AwsGlue"
CHECK_ALTERNATE_check7117="extra7117"
CHECK_SERVICENAME_extra7117="glue"
CHECK_RISK_extra7117='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7117='On the AWS Glue console; you can enable this option on the Data catalog settings page.'
CHECK_DOC_extra7117='https://docs.aws.amazon.com/glue/latest/dg/encrypt-connection-passwords.html'
CHECK_CAF_EPIC_extra7117='Data Protection'
extra7117(){
for regx in $REGIONS; do
CONNECTION_LIST=$($AWSCLI glue get-connections $PROFILE_OPT --region $regx --output text --query 'ConnectionList[*]' 2>&1)
if [[ $(echo "$CONNECTION_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get connections" "$regx"
continue
fi
if [[ ! -z $CONNECTION_LIST ]]; then
METADATA_ENCRYPTED=$($AWSCLI glue get-data-catalog-encryption-settings $PROFILE_OPT --region $regx --output text --query "DataCatalogEncryptionSettings.ConnectionPasswordEncryption.ReturnConnectionPasswordEncrypted")
if [[ "$METADATA_ENCRYPTED" == "False" ]]; then
textFail "$regx: Glue data catalog connection password is not encrypted" "$regx"
else
textPass "$regx: Glue data catalog connection password is encrypted" "$regx"
fi
else
textInfo "$regx: Glue data catalog connection password encryption does not apply since there are no connections" "$regx"
fi
done
}

59
checks/check_extra7118 Normal file
View File

@@ -0,0 +1,59 @@
#!/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_extra7118="7.118"
CHECK_TITLE_extra7118="[extra7118] Check if Glue ETL Jobs have S3 encryption enabled."
CHECK_SCORED_extra7118="NOT_SCORED"
CHECK_CIS_LEVEL_extra7118="EXTRA"
CHECK_SEVERITY_extra7118="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7118="AwsGlue"
CHECK_ALTERNATE_check7118="extra7118"
CHECK_SERVICENAME_extra7118="glue"
CHECK_RISK_extra7118='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7118='Provide the encryption properties that are used by crawlers; jobs; and development endpoints.'
CHECK_DOC_extra7118='https://docs.aws.amazon.com/glue/latest/dg/console-security-configurations.html'
CHECK_CAF_EPIC_extra7118='Data Protection'
extra7118(){
for regx in $REGIONS; do
JOB_LIST=$($AWSCLI glue get-jobs $PROFILE_OPT --region $regx --output json --query 'Jobs[*].{Name:Name,SecurityConfiguration:SecurityConfiguration,JobEncryption:DefaultArguments."--encryption-type"}' 2>&1)
if [[ $(echo "$JOB_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get jobs" "$regx"
continue
fi
if [[ $JOB_LIST != '[]' ]]; then
for job in $(echo "${JOB_LIST}" | jq -r '.[] | @base64'); do
JOB_NAME=$(echo $job | base64 --decode | jq -r '.Name')
SECURITY_CONFIGURATION=$(echo $job | base64 --decode | jq -r '.SecurityConfiguration // empty')
JOB_ENCRYPTION=$(echo $job | base64 --decode | jq -r '.JobEncryption // empty')
if [[ ! -z "$SECURITY_CONFIGURATION" ]]; then
S3_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${SECURITY_CONFIGURATION}" $PROFILE_OPT --region $regx --output text --query 'SecurityConfiguration.EncryptionConfiguration.S3Encryption[0].S3EncryptionMode')
if [[ "$S3_ENCRYPTION" == "DISABLED" ]]; then
if [[ ! -z "$JOB_ENCRYPTION" ]]; then
textPass "$regx: Glue job $JOB_NAME does have $JOB_ENCRYPTION for S3 encryption enabled" "$regx" "$JOB_NAME"
else
textFail "$regx: Glue job $JOB_NAME does not have S3 encryption enabled" "$regx" "$JOB_NAME"
fi
else
textPass "$regx: Glue job $JOB_NAME does have $S3_ENCRYPTION for S3 encryption enabled" "$regx" "$JOB_NAME"
fi
elif [[ ! -z "$JOB_ENCRYPTION" ]]; then
textPass "$regx: Glue job $JOB_NAME does have $JOB_ENCRYPTION for S3 encryption enabled" "$regx" "$JOB_NAME"
else
textFail "$regx: Glue job $JOB_NAME does not have S3 encryption enabled" "$regx" "$JOB_NAME"
fi
done
else
textInfo "$regx: There are no Glue jobs" "$regx"
fi
done
}

53
checks/check_extra7119 Normal file
View File

@@ -0,0 +1,53 @@
#!/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_extra7119="7.119"
CHECK_TITLE_extra7119="[extra7119] Check if Glue development endpoints have CloudWatch logs encryption enabled."
CHECK_SCORED_extra7119="NOT_SCORED"
CHECK_CIS_LEVEL_extra7119="EXTRA"
CHECK_SEVERITY_extra7119="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7119="AwsGlue"
CHECK_ALTERNATE_check7119="extra7119"
CHECK_SERVICENAME_extra7119="glue"
CHECK_RISK_extra7119='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7119='Enable Encryption in the Security configurations.'
CHECK_DOC_extra7119='https://docs.aws.amazon.com/glue/latest/dg/console-security-configurations.html'
CHECK_CAF_EPIC_extra7119='Logging and Monitoring'
extra7119(){
for regx in $REGIONS; do
LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json 2>&1)
if [[ $(echo "$LIST_EP_SC" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get dev endpoints" "$regx"
continue
fi
if [[ $LIST_EP_SC != '[]' ]]; then
for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do
ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name')
ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty')
if [[ ! -z "$ENDPOINT_SC" ]]; then
ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.CloudWatchEncryption.CloudWatchEncryptionMode' --output text)
if [[ $ENDPOINT_SC_ENCRYPTION == "DISABLED" ]]; then
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have CloudWatch logs encryption enabled!" "$regx" "$ENDPOINT_NAME"
else
textPass "$regx: Glue development endpoint $ENDPOINT_NAME has CloudWatch logs encryption enabled" "$regx" "$ENDPOINT_NAME"
fi
else
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" "$ENDPOINT_NAME"
fi
done
else
textInfo "$regx: There are no Glue development endpoints" "$regx"
fi
done
}

44
checks/check_extra712 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_extra712="7.12"
CHECK_TITLE_extra712="[extra712] Check if Amazon Macie is enabled"
CHECK_SCORED_extra712="NOT_SCORED"
CHECK_CIS_LEVEL_extra712="EXTRA"
CHECK_SEVERITY_extra712="Low"
CHECK_ALTERNATE_check712="extra712"
CHECK_ASFF_RESOURCE_TYPE_extra712="AwsMacieSession"
CHECK_SERVICENAME_extra712="macie"
CHECK_RISK_extra712='Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to help you discover; monitor; and protect your sensitive data in AWS.'
CHECK_REMEDIATION_extra712='Enable Amazon Macie and create appropriate jobs to discover sensitive data.'
CHECK_DOC_extra712='https://docs.aws.amazon.com/macie/latest/user/getting-started.html'
CHECK_CAF_EPIC_extra712='Data Protection'
extra712(){
# Macie supports get-macie-session which tells the current status, if not Disabled.
# Capturing the STDOUT can help determine when Disabled.
for region in $REGIONS; do
MACIE_STATUS=$($AWSCLI macie2 get-macie-session ${PROFILE_OPT} --region "$region" --query status --output text 2>&1)
if [[ "$MACIE_STATUS" == "ENABLED" ]]; then
textPass "$region: Macie is enabled." "$region"
elif [[ "$MACIE_STATUS" == "PAUSED" ]]; then
textFail "$region: Macie is currently in a SUSPENDED state." "$region"
elif grep -q -E 'Macie is not enabled' <<< "${MACIE_STATUS}"; then
textFail "$region: Macie is not enabled." "$region"
elif grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError' <<< "${MACIE_STATUS}"; then
textInfo "$region: Access Denied trying to get AWS Macie information." "$region"
fi
done
}

52
checks/check_extra7120 Normal file
View File

@@ -0,0 +1,52 @@
#!/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_extra7120="7.120"
CHECK_TITLE_extra7120="[extra7120] Check if Glue ETL Jobs have CloudWatch Logs encryption enabled."
CHECK_SCORED_extra7120="NOT_SCORED"
CHECK_CIS_LEVEL_extra7120="EXTRA"
CHECK_SEVERITY_extra7120="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7120="AwsGlue"
CHECK_ALTERNATE_check7120="extra7120"
CHECK_SERVICENAME_extra7120="glue"
CHECK_RISK_extra7120='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7120='Enable Encryption in the Security configurations.'
CHECK_DOC_extra7120='https://docs.aws.amazon.com/glue/latest/dg/console-security-configurations.html'
CHECK_CAF_EPIC_extra7120='Logging and Monitoring'
extra7120(){
for regx in $REGIONS; do
JOB_LIST=$($AWSCLI glue get-jobs $PROFILE_OPT --region $regx --output json --query 'Jobs[*].{Name:Name,SecurityConfiguration:SecurityConfiguration}' 2>&1)
if [[ $(echo "$JOB_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get jobs" "$regx"
continue
fi
if [[ $JOB_LIST != '[]' ]]; then
for job in $(echo "${JOB_LIST}" | jq -r '.[] | @base64'); do
JOB_NAME=$(echo $job | base64 --decode | jq -r '.Name')
SECURITY_CONFIGURATION=$(echo $job | base64 --decode | jq -r '.SecurityConfiguration // empty')
if [[ ! -z "$SECURITY_CONFIGURATION" ]]; then
CLOUDWATCH_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${SECURITY_CONFIGURATION}" $PROFILE_OPT --region $regx --output text --query 'SecurityConfiguration.EncryptionConfiguration.CloudWatchEncryption.CloudWatchEncryptionMode')
if [[ "$CLOUDWATCH_ENCRYPTION" == "DISABLED" ]]; then
textFail "$regx: Glue job $JOB_NAME does not have CloudWatch Logs encryption enabled" "$regx" "$JOB_NAME"
else
textPass "$regx: Glue job $JOB_NAME does have $CLOUDWATCH_ENCRYPTION CloudWatch Logs encryption enabled" "$regx" "$JOB_NAME"
fi
else
textFail "$regx: Glue job $JOB_NAME does not have CloudWatch Logs encryption enabled" "$regx" "$JOB_NAME"
fi
done
else
textInfo "$regx: There are no Glue jobs" "$regx"
fi
done
}

55
checks/check_extra7121 Normal file
View File

@@ -0,0 +1,55 @@
#!/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_extra7121="7.121"
CHECK_TITLE_extra7121="[extra7121] Check if Glue development endpoints have Job bookmark encryption enabled."
CHECK_SCORED_extra7121="NOT_SCORED"
CHECK_CIS_LEVEL_extra7121="EXTRA"
CHECK_SEVERITY_extra7121="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7121="AwsGlue"
CHECK_ALTERNATE_check7121="extra7121"
CHECK_SERVICENAME_extra7121="glue"
CHECK_RISK_extra7121='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7121='Enable Encryption in the Security configurations.'
CHECK_DOC_extra7121='https://docs.aws.amazon.com/glue/latest/dg/console-security-configurations.html'
CHECK_CAF_EPIC_extra7121='Data Protection'
extra7121(){
for regx in $REGIONS; do
LIST_EP_SC=$($AWSCLI glue get-dev-endpoints $PROFILE_OPT --region $regx --query 'DevEndpoints[*].{Name:EndpointName,Security:SecurityConfiguration}' --output json 2>&1)
if [[ $(echo "$LIST_EP_SC" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get dev endpoints" "$regx"
continue
fi
if [[ $LIST_EP_SC != '[]' ]]; then
for ep in $(echo "${LIST_EP_SC}"| jq -r '.[] | @base64');do
ENDPOINT_NAME=$(echo $ep | base64 --decode | jq -r '.Name')
ENDPOINT_SC=$(echo $ep | base64 --decode | jq -r '.Security // empty')
if [[ ! -z "$ENDPOINT_SC" ]]; then
ENDPOINT_SC_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${ENDPOINT_SC}" $PROFILE_OPT --region $regx --query 'SecurityConfiguration.EncryptionConfiguration.JobBookmarksEncryption.JobBookmarksEncryptionMode' --output text)
if [[ "$ENDPOINT_SC_ENCRYPTION" == "DISABLED" ]]; then
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have Job Bookmark encryption enabled!" "$regx" "$ENDPOINT_NAME"
else
textPass "$regx: Glue development endpoint $ENDPOINT_NAME has Job Bookmark encryption enabled" "$regx" "$ENDPOINT_NAME"
fi
else
textFail "$regx: Glue development endpoint $ENDPOINT_NAME does not have security configuration" "$regx" "$ENDPOINT_NAME"
fi
done
else
textInfo "$regx: There are no Glue development endpoints" "$regx"
fi
done
}

52
checks/check_extra7122 Normal file
View File

@@ -0,0 +1,52 @@
#!/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_extra7122="7.122"
CHECK_TITLE_extra7122="[extra7122] Check if Glue ETL Jobs have Job bookmark encryption enabled."
CHECK_SCORED_extra7122="NOT_SCORED"
CHECK_CIS_LEVEL_extra7122="EXTRA"
CHECK_SEVERITY_extra7122="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7122="AwsGlue"
CHECK_ALTERNATE_check7122="extra7122"
CHECK_SERVICENAME_extra7122="glue"
CHECK_RISK_extra7122='If not enabled sensitive information at rest is not protected.'
CHECK_REMEDIATION_extra7122='Enable Encryption in the Security configurations.'
CHECK_DOC_extra7122='https://docs.aws.amazon.com/glue/latest/dg/console-security-configurations.html'
CHECK_CAF_EPIC_extra7122='Data Protection'
extra7122(){
for regx in $REGIONS; do
JOB_LIST=$($AWSCLI glue get-jobs $PROFILE_OPT --region $regx --output json --query 'Jobs[*].{Name:Name,SecurityConfiguration:SecurityConfiguration}' 2>&1)
if [[ $(echo "$JOB_LIST" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to get jobs" "$regx"
continue
fi
if [[ $JOB_LIST != '[]' ]]; then
for job in $(echo "${JOB_LIST}" | jq -r '.[] | @base64'); do
JOB_NAME=$(echo $job | base64 --decode | jq -r '.Name')
SECURITY_CONFIGURATION=$(echo $job | base64 --decode | jq -r '.SecurityConfiguration // empty')
if [[ ! -z "$SECURITY_CONFIGURATION" ]]; then
JOB_BOOKMARK_ENCRYPTION=$($AWSCLI glue get-security-configuration --name "${SECURITY_CONFIGURATION}" $PROFILE_OPT --region $regx --output text --query 'SecurityConfiguration.EncryptionConfiguration.JobBookmarksEncryption.JobBookmarksEncryptionMode')
if [[ "$JOB_BOOKMARK_ENCRYPTION" == "DISABLED" ]]; then
textFail "$regx: Glue job $JOB_NAME does not have Job bookmark encryption enabled" "$regx" "$JOB_NAME"
else
textPass "$regx: Glue job $JOB_NAME does have $JOB_BOOKMARK_ENCRYPTION for Job bookmark encryption enabled" "$regx" "$JOB_NAME"
fi
else
textFail "$regx: Glue job $JOB_NAME does not have Job bookmark encryption enabled" "$regx" "$JOB_NAME"
fi
done
else
textInfo "$regx: There are no Glue jobs" "$regx"
fi
done
}

38
checks/check_extra7123 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_extra7123="7.123"
CHECK_TITLE_extra7123="[extra7123] Check if IAM users have two active access keys"
CHECK_SCORED_extra7123="NOT_SCORED"
CHECK_CIS_LEVEL_extra7123="EXTRA"
CHECK_SEVERITY_extra7123="Medium"
CHECK_ASFF_TYPE_extra7123="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
CHECK_ASFF_RESOURCE_TYPE_extra7123="AwsIamUser"
CHECK_ALTERNATE_check7123="extra7123"
CHECK_ASFF_COMPLIANCE_TYPE_extra7123="ens-op.acc.1.aws.iam.2"
CHECK_SERVICENAME_extra7123="iam"
CHECK_RISK_extra7123='Access Keys could be lost or stolen. It creates a critical risk.'
CHECK_REMEDIATION_extra7123='Avoid using long lived access keys.'
CHECK_DOC_extra7123='https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListAccessKeys.html'
CHECK_CAF_EPIC_extra7123='IAM'
extra7123(){
LIST_OF_USERS_WITH_2ACCESS_KEYS=$(cat $TEMP_REPORT_FILE| awk -F, '{ print $1, $9, $14 }' |grep "\ true\ true" | awk '{ print $1 }')
if [[ $LIST_OF_USERS_WITH_2ACCESS_KEYS ]]; then
# textFail "Users with access key 1 older than 90 days:"
for user in $LIST_OF_USERS_WITH_2ACCESS_KEYS; do
textFail "User $user has 2 active access keys" "$REGION" "$user"
done
else
textPass "No users with 2 active access keys" "$REGION"
fi
}

52
checks/check_extra7124 Normal file
View File

@@ -0,0 +1,52 @@
#!/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_extra7124="7.124"
CHECK_TITLE_extra7124="[extra7124] Check if EC2 instances are managed by Systems Manager."
CHECK_SCORED_extra7124="NOT_SCORED"
CHECK_CIS_LEVEL_extra7124="EXTRA"
CHECK_SEVERITY_extra7124="Medium"
CHECK_ASFF_RESOURCE_TYPE_extra7124="AwsEc2Instance"
CHECK_ALTERNATE_check7124="extra7124"
CHECK_ASFF_COMPLIANCE_TYPE_extra7124="ens-op.exp.1.aws.sys.1 ens-op.acc.4.aws.sys.1"
CHECK_SERVICENAME_extra7124="ssm"
CHECK_RISK_extra7124='AWS Config provides AWS Managed Rules; which are predefined; customizable rules that AWS Config uses to evaluate whether your AWS resource configurations comply with common best practices.'
CHECK_REMEDIATION_extra7124='Verify and apply Systems Manager Prerequisites.'
CHECK_DOC_extra7124='https://docs.aws.amazon.com/systems-manager/latest/userguide/managed_instances.html'
CHECK_CAF_EPIC_extra7124='Infrastructure Security'
extra7124(){
for regx in $REGIONS; do
# Filters running instances only
LIST_EC2_INSTANCES=$($AWSCLI ec2 describe-instances $PROFILE_OPT --query 'Reservations[*].Instances[*].[InstanceId]' --filters Name=instance-state-name,Values=running --region $regx --output text 2>&1)
if [[ $(echo "$LIST_EC2_INSTANCES" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
textInfo "$regx: Access Denied trying to describe instances" "$regx"
continue
fi
if [[ $LIST_EC2_INSTANCES ]]; then
LIST_SSM_MANAGED_INSTANCES=$($AWSCLI ssm describe-instance-information $PROFILE_OPT --query "InstanceInformationList[].InstanceId" --region $regx | jq -r '.[]')
LIST_EC2_UNMANAGED=$(echo ${LIST_SSM_MANAGED_INSTANCES[@]} ${LIST_EC2_INSTANCES[@]} | tr ' ' '\n' | sort | uniq -u)
if [[ $LIST_EC2_UNMANAGED ]]; then
for instance in $LIST_EC2_UNMANAGED; do
textFail "$regx: EC2 instance $instance is not managed by Systems Manager" "$regx" "$instance"
done
fi
if [[ $LIST_SSM_MANAGED_INSTANCES ]]; then
for instance in $LIST_SSM_MANAGED_INSTANCES; do
textPass "$regx: EC2 instance $instance is managed by Systems Manager" "$regx" "$instance"
done
fi
else
textInfo "$regx: No EC2 instances running found" "$regx"
fi
done
}

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