Skip to content
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
28 changes: 28 additions & 0 deletions charts/openshell-ztm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v2
name: openshell-ztm
description: |
NVIDIA OpenShell AI Agent Sandbox with Zero Trust integration.
Wraps the official NVIDIA OpenShell Helm chart and adds ZTVP
integration (Vault, ESO, Keycloak, SPIFFE/SPIRE, ACS) plus a
pre-configured Pi agent sandbox with zero-trust policies.
version: 1.3.1
appVersion: "0.1.6"
type: application
keywords:
- zero-trust
- ai-agents
- openshell
- security
- sandbox
- maas
maintainers:
- name: Zero Trust Validated Patterns Team
email: ztvp-arch-group@redhat.com
sources:
- https://github.com/NVIDIA/OpenShell
- https://github.com/validatedpatterns/layered-zero-trust
dependencies:
- name: helm-chart
version: "0.1.6"
repository: "oci://ghcr.io/nvidia/openshell"
alias: openshell
56 changes: 56 additions & 0 deletions charts/openshell-ztm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
╔═══════════════════════════════════════════════════════════════════╗
║ OpenShell + Pi AI Agent on Zero Trust Mesh — v{{ .Chart.Version }} ║
╚═══════════════════════════════════════════════════════════════════╝

Gateway URL:
https://{{ include "ztm.routeHostname" . }}

Pi Sandbox: {{ .Values.pi.sandbox.name }}
Namespace: {{ .Values.namespace }}

── Quick Start ─────────────────────────────────────────────────────

1. Install the OpenShell CLI:
curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh

2. Point to the gateway:
export OPENSHELL_GATEWAY="https://{{ include "ztm.routeHostname" . }}"

3. Verify sandbox is ready:
openshell sandbox list

4. Connect:
openshell sandbox exec {{ .Values.pi.sandbox.name }}

5. Inside the sandbox, run Pi:
pi "Write a hello world in Python"

── Demo Scenarios ──────────────────────────────────────────────────

A) Network Deny — try reaching an unauthorized host:
curl https://evil.example.com
→ BLOCKED. Only maas-rhdp.apps.maas..., github.com, npm are allowed.

B) Filesystem Deny — try writing outside allowed paths:
touch /etc/shadow
→ DENIED by Landlock LSM. Only /sandbox and /tmp are writable.

C) Credential Security — API key never visible inside sandbox:
env | grep MAAS
→ Shows openshell:resolve:... not the real key.

D) Dynamic Policy Update — add access on the fly:
openshell policy update --sandbox {{ .Values.pi.sandbox.name }} \
--add-endpoint "https://pypi.org:443"

── Clean Uninstall ─────────────────────────────────────────────────

helm uninstall {{ .Release.Name }} -n {{ .Values.namespace }}

To also remove the namespace:
oc delete namespace {{ .Values.namespace }}

To reinstall fresh:
helm install {{ .Release.Name }} openshell-ztm-demo/openshell-ztm-demo \
-n {{ .Values.namespace }} --create-namespace \
--set maas.apiKey=<YOUR_KEY>
95 changes: 95 additions & 0 deletions charts/openshell-ztm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{{/*
Cluster domain — uses the VP framework's global.localClusterDomain,
with fallback to OpenShift Ingress auto-detection.
*/}}
{{- define "ztm.clusterDomain" -}}
{{- if .Values.global.localClusterDomain -}}
{{- .Values.global.localClusterDomain -}}
{{- else -}}
{{- $ing := (lookup "config.openshift.io/v1" "Ingress" "" "cluster") -}}
{{- if and $ing $ing.spec $ing.spec.domain -}}
{{- $ing.spec.domain -}}
{{- else -}}
{{- fail "Cannot auto-detect cluster domain. Set global.localClusterDomain" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Default OpenShift Route hostname for OpenShell gateway.
When spec.host is empty, OpenShift auto-generates: {route-name}-{namespace}.{cluster-domain}
*/}}
{{- define "ztm.routeHostname" -}}
{{- if .Values.openshell.openshiftRoute.host -}}
{{- .Values.openshell.openshiftRoute.host -}}
{{- else -}}
{{ include "ztm.gatewayServiceName" . }}-{{ .Values.namespace }}.{{ include "ztm.clusterDomain" . }}
{{- end -}}
{{- end -}}

{{/*
Keycloak base URL derived from cluster domain.
*/}}
{{- define "ztm.keycloakUrl" -}}
https://keycloak.{{ include "ztm.clusterDomain" . }}
{{- end -}}

{{/*
SPIFFE trust domain derived from cluster domain.
*/}}
{{- define "ztm.trustDomain" -}}
{{- if .Values.spiffe.trustDomain -}}
{{- .Values.spiffe.trustDomain -}}
{{- else -}}
{{ include "ztm.clusterDomain" . }}
{{- end -}}
{{- end -}}

