Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
76e1af4
Add Initial Test Makefile for Amass
nigthknight Jun 7, 2021
aa6d8ae
Add .helmignore To Exclude Image Tar From Chart
nigthknight Jun 8, 2021
23e3493
Move Integration Tests For Amass Into Amass
nigthknight Jun 8, 2021
35e27ec
Fix Error in Docker Build Command
nigthknight Jun 14, 2021
1a425da
Move package.json, package-lock.json Into parser
nigthknight Jun 14, 2021
314d401
Add .gitignore To Exclude Generated Content
nigthknight Jun 14, 2021
fe66960
Fix CI For New Integration Test Workflow
nigthknight Jun 14, 2021
5b5b44c
Exclude e2e Directory From Unit Tests
nigthknight Jun 14, 2021
2247d87
Add Kubernetes Client As Dependency
nigthknight Jun 14, 2021
4dacba2
Change TS Compile Command And Update TS
nigthknight Jun 14, 2021
4726d63
Ignore Generated JS Files
nigthknight Jun 14, 2021
00a11d5
Add Image Tar To .helmignore
nigthknight Jun 14, 2021
1fe408c
Rename Step To Include All Test Dependencies
nigthknight Jun 14, 2021
4abb7fb
Add Makefile POC For finding-post-processing hook
nigthknight Jun 14, 2021
d5fa206
Move Integration Tests In Hook Root
nigthknight Jun 15, 2021
cc55ecc
Exclude Integration Tests From Unit Tests
nigthknight Jun 15, 2021
dbba18a
Remove `helpers.js` From Amass
nigthknight Jun 15, 2021
69698bf
Remove `helpers.js` From Hook
nigthknight Jun 15, 2021
ed36092
Ignore VIM Generated Content
nigthknight Jun 15, 2021
1ca5309
Remove Jest As Dependency And Use It Via `npx`
nigthknight Jun 22, 2021
aa2857a
Update Makefile For finding-post-processing
nigthknight Jun 22, 2021
3cc20e1
Add Separate Step For Build And Test
nigthknight Jun 22, 2021
af52f2f
Restore Files Deleted To Early
nigthknight Jun 22, 2021
0f5d5b6
[Debug] Hook Deps Install
nigthknight Jun 28, 2021
820e9b0
Fix `package-lock.json`
nigthknight Jun 28, 2021
c0740af
Fix package-lock
nigthknight Jun 28, 2021
66f3f6b
Add `hook` Directory To Cascading Scans
nigthknight Jun 28, 2021
c529666
Add `hook` Directory To Cascading Scans
nigthknight Jun 28, 2021
10d819f
Add `hook` Directory To persistence-defect-dojo
nigthknight Jun 28, 2021
fb45616
Add `hook` Directory To Persistence Elastic
nigthknight Jun 28, 2021
5311463
Add `hook` Directory To Teams Webhook
nigthknight Jun 28, 2021
63fa545
Add `hook` Directory To Update Field
nigthknight Jun 28, 2021
e2ea85d
Change Directory For Building Hook Images
nigthknight Jun 28, 2021
5a27d3c
Change Jest Subprojects To Match New Hook Layout
nigthknight Jun 28, 2021
860b2a5
Change Directory For Notification Hook
nigthknight Jun 28, 2021
07964f5
Add Amass Test Temporary Until CI is Updated
nigthknight Jun 28, 2021
711604b
Update .helmignore To Resolve Review Comments
nigthknight Jun 29, 2021
4da66cc
Add .tar Files To Global .gitignore
nigthknight Jun 29, 2021
3440194
Use Makefile For Amass Integration Tests
nigthknight Jun 29, 2021
e2dae3f
Fix Working Directory For Amass Integration Tests
nigthknight Jun 29, 2021
f0e0cbd
Fix Spelling
nigthknight Jun 29, 2021
fc51519
[Debug] Makefile Issues
nigthknight Jun 29, 2021
96715db
Improving the makefiles to run integration tests
rfelber Jul 3, 2021
e7b10ac
Added general prerequisite check to makefile
rfelber Jul 3, 2021
2728ed7
Trying to refactor the CI pipeline to use
rfelber Jul 3, 2021
95baca3
Fixing CI Pipeline
rfelber Jul 3, 2021
dbcf950
Added kind to new makefile build CI
rfelber Jul 3, 2021
6e1cb0e
Added package.son to ensure jest is available.
rfelber Jul 3, 2021
748e881
Fixing docker image reference
rfelber Jul 3, 2021
863f29d
Debugging CI Pipeline
rfelber Jul 3, 2021
fce3d44
Debugging CI Pipeline
rfelber Jul 3, 2021
cd82700
Debugging Ci Pipeline
rfelber Jul 3, 2021
cc59a61
Debugging CI Pipeline
rfelber Jul 3, 2021
5f84d26
Debugging CI Pipeline
rfelber Jul 3, 2021
8c6c89d
bugfixing ci jest pipeline
rfelber Jul 3, 2021
27f6962
Bugfixing jest
rfelber Jul 3, 2021
630ecf6
Bugfixing jest
rfelber Jul 3, 2021
293e807
Bugfixing jest + CI Pipeline
rfelber Jul 3, 2021
09f0863
Bugfixing jest + CI Pipeline
rfelber Jul 3, 2021
7758001
Fixing jest + CI
rfelber Jul 3, 2021
db03f72
Debugging npm
rfelber Jul 4, 2021
f4a784a
Debugging NPM & NPX
rfelber Jul 4, 2021
fe44e14
Debugging npx
rfelber Jul 4, 2021
267b626
Debugging NPM+NPX+Jest
rfelber Jul 4, 2021
f0bd80f
Install Dependencies For Integration Tests
nigthknight Jul 6, 2021
d06e3a1
Change Path For npx Command
nigthknight Jul 6, 2021
ad221da
Rename Lurcher -> Lurker
nigthknight Jul 12, 2021
4ef9765
Remove Debug Steps
nigthknight Jul 12, 2021
4d24773
Install `ts-jest` For Finding Post Processing Test
nigthknight Jul 12, 2021
7d18ff9
Add `--yes` To Confirm Jest Installation
nigthknight Jul 12, 2021
5087c99
Fix Defect-dojo Persistence Provider
nigthknight Jul 12, 2021
f26d5a3
Update Dockerfile For New Hook Layout
nigthknight Jul 12, 2021
ce3810c
Change Directory For Dockerfile To Comply With Rest
nigthknight Jul 12, 2021
b966a13
Update Lockfile Version For Scanner And Parser
nigthknight Jul 12, 2021
8e40c4d
Fix Layout For Notification Hook
nigthknight Jul 12, 2021
2909364
Include Image Build And Helm Deployment
nigthknight Jul 13, 2021
eded32e
Improve Naming For Makefile Targets
nigthknight Jul 13, 2021
5af1466
Move Operator Installation Out Of Scanner/Hook
nigthknight Jul 13, 2021
a4b8245
Change Pull Policy To `IfNotPresent`
nigthknight Jul 13, 2021
4ebecc6
Add `ts-jest` To Hooks
nigthknight Jul 13, 2021
7295764
Remove `ts-jest` From npx Command
nigthknight Jul 13, 2021
07033c7
Change Syntax For npx Command
nigthknight Jul 13, 2021
b894dc6
Add Jest Config To Unit Tests
nigthknight Jul 13, 2021
dc4d855
Add Path To Jest Config
nigthknight Jul 13, 2021
f917162
Test Global Jest Installation
nigthknight Jul 13, 2021
71f367c
Ensure That Node 14 (LTS) Is Used
nigthknight Jul 19, 2021
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
107 changes: 87 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- run: |
cd hooks/${{ matrix.unit }}/
cd hooks/${{ matrix.unit }}/hook
./gradlew test

