Skip to content

Commit efc6eb0

Browse files
authored
Merge pull request #11 from dgolive/sec/CVE-2025-53547
build and sout
2 parents bb0c816 + 2ef4f9f commit efc6eb0

File tree

2 files changed

+45
-19
lines changed

2 files changed

+45
-19
lines changed
Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
1-
name: CI/CD Pipeline
1+
# This GitHub Actions workflow automates the process of building, testing, and deploying a project.
2+
# The workflow is triggered on push and pull request events to the main branch.
23

3-
on:
4-
push:
5-
branches:
6-
- main
4+
name: CI/CD Pipeline # Name of the workflow
75

8-
jobs:
9-
build-and-push:
6+
on: # Workflow trigger configuration
7+
push: # Trigger on push events
8+
branches: # Specify branches to trigger on
9+
- main # Only trigger on pushes to the main branch
10+
11+
jobs: # Define jobs to run
12+
build-and-push: # Job name
13+
runs-on: ubuntu-latest # Use the latest Ubuntu runner
14+
15+
steps: # List of steps in the job
16+
17+
- name: Checkout code # Step to checkout repository code
18+
uses: actions/checkout@v4 # Use the official checkout action
19+
20+
- name: Set up Docker Buildx # Step to set up Docker Buildx for advanced builds
21+
uses: docker/setup-buildx-action@v3 # Use Docker Buildx setup action
22+
23+
- name: Log in to Docker Hub # Step to authenticate to Docker Hub
24+
uses: docker/login-action@v3 # Use Docker login action
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }} # Docker Hub username from secrets
27+
password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker Hub token from secrets
28+
29+
- name: Build and push Docker image # Step to build and push Docker image
30+
uses: docker/build-push-action@v5 # Use Docker build and push action
31+
with:
32+
context: . # Build context is the root of the repository
33+
file: ./Dockerfile # Dockerfile location
34+
push: true # Push the image after building
35+
tags: danilogo/istio-analyzer-exporter:v1.0.11 # Tag for the Docker image
36+
37+
38+
security-code-review:
1039
runs-on: ubuntu-latest
40+
needs: build-and-push
1141

1242
steps:
1343
- name: Checkout code
@@ -16,16 +46,10 @@ jobs:
1646
- name: Set up Docker Buildx
1747
uses: docker/setup-buildx-action@v3
1848

19-
- name: Log in to Docker Hub
20-
uses: docker/login-action@v3
21-
with:
22-
username: ${{ secrets.DOCKERHUB_USERNAME }}
23-
password: ${{ secrets.DOCKERHUB_TOKEN }}
24-
25-
- name: Build and push Docker image
26-
uses: docker/build-push-action@v5
49+
- name: Docker Scout Analyze
50+
uses: docker/scout-action@v1
2751
with:
28-
context: .
29-
file: ./Dockerfile
30-
push: true
31-
tags: danilogo/istio-analyzer-exporter:v1.0.11
52+
command: cves
53+
image: danilogo/istio-analyzer-exporter:v1.0.11
54+
dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }}
55+
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN curl -L https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/is
1515

1616
ENV PATH=$ISTIOCTL_DIR:$PATH
1717

18+
RUN useradd --create-home nonroot
19+
1820
WORKDIR /app
1921

2022
COPY istio_analyzer_exporter.py .

0 commit comments

Comments
 (0)