Skip to content

Commit

Permalink
feat: Combined KSPM and Runtime Security for Helm release
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyaccuknox committed Dec 11, 2024
1 parent 79a198f commit 3f5b6ae
Show file tree
Hide file tree
Showing 38 changed files with 85 additions and 123 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/kspm-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: KSPM-Runtime Workflow

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
pull_request_target:
branches:
- "*"


jobs:
tag-validate:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: rubenesp87/[email protected]
with:
version: ${{ github.ref_name }}

helm_chart_validation:
runs-on: ubuntu-latest
if: always() && !contains(needs.tag-validate.result, 'failure')
needs: [tag-validate]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Update Helm Dependencies
run: |
cd kspm-runtime
helm dependency update
- name: Validate Helm charts
run: |
helm lint kspm-runtime
helm template kspm-runtime --dry-run > /dev/null
helm_push_to_ecr:
runs-on: ubuntu-latest
needs: [helm_chart_validation]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Login to AWS ECR
run: |
aws ecr-public get-login-password --region us-east-1 | helm registry login --username AWS --password-stdin ${{ secrets.REPO }}
- name: Update Helm Dependencies
run: |
cd kspm-runtime
helm dependency update
- name: Chart versioning
if: ( github.event_name != 'pull_request' && github.event_name != 'pull_request_target' )
run: |
sed -i "s/^version:.*$/version: ${{ github.ref_name }}/" kspm-runtime/Chart.yaml
sed -i "s/^appVersion:.*$/appVersion: ${{ github.ref_name }}/" kspm-runtime/Chart.yaml
- name: Package and Push Helm Chart
run: |
helm package kspm-runtime
HELM_PACKAGE=$(ls kspm-runtime-*.tgz)
helm push $HELM_PACKAGE oci://${{ secrets.REPO }}
31 changes: 0 additions & 31 deletions .github/workflows/sonarscan.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions accuknox-jobs/Chart.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions accuknox-jobs/charts/kiem-job/.helmignore

This file was deleted.

26 changes: 0 additions & 26 deletions accuknox-jobs/values.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3f5b6ae

Please sign in to comment.