Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 12 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ on:
schedule:
- cron: "15 2 * * *" # Nightly-Build at 2:15 AM UTC

# The CI runs on ubuntu-20.04; More info about the installed software is found here:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md

env:
# ---- Language Versions ----

GO_VERSION: "1.17"
PYTHON_VERSION: "3.9"
PYTHON_VERSION: "3.8.10"
NODE_VERSION: "16"
NPM_VERSION: "7"

Expand All @@ -24,7 +27,7 @@ jobs:

unit-java:
name: "Unit-Test | Java"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
unit: ["persistence-defectdojo"]
Expand All @@ -45,7 +48,7 @@ jobs:

operator:
name: "Build | Operator"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
component: ["operator", "lurker"]
Expand Down Expand Up @@ -83,7 +86,7 @@ jobs:

auto-discovery-kubernetes:
name: "AutoDiscovery | Kubernetes"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:

sdk:
name: "Build | SDKs"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
sdk:
Expand Down Expand Up @@ -154,7 +157,7 @@ jobs:
needs:
- sdk
- operator
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -305,7 +308,7 @@ jobs:
needs:
- sdk
- operator
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -426,7 +429,7 @@ jobs:
name: Integration Tests Hook ${{ matrix.hook }} | k8s ${{ matrix.k8sVersion }}
needs:
- operator
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
k8sVersion:
Expand Down Expand Up @@ -560,7 +563,7 @@ jobs:

# ---- Integration-Test ----

- name: Deploy ${{ matrix.unit }}
- name: Deploy ${{ matrix.hook }}
working-directory: ./hooks/${{ matrix.hook }}
run: make deploy

Expand Down
2 changes: 1 addition & 1 deletion scanners/zap-advanced/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deploy-with-scanner:
--set="scanner.image.repository=docker.io/$(IMG_NS)/$(scanner-prefix)-$(scanner)" \
--set="scanner.image.tag=$(IMG_TAG)"

deploy-test-deps: deploy-test-dep-nginx deploy-test-dep-bodgeit deploy-test-dep-juiceshop deploy-test-dep-petstore
deploy-test-deps: deploy-test-dep-bodgeit deploy-test-dep-juiceshop deploy-test-dep-petstore

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
Expand Down
16 changes: 0 additions & 16 deletions scanners/zap-advanced/integration-tests/zap-advanced.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ const {scan} = require("../../helpers");

jest.retryTimes(3);

test(
"ZAP-advanced scan without config YAML against a plain 'nginx container' should only find couple findings",
async () => {
const { count } = await scan(
"zap-advanced-scan-nginx-demo",
"zap-advanced-scan",
["-t", "http://nginx.demo-targets.svc"],
60 * 15
);

// There must be at least one finding
expect(count).toBeGreaterThanOrEqual(1);
},
60 * 16 * 1000
);

test(
"ZAP-advanced scan without config YAML against 'bodgeit' container should only find couple findings",
async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import glob
import hiyapyco

from typing import List

# set up logging to file - see previous section for more details
logging.basicConfig(
level=logging.INFO,
Expand Down Expand Up @@ -88,7 +90,7 @@ def get_global(self) -> collections.OrderedDict:
return result

@property
def get_all_contexts(self) -> list[collections.OrderedDict]:
def get_all_contexts(self) -> List[collections.OrderedDict]:
return self.__config["contexts"] if "contexts" in self.__config else []

def _get_active_config_from(self, configs: collections.OrderedDict, key: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging

from zapv2 import ZAPv2
from typing import List

from .. import ZapClient
from ..configuration import ZapConfiguration
Expand Down Expand Up @@ -308,7 +309,7 @@ def _get_level(self, level: str):
logging.warn("AlertFilter configured with unknown level: '%s'. This rule will be ignored!", level)
return None

def _configure_alert_filters(self, alert_filters: list[collections.OrderedDict], context_id: int):
def _configure_alert_filters(self, alert_filters: List[collections.OrderedDict], context_id: int):
"""Protected method to configure the ZAP 'Context / Alert Filters' Settings based on a given ZAP config.

Parameters
Expand Down