Skip to content

Commit

Permalink
lint, dast,sast
Browse files Browse the repository at this point in the history
  • Loading branch information
seaniesean committed Jan 31, 2024
1 parent db65527 commit 5ba3463
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 69 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "linting-tool-scan"

on:
push:
branches: [githubcicd]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci --force
- name: Installing JSHint
run: |
sudo npm install -g jshint
- name: Change script permission
run: |
chmod +x scripts/jshint-script.sh
- name: Run scan with JSHint
run: scripts/jshint-script.sh

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: linting tool report
path: |
./JSHint-report
37 changes: 37 additions & 0 deletions .github/workflows/sast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "sast-scan"

on:
push:
branches: [githubcicd]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci --force
- name: OWASP Dependency Check
run: |
wget https://github.com/jeremylong/DependencyCheck/releases/download/v7.2.0/dependency-check-7.2.0-release.zip
unzip dependency-check-7.2.0-release.zip
- name: Run scan with ODC
run: |
dependency-check/bin/dependency-check.sh --project "bitcoin" --scan . > ODC-report
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: sast report
path: |
./ODC-report
31 changes: 31 additions & 0 deletions .github/workflows/zap-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "owasp-scan"

on:
push:
branches: [githubcicd]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Change script permission
run: |
chmod +x scripts/zap-script.sh
- name: ZAP scan
run: scripts/zap-script.sh

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: zap report
path: |
./zap_baseline_report.html
69 changes: 0 additions & 69 deletions github/workflows/build.yml

This file was deleted.

5 changes: 5 additions & 0 deletions scripts/jshint-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

jshint --exclude="node_modules/" --reporter=unix . > JSHint-report

echo $? > /dev/null
6 changes: 6 additions & 0 deletions scripts/zap-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

docker pull owasp/zap2docker-stable
docker run -i owasp/zap2docker-stable zap-baseline.py -t "https://kenken64.github.io/bitcoin-order-app/" -l PASS > zap_baseline_report.html

echo $? > /dev/null

0 comments on commit 5ba3463

Please sign in to comment.