# ---- Unit-Test | Python ----
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
done
- name: "Install npm dependencies in all hook sub projects"
run: |
for dir in hooks/*/
for dir in hooks/*/hook/
do
cd $dir
if [ -f package.json ] && [ -f package-lock.json ]; then
Expand All @@ -99,6 +99,9 @@ jobs:
# cd back
cd -
done
- name: Debug Hook Installation
if: failure()
run: "find /home/runner/.npm/_logs -type f -exec cat {} +"
- name: "Install npm test dependencies"
run: |
npm ci
Expand All @@ -109,14 +112,15 @@ jobs:
npm ci
- name: "Compile Typescript"
run: |
cd hooks/cascading-scans
cd hooks/cascading-scans/hook
npm ci
npm run build
- name: "Run tests & publish code coverage"
uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm test -- --ci --colors --coverage
# - name: "Run tests & publish code coverage"
# uses: paambaati/codeclimate-action@v2.6.0
# env:
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
# with:
# coverageCommand: npm test -- --ci --colors --coverage --testPathIgnorePatterns=["/integration-tests/"]

# ---- Build Stage ----

Expand Down Expand Up @@ -279,6 +283,72 @@ jobs:
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

# ---- New Makefile based CI Pipeline steps ----
makefile-scanner:
name: "Make Scanners"
needs:
- sdk
- operator
runs-on: ubuntu-latest
strategy:
matrix:
unit: ["amass"]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: "Start kind cluster"
run: |
kind version
kind create cluster --image kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 --wait 3m
- name: "Inspect kind cluster"
run: |
kubectl config current-context
kubectl get node
- name: Install Operator
working-directory: ./operator
run: |
make helm-deploy
- name: "Run makefile for scanner '${{ matrix.unit }}'"
working-directory: ./scanners/${{ matrix.unit }}/
run: |
make all