{{/*
Vault internal (in-cluster) URL.
*/}}
{{- define "ztm.vaultInternalUrl" -}}
{{- if .Values.vault.internalUrl -}}
{{- .Values.vault.internalUrl -}}
{{- else -}}
https://vault.{{ .Values.vault.namespace }}.svc.cluster.local:8200
{{- end -}}
{{- end -}}

{{/*
Vault external URL derived from cluster domain.
*/}}
{{- define "ztm.vaultExternalUrl" -}}
https://vault-vault.{{ include "ztm.clusterDomain" . }}
{{- end -}}

{{/*
Gateway in-cluster service name — mirrors the subchart's openshell.fullname logic.
*/}}
{{- define "ztm.gatewayServiceName" -}}
{{- $name := .Values.openshell.nameOverride | default "openshell" -}}
{{- if contains $name .Release.Name -}}
{{ .Release.Name }}
{{- else -}}
{{ .Release.Name }}-{{ $name }}
{{- end -}}
{{- end -}}

{{/*
Gateway in-cluster gRPC endpoint (used by openshell CLI in hook jobs).
*/}}
{{- define "ztm.gatewayEndpoint" -}}
https://{{ include "ztm.gatewayServiceName" . }}.{{ .Values.namespace }}.svc.cluster.local:8080
{{- end -}}

{{/*
Standard labels for ZTM resources.
*/}}
{{- define "ztm.labels" -}}
app.kubernetes.io/name: openshell-ztm
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: layered-zero-trust
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/openshell-ztm/templates/deepseek-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.deepseek.enabled .Values.deepseek.apiKey }}
apiVersion: v1
kind: Secret
metadata:
name: deepseek-api-key
namespace: {{ .Values.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
type: Opaque
stringData:
api_key: {{ .Values.deepseek.apiKey | quote }}
{{- end }}
45 changes: 45 additions & 0 deletions charts/openshell-ztm/templates/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.vault.enabled }}
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: maas-api-key-es
namespace: {{ .Values.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
spec:
refreshInterval: 1h
secretStoreRef:
name: {{ .Values.vault.clusterSecretStoreName }}
kind: ClusterSecretStore
target:
name: maas-api-key
creationPolicy: Merge
data:
- secretKey: api_key
remoteRef:
key: {{ .Values.vault.secretPath | trimPrefix "secret/data/" }}
property: api_key
{{- end }}
{{- if and .Values.deepseek.enabled .Values.vault.enabled }}
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: deepseek-api-key-es
namespace: {{ .Values.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
spec:
refreshInterval: 1h
secretStoreRef:
name: {{ .Values.vault.clusterSecretStoreName }}
kind: ClusterSecretStore
target:
name: deepseek-api-key
creationPolicy: Merge
data:
- secretKey: api_key
remoteRef:
key: hub/infra/openshell/deepseek
property: api_key
{{- end }}
12 changes: 12 additions & 0 deletions charts/openshell-ztm/templates/image-pull-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.imagePullSecret.create }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.imagePullSecret.name }}
namespace: {{ .Values.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ .Values.imagePullSecret.dockerconfigjson | b64enc | quote }}
{{- end }}
33 changes: 33 additions & 0 deletions charts/openshell-ztm/templates/keycloak-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.keycloak.enabled }}
apiVersion: k8s.keycloak.org/v2alpha1
kind: KeycloakRealmImport
metadata:
name: openshell-oidc-client
namespace: {{ .Values.keycloak.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
spec:
keycloakCRName: keycloak
realm:
realm: {{ .Values.keycloak.realm }}
enabled: true
clients:
- clientId: {{ .Values.keycloak.clientId }}
name: OpenShell Gateway
enabled: true
publicClient: true
standardFlowEnabled: true
directAccessGrantsEnabled: true
rootUrl: https://{{ include "ztm.routeHostname" . }}
redirectUris:
- https://{{ include "ztm.routeHostname" . }}/*
- http://localhost:*/*
webOrigins:
- https://{{ include "ztm.routeHostname" . }}
- http://localhost:*
protocol: openid-connect
defaultClientScopes:
- openid
- profile
- email
{{- end }}
12 changes: 12 additions & 0 deletions charts/openshell-ztm/templates/maas-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.maas.apiKey }}
apiVersion: v1
kind: Secret
metadata:
name: maas-api-key
namespace: {{ .Values.namespace }}
labels:
{{- include "ztm.labels" . | nindent 4 }}
type: Opaque
stringData:
api_key: {{ .Values.maas.apiKey | quote }}
{{- end }}
Loading