Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RDS): Additional RDS checks #4233

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

sansns
Copy link
Contributor

@sansns sansns commented Jun 11, 2024

Context

  1. Add default admin user check.
  2. Backtrack is enabled on Aurora MySQL Clusters
  3. IAM Authentication is enabled for DB Instances/Clusters
  4. Snapshots are encrypted

Description

All RDS DB instances/clusters use ```admin``` as a default username other than PostgreSQL based instances/clusters which use ```postgres``` as the default user. Added checks to find both ```admin``` and ```postgres``` being the default admin username. 

Trend Cloud Conformity and AWS RDS Controls only check for ```admin```, but I also added ```postgres``` as that is the default PostgreSQL username to the check are more robust.

https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/RDS/rds-master-username.html#
https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-25
Ensure that the Backtrack feature is enabled for your Amazon Aurora (with MySQL compatibility) database clusters in order to backtrack your clusters to a specific time, without using backups. Backtrack is an Amazon RDS feature that allows you to specify the amount of time that an Aurora MySQL database cluster needs to retain change records, in order to have a fast way to recover from user errors, such as dropping the wrong table or deleting the wrong row by moving your MySQL database to a prior point in time without the need to restore from a recent backup.

Trend Cloud Conformity has it as a low priority
AWS RDS Controls has it as medium priority

DB Clusters
https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/RDS/backtrack.html#
https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-14
https://docs.aws.amazon.com/config/latest/developerguide/aurora-mysql-backtracking-enabled.html
With this feature enabled, you don't have to use a password when you connect to your MySQL/PostgreSQL database, instead you can use an authentication token. An authentication token is a unique string of characters with a lifetime of 15 minutes that Amazon RDS generates on your request. IAM Database Authentication removes the need of storing user credentials within the database configuration, because authentication is managed externally using Amazon IAM.

DB Instances
https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/RDS/iam-database-authentication.html#
https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-10

DB Clusters
https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-12
Ensure that your manual Amazon RDS database snapshots are encrypted in order to achieve compliance for data-at-rest encryption within your organization. The Amazon RDS snapshot encryption and decryption process is handled transparently and does not require any additional action from you or your application. 

https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/RDS/snapshot-encrypted.html#
https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-4

License

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

@sansns sansns requested review from a team as code owners June 11, 2024 02:49
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Jun 11, 2024
Copy link

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 98.31933% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.68%. Comparing base (daf6194) to head (366e928).
Report is 41 commits behind head on master.

Files Patch % Lines
...enabled/rds_instance_iam_authentication_enabled.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4233      +/-   ##
==========================================
+ Coverage   86.65%   86.68%   +0.02%     
==========================================
  Files         818      822       +4     
  Lines       25694    25831     +137     
==========================================
+ Hits        22265    22391     +126     
- Misses       3429     3440      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@snaow
Copy link
Member

snaow commented Jun 12, 2024

Thanks @sansns! We will review and merge/get back to you soon

@sergargar sergargar self-requested a review June 20, 2024 16:18
Copy link
Member

@sergargar sergargar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These checks are awesome, thanks @sansns !

@sergargar sergargar merged commit 9ca64e7 into prowler-cloud:master Jun 20, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants