โก Instant Deployment โข Built-in Web Dashboard โข Production-Ready Security Platform
A full-featured, production-grade security testing suite for REST APIs, packed with an interactive web-based control panel. Deploy in minutes with automatic environment detection and zero manual dependency setup.
Easiest way (one command):
# From the repo root
./start.sh- This will automatically build the GUI if needed and pick free ports if defaults are busy.
- Default dashboard URL: http://localhost:8090 (the exact port will be printed on start).
- Run without the GUI:
./start.sh --no-gui - Override ports:
./start.sh --port 8082 --metrics-port 8095
Alternative shortcuts:
# Using Make
make start # with GUI
a make start-nogui # backend only
# Using npm (from repo root)
npm start # with GUI
npm run start:nogui # backend onlyPrevious flow (kept for development):
# Clone and install everything automatically
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
./install.sh
# Or run development mode (GUI dev server)
./run.sh devAccess the GUI:
- Development (run.sh dev): http://localhost:3000
- Production via start.sh: http://localhost:8090 (or the printed port)
Default Login: admin / admin
- ๐ Single-Command Deployment - Fully automated setup that handles all dependencies for you
- ๐ฏ Interactive Web Panel - Sleek React-powered dashboard with live data visualization
- ๐ก๏ธ Deep Vulnerability Coverage - Detects SQLi, XSS, NoSQL injection, broken authentication, and beyond
- ๐ Intelligent Reporting - Automated risk scoring, trend tracking, and export in multiple formats
- ๐ข Built for Teams - Multi-tenant isolation, SIEM connectors, and automated API endpoint discovery
- โก Optimized for Speed - Parallel scanning engine with adjustable rate limiting and concurrency controls
This tool conducts automated security audits on API endpoints by probing for widely exploited vulnerability classes, including:
- Authentication Bypass Detection
- SQL Injection Vulnerabilities
- NoSQL Injection Vulnerabilities
- HTTP Method Validation
- Security Header Analysis
- Parameter Tampering Detection
- Cross-Site Scripting (XSS) Vulnerabilities
- Authentication Bypass Testing
Engineered for high throughput and stability, the scanner leverages goroutine-based parallel execution to assess multiple endpoints at once while generating in-depth security reports. The platform also ships with enterprise-grade capabilities like organization-level multi-tenancy, SIEM event forwarding, live monitoring dashboards, and pluggable authentication providers.
- Authentication Testing: Verifies credential-based access controls and detects permission misconfigurations
- SQL Injection Detection: Payload-driven testing engine that identifies SQL injection flaws across query parameters and request bodies
- HTTP Method Validation: Confirms proper method restrictions and guards against verb-tampering exploits
- XSS Vulnerability Detection: Injects common XSS vectors and checks for unsanitized reflection in responses
- Header Security Analysis: Inspects HTTP response headers for missing or misconfigured security policies
- Authentication Bypass Testing: Probes for broken access control and credential-less endpoint access
- Parameter Tampering Detection: Tests for insecure handling of modified or unexpected request parameters
- NoSQL Injection Detection: Checks for document database injection flaws across MongoDB, CouchDB, and similar platforms using targeted payload sets
- Concurrent Execution: Goroutine-powered parallel scanning across multiple endpoints for maximum throughput
- Detailed Reporting: Generates structured security reports with severity ratings and remediation guidance
- OpenAPI/Swagger Integration: Parse OpenAPI specs to auto-generate test targets with endpoint validation and schema-aware scanning
- API Discovery: Crawl and map API endpoints starting from a base URL, with depth control and custom exclusion rules
- Historical Comparison: Monitor your security posture across time with diff-based trend reports and vulnerability lifecycle tracking
- Endpoint Crawling: Recursively explore API surfaces using intelligent link extraction and parameter detection
- Parameter Discovery: Automatically extract and test parameters from HTML forms, JSON responses, and URL patterns
- Score Trending: Visualize how your security scores evolve across consecutive scans with exportable reports
- Vulnerability Tracking: Maintain a running log of newly discovered and resolved vulnerabilities with side-by-side comparisons
- Multi-format Reports: Output scan results in JSON, HTML, CSV, XML, or plain text with embedded historical context
- Multi-Tenant Architecture: Isolate data and configurations across organizations with per-tenant resource quotas
- SIEM Integration: Push security events directly to Wazuh, Splunk, ELK, QRadar, or ArcSight for centralized threat monitoring
- Advanced Authentication: Plug in OAuth2, JWT, API keys, bearer tokens, or mutual TLS for authenticated scanning
- Real-Time Monitoring Dashboard: WebSocket-powered web dashboard for live metric streams and visual health indicators
- Grafana Integration: Expose Prometheus-compatible metrics for building custom Grafana dashboards and alert rules
- Performance Metrics: Track CPU, memory, network I/O, and scan throughput in real time
- Resource Management: Set per-tenant rate limits, concurrency caps, and storage quotas
- Alert Management: Route critical findings to email, Slack, or custom webhooks with configurable severity thresholds
- Health Monitoring: Automated system health probes with self-healing and failover support
- Historical Analytics: Time-series vulnerability data with trend projection and regression detection
- Enterprise Logging: Structured JSON logs with per-tenant isolation and full audit trail support
- React-Based GUI: Responsive single-page application built on React and Material-UI component library
- Real-Time Dashboard: Live-updating metrics panel with vulnerability counters and system health indicators
- Interactive Visualizations: Dynamic charts and trend graphs powered by Chart.js for security data analysis
- Grafana Integration: Prometheus-format metrics endpoint ready for custom Grafana dashboards and alerting
- Scan Management: Launch, configure, and track security scans through a visual point-and-click interface
- Results Analysis: Filter, search, and export vulnerability findings with detailed drill-down reports
- Multi-Tenant Management: Full tenant lifecycle management through the admin console
- Development & Production Modes: Hot-reloading dev server and optimized production bundle
- Single Server Deployment: Frontend assets served directly by the Go backend โ no Nginx or Apache needed
- Fast Execution: Parallel goroutine workers with tunable rate limiting for safe scanning
- Robust Error Handling: Graceful recovery from network timeouts, DNS failures, and dropped connections
- Memory Efficient: Streaming architecture optimized for scanning thousands of endpoints without memory spikes
- Configurable Timeouts: Per-request and per-scan timeout settings to prevent stalled operations
- Multiple Output Formats: Export findings as plain text, JSON, HTML, CSV, or XML
- Risk Assessment: Auto-calculated risk scores with actionable remediation recommendations
- Structured Logging: Configurable log output in text or JSON format for easy ingestion
- Score-based Metrics: 100-point grading system to quantify your API's security posture
- Configuration Validation: YAML schema validation with human-readable error messages
- Rate Limiting: Fine-grained controls for requests-per-second and max concurrent connections
- Endpoint Reachability Testing: Pre-scan connectivity checks to verify target availability
Hassle-free setup โ the installer detects your OS and handles everything automatically:
# Full automated installation
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
./install.shThe installation script will:
- โ Detect your operating system
- โ Install Go 1.24+ (if missing)
- โ Install Node.js v16+ (if missing)
- โ Install all GUI dependencies
- โ Build the application
- โ Create configuration files
- โ Set up desktop shortcuts (Linux)
Already have dependencies installed? Start immediately:
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
./run.sh devIf you prefer manual installation:
- Go 1.24 or higher - Download Go
- Node.js v16 or higher - Download Node.js
- Git - Download Git
The project ships with a ready-to-use Docker Compose setup that spins up both the scanner and OWASP Juice Shop, giving you a sandboxed environment with real-world vulnerabilities to test against.
# Clone the repository
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
# Build and start both the scanner and the test API (OWASP Juice Shop)
docker-compose up -d
# Verify both containers are running
docker ps
# The dashboard is accessible at: http://localhost:8090 (or the port printed by the launcher)
# The API is available on port: 8081 (for API calls)
# The test API (Juice Shop) is available on port: 3000Once both containers are running, you can execute a security scan:
# Run a test scan against OWASP Juice Shop
docker exec api-security-scanner ./api-security-scanner -config config-test.yaml -scan
# Or run the scanner in dashboard mode
docker exec api-security-scanner ./api-security-scanner -config config-test.yaml -dashboardFor the simplest setup with automatic port detection and GUI:
# From the repo root (when using Docker setup)
./start.sh --port 8081 --metrics-port 8090Alternative shortcuts:
make start # same as ./start.sh
npm start # same as ./start.sh# Build Docker image
docker build -t api-security-scanner .
# Run with test configuration
docker run -d --name api-security-scanner -p 8080-8081:8080-8081 \
-v $(pwd)/config-test.yaml:/app/config-test.yaml \
-v $(pwd)/reports:/app/reports \
api-security-scanner ./api-security-scanner -config config-test.yaml -dashboardOne-command launch (recommended):
./start.sh # build GUI if needed and start dashboard
./start.sh --no-gui # backend only
./start.sh --port 8082 # override backend port
./start.sh --metrics-port 8095 # override dashboard portShortcuts:
make start # same as ./start.sh
make start-nogui # same as ./start.sh --no-gui
npm start # same as ./start.sh
npm run start:nogui # same as ./start.sh --no-guiLegacy/dev commands (still available):
./run.sh dev # GUI dev server at :3000, backend at :8080
./run.sh prod # legacy production runner
./run.sh backend # backend only
./run.sh gui # GUI dev server
./run.sh build # build everything
./run.sh stop # stop processes
./run.sh help # show helpAccess Points:
- Development (run.sh dev): http://localhost:3000
- Production (start.sh): http://localhost:8090 (or the port printed by the launcher)
- Default Login:
admin/admin
GUI Features:
- ๐ Dashboard: Real-time metrics and system health
- ๐ Scanner: Configure and run security scans
- ๐ Results: View vulnerability reports and analysis
- ๐ข Tenants: Multi-tenant management interface
- โ๏ธ Settings: System configuration and preferences
# Show version information
./api-security-scanner -version
# Run security scan with default configuration
./api-security-scanner -scan
# Run with custom configuration file
./api-security-scanner -scan -config /path/to/custom-config.yaml
# Start monitoring dashboard
./api-security-scanner -dashboard
# Run scan for specific tenant
./api-security-scanner -scan -tenant "production"
# Generate historical comparison
./api-security-scanner -historical -output html
# Show trend analysis
./api-security-scanner -trend -output json| Mode | Development | Production |
|---|---|---|
| GUI URL | http://localhost:3000 | http://localhost:8080 |
| Process | 2 separate processes | 1 integrated process |
| Hot Reload | โ Yes | โ No |
| Performance | Development optimized | Production optimized |
| Best For | Development & Testing | Regular Use |
-
๐ Start the Application
./run.sh dev # Development mode # or ./run.sh prod # Production mode
-
๐ Open the GUI
- Development: http://localhost:3000
- Production: http://localhost:8080
-
๐ Login
- Username:
admin - Password:
admin
- Username:
-
โ๏ธ Configure APIs
- Edit
config.yamlto add your API endpoints - Or use the GUI to configure endpoints
- Edit
-
๐ Run Security Scan
- Use the GUI to configure and run scans
- View results and vulnerability reports
- ๐ Quick Start: QUICKSTART.md - Get running in 60 seconds
- ๐ User Guide: GUIDE.md - Comprehensive usage guide
- โ๏ธ Configuration: CONFIGURATION.md - All configuration options
- ๐ง Troubleshooting: QUICKSTART.md - Common issues and solutions
| Option | Description | Default |
|---|---|---|
-config |
Path to configuration file | config.yaml |
-scan |
Run security scan immediately | false |
-dashboard |
Start monitoring dashboard | false |
-tenant |
Tenant ID for multi-tenant mode | default |
-output |
Output format (json, html, text) | json |
-historical |
Show historical comparison | false |
-trend |
Show trend analysis | false |
-version |
Show version information | false |
The scanner uses a YAML configuration file to define test parameters:
# API endpoints to test
api_endpoints:
- url: "https://api.example.com/v1/users"
method: "GET"
- url: "https://api.example.com/v1/data"
method: "POST"
body: '{"query": "value"}'
# Authentication credentials
auth:
username: "admin"
password: "securepassword"
# SQL injection test payloads
injection_payloads:
- "' OR '1'='1"
- "'; DROP TABLE users;--"
- "1' OR '1'='1"
- "admin'--"
# XSS test payloads
xss_payloads:
- "<script>alert('XSS')</script>"
- "'><script>alert('XSS')</script>"
- "<img src=x onerror=alert('XSS')>"
# Rate limiting configuration
rate_limiting:
requests_per_second: 10
max_concurrent_requests: 5
# Custom headers
headers:
"User-Agent": "SecScan-Pro/1.0"
"X-Scanner": "true"api_endpoints:
- url: "https://api.example.com/endpoint" # Required: API endpoint URL
method: "GET" # Required: HTTP method (GET, POST, PUT, DELETE, etc.)
body: '{"param": "value"}' # Optional: Request body for POST/PUT requestsauth:
username: "your_username" # Required: Username for basic authentication
password: "your_password" # Required: Password for basic authenticationinjection_payloads:
- "' OR '1'='1" # Classic SQL injection
- "'; DROP TABLE users;--" # SQL DROP statement
- "1' OR '1'='1" # Numeric SQL injection
- "admin'--" # Comment-based SQL injectionxss_payloads:
- "<script>alert('XSS')</script>" # Basic script tag injection
- "'><script>alert('XSS')</script>" # Attribute breaking injection
- "<img src=x onerror=alert('XSS')>" # Image tag injection
- "javascript:alert('XSS')" # JavaScript URI injectionheaders:
"User-Agent": "SecScan-Pro/2.0"
"X-Test-Header": "test-value"
"Accept": "application/json"nosql_payloads:
- "{$ne: null}"
- "{$gt: ''}"
- "{$or: [1,1]}"
- "{$where: 'sleep(100)'}"
- "{$regex: '.*'}"
- "{$exists: true}"
- "{$in: [1,2,3]}"openapi_spec: "path/to/openapi.yaml"api_discovery:
enabled: true
max_depth: 3
follow_links: true
discover_params: true
user_agent: "SecScan-Discovery/1.0"
exclude_patterns:
- "/static/"
- "/assets/"
- ".css"
- ".js"historical_data:
enabled: true
storage_path: "./history"
retention_days: 30
compare_previous: true
trend_analysis: trueAPI Security Scan Detailed Report
==================================
Endpoint: https://api.example.com/v1/users
Overall Score: 100/100
Test Results:
- Auth Test: PASSED
Details: Authentication successful
- HTTP Method Test: PASSED
Details: Method validation successful
- Injection Test: PASSED
Details: No injection vulnerabilities detected
- XSS Test: PASSED
Details: No XSS vulnerabilities detected
- Header Security Test: PASSED
Details: All security headers present
- Auth Bypass Test: PASSED
Details: Authentication properly enforced
- Parameter Tampering Test: PASSED
Details: Parameter validation successful
- NoSQL Injection Test: PASSED
Details: No NoSQL injection vulnerabilities detected
Risk Assessment:
No significant risks detected.
Endpoint: https://api.example.com/v1/data
Overall Score: 25/100
Test Results:
- Auth Test: PASSED
Details: Authentication successful
- HTTP Method Test: PASSED
Details: Method validation successful
- Injection Test: FAILED
Details: Potential SQL injection detected with payload: ' OR '1'='1
- XSS Test: FAILED
Details: Potential XSS detected with payload: <script>alert('XSS')</script>
- Header Security Test: FAILED
Details: Missing security headers: X-Frame-Options, X-Content-Type-Options
- Auth Bypass Test: FAILED
Details: Endpoint accessible without authentication
- Parameter Tampering Test: PASSED
Details: Parameter validation successful
- NoSQL Injection Test: FAILED
Details: Potential NoSQL injection detected with payload: {$ne: null}
Risk Assessment:
- SQL injection vulnerabilities pose a significant data breach risk.
- NoSQL injection vulnerabilities could allow unauthorized database access in document databases.
- Cross-site scripting vulnerabilities could allow malicious script execution.
- Insecure headers may expose sensitive information or lack security protections.
- Authentication bypass vulnerabilities could allow unauthorized access to protected resources.
Overall Security Assessment:
Average Security Score: 62/100
Critical Vulnerabilities Detected: 2
Moderate security risks detected. Address identified vulnerabilities promptly.
The scanner uses a 100-point scoring system:
- Starting Score: 100/100 for each endpoint
- Authentication Failure: -30 points
- HTTP Method Failure: -20 points
- SQL Injection Vulnerability: -50 points
- NoSQL Injection Vulnerability: -50 points
- XSS Vulnerability: -40 points
- Header Security Issues: -25 points
- Auth Bypass Vulnerability: -35 points
- Parameter Tampering Vulnerability: -30 points
| Score Range | Risk Level | Action Required |
|---|---|---|
| 90-100 | Low | Monitor regularly |
| 70-89 | Medium | Address within 30 days |
| 50-69 | High | Address within 7 days |
| 0-49 | Critical | Immediate action required |
The Enterprise Edition supports multi-tenant deployments with complete data isolation:
- Tenant Management: Create and manage multiple security teams/organizations
- Data Isolation: Each tenant has isolated storage and configuration
- Resource Quotas: Configure limits per tenant (requests, endpoints, concurrent scans)
- Custom Settings: Tenant-specific notification settings and alert thresholds
Send security events to major SIEM platforms for centralized monitoring:
- Wazuh: Native syslog integration with custom decoders and rules
- Splunk: HTTP Event Collector (HEC) integration
- ELK Stack: Elasticsearch indexing with Kibana dashboards
- IBM QRadar: LEA protocol and event forwarding
- ArcSight: CEF format and SmartConnector integration
Support for enterprise authentication standards:
- OAuth 2.0: Multiple grant types (client_credentials, authorization_code, password)
- JWT: JSON Web Token authentication with various signing algorithms
- API Keys: Custom header-based authentication
- Mutual TLS: Certificate-based authentication
- Basic Auth: Enhanced basic authentication with rate limiting
Real-time monitoring and metrics collection:
- System Metrics: CPU, memory, network usage monitoring
- Security Metrics: Vulnerability counts, scan success rates, threat trends
- Business Metrics: API availability, response times, compliance status
- Dashboard: Real-time WebSocket-based monitoring dashboard
- Health Checks: Automated system health monitoring
Comprehensive historical data analysis and trending:
- Trend Analysis: Track vulnerability trends over time
- Comparative Analysis: Compare current scan results with historical data
- Compliance Reporting: Generate reports for regulatory compliance
- Automated Reporting: Scheduled reports and executive summaries
The scanner tests authentication by:
- Sending requests with configured credentials
- Analyzing HTTP response codes (200, 401, 403)
- Verifying proper access control mechanisms
- Testing for authentication bypass vulnerabilities
The scanner tests for SQL injection by:
- Sending baseline requests to establish normal response patterns
- Testing with various SQL injection payloads
- Analyzing response differences and error messages
- Looking for indicators of successful injection
The scanner validates HTTP method handling by:
- Testing supported HTTP methods for each endpoint
- Verifying proper handling of disallowed methods
- Checking for method-based access control issues
- Ensuring REST compliance
The scanner tests for XSS vulnerabilities by:
- Sending baseline requests to establish normal response patterns
- Testing with various XSS payloads
- Analyzing response content for unsanitized payload reflection
- Looking for indicators of successful XSS execution
The scanner analyzes HTTP response headers by:
- Checking for presence of recommended security headers
- Identifying insecure information disclosure headers
- Validating cookie security attributes
- Analyzing CORS policy configurations
The scanner tests for authentication bypass by:
- Sending requests without authentication credentials
- Testing with invalid credentials
- Checking for common bypass headers
- Analyzing response codes for unauthorized access
The scanner tests for parameter tampering by:
- Modifying parameter values in requests
- Adding extra parameters to requests
- Testing for IDOR (Insecure Direct Object Reference)
- Analyzing response behavior for parameter changes
The scanner tests for NoSQL injection by:
- Sending baseline requests to establish normal response patterns
- Testing with various NoSQL injection payloads for MongoDB, CouchDB, and other document databases
- Analyzing response differences and error messages for NoSQL syntax
- Looking for indicators of successful NoSQL injection including:
- Response time anomalies
- Error messages containing NoSQL syntax
- Response body changes indicating unauthorized data access
- Status code deviations from baseline responses
To prevent overwhelming target APIs, configure rate limiting:
rate_limiting:
requests_per_second: 10
max_concurrent_requests: 5Add custom headers for requests:
headers:
"User-Agent": "SecScan-Pro/1.0"
"X-API-Key": "your-api-key"
"Accept": "application/json"Configure proxy settings for corporate environments:
proxy:
url: "http://proxy.company.com:8080"
username: "proxy-user"
password: "proxy-password"- Run in Staging First: Always test against staging environments before production
- Schedule Scans: Run during off-peak hours to minimize impact
- Monitor Resources: Watch for high CPU/memory usage during large scans
- Review Results: Analyze findings and prioritize critical vulnerabilities
- Integrate into CI/CD: Add security scans to your deployment pipeline
- Fix Findings Promptly: Address security issues before deployment
- Update Configuration: Regularly update API endpoints and test payloads
- Document Exceptions: Maintain documentation for accepted risks
- Understand Scope: Clearly define which APIs can be tested
- Coordinate Testing: Schedule scans with API maintenance windows
- Review Results: Work with security teams to understand findings
- Implement Fixes: Prioritize and deploy security patches
The scanner now includes comprehensive historical reporting capabilities to track security posture over time:
Generate comparison reports between current and previous scans:
# Generate comparison report (automatically included when historical data is enabled)
./api-security-scanner -output json
./api-security-scanner -output html
./api-security-scanner -output textFeatures:
- Score changes between scans
- New and resolved vulnerability tracking
- Endpoint-specific change analysis
- Visual indicators for improvement/regression
Track security trends over multiple scans:
# Enable trend analysis in configuration
historical_data:
enabled: true
trend_analysis: true
storage_path: "./history"
retention_days: 30Features:
- Security score progression over time
- Vulnerability count trends
- Time-based analysis with configurable periods
- Visual charts and graphs (HTML output)
- Automatic Storage: Scan results automatically saved with timestamps
- Configurable Retention: Set retention policies for historical data
- Comparison Flexibility: Compare with any previous scan
- Export Capabilities: Export historical data in multiple formats
We welcome contributions! Please see our Contributing Guidelines for details.
# Fork the repository
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes
go build
go run main.go
# Test your changes
git add .
git commit -m "Add amazing feature"
git push origin feature/amazing-feature- Follow Go standard formatting (
go fmt) - Write clear, concise code with proper documentation
- Add comprehensive error handling
- Include tests for new features
- Update documentation as needed
# Scan using OpenAPI specification
./api-security-scanner -config config-with-openapi.yaml# Configuration with OpenAPI
openapi_spec: "./api-spec.yaml"
api_endpoints: [] # Leave empty to generate from spec# Run with API discovery enabled
./api-security-scanner -config config-with-discovery.yaml# Configuration with discovery
api_discovery:
enabled: true
max_depth: 3
follow_links: true
discover_params: true# Generate trend analysis
./api-security-scanner -output html -config config-with-history.yaml# Configuration with historical data
historical_data:
enabled: true
storage_path: "./security-history"
retention_days: 90
compare_previous: true
trend_analysis: true# Run with SIEM integration
./api-security-scanner -config config-siem.yaml -scan# Wazuh SIEM Configuration
siem:
enabled: true
type: "syslog"
format: "json"
config:
host: "wazuh-manager.company.com"
port: 514
facility: "local0"
severity: "info"
# Splunk SIEM Configuration
siem:
enabled: true
type: "splunk"
format: "json"
endpoint_url: "https://splunk.company.com:8088/services/collector"
auth_token: "your-splunk-hec-token"# Run scan for specific tenant
./api-security-scanner -config enterprise-config.yaml -tenant "acme-corp" -scan
# Start dashboard for specific tenant
./api-security-scanner -config enterprise-config.yaml -tenant "acme-corp" -dashboard# Enterprise multi-tenant configuration
tenant:
id: "acme-corp"
name: "Acme Corporation"
description: "Enterprise security team"
is_active: true
settings:
resource_limits:
max_requests_per_day: 50000
max_concurrent_scans: 10
max_endpoints_per_scan: 200
data_isolation:
storage_path: "./data/acme-corp"
enabled: true
notification_settings:
email_notifications: true
webhook_url: "https://hooks.slack.com/services/xxx"
alert_threshold: "medium"# Run with OAuth2 authentication
./api-security-scanner -config config-oauth2.yaml -scan# OAuth2 Configuration
auth:
enabled: true
type: "oauth2"
config:
client_id: "security-scanner"
client_secret: "your-client-secret"
token_url: "https://auth.company.com/oauth/token"
scopes: ["read", "write"]
grant_type: "client_credentials"
# JWT Configuration
auth:
enabled: true
type: "jwt"
config:
secret_key: "your-jwt-secret"
signing_method: "HS256"
audience: "api-security-scanner"
issuer: "auth.company.com"# Start monitoring dashboard
./api-security-scanner -config config-metrics.yaml -dashboard
# Run scan with metrics enabled
./api-security-scanner -config config-metrics.yaml -scan# Metrics Configuration
metrics:
enabled: true
port: 8080
update_interval: 30s
retention_days: 30
dashboard:
enabled: true
port: 8081
host: "localhost"
update_interval: 5s
max_connections: 100
health_check:
enabled: true
interval: 30s
timeout: 10sThe API Security Scanner now includes built-in Prometheus metrics export for integration with Grafana for advanced visualization and monitoring:
# Metrics Configuration (for Prometheus/Grafana integration)
metrics:
enabled: true
port: 8090 # Prometheus will scrape metrics from this port
update_interval: 30s
retention_days: 30The scanner exposes metrics in standard Prometheus format at the /metrics endpoint. To integrate with Grafana:
- Direct Integration: Configure Prometheus to scrape from
http://<scanner-host>:8090/metrics - Docker Setup: Use the provided
grafana-docker-compose.ymlfor a complete setup with auto-provisioned dashboard - Custom Dashboards: All scanner metrics are available with proper labels for tenant isolation
Key metrics available include:
api_scanner_total_vulnerabilities- Total vulnerabilities foundapi_scanner_critical_vulnerabilities- Critical vulnerabilities countapi_scanner_cpu_usage- System CPU usage percentageapi_scanner_memory_usage- Memory usage in MBapi_scanner_throughput- Requests per secondapi_scanner_error_rate- Error rate percentage- And many more metrics with tenant-specific labels
# Increase timeout
./api-security-scanner -timeout 30# Verify credentials in config.yaml
auth:
username: "correct-username"
password: "correct-password"# Disable SSL verification (not recommended for production)
export SSL_CERT_FILE=/path/to/cert.pemEnable verbose logging for troubleshooting:
./api-security-scanner -verboseWe welcome contributions! Please see our Contributing Guidelines for details.
# Fork the repository
git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
# Create a feature branch
git checkout -b feature/amazing-feature
# Make your changes
go build
go run main.go
# Test your changes
git add .
git commit -m "Add amazing feature"
git push origin feature/amazing-feature- Follow Go standard formatting (
go fmt) - Write clear, concise code with proper documentation
- Add comprehensive error handling
- Include tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- OWASP API Security Top 10 - For security testing guidelines
- Go Community - For excellent tooling and libraries
- Security Researchers - For vulnerability research and disclosures
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Security Team
- Basic authentication testing
- SQL injection detection
- HTTP method validation
- Concurrent execution
- Detailed reporting
- XSS vulnerability detection
- Security header analysis
- Authentication bypass testing
- Parameter tampering detection
- NoSQL injection testing
- OpenAPI/Swagger integration
- API discovery and crawling
- Historical comparison and trending
- Multi-tenant support with data isolation
- SIEM integration (Wazuh, Splunk, ELK, QRadar, ArcSight)
- Advanced authentication methods (OAuth2, JWT, API keys, Mutual TLS)
- Performance metrics and monitoring dashboard
- Machine learning-based vulnerability detection
- API behavior analysis and anomaly detection
- Cloud-native deployment options
- Advanced compliance reporting
- Integration with additional security tools
Built with โค๏ธ by realsandeep1271-ui โ Securing APIs, One Endpoint at a Time