Skip to content

Commit 66aab4d

Browse files
committed
container scan and dast scan implemented
1 parent c68ff5b commit 66aab4d

File tree

10 files changed

+687
-4
lines changed

10 files changed

+687
-4
lines changed

.cursor/rules/project-rules.mdc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
alwaysApply: true
3+
---
4+
# Project Instructions
5+
6+
* Follow OWASP: validate inputs (core.getInput), sanitize outputs, and secure secrets via GitHub secrets.
7+
* write async, memory‑efficient code; avoid blocking I/O; stream large data.
8+
* Use modern idioms; keep code modular and maintainable
9+
* Documentation: update README with usage and examples.
10+
* Unit test critical logic; ≥80% coverage; mock APIs
11+
* use try/catch around API calls; structured logs with core.info/core.error; never log sensitive data.
12+
* Write meaningful, focused commits; never commit secrets
13+
* do not create document every time, create only when asked
14+
* For every new feature, scan the Action codebase to identify how similar features are organized, then generate the corresponding modules, inputs in action.yml, helper functions, and tests. Place files in the correct folders and maintain the project’s established naming conventions and architecture.

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vigilnz-scan-action.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 142 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# <img src="images/vigilnz.svg" width="40" height="40" align="absmiddle" /> Vigilnz GitHub Action
22

33
## Overview
4-
The **Vigilnz Security Scan Action** helps developers automatically check their repositories for vulnerabilities during CI/CD.
4+
The **Vigilnz Security Scan Action** helps developers automatically check their applications and repositories for vulnerabilities during CI/CD.
55
It supports multiple scan types:
66
- **SCA** → Software Composition Analysis
77
- **SBOM** → Software Bill of Materials generation
88
- **SAST** → Static Application Security Testing
99
- **IAC SCAN** → Infrastructure as Code — checks configuration files (Terraform, Kubernetes, etc.) for misconfigurations.
1010
- **SECRET SCAN** → Secret Detection — finds hardcoded credentials, API keys, and sensitive information in source code.
11+
- **DAST** → Dynamic Application Security Testing — tests running web applications for security vulnerabilities.
12+
- **CONTAINER SCAN** → Container Image Scanning — analyzes container images for vulnerabilities and misconfigurations.
1113

1214

1315
This action makes it easy to integrate Vigilnz scanning into your GitHub workflows.
@@ -64,15 +66,46 @@ jobs:
6466
with:
6567
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
6668
scanTypes: "SCA,SBOM,SAST,SECRET SCAN,IAC SCAN"
69+
projectName: "my-project"
70+
environment: "production"
6771

