Get Started with ApiPosture
Installation, CLI reference, configuration, and CI/CD integration.
Installation
ApiPosture is distributed as a .NET global tool. Install it with a single command:
Prerequisites
- .NET 8.0 SDK or later
- Windows, macOS, or Linux
Verify Installation
Update to Latest Version
Quick Start
Scan your ASP.NET Core API project in seconds:
ApiPosture uses Roslyn's syntax-only parsing, which means:
- No compilation required - works with incomplete code
- Fast - typical scans complete in under 2 seconds
- No dependencies - doesn't need your NuGet packages
CLI Reference
scan
The main command to analyze your API project.
Arguments
<path>- Path to the directory containing your C# source files
Options
| Option | Description | Default |
|---|---|---|
--output, -o |
Output format: terminal, json, markdown |
terminal |
--fail-on |
Exit with non-zero code if severity found: critical, high, medium, low |
- |
--exclude |
Glob patterns to exclude (can be used multiple times) | - |
--config |
Path to configuration file | .apiposture.json |
--no-color |
Disable colored output | false |
--verbose, -v |
Show detailed output | false |
Examples
Configuration
Create a .apiposture.json file in your project root for persistent configuration:
Configuration Options
exclude- Array of glob patterns to exclude from scanningrules- Per-rule configuration overridesdisabledRules- Array of rule IDs to disable
Output Formats
Terminal (Default)
Human-readable colored output optimized for terminal viewing:
JSON
Machine-readable output for integration with other tools:
Markdown
Formatted report suitable for documentation or PR comments:
CI/CD Integration
Integrate ApiPosture into your CI/CD pipeline to catch security issues before they reach production.
GitHub Actions
Azure DevOps
GitLab CI
Security Rules
ApiPosture includes 8 purpose-built security rules. See the Features page for detailed explanations of each rule.
| Rule | Category | Severity | Description |
|---|---|---|---|
AP001 |
Exposure | HIGH | Unintentional Public Access |
AP002 |
Exposure | HIGH | Anonymous Write Operations |
AP003 |
Consistency | MEDIUM | Authorization Conflicts |
AP004 |
Consistency | CRITICAL | Missing Auth on Writes |
AP005 |
Privilege | LOW | Role Sprawl |
AP006 |
Privilege | LOW | Weak Role Names |
AP007 |
Surface | MEDIUM | Sensitive Routes Exposed |
AP008 |
Surface | HIGH | Minimal API Gaps |
Questions or Feedback?
Open an issue on GitHub or reach out via our contact page.