Skip to content

Commit

Permalink
1.0.63 Update Hadolint Scan Action
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed May 16, 2024
1 parent 4ac44cb commit 6f8f3e6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 41 deletions.
71 changes: 35 additions & 36 deletions .github/workflows/build-and-push-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ name: build-scan-push-to-dockerhub
# Specify when this workflow should run (on a push event to the 'main' branch).
on:
push:
branches:
- 'main'
branches: ["main"]

# Define environment variables for better organization.
env:
Expand All @@ -28,7 +27,7 @@ jobs:
steps:
# Step 1: Prepare the runner and check out the codebase.
- name: Check out the codebase
uses: actions/checkout@v4
uses: actions/checkout@main

# Step 2: Get the version from a file and set it as an environment variable.
- name: Get version from version file
Expand All @@ -38,15 +37,15 @@ jobs:
# Step 3: Set up QEMU on the runner.
- name: Set up QEMU on the runner
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@master

# Step 4: Set up Docker Buildx on the runner.
- name: Set up Docker Buildx on the runner
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@master

# Step 5: Login to Docker Hub using secrets for authentication.
- name: Login to Docker Hub
uses: docker/login-action@v3
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -56,10 +55,10 @@ jobs:
# ----------------------------------------------------------------------------
-
name: Build and Export Database Container to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
load: true
tags: webpwnized/mutillidae:${{ env.DATABASE_CONTAINER_NAME }}

Expand All @@ -80,19 +79,19 @@ jobs:

-
name: Build and push Database container
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.DATABASE_CONTAINER_NAME }}

-
name: Build and push Database container with version number
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.DATABASE_CONTAINER_NAME }}-${{ env.VERSION }}

Expand All @@ -102,10 +101,10 @@ jobs:

-
name: Build and Export Database Admin Container to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
load: true
tags: webpwnized/mutillidae:${{ env.DATABASE_ADMIN_CONTAINER_NAME }}

Expand All @@ -126,19 +125,19 @@ jobs:

-
name: Build and push Database Admin Container
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.DATABASE_ADMIN_CONTAINER_NAME }}

-
name: Build and push Database Admin Container with version number
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.DATABASE_ADMIN_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.DATABASE_ADMIN_CONTAINER_NAME }}-${{ env.VERSION }}

Expand All @@ -148,10 +147,10 @@ jobs:

-
name: Build and Export LDAP Container to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
load: true
tags: webpwnized/mutillidae:${{ env.LDAP_CONTAINER_NAME }}

Expand All @@ -172,19 +171,19 @@ jobs:

-
name: Build and push LDAP Container
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.LDAP_CONTAINER_NAME }}

-
name: Build and push LDAP Container with version number
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.LDAP_CONTAINER_NAME }}-${{ env.VERSION }}

Expand All @@ -194,10 +193,10 @@ jobs:

-
name: Build and Export LDAP Admin Container to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
load: true
tags: webpwnized/mutillidae:${{ env.LDAP_ADMIN_CONTAINER_NAME }}

Expand All @@ -218,19 +217,19 @@ jobs:

-
name: Build and push LDAP Admin Container
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.LDAP_ADMIN_CONTAINER_NAME }}

-
name: Build and push LDAP Admin Container with version number
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
file: .build/${{ env.LDAP_ADMIN_CONTAINER_NAME }}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.LDAP_ADMIN_CONTAINER_NAME }}-${{ env.VERSION }}

Expand All @@ -240,10 +239,10 @@ jobs:

-
name: Build and Export Web Container to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.WEB_CONTAINER_NAME}}/Dockerfile
file: .build/${{ env.WEB_CONTAINER_NAME}}/Dockerfile
load: true
tags: webpwnized/mutillidae:${{ env.WEB_CONTAINER_NAME}}

Expand All @@ -264,18 +263,18 @@ jobs:

-
name: Build and push Web Container
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.WEB_CONTAINER_NAME}}/Dockerfile
file: .build/${{ env.WEB_CONTAINER_NAME}}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.WEB_CONTAINER_NAME}}

-
name: Build and push Web Container with version number
uses: docker/build-push-action@v5
uses: docker/build-push-action@master
with:
context: .
file: ./${{ env.WEB_CONTAINER_NAME}}/Dockerfile
file: .build/${{ env.WEB_CONTAINER_NAME}}/Dockerfile
push: true
tags: webpwnized/mutillidae:${{ env.WEB_CONTAINER_NAME}}-${{ env.VERSION }}
8 changes: 4 additions & 4 deletions .github/workflows/scan-application-with-stackhawk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
# Step 1: Checkout code from the repository.
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@main

# Step 2: Install LDAP Utilities
- name: Install LDAP Utilities
Expand All @@ -49,7 +49,7 @@ jobs:
run: |
# Starting containers using Docker Compose.
docker-compose -f docker-compose.yml up -d;
docker-compose -f .build/docker-compose.yml up -d;
# Step 4: Load Users into LDAP Directory
- name: Load Users into LDAP Directory
Expand All @@ -59,7 +59,7 @@ jobs:
# ldapadd will exit with non-zero exit code if user already exists in the directory
# Use || true to force zero exit code
CURRENT_DIRECTORY=$(pwd);
ldapadd -c -x -D "cn=admin,dc=mutillidae,dc=localhost" -w mutillidae -H ldap:// -f $CURRENT_DIRECTORY/ldap/ldif/mutillidae.ldif || true;
ldapadd -c -x -D "cn=admin,dc=mutillidae,dc=localhost" -w mutillidae -H ldap:// -f $CURRENT_DIRECTORY/.build/ldap/ldif/mutillidae.ldif || true;
# Step 5: Run Database Build Script
- name: Run Database Build Script
Expand All @@ -80,7 +80,7 @@ jobs:
# Step 7: Run StackHawk Scan
- name: Run StackHawk Scan
uses: stackhawk/hawkscan-action@v2
uses: stackhawk/hawkscan-action@main
with:
apiKey: ${{ secrets.HAWK_API_KEY }} # Secret key for authentication.
configurationFiles: .github/workflows/config/stackhawk.yml # Path to configuration file.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan-dockerfiles-with-kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
- name: Run KICS Scan with SARIF result
uses: Checkmarx/kics-github-action@master
with:
path: .
# when provided with a directory on output_path
# it will generate the specified reports file named 'results.{extension}'
# in this example it will generate: results.sarif
output_path: .
platform_type: Dockerfile
output_formats: 'sarif'
ignore_on_exit: results
path: .build/database/Dockerfile, .build/database_admin/Dockerfile, .build/ldap/Dockerfile, .build/ldap_admin/Dockerfile, .build/www/Dockerfile

- name: View Results
run: cat results.sarif
Expand Down

0 comments on commit 6f8f3e6

Please sign in to comment.