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
47 changes: 47 additions & 0 deletions .github/workflows/push-artifact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: push-artifact

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'k8s/**'

jobs:
flux-push:
strategy:
fail-fast: false
matrix:
component:
- manifests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for pushing
id-token: write # for signing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flux
uses: controlplaneio-fluxcd/distribution/actions/setup@main
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push artifact
uses: controlplaneio-fluxcd/distribution/actions/push@main
id: push
with:
repository: ghcr.io/${{ github.repository }}/${{ matrix.component }}
path: "./k8s/${{ matrix.component }}"
diff-tag: latest
- name: Sign artifact
if: steps.push.outputs.pushed == 'true'
run: cosign sign --yes $DIGEST_URL
env:
DIGEST_URL: ${{ steps.push.outputs.digest-url }}
72 changes: 72 additions & 0 deletions .github/workflows/push-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: push-image

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'container/**'

jobs:
docker-push:
strategy:
fail-fast: false
matrix:
component:
- proxy-chatbot
- proxy-llm-guard
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for pushing
id-token: write # for signing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# inspired by https://github.com/stefanprodan/podinfo/blob/b3396adb98a6a0f5eeedd1a600beaf5e954a1f28/.github/workflows/release.yml#L61-L94
- name: Prepare tags
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}

echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Generate images meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/${{ matrix.component }}
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
type=raw,value=latest
- name: Publish multi-arch image
uses: docker/build-push-action@v6
id: push
with:
sbom: true
provenance: true
push: true
builder: ${{ steps.buildx.outputs.name }}
context: "./container/${{ matrix.component }}"
platforms: linux/amd64,linux/arm/v7,linux/arm64
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using linux/arm64/v8 instead of linux/arm64 for more explicit ARM64 architecture specification, as linux/arm64 is an alias that may be deprecated.

Suggested change
platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8

Copilot uses AI. Check for mistakes.
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Sign image
run: cosign sign --yes ghcr.io/${{ github.repository }}/${{ matrix.component }}@${DIGEST}
env:
DIGEST: ${{ steps.push.outputs.digest }}
55 changes: 55 additions & 0 deletions .github/workflows/release-artifact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: release-artifact

on:
push:
tags:
- 'manifests/*'

jobs:
flux-push-component:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for pushing
id-token: write # for signing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flux
uses: controlplaneio-fluxcd/distribution/actions/setup@main
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare tags
id: prep
env:
REF_NAME: ${{ github.ref_name }}
run: |
if [[ $REF_NAME != */* ]]; then
echo "Ref name is not in the format component/version"
exit 1
fi

COMPONENT=$(echo "$REF_NAME" | cut -d'/' -f 1)
VERSION=$(echo "$REF_NAME" | cut -d'/' -f 2)

echo "component=${COMPONENT}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Push artifact
uses: controlplaneio-fluxcd/distribution/actions/push@main
id: push
with:
repository: ghcr.io/${{ github.repository }}/${{ steps.prep.outputs.component }}
path: "./k8s/${{ steps.prep.outputs.component }}"
diff-tag: ${{ steps.prep.outputs.version }}
tags: latest-stable
- name: Sign artifact
if: steps.push.outputs.pushed == 'true'
run: cosign sign --yes $DIGEST_URL
env:
DIGEST_URL: ${{ steps.push.outputs.digest-url }}
73 changes: 73 additions & 0 deletions .github/workflows/release-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: release-image

on:
push:
tags:
- 'proxy-llm-guard/*'
- 'proxy-chatbot/*'

jobs:
docker-push-component:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # for pushing
id-token: write # for signing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# inspired by https://github.com/stefanprodan/podinfo/blob/b3396adb98a6a0f5eeedd1a600beaf5e954a1f28/.github/workflows/release.yml#L61-L94
- name: Prepare tags
id: prep
env:
REF_NAME: ${{ github.ref_name }}
run: |
if [[ $REF_NAME != */* ]]; then
echo "Ref name is not in the format component/version"
exit 1
fi

