Skip to content

Commit 09d9dfd

Browse files
authored
Create docker-security.yml
1 parent 7e1da47 commit 09d9dfd

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Validate Docker Image with Trivy (docker-compose)
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-scan:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 🧾 Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: 🐳 Set up Docker Compose
18+
run: sudo apt-get update && sudo apt-get install -y docker-compose
19+
20+
- name: 🛠️ Build image with docker compose
21+
run: docker compose build
22+
23+
- name: 🔍 Scan local image with Trivy
24+
uses: aquasecurity/trivy-action@master
25+
with:
26+
image-ref: python-samples-fastapi-restful:latest # tu nombre de imagen real
27+
format: table
28+
exit-code: 1
29+
ignore-unfixed: true
30+
severity: CRITICAL,HIGH

0 commit comments

Comments
 (0)