WAF++ PASS – CLI Reference
wafpass is the official CLI tool of the WAF++ Framework.
It reads the machine-readable YAML controls and automatically checks Terraform configurations against the defined assertions.
Commands
wafpass check
The only command in the current version. Checks Terraform files against WAF++ controls.
wafpass check <PATH> [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
|
|
Path to the directory containing the WAF++ YAML control files. |
|
(all) |
Load only controls for a specific pillar.
Allowed values: |
|
(all) |
Comma-separated list of control IDs to check.
Example: |
|
(all) |
Minimum severity level for evaluation.
Allowed values: |
|
|
Output all results, including PASSes. Default: only FAILs and SKIPs are displayed. |
|
|
Output only the summary table, no per-control details. |
|
|
Condition for exit code 1 (error). |
|
|
Output format. Currently only |
|
– |
Print version and exit. |
Exit Codes
| Code | Meaning |
|---|---|
|
All checks passed (according to |
|
At least one FAIL (or SKIP with |
|
Error loading controls or parsing Terraform files. |
Output Format
Default (FAILs only)
WAF++ PASS — Terraform Compliance Check
Path: ./infrastructure/ Controls: 12
WAF-SOV-010 Data Residency Policy critical FAIL
✗ aws_db_instance.main
→ Tag 'data-residency' not found in 'tags'.
✗ aws_elasticache_cluster.session
→ Tag 'data-class' not found in 'tags'.
WAF-COST-010 Cost Allocation Tagging high FAIL
✗ aws_instance.web
→ Key 'cost-center' not found in 'tags'.
→ Key 'owner' not found in 'tags'.
WAF-COST-040 Retention Lifecycle medium FAIL
✗ aws_cloudwatch_log_group.debug_logs
→ 'retention_in_days' is 0, must be >= 1.
────────────────────────────────────────────────────────────
Summary
┌──────────────┬───────┬──────┬──────┬──────┐
│ Pillar │ Total │ PASS │ FAIL │ SKIP │
├──────────────┼───────┼──────┼──────┼──────┤
│ cost │ 6 │ 4 │ 2 │ 0 │
│ sovereign │ 6 │ 4 │ 1 │ 1 │
├──────────────┼───────┼──────┼──────┼──────┤
│ TOTAL │ 12 │ 8 │ 3 │ 1 │
└──────────────┴───────┴──────┴──────┴──────┘
Verbose (--verbose)
With --verbose, PASSes and remediation hints are additionally output:
WAF-SOV-020 Region Pinning high PASS
✓ provider.aws — 'region' is not empty.
WAF-SOV-010 Data Residency Policy critical FAIL
✗ aws_db_instance.main
→ Tag 'data-residency' not found in 'tags'.
Remediation: Add 'data-residency' and 'data-class' tags to all data resources.
Assertion Operators
The following table lists all operators that can be used in WAF++ YAML controls:
Automatically evaluable
| Operator | Description | Example Use Case |
|---|---|---|
|
Attribute exists and is not |
|
|
Primary or fallback attribute exists |
|
|
Attribute exists and is not empty ( |
Region not empty? |
|
Attribute value == expected value |
|
|
Attribute value != expected value |
|
|
Attribute value is in the allowed list |
|
|
Attribute value is not in the forbidden list |
|
|
Attribute is |
|
|
Attribute is |
|
|
Numeric value >= threshold |
|
|
Numeric value ⇐ threshold |
|
|
Attribute value matches regex pattern |
|
|
Attribute value does not match regex pattern |
|
|
Key exists in a map (e.g. |
|
|
Terraform block of the specified type exists |
|
|
Another resource references this block |
VPC has flow log or endpoint? |
|
Attribute value does not contain the substring |
String contains no unwanted patterns |
Automatically skipped (SKIP)
These operators require runtime information or cross-resource analysis that goes beyond static HCL evaluation:
| Operator | Reason for SKIP |
|---|---|
|
Requires JSON parsing of the IAM policy string at runtime |
|
ARN contains account ID and region, which are only known after |
|
Variable values are only fully resolvable after |
|
Requires cross-resource lookup between CloudWatch Log Group and Metric Filter |
|
Requires cross-resource resolution of S3 bucket references |
|
Requires knowledge of a sibling attribute |
|
Multi-attribute condition |
|
Multiple provider blocks must be evaluated together |
|
Conditional assertion depending on another attribute value |
Examples
CI/CD Integration
GitHub Actions
name: WAF++ Compliance
on:
push:
branches: [main]
pull_request:
paths:
- 'infrastructure/**'
jobs:
wafpass:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install wafpass
run: pip install wafpass
- name: Copy WAF++ controls
run: cp -r path/to/wafpp-controls/ controls/
- name: Run WAF++ PASS
run: |
wafpass check infrastructure/ \
--pillar cost,sovereign \
--severity high \
--fail-on critical \
--verbose
Controls Directory
wafpass expects YAML files in the format WAF-*.yml in the controls directory.
By default it looks in the controls/ subdirectory relative to the working directory.
Each YAML file corresponds to one control. The complete schema documentation is available at Control Schema Reference.
Further Reading
-
Assessment Methodology – how wafpass is embedded in the assessment process
-
Controls Catalog – all available controls with assertions
-
Control Schema Reference – YAML structure for custom controls