makefile-hooks:
name: "Make Hooks"
needs:
- sdk
- operator
runs-on: ubuntu-latest
strategy:
matrix:
unit: ["finding-post-processing"]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: "Start kind cluster"
run: |
kind version
kind create cluster --image kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 --wait 3m
- name: "Inspect kind cluster"
run: |
kubectl config current-context
kubectl get node
- name: Install Operator
working-directory: ./operator
run: |
make helm-deploy
- name: "Run makefile for hook '${{ matrix.unit }}'"
working-directory: ./hooks/${{ matrix.unit }}/
run: |
make all


# ---- Build Stage | Matrix Hooks ----

hooks:
Expand Down Expand Up @@ -325,8 +395,8 @@ jobs:
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: ./hooks/${{ matrix.hook }}
file: ./hooks/${{ matrix.hook }}/Dockerfile
context: ./hooks/${{ matrix.hook }}/hook
file: ./hooks/${{ matrix.hook }}/hook/Dockerfile
build-args: |
namespace=${{ env.DOCKER_NAMESPACE }}
baseImageTag=${{ env.baseImageTag }}
Expand Down Expand Up @@ -769,16 +839,13 @@ jobs:
kubectl create deployment --image nginx:alpine nginx --namespace demo-targets
kubectl expose deployment nginx --port 80 --namespace demo-targets

# ---- OWASP Amass Integration Tests ----
# # ---- OWASP Amass Integration Tests ----

- name: "amass Integration Tests"
run: |
kubectl -n integration-tests delete scans --all
helm -n integration-tests install amass ./scanners/amass/ \
--set="parser.image.repository=docker.io/${{ env.DOCKER_NAMESPACE }}/parser-amass" \
--set="parser.image.tag=sha-$(git rev-parse --short HEAD)"
cd tests/integration/
npx jest --ci --color scanner/amass.test.js
# - name: "amass Integration Tests"
# working-directory: ./scanners/amass
# run: |
# make deploy IMG_TAG=$(git rev-parse --short HEAD)
# make integration-tests

# ---- gitleaks Integration Tests ----

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*.ipr
out/

Created by https://www.toptal.com/developers/gitignore/api/vim
# Created by https://www.toptal.com/developers/gitignore/api/vim
# Edit at https://www.toptal.com/developers/gitignore?templates=vim

### Vim ###
Expand All @@ -47,3 +47,5 @@ tags
[._]*.un~

# End of https://www.toptal.com/developers/gitignore/api/vim

*.tar
11 changes: 3 additions & 8 deletions hooks/cascading-scans/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# SPDX-FileCopyrightText: 2020 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0

node_modules
*.map
**.js
!**.test.js
declarative-subsequent-scans.tar
*.js
*.js.map
2 changes: 2 additions & 0 deletions hooks/cascading-scans/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ config/*
Dockerfile
.dockerignore
docs/
declarative-subsequent-scans.tar
hook
File renamed without changes.
Loading