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

Fix a couple of checkov issues on modernisation-platform-terraform-s3-bucket #4996

Closed
1 of 3 tasks
SteveLinden opened this issue Sep 13, 2023 · 13 comments
Closed
1 of 3 tasks
Assignees
Labels
firebreak Mod Platform skunk works member request Feature requested by a member to enhance the platform experience onboarding Tasks to onboard teams

Comments

@SteveLinden
Copy link
Contributor

SteveLinden commented Sep 13, 2023

There are a couple of issues popping up on the checkov checks. Ewa suggested we correct the issue rather than ignore the checkov check.

"This option is currently not supported in this module. The fix should be to allow to opt in for it by passing the sns topic arn." for Check: CKV2_AWS_62: "Ensure S3 buckets should have event notifications enabled" error

Environment details

modernisation-platform-terraform-s3-bucket
Also in closed PR ministryofjustice/modernisation-platform-terraform-s3-bucket#252

Application Name

Fix the checkov error.

Description of application

This will correct the issue popping up on the checkov overnight checks.

Definition of done

  • error corrected
  • no issues showing in the checkov checks
  • clear error log
@SteveLinden SteveLinden added onboarding Tasks to onboard teams member request Feature requested by a member to enhance the platform experience labels Sep 13, 2023
@SteveLinden SteveLinden added the firebreak Mod Platform skunk works label Sep 19, 2023
@SteveLinden SteveLinden self-assigned this Sep 19, 2023
@SteveLinden SteveLinden moved this from To Do to In Progress in Modernisation Platform Sep 21, 2023
@SteveLinden
Copy link
Contributor Author

Ignored one check that was popping up (300 - set time for failed uploads) and added some code to pick up the arn and put it in the code. Looks like this has corrected the issues but I will keep this open until the overnight run has completed. Works OK with a manual run.

@SteveLinden
Copy link
Contributor Author

Change didn't work. May need to speak @ewastempel about to understand what she needs for this.

@ewastempel
Copy link
Contributor

ewastempel commented Sep 25, 2023

The goal of this ticket is to explore if it is possible to address the following checkov issue, rather than suppressing it:
#checkov:skip=CKV2_AWS_62: "Ensure S3 buckets should have event notifications enabled"

Currently the S3 tf module does not allow for s3 bucket notifications. This ticket is to see if it can be enabled by improving the module.

This can be a useful read when implementing this:
https://francescoboffa.com/s3-bucket-notifications/
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_notification

@SteveLinden
Copy link
Contributor Author

Various changes made and lots of issues with the multiple rows in the replication section. Many errors on the terratest part so multiple plans sent through

@SteveLinden
Copy link
Contributor Author

SteveLinden commented Oct 4, 2023

After discussions we are doing something slightly different to this. It will be to stop the run if there are blank values on two variables.

Additionally, one of the failures (300) will be covered in another call #5133

@SteveLinden
Copy link
Contributor Author

Added a test so will clear out my checks and push this to be checked.

@SteveLinden
Copy link
Contributor Author

Further adjustments needed to the test process

@SteveLinden
Copy link
Contributor Author

A number of changes made and pushed up to github. This is now in a ready to review status so I will post it on the channel.

@SteveLinden
Copy link
Contributor Author

A few final changes were made to make sure the new check ran and was pushed to output. This was pushed through to main. Previous changes had accidentally been applied to main when a dependabot run was undertaken.

Will close on Monday after the checkov run is checked.

@SteveLinden
Copy link
Contributor Author

SteveLinden commented Oct 13, 2023

PRs
First
and
second

@SteveLinden
Copy link
Contributor Author

Another checkov issue popped up so this has been added to the skip list and posted to the latest PR

It was under the unit-test part which had not been tested when we worked on it. This has now been done and it is skipped.

@SteveLinden
Copy link
Contributor Author

Latest release applied. It will be checked again tomorrow after the next run. If OK it will be closed.

@SteveLinden
Copy link
Contributor Author

It worked!
After discussions the release will be set to latest and users on ask and update will be informed. They do not necessarily need to use it but it will be made available.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Modernisation Platform Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firebreak Mod Platform skunk works member request Feature requested by a member to enhance the platform experience onboarding Tasks to onboard teams
Projects
Archived in project
Development

No branches or pull requests

2 participants