scan_with_ash
Scan code snippets using ASH to uncover security issues from multiple scanners like Bandit, Checkov, and detect-secrets. Get aggregated findings with adjustable severity thresholds.
Instructions
Scan code using ASH (Automated Security Helper) for comprehensive security analysis.
ASH is a comprehensive security scanning tool that runs multiple security scanners including Bandit, Checkov, cfn-nag, cdk-nag, detect-secrets, and more.
Note: Semgrep is excluded from ASH scans because there's a separate scan_with_semgrep tool.
This tool performs delta scanning on the provided code snippet, creating a temporary file and scanning it with ASH in local mode. This approach is optimized for scanning code changes rather than entire projects.
Supported file types:
Python (.py): Scanned with Bandit, detect-secrets
JavaScript/TypeScript (.js, .ts): Scanned with npm-audit
Terraform (.tf): Scanned with Checkov
CloudFormation (.yaml, .yml, .json): Scanned with Checkov, cfn-nag, cdk-nag
Dockerfile: Scanned with Checkov
And many more formats supported by the underlying scanners
For Semgrep scanning, use the separate scan_with_semgrep tool.
Args: code: The code content to analyze file_extension: File extension to determine scanner selection (e.g., '.py', '.tf', 'Dockerfile') severity_threshold: Minimum severity level to report (LOW, MEDIUM, HIGH, CRITICAL)
Returns: A dictionary with aggregated scan results from multiple scanners
Note: ASH must be installed and available in PATH. Install with: uvx git+https://github.com/awslabs/automated-security-helper.git@v3.2.1 or: pip install git+https://github.com/awslabs/automated-security-helper.git@v3.2.1
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Code content to scan | |
| file_extension | Yes | File extension (e.g., .py, .tf, .js, Dockerfile) | |
| severity_threshold | No | Minimum severity threshold (LOW, MEDIUM, HIGH, CRITICAL) | MEDIUM |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |