Fuzz API endpoints for vulnerabilities.
(
spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"),
max_requests: int = typer.Option(100, "--max", "-m", help="Maximum requests"),
auth_token: Optional[str] = typer.Option(None, "--token", "-t"),
)
| 1170 | else: |
| 1171 | console.print(f"[yellow]No specific remediation guide found for: {finding}[/yellow]") |
| 1172 | console.print("[dim]Try keywords like: sql injection, xss, security header, ssl, exposed[/dim]") |
| 1173 | |
| 1174 | |
| 1175 | # ============== API Security Commands ============== |
| 1176 | |
| 1177 | @apisec_app.command("scan") |
| 1178 | def api_scan( |
| 1179 | spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"), |
| 1180 | auth_token: str | None = typer.Option(None, "--token", "-t", help="Auth token"), |
| 1181 | ): |
| 1182 | """Scan API endpoints for vulnerabilities.""" |
| 1183 | setup_logging() |
| 1184 | |
| 1185 | console.print(f"[bold]API Security Scan:[/bold] {spec_url}") |
| 1186 | |
| 1187 | async def run(): |
| 1188 | from modules.apisec import APIEndpointTester, OpenAPIParser |
| 1189 | |
| 1190 | parser = OpenAPIParser() |
| 1191 | api = await parser.parse_url(spec_url) |
| 1192 | |
| 1193 | console.print(f"[green]Parsed {len(api.endpoints)} endpoints from {api.title}[/green]") |
| 1194 | |
| 1195 | tester = APIEndpointTester(auth_token=auth_token) |
| 1196 | result = await tester.test_api(api) |
| 1197 |
nothing calls this directly
no test coverage detected