Skip to content

About

Enterprise-grade API security testing platform with React GUI, multi-tenant support, and SIEM integration

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ API Security Scanner - Enterprise Edition

License: MIT Go Version Build Status Version Enterprise

โšก 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.

๐ŸŽฏ Quick Start

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 only

Previous 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 dev

Access the GUI:

Default Login: admin / admin

๐ŸŒŸ Why Choose This Scanner?

  • ๐Ÿš€ 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

๐ŸŽฏ Overview

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.

โœจ Key Features

๐Ÿ”’ Security Testing

  • 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

๐Ÿ”ง Advanced Features

  • 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

๐Ÿข Enterprise Features (Phase 4)

  • 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

๐Ÿ–ฅ๏ธ Web Interface (GUI)

  • 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

๐Ÿš€ Performance & Reliability

  • 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

๐Ÿ“Š Reporting & Output

  • 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 & Management

  • 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

๐Ÿ› ๏ธ Installation

โšก Automated Installation (Recommended)

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.sh

The 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)

๐Ÿš€ Quick Start

Already have dependencies installed? Start immediately:

git clone https://github.com/realsandeep1271-ui/API-Security-Scanner.git
cd API-Security-Scanner
./run.sh dev

๐Ÿ“‹ Prerequisites (Manual Install)

If you prefer manual installation:

๐Ÿณ Docker Installation and Integration Testing

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.

Quick Start with Complete Environment

# 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: 3000

Run a Test Scan

Once 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 -dashboard

One-Command Launch with Docker

For the simplest setup with automatic port detection and GUI:

# From the repo root (when using Docker setup)
./start.sh --port 8081 --metrics-port 8090

Alternative shortcuts:

make start            # same as ./start.sh
npm start             # same as ./start.sh

Manual Docker Build

# 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 -dashboard

๐ŸŽฎ Running the Application

โšก Easy Commands

One-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 port

Shortcuts:

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-gui

Legacy/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 help

๐Ÿš€ Usage

๐ŸŒ Web Interface (GUI)

Access Points:

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

๐Ÿ–ฅ๏ธ Command Line Usage

# 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

๐Ÿ”„ Development vs Production

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

๐Ÿšจ First Steps

  1. ๐Ÿš€ Start the Application

    ./run.sh dev  # Development mode
    # or
    ./run.sh prod # Production mode
  2. ๐ŸŒ Open the GUI

  3. ๐Ÿ”‘ Login

    • Username: admin
    • Password: admin
  4. โš™๏ธ Configure APIs

    • Edit config.yaml to add your API endpoints
    • Or use the GUI to configure endpoints
  5. ๐Ÿ” Run Security Scan

    • Use the GUI to configure and run scans
    • View results and vulnerability reports

๐Ÿ“š Quick Links

  • ๐Ÿš€ 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

Command Line Options

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

Configuration

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"

๐Ÿ“‹ Configuration Reference

API Endpoints Configuration

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 requests

Authentication Configuration

auth:
  username: "your_username"     # Required: Username for basic authentication
  password: "your_password"     # Required: Password for basic authentication

Injection Payloads Configuration

injection_payloads:
  - "' OR '1'='1"                    # Classic SQL injection
  - "'; DROP TABLE users;--"         # SQL DROP statement
  - "1' OR '1'='1"                   # Numeric SQL injection
  - "admin'--"                       # Comment-based SQL injection

XSS Payloads Configuration

xss_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 injection

Headers Configuration

headers:
  "User-Agent": "SecScan-Pro/2.0"
  "X-Test-Header": "test-value"
  "Accept": "application/json"

NoSQL Injection Configuration

nosql_payloads:
  - "{$ne: null}"
  - "{$gt: ''}"
  - "{$or: [1,1]}"
  - "{$where: 'sleep(100)'}"
  - "{$regex: '.*'}"
  - "{$exists: true}"
  - "{$in: [1,2,3]}"

OpenAPI Integration Configuration

openapi_spec: "path/to/openapi.yaml"

API Discovery Configuration

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 Configuration

historical_data:
  enabled: true
  storage_path: "./history"
  retention_days: 30
  compare_previous: true
  trend_analysis: true

๐Ÿ“Š Sample Output

Successful Scan

API 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.

๐ŸŽฏ Security Scoring

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

Risk Levels

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

๐Ÿ”ง Enterprise Features

Multi-Tenant Architecture

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

SIEM Integration

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

Advanced Authentication

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

Performance Monitoring

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

Historical Analysis

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

๐Ÿงช Testing Methodology

Authentication Testing

The scanner tests authentication by:

  1. Sending requests with configured credentials
  2. Analyzing HTTP response codes (200, 401, 403)
  3. Verifying proper access control mechanisms
  4. Testing for authentication bypass vulnerabilities

SQL Injection Testing

The scanner tests for SQL injection by:

  1. Sending baseline requests to establish normal response patterns
  2. Testing with various SQL injection payloads
  3. Analyzing response differences and error messages
  4. Looking for indicators of successful injection

HTTP Method Testing

The scanner validates HTTP method handling by:

  1. Testing supported HTTP methods for each endpoint
  2. Verifying proper handling of disallowed methods
  3. Checking for method-based access control issues
  4. Ensuring REST compliance

XSS Vulnerability Testing

The scanner tests for XSS vulnerabilities by:

  1. Sending baseline requests to establish normal response patterns
  2. Testing with various XSS payloads
  3. Analyzing response content for unsanitized payload reflection
  4. Looking for indicators of successful XSS execution

Header Security Analysis

The scanner analyzes HTTP response headers by:

  1. Checking for presence of recommended security headers
  2. Identifying insecure information disclosure headers
  3. Validating cookie security attributes
  4. Analyzing CORS policy configurations

