Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 21a0c48

Browse files
authored
Merge pull request #1854 from HarryStericker/optional-icmp-open
[v0.16.0] Creating a switch to disable ICMP Ping instead of the default allow 0.0.0/0
2 parents bdc0325 + 4aad063 commit 21a0c48

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

builtin/files/cluster.yaml.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,10 @@ kubeProxy:
13601360
# It is enabled by default.
13611361
#cloudFormationStreaming: true
13621362

1363+
# When enabled, a security group rule is included on the generated kube-aws SG to allow ICMP Ping from all traffic (0.0.0.0/0).
1364+
# This is applied to all nodes (worker & control plane) in the cluster.
1365+
openICMP: true
1366+
13631367
# Addon features
13641368
addons:
13651369
# When enabled, Kubernetes rescheduler is deployed to the cluster controller(s)

builtin/files/stack-templates/control-plane.json.tmpl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,22 @@
211211
}
212212
],
213213
"SecurityGroupIngress": [
214+
{{ if .OpenICMP -}}
215+
{
216+
"CidrIp": "0.0.0.0/0",
217+
"FromPort": -1,
218+
"IpProtocol": "icmp",
219+
"ToPort": -1
220+
},
221+
{{end -}}
214222
{{ range $_, $r := $.SSHAccessAllowedSourceCIDRs -}}
215223
{
216224
"CidrIp": "{{$r}}",
217225
"FromPort": 22,
218226
"IpProtocol": "tcp",
219227
"ToPort": 22
220-
},
221-
{{end -}}
222-
{
223-
"CidrIp": "0.0.0.0/0",
224-
"FromPort": -1,
225-
"IpProtocol": "icmp",
226-
"ToPort": -1
227228
}
229+
{{end -}}
228230
],
229231
"Tags": [
230232
{

builtin/files/stack-templates/network.json.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@
9191
}
9292
],
9393
"SecurityGroupIngress": [
94+
{{ if .OpenICMP -}}
9495
{
9596
"CidrIp": "0.0.0.0/0",
9697
"FromPort": -1,
9798
"IpProtocol": "icmp",
9899
"ToPort": -1
99100
},
101+
{{end -}}
100102
{{ range $_, $r := $.SSHAccessAllowedSourceCIDRs -}}
101103
{
102104
"CidrIp": "{{$r}}",

pkg/api/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ type Cluster struct {
562562
CustomApiServerSettings CustomApiServerSettings `yaml:"customApiServerSettings,omitempty"`
563563
CustomSettings map[string]interface{} `yaml:"customSettings,omitempty"`
564564
KubeResourcesAutosave `yaml:"kubeResourcesAutosave,omitempty"`
565+
OpenICMP bool `yaml:"openICMP,omitempty"`
565566
}
566567

567568
type WaitSignal struct {

0 commit comments

Comments
 (0)