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

chore: block local auth for neuvector #965

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/neuvector/chart/templates/neuvector-deny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

{{- if .Values.denyLocalAuth }}
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
name: neuvector-deny-local-login
namespace: {{ .Release.Namespace }}
spec:
action: DENY
selector:
matchLabels:
app: neuvector-manager-pod
rules:
- to:
- operation:
paths: ["/auth"]
ports: ["8443"]
{{- end }}
8 changes: 8 additions & 0 deletions src/neuvector/chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
{{- $neuvectorAdminPass := join "" (list (randAlphaNum 12) (randAlpha 2 | upper) (randAlpha 2 | lower) (randNumeric 2))}}

apiVersion: uds.dev/v1alpha1
kind: Package
Expand All @@ -24,6 +25,13 @@ spec:
- "https://neuvector.admin.{{ .Values.domain }}/openId_auth"
secretName: neuvector-secret
secretTemplate:
userinitcfg.yaml: |-
always_reload: true
users:
- username: admin
fullname: admin
password: {{ $neuvectorAdminPass }}
role: admin
oidcinitcfg.yaml: |-
always_reload: true
client_id: clientField(clientId)
Expand Down
2 changes: 2 additions & 0 deletions src/neuvector/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ grafana:
enabled: false

generateInternalCert: false

denyLocalAuth: true