Skip to content

Commit

Permalink
fix: Security issues (#348)
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Feb 16, 2023
1 parent a0993dc commit 5bd0b19
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ spec:
}}'
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
Expand Down Expand Up @@ -103,6 +104,9 @@ spec:
}}'
memory: '{{ .Values.controllerManager.kubeRbacProxy.resources.requests.memory
}}'
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
securityContext:
runAsNonRoot: true
serviceAccountName: open-feature-operator-controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ rules:
- apiGroups:
- core.openfeature.dev
resources:
- '*'
- flagsourceconfigurations
- featureflagconfigurations
verbs:
- get
- watch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ rules:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- '*'
- clusterrolebindings
verbs:
- '*'
- get
- list
- update
- watch
6 changes: 6 additions & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ spec:
requests:
cpu: 5m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
- name: manager
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--sidecar-cpu-limit=0.5" # cores
- "--sidecar-ram-limit=64M"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
name: manager
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/flagd_kubernetes_sync_clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
name: flagd-kubernetes-sync
rules:
- apiGroups: ["core.openfeature.dev"]
resources: ["*"]
resources: ["flagsourceconfigurations", "featureflagconfigurations"]
verbs: ["get", "watch", "list"]
7 changes: 5 additions & 2 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ rules:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- '*'
- clusterrolebindings
verbs:
- '*'
- get
- list
- update
- watch
2 changes: 1 addition & 1 deletion webhooks/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=Ignore,groups="",resources=pods,verbs=create;update,versions=v1,name=mutate.openfeature.dev,admissionReviewVersions=v1,sideEffects=NoneOnDryRun
//+kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=*,verbs=*;
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;watch;update;

// PodMutator annotates Pods
type PodMutator struct {
Expand Down

0 comments on commit 5bd0b19

Please sign in to comment.