Commit Graph

32 Commits

Author SHA1 Message Date
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
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
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
Pepe Fagoaga 5c6902b459 fix(extra730): Handle invalid date formats checking ACM certificates (#1033) 2022-02-09 17:56:55 +01: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 3dfca9c9dd Improved html output with scoring information 2021-04-08 00:14:24 +02: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
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
C.J bf1bd505c5 Fix for busybox date command 2021-01-12 09:11:52 -05:00
Toni de la Fuente 953bdf3034 Merge branch 'master' into master 2020-12-18 10:24:25 +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
Michael Dickinson 8ab91e9f8e fix: Store assumed role expiry time for later checking 2020-11-23 21:05:11 +00: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
Joaquin Rinaudo f6d17ba6e0 fix(securityhub): consistency + prefix bug + PASSED
fix(securityhub): consistency + prefix bug + PASSED
2020-11-12 21:48:21 +01:00
Joaquin Rinaudo 321401f755 fix(securityhub): other os/check fixes + batch in 100 findings 2020-09-24 09:34:09 +02:00
Joaquin Rinaudo c1b09b6b9d bugfix(securityhub): race condition fix 2020-09-18 14:52:32 +02:00
Joaquin Rinaudo ecbe997084 severity+security_hub 2020-09-03 08:04:13 +02: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
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
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
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
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
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
gabrielsoltz 085dd338f4 function os 2019-06-06 21:04:40 +01:00
Toni de la Fuente a707b382b0 Revert adding freebsd detector 2019-04-08 22:15:22 -04:00
Toni de la Fuente a2ccac97d9 Make it work in FreeBSD issue #310 2019-04-08 21:18:39 -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 e3e038127f license changes for checks 2018-04-09 15:09:30 -04:00
Toni de la Fuente a21bff31a5 create check files 2018-03-20 22:59:34 -04:00