/appsec:static-appsec-scanfrom appsec
Use AskUserQuestion for scan type, auto-detect inputs, run scans, then offer remediation
Ships in appsec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill uses AskUserQuestion to get the user's scan type choice, then automatically detects technical inputs (language, image) from the repository.
AskUserQuestion Tool for All User PromptsCRITICAL: Use the AskUserQuestion tool for all user interactions. Never run shell scripts without command-line arguments.
Correct pattern:
AskUserQuestion to get user's choiceAlways use AskUserQuestion tool — do not auto-detect the scan type and do not use shell prompts.
Call AskUserQuestion with these 4 options. For "all", user types "all" in chat:
{
"questions": [{
"question": "What type of security scan would you like to run? (Type 'all' in chat for full scan)",
"header": "Scan type",
"options": [
{"label": "Secret Detection", "description": "Find exposed credentials and secrets"},
{"label": "Image Scan", "description": "Scan container image for vulnerabilities"},
{"label": "SAST", "description": "Static Application Security Testing (code)"},
{"label": "SCA", "description": "Software Composition Analysis (dependencies)"}
],
"multiSelect": false
}]
}
Handle user input:
--scan-type allMap the selection to --scan-type value:
| Returned label | --scan-type value |
|---|---|
| "Secret Detection" | secret |
| "Image Scan" | container |
| "SAST" | sast |
| "SCA" | dependency |
| User types "all" | all |
CRITICAL: After receiving the answer, immediately run the script with --scan-type specified. Never run ./scripts/run-static-scan.sh without arguments.
After the user selects a scan type, automatically detect the technical inputs:
# Run detection script (non-interactive mode - returns ALL Dockerfiles)
./plugins/appsec/skills/static-appsec-scan/scripts/detect-inputs.sh
The script outputs JSON with detected values:
{
"language": "javascript",
"source_path": ".",
"dockerfile_count": 3,
"dockerfiles": ["Dockerfile", "services/api/Dockerfile", "services/web/Dockerfile.prod"]
}
Detection logic:
package.json/*.js/*.ts (javascript), pom.xml/*.java (maven), build.gradle (gradle), requirements.txt/pyproject.toml/uv.lock/*.py (python including UV), go.mod/*.go (go)services/api/package.json, backend/pom.xml). Each service is scanned separately for dependencies.src/ or app/ directories, defaults to .Dockerfile and Dockerfile.* files (case-insensitive)Multi-language SAST support: When multiple languages are detected, SAST runs separately for each language and the reports are merged into a single combined report.
Multi-service dependency scanning: When multiple services are detected (e.g., monorepo with services/api/package.json, services/web/package.json, backend/pom.xml), dependency scanning runs separately for each service and merges all vulnerability findings into a combined report with service metadata.
IMPORTANT: Batch ALL questions into a single AskUserQuestion call to avoid multiple rounds:
{
"questions": [
{
"question": "Scan type: Image Scan. Found 3 Dockerfile(s). Which would you like to scan?",
"header": "Select Dockerfiles",
"options": [
{"label": "All Dockerfiles", "description": "Scan all 3 detected Dockerfiles"},
{"label": "Select specific", "description": "Choose which Dockerfiles to scan"},
{"label": "Cancel", "description": "Skip this scan"}
],
"multiSelect": false
}
]
}
If user selects "Select specific", ask a follow-up AskUserQuestion with the list of Dockerfiles.
For container scans, check if the base images require JFROG authentication. Extract base images:
# Extract base image from each Dockerfile
for f in "${DOCKERFILES[@]}"; do
grep -i "^FROM" "$f" | head -1 | awk '{print $2}'
done
Then batch the JFROG question together with the Dockerfile selection:
{
"questions": [{
"question": "Base images are from private registry (docker-cicd-test.artifactory.<YOUR_DOMAIN>). Provide JFROG_TOKEN?",
"header": "JFROG auth",
"options": [
{"label": "Yes, here's the token", "description": "I'll provide the JFROG_TOKEN"},
{"label": "No, images are public", "description": "No authentication needed"}
],
"multiSelect": false
}]
}
If the user provides the token, pass it to the script via --jfrog-token argument to avoid interactive prompts.
Once the user has selected which Dockerfiles to scan and provided the JFROG_TOKEN (if needed), run the detection script with the --dockerfiles flag:
# Non-interactive: pass selected Dockerfiles as comma-separated list
./plugins/appsec/skills/static-appsec-scan/scripts/detect-inputs.sh --dockerfiles "services/chatbot/Dockerfile,services/gateway/Dockerfile"
This returns only the specified Dockerfiles without any interactive prompts.
IMPORTANT: Run the script with all arguments provided. Never run it interactively.
Before running, verify you have these values:
SCAN_TYPE — from Step 1 AskUserQuestion answerLANGUAGE — from auto-detect (Step 2) or user overrideSOURCE_PATH — from auto-detect (Step 2), usually .DOCKERFILES — comma-separated list from user selectionJFROG_TOKEN — from Step 2a (only for container/all scans, if base image requires auth)For container scans with selected Dockerfiles:
./plugins/appsec/skills/static-appsec-scan/scripts/run-static-scan.sh \
--scan-type container \
--language javascript \
--source-path . \
--dockerfiles "services/chatbot/Dockerfile,services/gateway/Dockerfile" \
--jfrog-token "<TOKEN>"
For other scan types (SAST, secret, dependency):
./plugins/appsec/skills/static-appsec-scan/scripts/run-static-scan.sh \
--scan-type <TYPE> \
--language <LANG> \
--source-path <PATH> \
[--jfrog-token <TOKEN>]
If you see prompts like "Select scan type: 1) 2) 3) 4)" — you ran the script without arguments. Stop and re-run with --scan-type specified.
Container Scan Flow (Multiple Dockerfiles):
When --scan-type container or --scan-type all is specified:
detect-inputs.sh script recursively searches for all Dockerfiles and prompts the user to confirm each onebuild_job — builds the Docker image and saves it as a GitLab artifactcontainer_scanning job — loads the image from artifact and scans it for vulnerabilitiesglci-artifacts/container_<safe-name>/gl-container-scanning-report-merged.jsongl-container-scanning-report.json for backward compatibilityThe container_scanning job always runs after build_job completes (enforced by the needs directive in the pipeline).
The script will:
glci-artifacts/ directoryglci run container_scanning for eachArtifact structure for multi-Dockerfile scans:
glci-artifacts/
├── container_Dockerfile/
│ ├── container_scanning.zip
│ └── gl-container-scanning-report.json (per-Dockerfile report)
├── container_services_api_Dockerfile/
│ ├── container_scanning.zip
│ └── gl-container-scanning-report.json (per-Dockerfile report)
├── gl-container-scanning-report-merged.json (all vulnerabilities combined)
└── gl-container-scanning-report.json (copy of merged for backward compatibility)
Do NOT:
Scan type arguments:
all — Full scan (SAST + Secret Detection + Container + SCA). If multiple Dockerfiles are found, user is prompted to select which ones to scan. Each selected Dockerfile is built and scanned. Multi-language SAST: If multiple languages are detected, SAST runs separately for each language and reports are merged. Multi-service dependency scanning: If multiple services are detected (monorepo), dependency scanning runs for each service and merges findings.secret — Secret detection onlycontainer — Container image scan. If multiple Dockerfiles are found, user is prompted to select which ones to scan. Each selected Dockerfile is built and scanned.sast — Static Application Security Testing. Multi-language support: Automatically detects all languages in the repo and runs SAST for each one, then merges the reports.dependency — SCA/dependency scan. Multi-service support: Automatically detects all services in the repo (e.g., services/api/, backend/) and runs dependency scanning for each service, then merges all vulnerability findings into a combined report with service metadata.After the scan completes, check the summary table output. If vulnerabilities were found, the script will list the report files:
glci-artifacts/gl-sast-report.json (and fortify.html)glci-artifacts/gl-secret-detection-report.jsonglci-artifacts/gl-container-scanning-report-merged.jsonglci-artifacts/container_<name>/gl-container-scanning-report.jsonglci-artifacts/vulnerability-findings-<scan-id>-merged.jsonglci-artifacts/svc-<service-name>/vulnerability-findings-*.jsonglci-artifacts/vulnerability-findings-*.jsonFor container scans with multiple Dockerfiles, the merged report contains all vulnerabilities from all scanned images, with metadata showing which Dockerfiles were included. Individual per-Dockerfile reports are also retained in their respective subdirectories for detailed analysis of a specific image.
For dependency scans with multiple services (monorepo), the merged report contains all vulnerabilities from all scanned services, with each finding tagged with service_path and service_language. Individual per-service reports are retained in glci-artifacts/svc-<service-name>/ subdirectories.
Only after the scan completes successfully, prompt the user using AskUserQuestion:
{
"questions": [{
"question": "Scan complete. Found " + count + " vulnerabilities. Would you like to remediate them one by one?",
"header": "Remediate",
"options": [
{"label": "Yes, remediate", "description": "Fix vulnerabilities one by one"},
{"label": "No, skip remediation", "description": "Review findings without making changes"}
],
"multiSelect": false
}]
}
Wait for the user's selection. If the user selects "Yes, remediate":
Read the scan result files to identify each vulnerability:
Remediate one vulnerability at a time using AskUserQuestion:
AskUserQuestion for each fix decision:{
"questions": [{
"question": "Fix this vulnerability?",
"header": "Fix " + severity,
"options": [
{"label": "Apply fix", "description": "Apply the suggested remediation"},
{"label": "Skip this one", "description": "Skip and move to next vulnerability"}
],
"multiSelect": false
}]
}
Continue until all vulnerabilities are addressed or the user stops
Remediation guidelines:
IMPORTANT: When a vulnerability remediation involves changing or upgrading a package/library (e.g., "upgrade lodash to 4.17.21", "replace moment.js with day.js"), you MUST check if the recommended package is available in the company's approved repositories before suggesting the fix.
The script checks these repositories:
https://artifactory.<YOUR_DOMAIN>/artifactory/api/npm/npm-airlock/https://artifactory.<YOUR_DOMAIN>/artifactory/maven-airlockhttps://artifactory.<YOUR_DOMAIN>/artifactory/api/pypi/pypi-airlock/simpledocker-airlock.artifactory.<YOUR_DOMAIN>Before recommending a package upgrade or replacement, run the availability check:
# For JavaScript/npm packages
./plugins/appsec/skills/static-appsec-scan/scripts/check-package-availability.sh --package <package-name> --language javascript
# For Java/Maven packages
./plugins/appsec/skills/static-appsec-scan/scripts/check-package-availability.sh --package <group-id/artifact-id> --language java
# For Python packages
./plugins/appsec/skills/static-appsec-scan/scripts/check-package-availability.sh --package <package-name> --language python
# For Docker images
./plugins/appsec/skills/static-appsec-scan/scripts/check-package-availability.sh --package <image-name> --language docker
Expected outputs:
available:<repo-url> — Package found in company repository (safe to recommend)not_found — Package not found in any company repositoryerror:<message> — Check failed (handle gracefully)If package is available (available:<repo-url>):
lodash to 4.17.21 (available at npm-airlock)"If package is NOT available (not_found):
Example remediation flow for dependency vulnerabilities:
<package> to <version>. This package is available in the company npm-airlock repository. Run: npm install <package>@<version>"<package>, but this package is not available in the company's approved repositories. You will need to bring in the required package manually through the proper procurement process. Alternative: consider refactoring to avoid this dependency."Important: This check applies only to remediations that involve adding or changing packages/libraries. It does NOT apply to:
README.md (opens in a new tab)config/scanner-preferences.yaml (opens in a new tab)reference/remote-pipeline.yml (opens in a new tab)reference/std-pipeline.yml (opens in a new tab)scripts/auto-scan.sh (opens in a new tab)scripts/check-package-availability.sh (opens in a new tab)scripts/check-prereqs.sh (opens in a new tab)scripts/detect-inputs.sh (opens in a new tab)scripts/local-pipeline.yml (opens in a new tab)scripts/run-static-scan.sh (opens in a new tab)scripts/scan-and-upload-sbom.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xotong/claude-marketplace --plugin appsec4 skills in this plugin
/appsec-dast-simLLM-based DAST simulation following OWASP WSTG v4.2. No containers, no running app required — works at design time by reading the codebase. Enumerates all API endpoints and routes, walks every WSTG v4.2 test category, inspects relevant code (auth middleware, input handling, session logic, business rules), generates specific test probes (curl commands, payload examples), and reports findings grouped by severity. Use when the user says: "DAST scan", "OWASP security review", "WSTG check", "web security audit", "security code review", "OWASP top 10 check", "audit my API", "is my API secure", "review my endpoints". Also activate for a SINGLE WSTG area and cover only that one (Phase 0 routes): Auth — "check auth security", "is my login secure", "authentication review"; Access control — "authorization check", "can users access other users' data", "IDOR", "privilege escalation"; Sessions — "check session handling", "cookie security", "session fixation"; Injection — "find XSS or SQLi", "injection vulnerabilities", "SSRF", "XXE", "command injection", "is my input validated"; Crypto — "crypto review", "am I hashing passwords properly", "TLS check"; Business logic — "business logic vulnerabilities", "can this flow be abused"; API — "API security audit", "GraphQL security", "REST security review"; Config — "security misconfiguration", "check my headers", "CORS review". Do NOT activate for general code review, unit testing, linting, or container scanning.
/appsec-scanOther plugins' skills for the same job