6872
```
6973

7074
## Inputs
7175

76+
### Required Inputs
77+
7278
| Name | Required | Description |
7379
|---------------|----------|------------------------------------------------------------|
7480
| vigilnzApiKey | True | Your Vigilnz API key (stored securely in GitHub Secrets). |
75-
| scanTypes | True | Comma-separated list: `SCA,SBOM,SAST,SECRET SCAN,IAC SCAN` |
81+
| scanTypes | True | Comma-separated list: `SCA,SBOM,SAST,SECRET SCAN,IAC SCAN,DAST,CONTAINER SCAN` |
82+
83+
### Optional Inputs
84+
85+
| Name | Required | Description |
86+
|---------------------|----------|--------------------------------------------------------------------------------|
87+
| projectName | False | Project name for the scan |
88+
| environment | False | Environment for the scan (`dev`, `development`, `demo`, `prod`, `production`) |
89+
90+
### DAST Scan Inputs
91+
92+
| Name | Required | Description | Required When |
93+
|---------------|----------|------------------------------------------------|--------------------------|
94+
| dastScanType | False | DAST scan type (e.g., `spider`, `active`) | When `DAST` in scanTypes |
95+
| dastTargetUrl | False | Target URL for DAST scan | When `DAST` in scanTypes |
96+
97+
### Container Scan Inputs
98+
99+
| Name | Required | Description | Required When |
100+
|-----------------------|----------|----------------------------------------------------------------------------------|----------------------------------|
101+
| containerImage | False | Container image name (e.g., `nginx:latest`) | When `CONTAINER SCAN` in scanTypes |
102+
| containerProvider | False | Registry provider: `dockerhub`, `aws-ecr`, `github`, `gitlab`, `google`, `azure`, `quay` | When `CONTAINER SCAN` in scanTypes |
103+
| containerRegistryType | False | Registry type: `public`, `private`, `ecr-public`, `ecr-private`, `gcr`, `artifact`, `mcr` | When required by provider |
104+
| containerRegistryUrl | False | Registry URL (for private registries) | When using private registries |
105+
| containerAuthType | False | Authentication type: `none`, `token`, `username-password` | When registry requires auth |
106+
| containerToken | False | Access token for container registry | When `containerAuthType` is `token` |
107+
| containerUsername | False | Username for container registry | When `containerAuthType` is `username-password` |
108+
| containerPassword | False | Password for container registry (store in secrets!) | When `containerAuthType` is `username-password` |
76109

77110

78111
## Example Scenarios
@@ -85,11 +118,117 @@ with:
85118
scanTypes: "SCA"
86119
```
87120
88-
### Run all scans:
121+
### Run all code-based scans:
89122
90123
```yaml
91124
with:
92125
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
93126
scanTypes: "SCA,SBOM,SAST,SECRET SCAN,IAC SCAN"
127+
projectName: "my-application"
128+
environment: "production"
129+
```
130+
131+
### Run DAST scan:
132+
133+
```yaml
134+
with:
135+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
136+
scanTypes: "DAST"
137+
dastScanType: "active"
138+
dastTargetUrl: "https://example.com"
139+
projectName: "web-application"
140+
```
141+
142+
### Run Container scan (Docker Hub public image):
143+
144+
```yaml
145+
with:
146+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
147+
scanTypes: "CONTAINER SCAN"
148+
containerImage: "nginx:latest"
149+
containerProvider: "dockerhub"
150+
containerAuthType: "none"
151+
```
152+
153+
### Run Container scan (Docker Hub private image):
154+
155+
```yaml
156+
with:
157+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
158+
scanTypes: "CONTAINER SCAN"
159+
containerImage: "myorg/myapp:1.0.0"
160+
containerProvider: "dockerhub"
161+
containerAuthType: "username-password"
162+
containerUsername: ${{ secrets.DOCKERHUB_USERNAME }}
163+
containerPassword: ${{ secrets.DOCKERHUB_PASSWORD }}
164+
```
165+
166+
### Run Container scan (AWS ECR private):
167+
168+
```yaml
169+
with:
170+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
171+
scanTypes: "CONTAINER SCAN"
172+
containerImage: "myapp:latest"
173+
containerProvider: "aws-ecr"
174+
containerRegistryType: "ecr-private"
175+
containerRegistryUrl: "123456789012.dkr.ecr.us-east-1.amazonaws.com"
176+
containerAuthType: "token"
177+
containerToken: ${{ secrets.AWS_ECR_TOKEN }}
178+
```
179+
180+
### Run Container scan (GitHub Container Registry):
181+
182+
```yaml
183+
with:
184+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
185+
scanTypes: "CONTAINER SCAN"
186+
containerImage: "ghcr.io/myorg/myapp:latest"
187+
containerProvider: "github"
188+
containerAuthType: "token"
189+
containerToken: ${{ secrets.GITHUB_TOKEN }}
94190
```
95191
192+
### Run Container scan (Google Container Registry):
193+
194+
```yaml
195+
with:
196+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
197+
scanTypes: "CONTAINER SCAN"
198+
containerImage: "gcr.io/myproject/myapp:latest"
199+
containerProvider: "google"
200+
containerRegistryType: "gcr"
201+
containerAuthType: "token"
202+
containerToken: ${{ secrets.GCP_TOKEN }}
203+
```
204+
205+
### Run Container scan (Azure Container Registry):
206+
207+
```yaml
208+
with:
209+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
210+
scanTypes: "CONTAINER SCAN"
211+
containerImage: "myapp:latest"
212+
containerProvider: "azure"
213+
containerRegistryType: "acr-private"
214+
containerRegistryUrl: "myregistry.azurecr.io"
215+
containerAuthType: "token"
216+
containerToken: ${{ secrets.AZURE_ACR_TOKEN }}
217+
```
218+
219+
### Run multiple scan types together:
220+
221+
```yaml
222+
with:
223+
vigilnzApiKey: ${{ secrets.VIGILNZ_API_KEY }}
224+
scanTypes: "SCA,SAST,DAST,CONTAINER SCAN"
225+
projectName: "full-stack-app"
226+
environment: "production"
227+
# DAST configuration
228+
dastScanType: "active"
229+
dastTargetUrl: "https://myapp.example.com"
230+
# Container configuration
231+
containerImage: "myapp:latest"
232+
containerProvider: "dockerhub"
233+
containerAuthType: "none"
234+
```

action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,42 @@ inputs:
1313
required: false
1414
environment:
1515
description: 'Choose which environment the scan trigger'
16+
required: false
17+
18+
# DAST fields
19+
dastScanType:
20+
description: 'DAST scan type (e.g., spider, active)'
21+
required: false
22+
dastTargetUrl:
23+
description: 'Target URL for DAST scan'
24+
required: false
25+
26+
# Container fields
27+
containerImage:
28+
description: 'Container image name (e.g., nginx:latest)'
29+
required: false
30+
containerProvider:
31+
description: 'Registry provider (dockerhub, aws-ecr, github, gitlab, google, azure, quay)'
32+
required: false
33+
containerRegistryType:
34+
description: 'Registry type (public, private, ecr-public, ecr-private, gcr, artifact, mcr)'
1635
required: false
36+
containerRegistryUrl:
37+
description: 'Registry URL (for private registries)'
38+
required: false
39+
containerAuthType:
40+
description: 'Authentication type (none, token, username-password)'
41+
required: false
42+
containerToken:
43+
description: 'Access token for container registry'
44+
required: false
45+
containerUsername:
46+
description: 'Username for container registry'
47+
required: false
48+
containerPassword:
49+
description: 'Password for container registry'
50+
required: false
51+
1752
runs:
1853
using: 'node16'
1954
main: 'dist/index.js'

0 commit comments

Comments
 (0)