Skip to content

Commit 46ac388

Browse files
committed
docs(security): rely on Xray/ECR for container vuln scanning
- Remove Trivy/Snyk/Docker Scout examples from rules and skills - Replace with guidance to enforce scanning in JFrog Xray or AWS ECR enhanced scanning (Inspector) - Clean up CI snippet examples to avoid ad-hoc scanner references
1 parent d6da533 commit 46ac388

8 files changed

Lines changed: 57 additions & 145 deletions

File tree

rules/100-core.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ func processFile(filename string) error {
782782
- Run as non-root user (avoid `USER root`).
783783
- Pin base image versions (`python:3.12.1-slim`, not `python:latest`).
784784
- Use `.dockerignore` to exclude unnecessary files.
785-
- Scan images for vulnerabilities (`docker scout`, `trivy`).
785+
- Scan images for vulnerabilities via centralized scanning gates (JFrog Xray / AWS ECR enhanced scanning).
786786
- Minimize layers (combine `RUN` commands with `&&`).
787787

788788
**JavaScript/TypeScript:**

rules/160-github-actions.mdc

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,21 +1044,12 @@ jobs:
10441044
uses: github/codeql-action/analyze@v3
10451045
```
10461046

1047-
**Dependency Scanning:**
1048-
```yaml
1049-
- name: Run Trivy vulnerability scanner
1050-
uses: aquasecurity/trivy-action@master
1051-
with:
1052-
scan-type: 'fs'
1053-
scan-ref: '.'
1054-
format: 'sarif'
1055-
output: 'trivy-results.sarif'
1047+
**Dependency / artifact vulnerability scanning:**
10561048

1057-
- name: Upload to Security tab
1058-
uses: github/codeql-action/upload-sarif@v3
1059-
with:
1060-
sarif_file: 'trivy-results.sarif'
1061-
```
1049+
Prefer centralized, registry-native scanning and enforcement rather than ad-hoc CI scanners:
1050+
1051+
- **JFrog Artifactory**: enforce vulnerability policies with **JFrog Xray** (block promotion/deploy on HIGH/CRITICAL)
1052+
- **AWS ECR**: enforce **Enhanced scanning (Amazon Inspector)** findings (block deploy on findings)
10621053

10631054
---
10641055

rules/310-security.mdc

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -465,34 +465,10 @@ updates:
465465

466466
**Lock File Scanning**
467467

468-
```yaml
469-
# GitHub Actions - Vulnerability scanning
470-
name: Security Scan
468+
Use language/package-ecosystem native tools (example: `npm audit`) and enforce container image vulnerability scanning in the registry:
471469

472-
on: [push, pull_request]
473-
474-
jobs:
475-
scan:
476-
runs-on: ubuntu-latest
477-
steps:
478-
- uses: actions/checkout@v4
479-
480-
- name: Run Snyk
481-
uses: snyk/actions/node@master
482-
env:
483-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
484-
485-
- name: Run npm audit
486-
run: npm audit --audit-level=high
487-
488-
- name: Run Trivy
489-
uses: aquasecurity/trivy-action@master
490-
with:
491-
scan-type: 'fs'
492-
scan-ref: '.'
493-
format: 'sarif'
494-
output: 'trivy-results.sarif'
495-
```
470+
- **JFrog Artifactory**: enforce vulnerability policies with **JFrog Xray** (block promotion/deploy on HIGH/CRITICAL)
471+
- **AWS ECR**: enforce **Enhanced scanning (Amazon Inspector)** findings (block deploy on findings)
496472

497473
---
498474

@@ -931,18 +907,9 @@ jobs:
931907
steps:
932908
- uses: actions/checkout@v4
933909

934-
- name: Run Trivy vulnerability scanner
935-
uses: aquasecurity/trivy-action@master
936-
with:
937-
scan-type: 'fs'
938-
scan-ref: '.'
939-
format: 'sarif'
940-
output: 'trivy-results.sarif'
941-
942-
- name: Run Snyk
943-
uses: snyk/actions/node@master
944-
env:
945-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
910+
# Container image vulnerability scanning should be enforced centrally:
911+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy)
912+
# - AWS ECR: Enhanced scanning (Amazon Inspector) findings (block deploy)
946913

947914
- name: Run GitGuardian
948915
uses: GitGuardian/ggshield-action@master

rules/440-docker.mdc

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,13 @@ CMD ["python", "-m", "src.main"]
262262

263263
### Scan for Vulnerabilities
264264
```bash
265-
# Trivy - scan for vulnerabilities
266-
trivy image myapp:latest
267-
268-
# Trivy - fail on HIGH and CRITICAL
269-
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:latest
270-
271-
# Snyk - scan and monitor
272-
snyk container test myapp:latest
273-
snyk container monitor myapp:latest
274-
275-
# Docker Scout
276-
docker scout cves myapp:latest
265+
## Prefer registry-native scanning gates
266+
#
267+
# For container image vulnerability scanning, rely on a centralized scanner that
268+
# runs in your registry / artifact-promotion pipeline (not ad-hoc on laptops):
269+
#
270+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy on HIGH/CRITICAL)
271+
# - AWS ECR: Enhanced scanning (Amazon Inspector) policies (block deploy on findings)
277272
```
278273

279274
### Sign Images
@@ -684,18 +679,9 @@ jobs:
684679
cache-from: type=gha
685680
cache-to: type=gha,mode=max
686681

687-
- name: Scan with Trivy
688-
uses: aquasecurity/trivy-action@master
689-
with:
690-
image-ref: ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}
691-
format: 'sarif'
692-
output: 'trivy-results.sarif'
693-
694-
- name: Upload Trivy results
695-
uses: github/codeql-action/upload-sarif@v2
696-
if: always()
697-
with:
698-
sarif_file: 'trivy-results.sarif'
682+
# Vulnerability scanning should be enforced centrally in the registry:
683+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy)
684+
# - AWS ECR: Enhanced scanning (Amazon Inspector) findings (block deploy)
699685
```
700686

