Skip to content

Commit 970cee1

Browse files
authored
feat: disable automountServiceAccountToken for proxy and ratelimit (#6364)
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
1 parent ddc9a5c commit 970cee1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+62
-0
lines changed

internal/infrastructure/kubernetes/proxy/resource_provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func (r *ResourceRender) ServiceAccount() (*corev1.ServiceAccount, error) {
147147
Kind: "ServiceAccount",
148148
APIVersion: "v1",
149149
},
150+
AutomountServiceAccountToken: ptr.To(false),
150151
ObjectMeta: metav1.ObjectMeta{
151152
Namespace: r.Namespace(),
152153
Name: r.Name(),
@@ -389,6 +390,7 @@ func (r *ResourceRender) Deployment() (*appsv1.Deployment, error) {
389390
Annotations: podAnnotations,
390391
},
391392
Spec: corev1.PodSpec{
393+
AutomountServiceAccountToken: ptr.To(false),
392394
Containers: containers,
393395
InitContainers: deploymentConfig.InitContainers,
394396
ServiceAccountName: r.Name(),
@@ -627,6 +629,7 @@ func (r *ResourceRender) getPodSpec(
627629
proxyConfig *egv1a1.EnvoyProxy,
628630
) corev1.PodSpec {
629631
return corev1.PodSpec{
632+
AutomountServiceAccountToken: ptr.To(false),
630633
Containers: containers,
631634
InitContainers: initContainers,
632635
ServiceAccountName: r.Name(),

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/component-level.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
gateway.envoyproxy.io/owning-gateway-name: default
3838
gateway.envoyproxy.io/owning-gateway-namespace: default
3939
spec:
40+
automountServiceAccountToken: false
4041
containers:
4142
- args:
4243
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/custom.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
gateway.envoyproxy.io/owning-gateway-name: default
3939
gateway.envoyproxy.io/owning-gateway-namespace: default
4040
spec:
41+
automountServiceAccountToken: false
4142
containers:
4243
- args:
4344
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/default-env.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
gateway.envoyproxy.io/owning-gateway-name: default
3838
gateway.envoyproxy.io/owning-gateway-namespace: default
3939
spec:
40+
automountServiceAccountToken: false
4041
containers:
4142
- args:
4243
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
gateway.envoyproxy.io/owning-gateway-name: default
3838
gateway.envoyproxy.io/owning-gateway-namespace: default
3939
spec:
40+
automountServiceAccountToken: false
4041
containers:
4142
- args:
4243
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/disable-prometheus.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
gateway.envoyproxy.io/owning-gateway-name: default
3434
gateway.envoyproxy.io/owning-gateway-namespace: default
3535
spec:
36+
automountServiceAccountToken: false
3637
containers:
3738
- args:
3839
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/extension-env.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
gateway.envoyproxy.io/owning-gateway-name: default
3838
gateway.envoyproxy.io/owning-gateway-namespace: default
3939
spec:
40+
automountServiceAccountToken: false
4041
containers:
4142
- args:
4243
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/gateway-namespace-mode.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ spec:
4040
gateway.envoyproxy.io/owning-gateway-namespace: ns1
4141
gateway.networking.k8s.io/gateway-name: gateway-1
4242
spec:
43+
automountServiceAccountToken: false
4344
containers:
4445
- args:
4546
- --service-cluster ns1/gateway-1

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/override-labels-and-annotations.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
label1: value1-override
4747
label2: value2
4848
spec:
49+
automountServiceAccountToken: false
4950
containers:
5051
- args:
5152
- --service-cluster default

internal/infrastructure/kubernetes/proxy/testdata/daemonsets/patch-daemonset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
gateway.envoyproxy.io/owning-gateway-name: default
3838
gateway.envoyproxy.io/owning-gateway-namespace: default
3939
spec:
40+
automountServiceAccountToken: false
4041
containers:
4142
- args:
4243
- --service-cluster default

0 commit comments

Comments
 (0)