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

Set security relevant settings on default node pool to comply with Sentinel #1038

Conversation

MajorBreakfast
Copy link
Contributor

@MajorBreakfast MajorBreakfast commented Oct 29, 2021

This PR adds some security relevant settings to the default node pool that exists temporarily during cluster creation to satisfy Terraform Enterprise Sentinel policies defined by CSO at my project.

@comment-bot-dev
Copy link

comment-bot-dev commented Oct 29, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

@MajorBreakfast
Copy link
Contributor Author

Can you share what the ci failure is about? Prior to raising the PR I planned the private-beta-cluster variant successfully.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

This is the error:

       Error: googleapi: Error 400: Cannot use default machine type (e2-medium) with gVisor; choose a different machine type., badRequest
       
         with module.example.module.gke.google_container_cluster.primary,
         on ../../../modules/beta-public-cluster/cluster.tf line 22, in resource "google_container_cluster" "primary":
         22: resource "google_container_cluster" "primary" {

@MajorBreakfast
Copy link
Contributor Author

@morgante Thank you for the quick feedback!

I've removed the sandbox from the PR to make the tests pass. Sentinel policy enforcement currently only happens for the integrity monitoring, so it's not necessary at this point.

@morgante
Copy link
Contributor

morgante commented Oct 29, 2021

/gcpbuild

@MajorBreakfast
Copy link
Contributor Author

MajorBreakfast commented Oct 29, 2021

Change of strategy: Now setting the machine type and image as well based on the value of node pool 0. This should fix it and make it so that even the gvisor can be activated. It makes also a bit more sense that the temporary default node pool uses a machine type matching what's actually used in a real node pool.

@MajorBreakfast
Copy link
Contributor Author

Green tests ✌️

@morgante morgante merged commit 8e92f6e into terraform-google-modules:master Oct 29, 2021
@MajorBreakfast MajorBreakfast deleted the sentinel-node-pool-config branch October 29, 2021 21:18
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this pull request Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants