Test API authentication security.
(
spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"),
)
| 1196 | result = await tester.test_api(api) |
| 1197 | |
| 1198 | display_result(result) |
| 1199 | |
| 1200 | run_async(run()) |
| 1201 | |
| 1202 | |
| 1203 | @apisec_app.command("fuzz") |
| 1204 | def api_fuzz( |
| 1205 | spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"), |
| 1206 | max_requests: int = typer.Option(100, "--max", "-m", help="Maximum requests"), |
| 1207 | auth_token: str | None = typer.Option(None, "--token", "-t"), |
| 1208 | ): |
| 1209 | """Fuzz API endpoints for vulnerabilities.""" |
| 1210 | setup_logging() |
| 1211 | |
| 1212 | console.print(f"[bold]API Fuzzing:[/bold] {spec_url}") |
| 1213 | |
| 1214 | async def run(): |
| 1215 | from modules.apisec import APIFuzzer, OpenAPIParser |
| 1216 | |
| 1217 | parser = OpenAPIParser() |
| 1218 | api = await parser.parse_url(spec_url) |
| 1219 | |
| 1220 | fuzzer = APIFuzzer(max_requests=max_requests, auth_token=auth_token) |
nothing calls this directly
no test coverage detected