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

update shadow firewall support #741

Merged

Conversation

ericyz
Copy link
Collaborator

@ericyz ericyz commented Nov 11, 2020

The goal of this PR is to add visibility of the traffic between the Google-managed default GKE firewall. The context of the request is that there are some compliance-driven requirements to capture all the inter-node traffics, which doesn't provide by the default GKE firewalls out of box.

The solution including in this PR can be described as:

  • Create the same firewall to match the default firewall created by GKE
  • Turn on the firewall logs for the created firewalls

@comment-bot-dev
Copy link

comment-bot-dev commented Nov 11, 2020

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

@morgante
Copy link
Contributor

@ericyz Please rebase on master.

@ericyz ericyz closed this Nov 12, 2020
@ericyz ericyz deleted the feature/shadow-firewall branch November 12, 2020 04:30
@ericyz ericyz restored the feature/shadow-firewall branch November 12, 2020 04:30
@ericyz ericyz reopened this Nov 12, 2020
@ericyz
Copy link
Collaborator Author

ericyz commented Dec 13, 2020

Hey team, any feedback on this PR?

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.

@ericyz Can you explain more about the purpose of "shadow" firewall rules? Maybe we could have an explanation somewhere in the README or description?

@ericyz
Copy link
Collaborator Author

ericyz commented Jan 11, 2021

Hi @morgante , I have added more descriptions to the TF variables. The purpose of shadow firewall is to gain more network insight of the packages flowing between GKE worker and master nodes.

default = false
}

variable "firewall_priority" {
type = number
description = "Priority rule for firewall rules"
description = "The firewall priority of GKE shadow firewall rules. The priority should be less than 1000, which is the priority of Google-managed GKE firewall."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description = "The firewall priority of GKE shadow firewall rules. The priority should be less than 1000, which is the priority of Google-managed GKE firewall."
description = "The firewall priority of custom cluster firewall rules.

@@ -545,13 +545,13 @@ variable "enable_binary_authorization" {

variable "add_cluster_firewall_rules" {
type = bool
description = "Create additional firewall rules"
description = "Create GKE shadow firewall rules by creating the same firewall rules as Google-managed ones with higher priority and firewall logs enabled."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description = "Create GKE shadow firewall rules by creating the same firewall rules as Google-managed ones with higher priority and firewall logs enabled."
description = "Create additional firewall rules for common GKE tasks."

firewall.tf Outdated
count = var.add_shadow_firewall_rules ? 1 : 0

name = "gke-shadow-${substr(var.name, 0, min(25, length(var.name)))}-all"
description = "Managed by terraform gke module: A shadow firewall rule to match the fireall allow pod communication."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description = "Managed by terraform gke module: A shadow firewall rule to match the fireall allow pod communication."
description = "Managed by terraform gke module: A shadow firewall rule to match the default rule allowing pod communication."

firewall.tf Outdated Show resolved Hide resolved
firewall.tf Outdated Show resolved Hide resolved
@ericyz ericyz force-pushed the feature/shadow-firewall branch 3 times, most recently from 8c4840e to 8f0a90d Compare February 4, 2021 23:09
@ericyz ericyz requested a review from morgante February 4, 2021 23:19
autogen/main/firewall.tf.tmpl Outdated Show resolved Hide resolved
autogen/main/firewall.tf.tmpl Outdated Show resolved Hide resolved
@ericyz
Copy link
Collaborator Author

ericyz commented Feb 15, 2021

Thanks @morgante for updating my typo. Please review and let me know anything to update for the merge.

@ericyz ericyz requested a review from morgante February 15, 2021 08:48
@morgante morgante merged commit 259dbfb into terraform-google-modules:master Feb 16, 2021
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