Authentication Bypass Testing

The scanner tests for authentication bypass by:

  1. Sending requests without authentication credentials
  2. Testing with invalid credentials
  3. Checking for common bypass headers
  4. Analyzing response codes for unauthorized access

Parameter Tampering Detection

The scanner tests for parameter tampering by:

  1. Modifying parameter values in requests
  2. Adding extra parameters to requests
  3. Testing for IDOR (Insecure Direct Object Reference)
  4. Analyzing response behavior for parameter changes

NoSQL Injection Testing

The scanner tests for NoSQL injection by:

  1. Sending baseline requests to establish normal response patterns
  2. Testing with various NoSQL injection payloads for MongoDB, CouchDB, and other document databases
  3. Analyzing response differences and error messages for NoSQL syntax
  4. 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

๐Ÿ”ง Advanced Configuration

Rate Limiting

To prevent overwhelming target APIs, configure rate limiting:

rate_limiting:
  requests_per_second: 10
  max_concurrent_requests: 5

Custom Headers

Add custom headers for requests:

headers:
  "User-Agent": "SecScan-Pro/1.0"
  "X-API-Key": "your-api-key"
  "Accept": "application/json"

Proxy Configuration

Configure proxy settings for corporate environments:

proxy:
  url: "http://proxy.company.com:8080"
  username: "proxy-user"
  password: "proxy-password"

๐Ÿšจ Best Practices

For Security Teams

  1. Run in Staging First: Always test against staging environments before production
  2. Schedule Scans: Run during off-peak hours to minimize impact
  3. Monitor Resources: Watch for high CPU/memory usage during large scans
  4. Review Results: Analyze findings and prioritize critical vulnerabilities

For Development Teams

  1. Integrate into CI/CD: Add security scans to your deployment pipeline
  2. Fix Findings Promptly: Address security issues before deployment
  3. Update Configuration: Regularly update API endpoints and test payloads
  4. Document Exceptions: Maintain documentation for accepted risks

For API Owners

  1. Understand Scope: Clearly define which APIs can be tested
  2. Coordinate Testing: Schedule scans with API maintenance windows
  3. Review Results: Work with security teams to understand findings
  4. Implement Fixes: Prioritize and deploy security patches

๐Ÿ“Š Historical Reporting and Analysis

The scanner now includes comprehensive historical reporting capabilities to track security posture over time:

Historical Comparison Reports

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 text

Features:

  • Score changes between scans
  • New and resolved vulnerability tracking
  • Endpoint-specific change analysis
  • Visual indicators for improvement/regression

Trend Analysis

Track security trends over multiple scans:

# Enable trend analysis in configuration
historical_data:
  enabled: true
  trend_analysis: true
  storage_path: "./history"
  retention_days: 30

Features:

  • Security score progression over time
  • Vulnerability count trends
  • Time-based analysis with configurable periods
  • Visual charts and graphs (HTML output)

Data Management

  • 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

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# 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

Coding Standards

  • 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

๐Ÿš€ Advanced Usage Examples

OpenAPI Integration

# 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

API Discovery

# 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

Historical Analysis

# 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

Enterprise SIEM Integration

# 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"

Multi-Tenant Deployment

# 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"

Advanced Authentication

# 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"

Performance Monitoring

# 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: 10s

Grafana Integration

The 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: 30

The scanner exposes metrics in standard Prometheus format at the /metrics endpoint. To integrate with Grafana:

  1. Direct Integration: Configure Prometheus to scrape from http://<scanner-host>:8090/metrics
  2. Docker Setup: Use the provided grafana-docker-compose.yml for a complete setup with auto-provisioned dashboard
  3. Custom Dashboards: All scanner metrics are available with proper labels for tenant isolation

Key metrics available include:

  • api_scanner_total_vulnerabilities - Total vulnerabilities found
  • api_scanner_critical_vulnerabilities - Critical vulnerabilities count
  • api_scanner_cpu_usage - System CPU usage percentage
  • api_scanner_memory_usage - Memory usage in MB
  • api_scanner_throughput - Requests per second
  • api_scanner_error_rate - Error rate percentage
  • And many more metrics with tenant-specific labels

๐Ÿ› Troubleshooting

Common Issues

Connection Timeouts

# Increase timeout
./api-security-scanner -timeout 30

Authentication Failures

# Verify credentials in config.yaml
auth:
  username: "correct-username"
  password: "correct-password"

SSL Certificate Issues

# Disable SSL verification (not recommended for production)
export SSL_CERT_FILE=/path/to/cert.pem

Debug Mode

Enable verbose logging for troubleshooting:

./api-security-scanner -verbose

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# 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

Coding Standards

  • 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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • OWASP API Security Top 10 - For security testing guidelines
  • Go Community - For excellent tooling and libraries
  • Security Researchers - For vulnerability research and disclosures

๐Ÿ“ž Support

๐Ÿ”ฎ Roadmap

Phase 1: Core Infrastructure โœ…

  • Basic authentication testing
  • SQL injection detection
  • HTTP method validation
  • Concurrent execution
  • Detailed reporting

Phase 2: Enhanced Testing โœ…

  • XSS vulnerability detection
  • Security header analysis
  • Authentication bypass testing
  • Parameter tampering detection

Phase 3: Advanced Features โœ…

  • NoSQL injection testing
  • OpenAPI/Swagger integration
  • API discovery and crawling
  • Historical comparison and trending

Phase 4: Enterprise Features โœ…

  • 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

Phase 5: Future Enhancements (Planned)

  • 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

Star on GitHub Fork on GitHub

About

Enterprise-grade API security testing platform with React GUI, multi-tenant support, and SIEM integration

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages