Skip to content

Commit

Permalink
scan and lint image with dockle
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilBaah committed Mar 2, 2024
1 parent 8da0b0d commit f757f99
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
58 changes: 34 additions & 24 deletions .github/workflows/devsecops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,45 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Unit tests and Linters
run: |
# Unit Test
python manage.py test
# - name: Unit tests and Linters
# run: |
# # Unit Test
# python manage.py test

# Code Formatter
black --check .
# # Code Formatter
# black --check .

# Import sort
isort --check-only .
# # Import sort
# isort --check-only .

# Lint Flake8
flake8 .
# # Lint Flake8
# flake8 .

- name: Test SCA Vulnerabilities | Static Composition Analysis
run: |
pyraider check -f requirements.txt
# - name: Test SCA Vulnerabilities | Static Composition Analysis
# run: |
# pyraider check -f requirements.txt

- name: Check Package License
run: |
pip-licenses --format=json > licenses.json
./scripts/run-license-compliance.sh
# - name: Check Package License
# run: |
# pip-licenses --format=json > licenses.json
# ./scripts/run-license-compliance.sh

- name: Scan for Secrets with Trufflehog
run: |
trufflehog3 --no-history --format json --output report.json --exclude "env/*"
# - name: Scan for Secrets with Trufflehog
# run: |
# trufflehog3 --no-history --format json --output report.json --exclude "env/*"

- name: Container Image Linter for Security Dockerfile with Dockle
# - name: Container Image Linter for Security Dockerfile with Dockle
# run: |
# docker run --rm -v $(pwd):/mnt goodwithtech/dockle:v0.3.1 -f json /mnt/Dockerfile > dockle.json
# cat dockle.json
- name: Build an image from Dockerfile
run: |
docker run --rm -v $(pwd):/mnt goodwithtech/dockle:v0.3.1 -f json /mnt/Dockerfile > dockle.json
cat dockle.json
docker build -t built-image:scan .
- name: Run dockle
uses: goodwithtech/dockle-action@main
with:
image: 'built-image:scan'
format: 'list'
exit-code: '1'
exit-level: 'warn'
ignore: 'CIS-DI-0001,DKL-DI-0006'
1 change: 1 addition & 0 deletions dockle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-03-02T17:53:43.899Z FATAL invalid image: invalid reference format: repository name must be lowercase

0 comments on commit f757f99

Please sign in to comment.