DevSecOps #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DevSecOps | |
on: | |
workflow_dispatch: | |
inputs: | |
testing: | |
type: choice | |
options: | |
- DevOps | |
- SAST/SCA | |
- DAST/IAST | |
required: true | |
jobs: | |
secret-leaks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: trufflehog | |
run: docker run --rm -t -v "$PWD:/pwd" trufflesecurity/trufflehog:latest filesystem /pwd/lib/ | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' >> $GITHUB_STEP_SUMMARY | |
semgrep: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: semgrep | |
run: docker run --rm -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config="r/javascript.sequelize.security.audit.sequelize-injection-express.express-sequelize-injection" --emacs * >> $GITHUB_STEP_SUMMARY | |
build: | |
runs-on: ubuntu-latest | |
needs: [secret-leaks, semgrep] | |
steps: | |
- name: "npm build" | |
run: echo "Build complete" | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: "Execute unit tests and smoke tests" | |
run: echo "Test complete" | |
terrascan: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: terrascan | |
run: docker run --rm -t -v "${PWD}:/pwd" tenable/terrascan scan -i cft -d /pwd/aws | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' >> $GITHUB_STEP_SUMMARY || exit 0 | |
package: | |
needs: terrascan | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Prepare Docker image" | |
run: echo "Image pushed" | |
akto-api: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: akto-api-dashboard | |
env: | |
AKTO_API_KEY: ${{ secrets.AKTO_API_KEY }} | |
run: | | |
curl -H "X-API-KEY: $AKTO_API_KEY" -H "content-type: application/json" -d '{"testingRunHexId": "65380f17b0c62f3ac22594e3", "startTimestamp" : 0,"metadata": {"platform": "Github Actions"}}' --compressed -X POST "https://app.akto.io/api/startTest" | |
akto-api-docker: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: akto-api-docker | |
env: | |
AKTO_API_KEY: ${{ secrets.AKTO_API_KEY }} | |
run: docker run -v ${PWD}:/out -e AKTO_DASHBOARD_URL="https://app.akto.io" -e TEST_IDS="JWT_NONE_ALGO REMOVE_TOKENS" -e API_COLLECTION_NAME=juice_shop_demo -e AKTO_API_KEY=$AKTO_API_KEY -e OUTPUT_LEVEL=SUMMARY aktosecurity/akto-api-testing-cli:latest | |
- run: cat output.txt >> $GITHUB_STEP_SUMMARY | |
akto-llm: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: akto-llm | |
env: | |
AKTO_API_KEY: ${{ secrets.AKTO_API_KEY_LLM }} | |
run: docker run -v ${PWD}:/out -e AKTO_DASHBOARD_URL=https://app.akto.io -e TEST_IDS=PROMPT_INJECTION_STAN -e API_COLLECTION_NAME=llm_apis -e AKTO_API_KEY=$AKTO_API_KEY -e OUTPUT_LEVEL=SUMMARY aktosecurity/akto-api-testing-cli:latest | |
- run: cat output.txt >> $GITHUB_STEP_SUMMARY | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [akto-api, akto-llm] | |
steps: | |
- name: "Trigger deployment" | |
run: echo "Deployed successfully" |