701687
---

skills/containers-orchestration/SKILL.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ description: Docker and container orchestration best practices for production-re
2020
| **Multi-Stage** | Required for compiled languages (Go, Rust, C++) |
2121
| **User** | Run as non-root (use `USER node` or create user) |
2222
| **Health Checks** | Always include `HEALTHCHECK` instruction |
23-
| **Scanning** | Trivy or Snyk before production |
23+
| **Scanning** | Registry-native scanning gates (JFrog Xray / AWS ECR enhanced scanning) |
2424
| **Signing** | Sign images with cosign or Docker Content Trust |
2525

2626
## Dockerfile Best Practices
@@ -183,18 +183,13 @@ CMD ["python", "-m", "src.main"]
183183
### Scan for Vulnerabilities
184184

185185
```bash
186-
# Trivy - scan for vulnerabilities
187-
trivy image myapp:latest
188-
189-
# Trivy - fail on HIGH and CRITICAL
190-
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:latest
191-
192-
# Snyk - scan and monitor
193-
snyk container test myapp:latest
194-
snyk container monitor myapp:latest
195-
196-
# Docker Scout
197-
docker scout cves myapp:latest
186+
## Prefer registry-native scanning gates
187+
#
188+
# For container image vulnerability scanning, rely on a centralized scanner that
189+
# runs in your registry / artifact-promotion pipeline (not ad-hoc on laptops):
190+
#
191+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy on HIGH/CRITICAL)
192+
# - AWS ECR: Enhanced scanning (Amazon Inspector) policies (block deploy on findings)
198193
```
199194

200195
## Health Checks

skills/containers-orchestration/references/docker.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,13 @@ CMD ["python", "-m", "src.main"]
265265
### Scan for Vulnerabilities
266266