COMPONENT=$(echo "$REF_NAME" | cut -d'/' -f 1)
VERSION=$(echo "$REF_NAME" | cut -d'/' -f 2)

echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "COMPONENT=${COMPONENT}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Generate images meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/${{ steps.prep.outputs.COMPONENT }}
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
type=raw,value=latest-stable
- name: Publish multi-arch image
uses: docker/build-push-action@v6
id: push
with:
sbom: true
provenance: true
push: true
builder: ${{ steps.buildx.outputs.name }}
context: "./container/${{ steps.prep.outputs.COMPONENT }}"
platforms: linux/amd64,linux/arm/v7,linux/arm64
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using linux/arm64/v8 instead of linux/arm64 for more explicit ARM64 architecture specification, as linux/arm64 is an alias that may be deprecated.

Suggested change
platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8

Copilot uses AI. Check for mistakes.
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Sign image
run: cosign sign --yes ghcr.io/${{ github.repository }}/${{ steps.prep.outputs.COMPONENT }}@${DIGEST}
env:
DIGEST: ${{ steps.push.outputs.digest }}
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ all: \
controls-install \
chatbot-build \
proxy-llm-guard-build \
ns-secret \
infra-up

.PHONY: down
Expand Down Expand Up @@ -69,14 +70,16 @@ proxy-llm-guard-build: ## Build and load the proxy-llm-guard container
docker build -t proxy-llm-guard:latest container/proxy-llm-guard
kind load docker-image proxy-llm-guard:latest -n $(CLUSTER_NAME)

.PHONY: infra-up
infra-up:
.PHONY: ns-secret
ns-secret:
kubectl apply -f k8s/manifests/00-namespaces.yaml

kubectl create secret generic app-chatbot-secret \
--from-literal=PROXY_API_KEY="$(OPENAI_API_KEY)" \
--namespace=app-chatbot

.PHONY: infra-up
infra-up:
kubectl apply -f "k8s/manifests/0[1-6]*.yaml"

-while [ -z "$$(kubectl -n fw-prompt get po -l app=envoy-proxy -o jsonpath='{.items[0].metadata.generateName}')" -a -z "$$(kubectl -n app-chatbot get po -l app=app-chatbot -o jsonpath='{.items[0].metadata.generateName}')" -a -z "$$(kubectl -n fw-model get po -l app=envoy-proxy -o jsonpath='{.items[0].metadata.generateName}')" ]; do \
Expand All @@ -99,7 +102,7 @@ test-prompt-fail:

.PHONY: netpols-apply
netpols-apply:
kubectl apply -f k8s/manifests/07-netpols.yaml
kubectl apply -f k8s/manifests/netpols/07-netpols.yaml

.PHONY: test
test:
Expand Down
23 changes: 23 additions & 0 deletions k8s/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- 00-namespaces.yaml
- 01-fw-prompt.yaml
- 02-app-chatbot.yaml
- 03-fw-model.yaml
- 04-ctrl-prompt-llm-guard.yaml
- 05-ctrl-prompt.yaml
- 06-pvcs.yaml
components:
# - ./netpols/
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented-out netpols component suggests incomplete implementation. Either enable the component or remove the commented line to avoid confusion.

Suggested change
# - ./netpols/

Copilot uses AI. Check for mistakes.
images:
# our images
- name: proxy-llm-guard
newName: ghcr.io/stealthybox/ai-security-architecture/proxy-llm-guard
newTag: v0.0.1
- name: proxy-chatbot
newName: ghcr.io/stealthybox/ai-security-architecture/proxy-chatbot
newTag: v0.0.1
# dependencies
- name: laiyer/llm-guard-api
newTag: 0.3.15
File renamed without changes.
4 changes: 4 additions & 0 deletions k8s/manifests/netpols/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- 07-netpols.yaml