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

Security pipeline #41

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
10 changes: 10 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
name: Deploy
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
outputs:
hostname: ${{ steps.export-hostname.outputs.hostname }}
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
Expand Down Expand Up @@ -70,6 +72,8 @@ jobs:
export CLEANED_BRANCH_NAME=$(echo ${BRANCH_NAME} | sed 's/^feature[-/]//' | sed 's:^\w*\/::' | tr -s ' _/[]().' '-' | tr '[:upper:]' '[:lower:]' | cut -c1-28 | sed 's/-$//')
export HOST_NAME=${CLEANED_BRANCH_NAME}-${DEV_HOST}

echo "${HOST_NAME}" > hostname.txt

helm upgrade ${CLEANED_BRANCH_NAME} \
${HELM_DIR} \
--namespace=${{ secrets.KUBE_NAMESPACE }} \
Expand All @@ -82,3 +86,9 @@ jobs:
--set sharedIPRangesLAA=$SHARED_IP_RANGES_LAA \
--force \
--install

- name: Upload HOST_NAME as artifact
uses: actions/upload-artifact@v4
with:
name: host-name
path: hostname.txt
5 changes: 5 additions & 0 deletions .github/workflows/feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

security:
name: Security
needs: deploy-dev
uses: ./.github/workflows/security.yml

build-and-push:
name: Build
uses: ./.github/workflows/build.yml
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Security

on: workflow_call

jobs:
zap_scan:
runs-on: ubuntu-latest
name: Scan the web application
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download HOST_NAME artifact
uses: actions/download-artifact@v4
with:
name: host-name

- name: Read HOST_NAME from file
id: read-hostname
run: |
HOST_NAME=$(cat hostname.txt)
echo "HOST_NAME=${HOST_NAME}" >> $GITHUB_ENV

- name: ZAP Full Scan
uses: zaproxy/[email protected]
with:
target: "http://${{ env.HOST_NAME }}"
artifact_name: 'zap_report'
continue-on-error: true

- name: Upload ZAP Report
uses: actions/upload-artifact@v4
with:
name: zap_report
path: 'report_html.html'
Loading