267267
```bash
268-
# Trivy - scan for vulnerabilities
269-
trivy image myapp:latest
270-
271-
# Trivy - fail on HIGH and CRITICAL
272-
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:latest
273-
274-
# Snyk - scan and monitor
275-
snyk container test myapp:latest
276-
snyk container monitor myapp:latest
277-
278-
# Docker Scout
279-
docker scout cves myapp:latest
268+
## Prefer registry-native scanning gates
269+
#
270+
# For container image vulnerability scanning, rely on a centralized scanner that
271+
# runs in your registry / artifact-promotion pipeline (not ad-hoc on laptops):
272+
#
273+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy on HIGH/CRITICAL)
274+
# - AWS ECR: Enhanced scanning (Amazon Inspector) policies (block deploy on findings)
280275
```
281276

282277
### Sign Images
@@ -697,18 +692,9 @@ jobs:
697692
cache-from: type=gha
698693
cache-to: type=gha,mode=max
699694

700-
- name: Scan with Trivy
701-
uses: aquasecurity/trivy-action@master
702-
with:
703-
image-ref: ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}
704-
format: 'sarif'
705-
output: 'trivy-results.sarif'
706-
707-
- name: Upload Trivy results
708-
uses: github/codeql-action/upload-sarif@v2
709-
if: always()
710-
with:
711-
sarif_file: 'trivy-results.sarif'
695+
# Vulnerability scanning should be enforced centrally in the registry:
696+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy)
697+
# - AWS ECR: Enhanced scanning (Amazon Inspector) findings (block deploy)
712698
```
713699

714700
---

skills/infrastructure-iac/references/docker.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,13 @@ LABEL org.opencontainers.image.revision="${GIT_SHA}"
162162
## Security Scanning
163163

164164
```bash
165-
# Scan for vulnerabilities
166-
docker scout cves myimage:latest
167-
trivy image myimage:latest
165+
## Prefer registry-native scanning gates
166+
#
167+
# For container image vulnerability scanning, rely on a centralized scanner that
168+
# runs in your registry / artifact-promotion pipeline (not ad-hoc on laptops):
169+
#
170+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy on HIGH/CRITICAL)
171+
# - AWS ECR: Enhanced scanning (Amazon Inspector) policies (block deploy on findings)
168172

169173
# Lint Dockerfile
170174
hadolint Dockerfile

skills/security-testing/references/owasp-security.md

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,13 @@ updates:
431431
**Lock File Scanning:**
432432

433433
```yaml
434-
# GitHub Actions - Vulnerability scanning
434+
# GitHub Actions - Vulnerability scanning (example pattern)
435+
#
436+
# Prefer registry-native scanning/enforcement for container images:
437+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy on HIGH/CRITICAL)
438+
# - AWS ECR: Enhanced scanning (Amazon Inspector) findings (block deploy on findings)
439+
#
440+
# Keep language/package native scanning in CI (example: npm audit) as appropriate.
435441
name: Security Scan
436442

437443
on: [push, pull_request]
@@ -441,22 +447,8 @@ jobs:
441447
runs-on: ubuntu-latest
442448
steps:
443449
- uses: actions/checkout@v4
444-
445-
- name: Run Snyk
446-
uses: snyk/actions/node@master
447-
env:
448-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
449-
450450
- name: Run npm audit
451451
run: npm audit --audit-level=high
452-
453-
- name: Run Trivy
454-
uses: aquasecurity/trivy-action@master
455-
with:
456-
scan-type: 'fs'
457-
scan-ref: '.'
458-
format: 'sarif'
459-
output: 'trivy-results.sarif'
460452
```
461453
462454
---
@@ -845,18 +837,9 @@ jobs:
845837
steps:
846838
- uses: actions/checkout@v4
847839

848-
- name: Run Trivy
849-
uses: aquasecurity/trivy-action@master
850-
with:
851-
scan-type: 'fs'
852-
scan-ref: '.'
853-
format: 'sarif'
854-
output: 'trivy-results.sarif'
855-
856-
- name: Run Snyk
857-
uses: snyk/actions/node@master
858-
env:
859-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
840+
# Container image vulnerability scanning should be enforced centrally:
841+
# - JFrog Artifactory: JFrog Xray policies (block promotion/deploy)
842+
# - AWS ECR: Enhanced scanning (Amazon Inspector) findings (block deploy)
860843

861844
- name: Run Bandit (Python)
862845
run: |

0 commit comments

Comments
 (0)