TSS

Testing & Security Stack

Security Testing DevSecOps

Comprehensive Docker-based testing and security scanning infrastructure with 25+ integrated tools for quality assurance, security testing, performance testing, and API validation.

Stack Overview

CategoryServicesPurpose
Code QualitySonarQube, SemgrepStatic analysis, code quality
Security TestingOWASP ZAP, Nuclei, Gitleaks, Checkov, FalcoDynamic security, secret detection, IaC, runtime
Container SecurityTrivy, SyftVulnerability scanning, SBOM generation
AI SecurityCAIAI-powered offensive/defensive security automation
API TestingNewman, WireMock, Pact, RESTlerAPI testing, mocking, contracts, fuzzing
Performance TestingK6, Locust, Artillery, ToxiproxyLoad testing, stress testing, chaos engineering
Browser TestingPlaywright, BackstopJS, Pa11yE2E, visual regression, accessibility
Database TestingFlywayMigration testing, schema validation
Vulnerability MgmtDefectDojoFinding aggregation, tracking, reporting
ReportingAllureTest result aggregation and visualization

Quick Start Commands

# Start all services
make up

# Run all scans
make scan-all

# Run security scans only
make security-scan

# Run performance tests
make perf-test

# Run API tests
make api-test

# Stop services
make down

Service Access Points

ServiceURLCredentials
SonarQubehttp://localhost:9000admin/admin
OWASP ZAPhttp://localhost:8082-
WireMockhttp://localhost:8081-
Allure UIhttp://localhost:5252-
Dashboardhttp://localhost:10000-
Locusthttp://localhost:8089-
DefectDojohttp://localhost:8083admin/defectdojo
Pact Brokerhttp://localhost:9292-

Key Workflows

Full Security Scan Pipeline

SAST → DAST → Secret Detection → Results Aggregation

# Run static analysis (SAST)
docker exec semgrep semgrep --config auto --json /src

# Run dynamic analysis (DAST)
docker exec owasp-zap zap-baseline.py -t http://target:8080

# Check for secrets
docker exec gitleaks gitleaks detect --source /src

Performance Testing Pipeline

Smoke Test → Load Test → Stress Test → Analysis

# K6 load test
docker exec k6 k6 run /scripts/load-test.js

# Locust distributed testing
docker exec locust locust -f /locust/locustfile.py --headless

# Artillery scenario test
docker exec artillery artillery run /scripts/spike-test.yml

API Testing Pipeline

# Newman collection tests
docker exec newman newman run /etc/newman/collection.json

# Contract tests with Pact
docker exec pact npm test -- --testPathPattern=pact

# API fuzzing with RESTler
docker exec restler restler fuzz-lean --grammar_file /Compile/grammar.py

Tool Decision Trees

Choosing Security Scanning Tools

Static Analysis (SAST):
├── Code quality + coverage → SonarQube
├── Security patterns + rules → Semgrep
├── Container/FS vulnerabilities → Trivy
├── Secret detection → Gitleaks
├── IaC security (Terraform/K8s) → Checkov
└── Supply chain/SBOM → Syft + Grype

Dynamic Analysis (DAST):
├── Web app scanning → OWASP ZAP
├── Template-based scanning → Nuclei
├── Stateful API fuzzing → RESTler
├── Runtime monitoring → Falco
└── AI-powered analysis → CAI

Choosing Performance Testing Tools

Performance Testing:
├── Developer-friendly (JS) → K6
│   └── Best for: CI/CD integration, scripted tests
├── Distributed testing (Python) → Locust
│   └── Best for: Large scale, real-time dashboard
├── Scenario-based (YAML) → Artillery
│   └── Best for: Complex scenarios, protocol variety
└── Chaos engineering → Toxiproxy
    └── Best for: Failure injection, resilience testing

Quality Gates & Thresholds

Security Thresholds

SeverityActionThreshold
CriticalBlock deployment0 findings
HighBlock deployment0 findings
MediumReview required< 5 findings
LowTrack in backlogUnlimited

Performance Thresholds

MetricTargetFail Threshold
Response Time (p95)< 200ms> 500ms
Error Rate0%> 1%
Throughput> 1000 req/s< 500 req/s
CPU Usage< 70%> 90%

Best Practices

Security Testing

Performance Testing

API Testing