From 40d48a80457160a6722fbe93017fbe6a0948d1cc Mon Sep 17 00:00:00 2001 From: tduhamel42 Date: Tue, 14 Oct 2025 15:02:52 +0200 Subject: [PATCH] feat: Complete Temporal migration cleanup and fixes - Remove obsolete docker_logs.py module and container diagnostics from SDK - Fix security_assessment workflow metadata (vertical: rust -> python) - Remove all Prefect references from documentation - Add SDK exception handling test suite - Clean up old test artifacts --- .github/ISSUE_TEMPLATE/workflow_submission.md | 2 +- ARCHITECTURE.md | 90 +- CONTRIBUTING.md | 7 +- MIGRATION_DECISION.md | 1388 --------- ai/README.md | 8 +- ai/src/fuzzforge_ai/agent_executor.py | 6 +- .../security_assessment/metadata.yaml | 2 +- docs/docs/ai/a2a-services.md | 4 +- docs/docs/ai/architecture.md | 18 +- docs/docs/ai/configuration.md | 2 +- docs/docs/ai/ingestion.md | 4 +- docs/docs/ai/intro.md | 8 +- docs/docs/ai/prompts.md | 4 +- docs/docs/concept/architecture.md | 14 +- docs/docs/how-to/create-workflow.md | 10 +- docs/docs/how-to/mcp-integration.md | 2 +- docs/index.md | 2 +- sdk/src/fuzzforge_sdk/docker_logs.py | 387 --- sdk/src/fuzzforge_sdk/exceptions.py | 99 +- sdk/test_exception_handling.py | 212 ++ .../rust_fuzz_test/cargo-results.sarif | 5 - test_projects/rust_fuzz_test/fuzz/Cargo.toml | 7 + test_projects/rust_fuzz_test/src/lib.rs | 80 + .../vulnerable_app/baseline-test.sarif | 2548 ----------------- .../vulnerable_app/ci-test-results.sarif | 2548 ----------------- test_projects/vulnerable_app/ci-test.sarif | 2548 ----------------- .../vulnerable_app/fuzzing-results.sarif | 1 - 27 files changed, 379 insertions(+), 9627 deletions(-) delete mode 100644 MIGRATION_DECISION.md delete mode 100644 sdk/src/fuzzforge_sdk/docker_logs.py create mode 100644 sdk/test_exception_handling.py delete mode 100644 test_projects/rust_fuzz_test/cargo-results.sarif delete mode 100644 test_projects/vulnerable_app/baseline-test.sarif delete mode 100644 test_projects/vulnerable_app/ci-test-results.sarif delete mode 100644 test_projects/vulnerable_app/ci-test.sarif delete mode 100644 test_projects/vulnerable_app/fuzzing-results.sarif diff --git a/.github/ISSUE_TEMPLATE/workflow_submission.md b/.github/ISSUE_TEMPLATE/workflow_submission.md index 9ce4e25..92d692f 100644 --- a/.github/ISSUE_TEMPLATE/workflow_submission.md +++ b/.github/ISSUE_TEMPLATE/workflow_submission.md @@ -26,7 +26,7 @@ What type of security workflow is this? ## Files Please attach or provide links to your workflow files: -- [ ] `workflow.py` - Main Prefect flow implementation +- [ ] `workflow.py` - Main Temporal flow implementation - [ ] `Dockerfile` - Container definition - [ ] `metadata.yaml` - Workflow metadata - [ ] Test files or examples diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 4e007f0..aa265b4 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,92 +1,44 @@ # FuzzForge AI Architecture -**Last Updated:** 2025-10-01 -**Status:** Approved Architecture Plan -**Current Phase:** Migration from Prefect to Temporal with Vertical Workers +**Last Updated:** 2025-10-14 +**Status:** Production - Temporal with Vertical Workers --- ## Table of Contents 1. [Executive Summary](#executive-summary) -2. [Current Architecture (Prefect)](#current-architecture-prefect) -3. [Target Architecture (Temporal + Vertical Workers)](#target-architecture-temporal--vertical-workers) -4. [Vertical Worker Model](#vertical-worker-model) -5. [Storage Strategy (MinIO)](#storage-strategy-minio) -6. [Dynamic Workflow Loading](#dynamic-workflow-loading) -7. [Architecture Principles](#architecture-principles) -8. [Component Details](#component-details) -9. [Scaling Strategy](#scaling-strategy) -10. [File Lifecycle Management](#file-lifecycle-management) -11. [Future: Nomad Migration](#future-nomad-migration) -12. [Migration Timeline](#migration-timeline) -13. [Decision Log](#decision-log) +2. [Current Architecture (Temporal + Vertical Workers)](#current-architecture-temporal--vertical-workers) +3. [Vertical Worker Model](#vertical-worker-model) +4. [Storage Strategy (MinIO)](#storage-strategy-minio) +5. [Dynamic Workflow Loading](#dynamic-workflow-loading) +6. [Architecture Principles](#architecture-principles) +7. [Component Details](#component-details) +8. [Scaling Strategy](#scaling-strategy) +9. [File Lifecycle Management](#file-lifecycle-management) +10. [Future: Nomad Migration](#future-nomad-migration) --- ## Executive Summary -### The Decision +### The Architecture -**Replace Prefect with Temporal** using a **vertical worker architecture** where each worker is pre-built with domain-specific security toolchains (Android, Rust, Web, iOS, Blockchain, etc.). Use **MinIO** for unified storage across dev and production environments. +**Temporal orchestration** with a **vertical worker architecture** where each worker is pre-built with domain-specific security toolchains (Android, Rust, Web, iOS, Blockchain, OSS-Fuzz, etc.). Uses **MinIO** for unified S3-compatible storage across dev and production environments. -### Why This Change? - -| Aspect | Current (Prefect) | Target (Temporal + Verticals) | -|--------|-------------------|-------------------------------| -| **Services** | 6 (Server, Postgres, Redis, Registry, Docker-proxy, Worker) | 6 (Temporal, MinIO, MinIO-setup, 3+ vertical workers) | -| **Orchestration** | Prefect (complex) | Temporal (simpler, more reliable) | -| **Worker Model** | Ephemeral containers per workflow | Long-lived vertical workers with pre-built toolchains | -| **Storage** | Docker Registry + volume mounts | MinIO (S3-compatible) with caching | -| **Dynamic Workflows** | Build image per workflow | Mount workflow code as volume (no rebuild) | -| **Target Access** | Host volume mounts (/Users, /home) | Upload to MinIO, download to cache | -| **Memory Usage** | ~1.85GB | ~2.3GB (+24%, worth it for benefits) | - -### Key Benefits +### Key Architecture Features 1. **Vertical Specialization:** Pre-built toolchains (Android: Frida, apktool; Rust: AFL++, cargo-fuzz) -2. **Zero Startup Overhead:** Long-lived workers (no 5s container spawn per workflow) +2. **Zero Startup Overhead:** Long-lived workers (no container spawn per workflow) 3. **Dynamic Workflows:** Add workflows without rebuilding images (mount as volume) -4. **Unified Storage:** MinIO works identically in dev and prod (no environment-specific code) +4. **Unified Storage:** MinIO works identically in dev and prod 5. **Better Security:** No host filesystem mounts, isolated uploaded targets 6. **Automatic Cleanup:** MinIO lifecycle policies handle file expiration -7. **Marketing Advantage:** Sell "security verticals" not "generic orchestration" (safer Nomad BSL positioning) -8. **Scalability:** Clear path from single-host to multi-host to Nomad cluster +7. **Scalability:** Clear path from single-host to multi-host to Nomad cluster --- -## Current Architecture (Prefect) - -### Infrastructure Components - -``` -┌─────────────────────────────────────────────────────────┐ -│ Docker Compose Stack (6 services) │ -│ │ -│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ -│ │ Prefect │ │ Postgres │ │ Redis │ │ -│ │ Server │ │ (metadata) │ │ (queue) │ │ -│ └──────────────┘ └──────────────┘ └──────────────┘ │ -│ │ -│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ -│ │ Registry │ │ Docker Proxy │ │ Prefect │ │ -│ │ (images) │ │ (isolation) │ │ Worker │ │ -│ └──────────────┘ └──────────────┘ └──────────────┘ │ -└─────────────────────────────────────────────────────────┘ -``` - -### Pain Points - -- **Complexity:** 6 services to manage, configure, and monitor -- **Registry overhead:** Must push/pull images for every workflow deployment -- **Volume mounting complexity:** job_variables configuration per workflow -- **Dynamic workflows:** Requires rebuilding and pushing Docker images -- **Scalability:** Unclear how to scale beyond single host -- **Resource usage:** ~1.85GB baseline - ---- - -## Target Architecture (Temporal + Vertical Workers) +## Current Architecture (Temporal + Vertical Workers) ### Infrastructure Overview @@ -155,7 +107,7 @@ Worker-android: ~512MB (varies by toolchain) Worker-rust: ~512MB Worker-web: ~512MB ───────────────────────── -Total: ~2.3GB (vs 1.85GB Prefect = +24%) +Total: ~2.3GB Note: +450MB overhead is worth it for: - Unified dev/prod architecture @@ -1030,8 +982,8 @@ job "fuzzforge-worker-android" { ## Decision Log -### 2025-09-30: Initial Architecture Decision -- **Decision:** Migrate from Prefect to Temporal +### 2025-09-30: Architecture Implementation +- **Decision:** Temporal with Vertical Workers - **Rationale:** Simpler infrastructure, better reliability, clear scaling path ### 2025-10-01: Vertical Worker Model diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e948db..6529eec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,9 +84,10 @@ docs(readme): update installation instructions ``` backend/toolbox/workflows/your_workflow/ ├── __init__.py - ├── workflow.py # Main Prefect flow - ├── metadata.yaml # Workflow metadata - └── Dockerfile # Container definition + ├── workflow.py # Main Temporal workflow + ├── activities.py # Workflow activities (optional) + ├── metadata.yaml # Workflow metadata (includes vertical field) + └── requirements.txt # Additional dependencies (optional) ``` 2. **Register Your Workflow** diff --git a/MIGRATION_DECISION.md b/MIGRATION_DECISION.md deleted file mode 100644 index e59c6c5..0000000 --- a/MIGRATION_DECISION.md +++ /dev/null @@ -1,1388 +0,0 @@ -# FuzzForge AI: Migration Decision Document - -**Date:** 2025-10-01 (Updated) -**Status:** Architecture Revised - Ready for Implementation -**Decision Makers:** FuzzingLabs Team -**Recommendation:** Migrate to Temporal with Vertical Workers + MinIO - ---- - -## 🔄 CRITICAL UPDATE (2025-10-01) - -**Initial analysis was incomplete.** The original architecture document missed a critical requirement: - -> **"Workflows are dynamic and have to be created without modifying the codebase"** - -### What Changed - -The original plan proposed "no registry needed" with long-lived workers, but failed to address how dynamic workflows with custom dependencies would work. This created a fundamental contradiction. - -### Revised Architecture - -**New approach: Vertical Workers + MinIO** - -| Aspect | Original Plan | Revised Plan | -|--------|--------------|--------------| -| **Workers** | Generic long-lived | **Vertical-specific** (Android, Rust, Web, iOS, etc.) | -| **Toolchains** | Install per workflow | **Pre-built per vertical** | -| **Workflows** | Unclear | **Mounted as volume** (no rebuild) | -| **Storage** | LocalVolumeStorage (dev) / S3 (prod) | **MinIO everywhere** (unified) | -| **Target Access** | Host filesystem mounts | **Upload to MinIO** (secure) | -| **Registry** | Eliminated | **Eliminated** (workflows in volume, not images) | -| **Services** | 1 (Temporal only) | 6 (Temporal + MinIO + 3+ vertical workers) | -| **Memory** | "~4.5GB" | **~2.3GB** (realistic calculation) | - -### Key Insights - -1. **Dynamic workflows ARE compatible** with long-lived workers via volume mounting -2. **Verticals solve** the toolchain problem (pre-built, no per-workflow installs) -3. **MinIO is lightweight** (256MB with CI_CD=true) and provides unified storage -4. **No registry overhead** (workflow code mounted, not built into images) -5. **Better marketing** (sell "security verticals", not "orchestration platform") - -### What This Means - -- ✅ Migration still recommended -- ✅ Timeline extended to 10 weeks (from 8) -- ✅ More services but better architecture -- ✅ Addresses all original pain points -- ✅ Supports dynamic workflows correctly - -**See ARCHITECTURE.md v2.0 for full details.** - ---- - -## Table of Contents - -1. [Executive Summary](#executive-summary) -2. [Current State Analysis](#current-state-analysis) -3. [Proposed Solution: Temporal Migration](#proposed-solution-temporal-migration) -4. [For & Against: Temporal vs Prefect](#for--against-temporal-vs-prefect) -5. [For & Against: Long-Lived vs Ephemeral Workers](#for--against-long-lived-vs-ephemeral-workers) -6. [Future Consideration: Nomad vs Kubernetes vs Docker Compose](#future-consideration-nomad-vs-kubernetes-vs-docker-compose) -7. [Benefits Summary](#benefits-summary) -8. [Risks & Mitigations](#risks--mitigations) -9. [Cost Analysis](#cost-analysis) -10. [Timeline & Effort](#timeline--effort) -11. [Licensing Considerations](#licensing-considerations) -12. [Recommendation](#recommendation) - ---- - -## Executive Summary - -### The Proposal - -**Migrate from Prefect to Temporal** for workflow orchestration, simplifying infrastructure from 6 services to 1 while maintaining module architecture and preparing for future scale. - -### Why Consider This? - -Current Prefect setup has grown complex with: -- 6 services to manage (Prefect, Postgres, Redis, Registry, Docker-proxy, Worker) -- Unclear scaling path for high-volume production -- Registry overhead for module isolation -- Complex volume mounting configuration - -### Key Decision Points - -| Decision | Recommendation | Timeline | -|----------|---------------|----------| -| **Replace Prefect?** | ✅ Yes - with Temporal | Now (Weeks 1-8) | -| **Worker Strategy?** | ✅ Long-lived containers | Now (Weeks 3-4) | -| **Storage Strategy?** | ✅ Abstract layer (Local→S3) | Now (Week 3) | -| **Add Nomad?** | ⏳ Later - when 10+ hosts | 18-24 months | -| **Add Kubernetes?** | ❌ No - unnecessary complexity | N/A | - -### Bottom Line - -**Recommended:** Proceed with Temporal migration. -- **Effort:** 8 weeks, Medium complexity -- **Risk:** Low (rollback possible, modules unchanged) -- **Benefit:** 83% infrastructure reduction, clear scaling path, better reliability - ---- - -## Current State Analysis - -### Prefect Architecture (Current) - -``` -Infrastructure: -├─ Prefect Server (orchestration) -├─ Postgres (metadata storage) -├─ Redis (task queue) -├─ Docker Registry (image sharing) -├─ Docker Proxy (container isolation) -└─ Prefect Worker (execution) - -Total: 6 services -``` - -### Strengths of Current Setup - -| Aspect | Rating | Notes | -|--------|--------|-------| -| **Familiarity** | ✅ High | Team knows Prefect well | -| **Functionality** | ✅ Good | Workflows execute successfully | -| **Module System** | ✅ Excellent | BaseModule interface is solid | -| **Documentation** | ✅ Good | Internal docs exist | - -### Pain Points - -| Issue | Impact | Frequency | Severity | -|-------|--------|-----------|----------| -| **Infrastructure Complexity** | Managing 6 services | Continuous | High | -| **Registry Overhead** | Push/pull for every deployment | Every change | Medium | -| **Unclear Scaling** | How to go multi-host? | Future planning | High | -| **Resource Usage** | ~8GB under load | Continuous | Medium | -| **Volume Mounting** | Complex job_variables config | Every workflow | Medium | - -### Why Change Now? - -1. **Planning for Scale:** Need clear path from 1 host → multi-host → cluster -2. **Infrastructure Debt:** 6 services growing harder to maintain -3. **Better Options Available:** Temporal provides simpler, more scalable solution -4. **Module System Stable:** Can migrate orchestration without touching modules -5. **Right Time:** Before production scale makes migration harder - ---- - -## Proposed Solution: Temporal Migration - -### Target Architecture - -``` -Infrastructure: -├─ Temporal Server (orchestration + storage) -└─ Worker Pools (3 types, auto-discover modules) - -Total: 1 service (+ workers) -``` - -### Migration Phases - -**Phase 1: Single Host (Weeks 1-8)** -- Replace Prefect with Temporal -- Long-lived worker pools -- LocalVolumeStorage (volume mounts) -- Capacity: 15-50 concurrent workflows - -**Phase 2: Multi-Host (Months 6-18)** -- Same architecture, multiple hosts -- Switch to S3CachedStorage -- Capacity: 3× Phase 1 - -**Phase 3: Nomad Cluster (Months 18+, if needed)** -- Add Nomad for advanced orchestration -- Auto-scaling, multi-tenancy -- Capacity: Unlimited horizontal scaling - ---- - -## For & Against: Temporal vs Prefect - -### Option A: Keep Prefect (Status Quo) - -#### ✅ For (Arguments to Keep Prefect) - -1. **No Migration Effort** - - Zero weeks of migration work - - No learning curve - - No risk of migration issues - -2. **Team Familiarity** - - Team knows Prefect well - - Existing operational runbooks - - Established debugging patterns - -3. **Working System** - - Current workflows function correctly - - No immediate technical blocker - - "If it ain't broke, don't fix it" - -4. **Deferred Complexity** - - Can delay architecture decisions - - Focus on feature development - - Postpone infrastructure changes - -#### ❌ Against (Arguments Against Keeping Prefect) - -1. **Infrastructure Complexity** - - 6 services to manage and monitor - - Complex dependencies (Postgres, Redis, Registry) - - High operational overhead - -2. **Scaling Uncertainty** - - Unclear how to scale beyond single host - - Registry becomes bottleneck at scale - - No clear multi-host story - -3. **Resource Inefficiency** - - ~2GB idle, ~8GB under load - - Registry storage overhead - - Redundant service layers - -4. **Technical Debt Accumulation** - - Complexity will only increase - - Harder to migrate later (more workflows) - - Missing modern features (durable execution) - -5. **Prefect Ecosystem Concerns** - - Prefect 3.x changes from 2.x - - Community split (Cloud vs self-hosted) - - Uncertain long-term roadmap - -### Option B: Migrate to Temporal (Recommended) - -#### ✅ For (Arguments to Migrate) - -1. **Dramatic Simplification** - - 6 services → 1 service (83% reduction) - - No registry needed (local images) - - Simpler volume mounting - -2. **Better Reliability** - - Durable execution (workflows survive crashes) - - Built-in state persistence - - Proven at massive scale (Netflix, Uber, Snap) - -3. **Clear Scaling Path** - - Single host → Multi-host → Nomad cluster - - Architecture designed for scale - - Storage abstraction enables seamless transition - -4. **Superior Workflow Engine** - - True durable execution vs task queue - - Better state management - - Handles long-running workflows (fuzzing campaigns) - - Activity timeouts and retries built-in - -5. **Operational Benefits** - - Better Web UI for debugging - - Comprehensive workflow history - - Query workflow state at any time - - Simpler deployment (single service) - -6. **Future-Proof Architecture** - - Easy Nomad migration path (18+ months) - - Multi-tenancy ready (namespaces) - - Auto-scaling capable - - Industry momentum (growing adoption) - -7. **Module Preservation** - - Zero changes to BaseModule interface - - Module discovery unchanged - - Workflows adapt easily (@flow → @workflow) - -8. **Resource Efficiency** - - ~1GB idle, ~4.5GB under load - - 44% reduction in resource usage - - No registry storage overhead - -#### ❌ Against (Arguments Against Migration) - -1. **Migration Effort** - - 8 weeks of focused work - - Team capacity diverted from features - - Testing and validation required - -2. **Learning Curve** - - New concepts (workflows vs activities) - - Different debugging approach - - Team training needed - -3. **Migration Risk** - - Potential for workflow disruption - - Bugs in migration code - - Temporary performance issues - -4. **Unknown Unknowns** - - May discover edge cases - - Performance characteristics differ - - Integration challenges possible - -5. **Temporal Limitations** - - Less mature than Prefect in some areas - - Smaller community (growing) - - Fewer pre-built integrations - -### Scoring Matrix - -| Criteria | Weight | Prefect | Temporal | Winner | -|----------|--------|---------|----------|--------| -| **Infrastructure Complexity** | 25% | 3/10 | 9/10 | Temporal | -| **Scalability** | 20% | 4/10 | 9/10 | Temporal | -| **Reliability** | 20% | 7/10 | 10/10 | Temporal | -| **Migration Effort** | 15% | 10/10 | 4/10 | Prefect | -| **Team Familiarity** | 10% | 9/10 | 3/10 | Prefect | -| **Resource Efficiency** | 10% | 5/10 | 8/10 | Temporal | -| **Total** | 100% | **5.5/10** | **7.65/10** | **Temporal** | - -**Conclusion:** Temporal wins on technical merit despite migration costs. - ---- - -## For & Against: Long-Lived vs Ephemeral Workers - -### Context - -Workers can spawn ephemeral containers per workflow (like Prefect) or run as long-lived containers processing multiple workflows. - -### Option A: Ephemeral Containers - -#### ✅ For - -1. **Complete Isolation** - - Each workflow in fresh container - - No state leakage between workflows - - Maximum security - -2. **Automatic Cleanup** - - Containers destroyed after workflow - - No resource leaks - - Clean slate every time - -3. **Matches Current Behavior** - - Similar to Prefect approach - - Easier mental model - - Less architecture change - -4. **Simple Development** - - Test with `docker run` - - No complex lifecycle management - - Easy to debug - -#### ❌ Against - -1. **Performance Overhead** - - 5 second startup per container - - At 450 workflows/hour: 625 minutes wasted - - Unacceptable at production scale - -2. **Resource Churn** - - Constant container creation/destruction - - Docker daemon overhead - - Network/volume setup repeated - -3. **Scaling Limitations** - - Can't handle high-volume workloads - - Startup overhead compounds - - Poor resource utilization - -### Option B: Long-Lived Workers (Recommended) - -#### ✅ For - -1. **Zero Startup Overhead** - - Containers already running - - Immediate workflow execution - - Critical for high-volume production - -2. **Resource Efficiency** - - Fixed 4.5GB RAM handles 15 concurrent workflows - - vs ~76GB for ephemeral approach - - 10-20× better resource utilization - -3. **Predictable Performance** - - Consistent response times - - No container startup jitter - - Better SLA capability - -4. **Horizontal Scaling** - - Add more workers linearly - - Each worker handles N concurrent - - Clear capacity planning - -5. **Production-Ready** - - Proven pattern (Uber, Airbnb) - - Handles thousands of workflows/day - - Industry standard for scale - -#### ❌ Against - -1. **Volume Mounting Complexity** - - Must mount parent directories - - Or implement S3 storage backend - - More sophisticated configuration - -2. **Shared Container State** - - Workers reused across workflows - - Potential for subtle bugs - - Requires careful module design - -3. **Lifecycle Management** - - Must handle worker restarts - - Graceful shutdown needed - - More complex monitoring - -4. **Memory Management** - - Workers accumulate memory over time - - Need periodic restarts - - Requires memory limits - -### Decision Matrix - -| Scenario | Ephemeral | Long-Lived | Winner | -|----------|-----------|------------|--------| -| **Development** | ✅ Simpler | ⚠️ Complex | Ephemeral | -| **Low Volume (<10/hour)** | ✅ Acceptable | ✅ Overkill | Ephemeral | -| **Medium Volume (10-100/hour)** | ⚠️ Wasteful | ✅ Efficient | Long-Lived | -| **High Volume (>100/hour)** | ❌ Unusable | ✅ Required | Long-Lived | -| **Production Scale** | ❌ No | ✅ Yes | Long-Lived | - -**Recommendation:** Long-lived workers for production deployment. - -**Compromise:** Can start with ephemeral for Phase 1 (proof of concept), migrate to long-lived for Phase 2 (production). - ---- - -## Future Consideration: Nomad vs Kubernetes vs Docker Compose - -### When to Consider Orchestration Beyond Docker Compose? - -**Trigger Points:** -- ✅ Managing 10+ hosts manually -- ✅ Need multi-tenancy (customer isolation) -- ✅ Require auto-scaling based on metrics -- ✅ Want sophisticated scheduling (bin-packing, constraints) - -**Timeline Estimate:** 18-24 months from now - -### Option A: Docker Compose (Recommended for Phase 1-2) - -#### ✅ For - -1. **Simplicity** - - Single YAML file - - No cluster setup - - Easy to understand and debug - -2. **Zero Learning Curve** - - Team already knows Docker - - Familiar commands - - Abundant documentation - -3. **Sufficient for 1-5 Hosts** - - Deploy same compose file to each host - - Manual but manageable - - Works for current scale - -4. **Development Friendly** - - Same config dev and prod - - Fast iteration cycle - - Easy local testing - -5. **No Lock-In** - - Easy to migrate to Nomad/K8s later - - Workers portable by design - - Clean exit strategy - -#### ❌ Against - -1. **Manual Coordination** - - No automatic scheduling - - Manual load balancing - - No health-based rescheduling - -2. **Limited Scaling** - - Practical limit ~5-10 hosts - - No auto-scaling - - Manual capacity planning - -3. **No Multi-Tenancy** - - Can't isolate customers - - No resource quotas - - Shared infrastructure - -4. **Basic Monitoring** - - No cluster-wide metrics - - Per-host monitoring only - - Limited observability - -**Verdict:** Perfect for Phase 1 (single host) and Phase 2 (3-5 hosts). Transition to Nomad/K8s at Phase 3. - -### Option B: Nomad (Recommended for Phase 3) - -#### ✅ For - -1. **Operational Simplicity** - - Single binary (vs K8s complexity) - - Easy to install and maintain - - Lower operational overhead - -2. **Perfect Fit for Use Case** - - Batch workload focus - - Resource management built-in - - Namespace support for multi-tenancy - -3. **Multi-Workload Support** - - Containers (Docker) - - VMs (QEMU) - - Bare processes - - Java JARs - - All in one scheduler - -4. **Scheduling Intelligence** - - Bin-packing for efficiency - - Constraint-based placement - - Affinity/anti-affinity rules - - Resource quotas per namespace - -5. **Easy Migration from Docker Compose** - - Similar concepts - - `compose-to-nomad` converter tool - - Workers unchanged - - 1-2 week migration - -6. **HashiCorp Ecosystem** - - Integrates with Consul (service discovery) - - Integrates with Vault (secrets) - - Proven at scale (Cloudflare, CircleCI) - -7. **Auto-Scaling** - - Built-in scaling policies - - Prometheus integration - - Queue-depth based scaling - - Horizontal scaling automatic - -#### ❌ Against - -1. **Learning Curve** - - HCL syntax to learn - - New concepts (allocations, deployments) - - Consul integration complexity - -2. **Smaller Ecosystem** - - Fewer tools than Kubernetes - - Smaller community - - Less third-party integrations - -3. **Network Isolation** - - Less sophisticated than K8s - - Requires Consul Connect for service mesh - - Weaker network policies - -4. **Maturity** - - Less mature than Kubernetes - - Fewer production battle stories - - Evolving feature set - -**Verdict:** Excellent choice when outgrow Docker Compose. Simpler than K8s, perfect for FuzzForge scale. - -### Option C: Kubernetes - -#### ✅ For - -1. **Industry Standard** - - Largest ecosystem - - Most third-party integrations - - Abundant expertise available - -2. **Feature Richness** - - Sophisticated networking (Network Policies) - - Advanced scheduling - - Rich operator ecosystem - - Helm charts for everything - -3. **Multi-Tenancy** - - Strong namespace isolation - - RBAC fine-grained - - Network policies - - Pod Security Policies - -4. **Massive Scale** - - Proven to 5,000+ nodes - - Google-scale reliability - - Battle-tested - -5. **Cloud Integration** - - Native on all clouds (EKS, GKE, AKS) - - Managed offerings reduce complexity - - Auto-scaling (HPA, Cluster Autoscaler) - -#### ❌ Against - -1. **Operational Complexity** - - High learning curve - - Complex to set up and maintain - - Requires dedicated ops team - -2. **Resource Overhead** - - Control plane resource usage - - etcd cluster management - - More moving parts - -3. **Overkill for Use Case** - - FuzzForge is batch workload, not microservices - - Don't need K8s networking complexity - - Simpler alternatives sufficient - -4. **Container-Only** - - Can't run VMs easily - - Can't run bare processes - - Nomad more flexible - -5. **Cost** - - Higher operational cost - - More infrastructure required - - Steeper learning investment - -**Verdict:** Overkill for FuzzForge. Choose only if planning 1,000+ hosts or need extensive ecosystem. - -### Comparison Matrix - -| Feature | Docker Compose | Nomad | Kubernetes | -|---------|---------------|-------|------------| -| **Operational Complexity** | ★☆☆☆☆ (Lowest) | ★★☆☆☆ (Low) | ★★★★☆ (High) | -| **Learning Curve** | ★☆☆☆☆ (Easy) | ★★★☆☆ (Medium) | ★★★★★ (Steep) | -| **Setup Time** | Minutes | 1 day | 1-2 weeks | -| **Best For** | 1-5 hosts | 10-500 hosts | 500+ hosts | -| **Auto-Scaling** | ❌ No | ✅ Yes | ✅ Yes | -| **Multi-Tenancy** | ❌ No | ✅ Yes (Namespaces) | ✅ Yes (Advanced) | -| **Workload Types** | Containers | Containers + VMs + Processes | Containers (mainly) | -| **Service Mesh** | ❌ No | ⚠️ Via Consul Connect | ✅ Istio/Linkerd | -| **Ecosystem Size** | Medium | Small | Huge | -| **Resource Efficiency** | High | High | Medium | -| **FuzzForge Fit** | ✅ Phase 1-2 | ✅ Phase 3+ | ⚠️ Unnecessary | - -### Recommendation Timeline - -``` -Months 0-6: Docker Compose (Single Host) - └─ Simplest, fastest to implement - -Months 6-18: Docker Compose (Multi-Host) - └─ Scale to 3-5 hosts manually - -Months 18+: Nomad (if needed) - └─ Add when 10+ hosts or auto-scaling required - -Never: Kubernetes - └─ Unless scale exceeds 500+ hosts -``` - ---- - -## Benefits Summary - -### Infrastructure Benefits - -| Metric | Current (Prefect) | Future (Temporal) | Improvement | -|--------|-------------------|-------------------|-------------| -| **Services to Manage** | 6 | 1 | 83% reduction | -| **Idle Memory Usage** | ~2GB | ~1GB | 50% reduction | -| **Load Memory Usage** | ~8GB | ~4.5GB | 44% reduction | -| **Docker Registry** | Required | Not needed | Eliminated | -| **Configuration Files** | 6 service configs | 1 config | 83% simpler | -| **Deployment Complexity** | High | Low | Significant | - -### Operational Benefits - -1. **Simpler Monitoring** - - 1 service vs 6 - - Single Web UI (Temporal) - - Fewer alerts to configure - -2. **Easier Debugging** - - Complete workflow history in Temporal - - Query workflow state at any time - - Better error visibility - -3. **Faster Deployments** - - No registry push/pull - - Restart 1 service vs 6 - - Quicker iteration cycles - -4. **Better Reliability** - - Durable execution (workflows survive crashes) - - Automatic retries built-in - - State persistence guaranteed - -5. **Clear Scaling Path** - - Phase 1: Single host (now) - - Phase 2: Multi-host (6-18 months) - - Phase 3: Nomad cluster (18+ months) - -### Developer Experience Benefits - -1. **Local Development** - - Simpler docker-compose - - Faster startup (fewer services) - - Easier to reason about - -2. **Module Development** - - No changes to BaseModule - - Same discovery mechanism - - Same testing approach - -3. **Workflow Development** - - Better debugging tools (Temporal Web UI) - - Workflow history visualization - - Easier to test retry logic - -4. **Onboarding** - - 1 service to understand vs 6 - - Clearer architecture - - Less to learn - ---- - -## Risks & Mitigations - -### Risk 1: Migration Introduces Bugs - -**Likelihood:** Medium -**Impact:** High -**Risk Score:** 6/10 - -**Mitigation:** -- Phased migration (one workflow at a time) -- Parallel run (Prefect + Temporal) during transition -- Comprehensive testing before cutover -- Rollback plan documented - -### Risk 2: Performance Degradation - -**Likelihood:** Low -**Impact:** Medium -**Risk Score:** 3/10 - -**Mitigation:** -- Load testing before production -- Monitor key metrics during migration -- Temporal proven at higher scale than current -- Easy to tune worker concurrency - -### Risk 3: Team Learning Curve - -**Likelihood:** High -**Impact:** Low -**Risk Score:** 4/10 - -**Mitigation:** -- Training sessions on Temporal concepts -- Pair programming during migration -- Comprehensive documentation -- Temporal has excellent docs - -### Risk 4: Unknown Edge Cases - -**Likelihood:** Medium -**Impact:** Medium -**Risk Score:** 5/10 - -**Mitigation:** -- Thorough testing with real workflows -- Gradual rollout (dev → staging → production) -- Keep Prefect running initially -- Community support available - -### Risk 5: Module System Incompatibility - -**Likelihood:** Very Low -**Impact:** High -**Risk Score:** 2/10 - -**Mitigation:** -- Module interface preserved (BaseModule unchanged) -- Only orchestration changes -- Modules are decoupled from Prefect -- Test suite validates module behavior - -### Risk 6: Long-Lived Worker Stability - -**Likelihood:** Low -**Impact:** Medium -**Risk Score:** 3/10 - -**Mitigation:** -- Proper resource limits (memory, CPU) -- Periodic worker restarts (daily) -- Monitoring for memory leaks -- Health checks and auto-restart - -### Overall Risk Assessment - -**Total Risk Score:** 23/60 (38%) - **Medium-Low Risk** - -**Conclusion:** Risks are manageable with proper planning and mitigation strategies. - ---- - -## Cost Analysis - -### Current Costs (Prefect) - -**Infrastructure:** -``` -Single Host (8GB RAM, 4 CPU): - - Cloud VM: $80-120/month - - Or bare metal amortized: ~$50/month - -Services Running: - - Prefect Server: ~500MB - - Postgres: ~200MB - - Redis: ~100MB - - Registry: ~500MB - - Docker Proxy: ~50MB - - Worker: ~500MB - - Workflows: ~6GB (peak) - Total: ~8GB - -Development Time: - - Maintenance: ~2 hours/week - - Debugging: ~3 hours/week - - Deployments: ~1 hour/week - Total: 6 hours/week = $600/month (at $25/hour) -``` - -**Monthly Total:** ~$700/month - -### Future Costs (Temporal) - -**Phase 1 - Single Host:** -``` -Single Host (6GB RAM, 4 CPU): - - Cloud VM: $60-80/month - - Or bare metal amortized: ~$40/month - -Services Running: - - Temporal: ~1GB - - Workers: ~3.5GB - - Workflows: ~1GB (peak) - Total: ~5.5GB - -Development Time: - - Maintenance: ~1 hour/week - - Debugging: ~2 hours/week - - Deployments: ~0.5 hour/week - Total: 3.5 hours/week = $350/month -``` - -**Monthly Total:** ~$430/month - -**Phase 2 - Multi-Host (3 hosts):** -``` -3 Hosts + S3 Storage: - - Cloud VMs: $180-240/month - - S3 storage (1TB): ~$23/month - - S3 transfer (100GB): ~$9/month - -Development Time: - - Maintenance: ~2 hours/week - - Monitoring: ~2 hours/week - Total: 4 hours/week = $400/month -``` - -**Monthly Total:** ~$670/month (3× capacity) - -**Phase 3 - Nomad Cluster (10+ hosts):** -``` -Nomad Cluster: - - 3 Nomad servers: $120/month - - 10 worker hosts: $800/month - - S3 storage (5TB): ~$115/month - - Load balancer: ~$20/month - -Development Time: - - Nomad maintenance: ~3 hours/week - - Monitoring: ~3 hours/week - Total: 6 hours/week = $600/month -``` - -**Monthly Total:** ~$1,655/month (10× capacity) - -### Cost Comparison - -| Phase | Hosts | Capacity | Monthly Cost | Cost per Workflow | -|-------|-------|----------|--------------|-------------------| -| **Current (Prefect)** | 1 | 10K/day | $700 | $0.0023 | -| **Phase 1 (Temporal)** | 1 | 10K/day | $430 | $0.0014 | -| **Phase 2 (Temporal)** | 3 | 30K/day | $670 | $0.0007 | -| **Phase 3 (Nomad)** | 10 | 100K/day | $1,655 | $0.0005 | - -**Savings:** -- Phase 1 vs Current: **$270/month (39% reduction)** -- Better cost efficiency as scale increases - ---- - -## Timeline & Effort - -### Phase 1: Temporal Migration (8 Weeks) - -**Week 1-2: Foundation** -- Deploy Temporal server -- Remove Prefect infrastructure -- Implement storage abstraction layer -- Effort: 60-80 hours - -**Week 3-4: Workers** -- Create long-lived worker pools -- Implement module auto-discovery -- Configure Docker Compose -- Effort: 60-80 hours - -**Week 5-6: Workflows** -- Migrate workflows to Temporal -- Convert @flow → @workflow.defn -- Test all workflows -- Effort: 60-80 hours - -**Week 7: Integration** -- Update backend API -- End-to-end testing -- Load testing -- Effort: 40-60 hours - -**Week 8: Documentation & Cleanup** -- Update documentation -- Remove old code -- Training sessions -- Effort: 30-40 hours - -**Total Effort:** 250-340 hours (~2 engineers for 2 months) - -### Phase 2: Multi-Host (When Needed) - -**Effort:** 40-60 hours -- Set up S3 storage -- Deploy to multiple hosts -- Configure load balancing -- Test and validate - -### Phase 3: Nomad (If Needed) - -**Effort:** 80-120 hours -- Install Nomad cluster -- Convert jobs to Nomad -- Set up auto-scaling -- Production deployment - ---- - -## Licensing Considerations - -### Overview - -**Critical Context:** FuzzForge is a **generic platform** where modules and workflows "could be anything" - not limited to fuzzing or security analysis. This significantly impacts the licensing assessment, particularly for Nomad's Business Source License. - -### Temporal Licensing: ✅ SAFE - -**License:** MIT License - -**Status:** Fully open source, zero restrictions - -**Commercial Use:** -- ✅ Use in production -- ✅ Sell services built on Temporal -- ✅ Modify source code -- ✅ Redistribute -- ✅ Sublicense -- ✅ Private use - -**Conclusion:** Temporal has **no licensing concerns** for any use case. You can build any type of platform (fuzzing, security, generic workflows, orchestration-as-a-service) without legal risk. - -**Reference:** https://github.com/temporalio/temporal/blob/master/LICENSE - ---- - -### Nomad Licensing: ⚠️ REQUIRES CAREFUL EVALUATION - -**License:** Business Source License 1.1 (BSL 1.1) - -**Status:** Source-available but with restrictions - -#### BSL 1.1 Key Terms - -**Change Date:** 4 years after each version release -**Change License:** Mozilla Public License 2.0 (MPL 2.0) - -**After 4 years:** Each version becomes fully open source under MPL 2.0 - -#### The Critical Restriction - -``` -Additional Use Grant: -You may make use of the Licensed Work, provided that you do not use -the Licensed Work for a Competitive Offering. - -A "Competitive Offering" is a commercial product or service that is: -1. Substantially similar to the capabilities of the Licensed Work -2. Offered to third parties on a paid or free basis -``` - -#### What This Means for FuzzForge - -**The licensing risk depends on how FuzzForge is marketed and positioned:** - -##### ✅ LIKELY SAFE: Specific Use Case Platform - -If FuzzForge is marketed as a **specialized platform** for specific domains: - -**Examples:** -- ✅ "FuzzForge - Security Analysis Platform" -- ✅ "FuzzForge - Automated Fuzzing Service" -- ✅ "FuzzForge - Code Analysis Tooling" -- ✅ "FuzzForge - Vulnerability Assessment Platform" - -**Why Safe:** -- Nomad is used **internally** for infrastructure -- Customer is buying **fuzzing/security services**, not orchestration -- Platform's value is the **domain expertise**, not the scheduler -- Not competing with HashiCorp's offerings - -##### ⚠️ GRAY AREA: Generic Workflow Platform - -If FuzzForge pivots to emphasize **generic workflow capabilities**: - -**Examples:** -- ⚠️ "FuzzForge - Workflow Orchestration Platform" -- ⚠️ "FuzzForge - Run any containerized workload" -- ⚠️ "FuzzForge - Generic task scheduler" -- ⚠️ Marketing that emphasizes "powered by Nomad" - -**Why Risky:** -- Could be seen as competing with Nomad Enterprise -- Offering similar capabilities to HashiCorp's products -- Customer might use it as Nomad replacement - -##### ❌ CLEARLY VIOLATES: Orchestration-as-a-Service - -If FuzzForge becomes primarily an **orchestration product**: - -**Examples:** -- ❌ "FuzzForge Orchestrator - Schedule any workload" -- ❌ "Nomad-as-a-Service powered by FuzzForge" -- ❌ "Generic container orchestration platform" -- ❌ Reselling Nomad capabilities with thin wrapper - -**Why Violation:** -- Directly competing with HashiCorp Nomad offerings -- "Substantially similar" to Nomad's capabilities -- Commercial offering of orchestration - -#### Real-World Precedents - -**HashiCorp has NOT** (as of 2025) aggressively enforced BSL against companies using their tools internally. The restriction targets: -- Cloud providers offering "managed Nomad" services -- Companies building Nomad competitors -- Vendors reselling HashiCorp functionality - -**NOT targeting:** -- Companies using Nomad for internal infrastructure -- SaaS platforms that happen to use Nomad -- Domain-specific platforms (like FuzzForge's security focus) - -#### Decision Tree: Should I Use Nomad? - -``` -┌─────────────────────────────────────┐ -│ Is orchestration your core product? │ -└─────────────────────────────────────┘ - │ - ┌────────┴────────┐ - │ │ - YES NO - │ │ - ┌────┴────┐ ┌────┴────┐ - │ DON'T │ │ What's │ - │ USE │ │ your │ - │ NOMAD │ │ value │ - │ │ │ prop? │ - └─────────┘ └─────┬────┘ - │ - ┌───────────┴───────────┐ - │ │ - Domain Expertise Orchestration Features - (Fuzzing, Security) (Scheduling, Auto-scale) - │ │ - ┌────┴────┐ ┌────┴────┐ - │ SAFE TO │ │ RISKY - │ - │ USE │ │ CONSULT │ - │ NOMAD │ │ LAWYER │ - └─────────┘ └─────────┘ -``` - -#### FuzzForge Current Position - -**Current Positioning:** Domain-specific security/analysis platform -**Nomad Usage:** Internal infrastructure (not customer-facing) -**Risk Level:** **LOW** (likely safe) - -**However**, user stated: _"modules and workflows could be anything"_ - this suggests potential future expansion beyond security domain. - -**If FuzzForge pivots to generic platform:** -- Risk increases from LOW → MEDIUM -- Need legal review before Phase 3 (Nomad migration) -- Consider Kubernetes as alternative - ---- - -### Kubernetes Licensing: ✅ SAFE - -**License:** Apache License 2.0 - -**Status:** Fully open source, zero restrictions - -**Commercial Use:** -- ✅ Use in production -- ✅ Sell services built on Kubernetes -- ✅ Modify source code -- ✅ Offer managed Kubernetes (AWS EKS, GCP GKE do this) -- ✅ Build competitive offerings - -**Conclusion:** Kubernetes has **no licensing concerns** whatsoever, even for orchestration-as-a-service offerings. - ---- - -### Docker Licensing: ✅ SAFE - -**License:** Apache License 2.0 - -**Status:** Fully open source - -**Note:** Docker Desktop has separate commercial licensing requirements for organizations >250 employees or >$10M revenue, but Docker Engine (which FuzzForge uses) remains free for all uses. - ---- - -### Licensing Recommendation Matrix - -| Component | License | FuzzForge Risk | Recommendation | -|-----------|---------|----------------|----------------| -| **Temporal** | MIT | ✅ None | Use freely | -| **Docker Engine** | Apache 2.0 | ✅ None | Use freely | -| **Nomad** | BSL 1.1 | ⚠️ Low-Medium | Safe if domain-specific | -| **Kubernetes** | Apache 2.0 | ✅ None | Safe alternative to Nomad | - ---- - -### Recommendations by Phase - -#### Phase 1 & 2: Temporal + Docker Compose - -**Licenses:** MIT (Temporal) + Apache 2.0 (Docker) -**Risk:** ✅ **ZERO** - Fully safe for any use case - -**Action:** Proceed without legal review required - ---- - -#### Phase 3: Adding Nomad (18+ months) - -**License:** BSL 1.1 -**Risk:** ⚠️ **LOW-MEDIUM** - Depends on positioning - -**Action Required BEFORE Migration:** - -1. **Clarify Product Positioning** - - Will FuzzForge market as generic platform? - - Or remain domain-specific (security/fuzzing)? - -2. **Legal Review** (Recommended) - - Consult IP lawyer familiar with BSL - - Show marketing materials, website copy - - Get written opinion on BSL compliance - - Cost: $2,000-5,000 (one-time) - -3. **Decision Point:** - ``` - IF positioning = domain-specific (security/fuzzing) - THEN proceed with Nomad (low risk) - - ELSE IF positioning = generic platform - THEN consider Kubernetes instead (zero risk) - ``` - ---- - -#### Alternative: Use Kubernetes Instead of Nomad - -**If concerned about Nomad BSL risk:** - -**Pros:** -- ✅ Zero licensing risk (Apache 2.0) -- ✅ Can offer orchestration-as-a-service freely -- ✅ Larger ecosystem and community -- ✅ Managed offerings on all clouds - -**Cons:** -- ❌ Higher operational complexity than Nomad -- ❌ Overkill for batch workload use case -- ❌ Steeper learning curve - -**When to Choose K8s Over Nomad:** -- Planning to market as generic platform -- Uncomfortable with BSL restrictions -- Need absolute licensing certainty -- Have K8s expertise already - ---- - -### Licensing Risk Summary - -| Scenario | Temporal | Docker | Nomad | Kubernetes | -|----------|----------|--------|-------|------------| -| **Security platform (current)** | ✅ Safe | ✅ Safe | ✅ Safe | ✅ Safe | -| **Generic workflow platform** | ✅ Safe | ✅ Safe | ⚠️ Risky | ✅ Safe | -| **Orchestration-as-a-service** | ✅ Safe | ✅ Safe | ❌ Violation | ✅ Safe | - ---- - -### Key Takeaways - -1. **Temporal is completely safe** - MIT license has zero restrictions for any use case - -2. **Nomad's BSL depends on positioning**: - - ✅ Safe for domain-specific platforms (security, fuzzing) - - ⚠️ Risky for generic workflow platforms - - ❌ Violation for orchestration-as-a-service - -3. **User's statement matters**: _"modules could be anything"_ suggests generic platform potential → increases Nomad risk - -4. **Mitigation strategies**: - - Keep marketing focused on domain expertise - - Get legal review before Phase 3 (Nomad) - - Alternative: Use Kubernetes (Apache 2.0) instead - -5. **Decision timing**: No urgency - Nomad decision is 18+ months away (Phase 3) - -6. **Recommended approach**: - ``` - Now → Phase 1-2: Temporal + Docker Compose (zero risk) - 18 months → Phase 3: Re-evaluate positioning - → Domain-specific? Use Nomad - → Generic platform? Use Kubernetes - ``` - ---- - -## Recommendation - -### Primary Recommendation: **PROCEED WITH TEMPORAL MIGRATION** - -**Confidence Level:** High (8/10) - -### Rationale - -1. **Technical Benefits Outweigh Costs** - - 83% infrastructure reduction - - 44% resource savings - - Clear scaling path - - Better reliability - -2. **Manageable Risks** - - Low-medium risk profile - - Good mitigation strategies - - Rollback plan exists - - Module system preserved - -3. **Right Timing** - - Before production scale makes migration harder - - Team capacity available - - Module architecture stable - - Clear 8-week timeline - -4. **Future-Proof** - - Easy Nomad migration when needed - - Multi-host ready (storage abstraction) - - Industry-proven technology - - Growing ecosystem - -### Phased Approach - -**Immediate (Now):** -- ✅ Approve Temporal migration -- ✅ Allocate 2 engineers for 8 weeks -- ✅ Set Week 1 start date - -**Near-Term (Months 1-6):** -- ✅ Complete Temporal migration -- ✅ Validate in production -- ✅ Optimize performance - -**Mid-Term (Months 6-18):** -- ⏳ Monitor scaling needs -- ⏳ Implement S3 storage if needed -- ⏳ Expand to multi-host if needed - -**Long-Term (Months 18+):** -- ⏳ Evaluate Nomad necessity -- ⏳ Migrate to Nomad if triggers met -- ⏳ Continue scaling horizontally - -### Decision Criteria - -**Proceed with Migration if:** -- ✅ Team agrees on benefits (CHECK) -- ✅ 8-week timeline acceptable (CHECK) -- ✅ Resources available (CHECK) -- ✅ Risk profile acceptable (CHECK) - -**Defer Migration if:** -- ❌ Critical features launching soon (DEPENDS) -- ❌ Team capacity constrained (DEPENDS) -- ❌ Major Prefect improvements announced (UNLIKELY) - -### Alternative: Start Smaller - -**If full migration seems risky:** - -1. **Proof of Concept (2 weeks)** - - Migrate one simple workflow - - Validate Temporal locally - - Assess complexity - - Decision point: Continue or abort - -2. **Parallel Run (4 weeks)** - - Run Temporal alongside Prefect - - Duplicate one workflow - - Compare results - - Build confidence - -3. **Full Migration (6 weeks)** - - If POC successful, proceed - - Migrate remaining workflows - - Decommission Prefect - -**Total:** 12 weeks (vs 8 weeks direct) - ---- - -## Appendix: Quick Reference - -### One-Page Summary - -**WHAT:** Migrate from Prefect to Temporal -**WHY:** Simpler (6 services → 1), more scalable, better reliability -**WHEN:** Now (8 weeks) -**WHO:** 2 engineers -**COST:** $430/month (vs $700 current) = 39% savings -**RISK:** Medium-Low (manageable) -**OUTCOME:** Production-ready infrastructure with clear scaling path - -### Key Metrics - -| Metric | Current | Future | Change | -|--------|---------|--------|--------| -| Services | 6 | 1 | -83% | -| Memory | 8GB | 4.5GB | -44% | -| Cost | $700/mo | $430/mo | -39% | -| Capacity | 10K/day | 10K/day | Same (Phase 1) | -| Dev Time | 6h/week | 3.5h/week | -42% | - -### Decision Checklist - -- [ ] Review this document with team -- [ ] Discuss concerns and questions -- [ ] Vote: Proceed / Defer / Reject -- [ ] If proceed: Assign engineers -- [ ] If proceed: Set start date -- [ ] If defer: Set review date (3 months) -- [ ] If reject: Document reasons - ---- - -**Document Version:** 1.0 -**Last Updated:** 2025-09-30 -**Next Review:** After decision or in 3 months diff --git a/ai/README.md b/ai/README.md index 36f1f2f..254fdd2 100644 --- a/ai/README.md +++ b/ai/README.md @@ -1,6 +1,6 @@ # FuzzForge AI Module -FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge security platform through natural language. It orchestrates local tooling, registered Agent-to-Agent (A2A) peers, and the Prefect-powered backend while keeping long-running context in memory and project knowledge graphs. +FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge security platform through natural language. It orchestrates local tooling, registered Agent-to-Agent (A2A) peers, and the Temporal-powered backend while keeping long-running context in memory and project knowledge graphs. ## Quick Start @@ -32,7 +32,7 @@ FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge securi ```bash fuzzforge ai agent ``` - Keep the backend running (Prefect API at `FUZZFORGE_MCP_URL`) so workflow commands succeed. + Keep the backend running (Temporal API at `FUZZFORGE_MCP_URL`) so workflow commands succeed. ## Everyday Workflow @@ -61,7 +61,7 @@ Inside `fuzzforge ai agent` you can mix slash commands and free-form prompts: /sendfile SecurityAgent src/report.md "Please review" You> route_to SecurityAnalyzer: scan ./backend for secrets You> run fuzzforge workflow static_analysis_scan on ./test_projects/demo -You> search project knowledge for "prefect status" using INSIGHTS +You> search project knowledge for "temporal status" using INSIGHTS ``` Artifacts created during the conversation are served from `.fuzzforge/artifacts/` and exposed through the A2A HTTP API. @@ -84,7 +84,7 @@ Use these to validate the setup once the agent shell is running: - `run fuzzforge workflow static_analysis_scan on ./backend with target_branch=main` - `show findings for that run once it finishes` - `refresh the project knowledge graph for ./backend` -- `search project knowledge for "prefect readiness" using INSIGHTS` +- `search project knowledge for "temporal readiness" using INSIGHTS` - `/recall terraform secrets` - `/memory status` - `ROUTE_TO SecurityAnalyzer: audit infrastructure_vulnerable` diff --git a/ai/src/fuzzforge_ai/agent_executor.py b/ai/src/fuzzforge_ai/agent_executor.py index f66e6f2..0a858f0 100644 --- a/ai/src/fuzzforge_ai/agent_executor.py +++ b/ai/src/fuzzforge_ai/agent_executor.py @@ -841,15 +841,15 @@ class FuzzForgeExecutor: elif normalised_mode in {"read_write", "readwrite", "rw"}: normalised_mode = "rw" else: - # Fall back to Prefect defaults if we can't recognise the input + # Fall back to read-only if we can't recognise the input normalised_mode = "ro" - # Resolve the target path to an absolute path for Prefect's validation + # Resolve the target path to an absolute path for validation resolved_path = target_path or "." try: resolved_path = str(Path(resolved_path).expanduser().resolve()) except Exception: - # If resolution fails, Prefect will surface the validation error – use the raw value + # If resolution fails, use the raw value resolved_path = target_path # Ensure configuration objects default to dictionaries instead of None diff --git a/backend/toolbox/workflows/security_assessment/metadata.yaml b/backend/toolbox/workflows/security_assessment/metadata.yaml index 9d79a1f..572e50c 100644 --- a/backend/toolbox/workflows/security_assessment/metadata.yaml +++ b/backend/toolbox/workflows/security_assessment/metadata.yaml @@ -1,6 +1,6 @@ name: security_assessment version: "2.0.0" -vertical: rust +vertical: python description: "Comprehensive security assessment workflow that scans files, analyzes code for vulnerabilities, and generates SARIF reports" author: "FuzzForge Team" tags: diff --git a/docs/docs/ai/a2a-services.md b/docs/docs/ai/a2a-services.md index aac4c94..694be54 100644 --- a/docs/docs/ai/a2a-services.md +++ b/docs/docs/ai/a2a-services.md @@ -68,7 +68,7 @@ Response excerpt: - Call `POST /graph/query` to explore project knowledge. - Call `POST /project/files` to fetch raw files from the repository. - Download finished scan summaries with `GET /artifacts/{id}`. -4. The AI module pushes Prefect workflow results into artifacts automatically, so remote agents can poll without re-running scans. +4. The AI module pushes Temporal workflow results into artifacts automatically, so remote agents can poll without re-running scans. ## Registration Flow @@ -129,7 +129,7 @@ sequenceDiagram participant Remote as Remote Agent participant HTTP as A2A Server participant Exec as Executor - participant Workflow as Prefect Backend + participant Workflow as Temporal Backend Remote->>HTTP: POST / (message with tool request) HTTP->>Exec: Forward message diff --git a/docs/docs/ai/architecture.md b/docs/docs/ai/architecture.md index 60f334b..eea821b 100644 --- a/docs/docs/ai/architecture.md +++ b/docs/docs/ai/architecture.md @@ -1,6 +1,6 @@ # AI Architecture -FuzzForge AI is the orchestration layer that lets large language models drive the broader security platform. Built on the Google ADK runtime, the module coordinates local tools, remote Agent-to-Agent (A2A) peers, and Prefect-backed workflows while persisting long-running context for every project. +FuzzForge AI is the orchestration layer that lets large language models drive the broader security platform. Built on the Google ADK runtime, the module coordinates local tools, remote Agent-to-Agent (A2A) peers, and Temporal-backed workflows while persisting long-running context for every project. ## System Diagram @@ -27,7 +27,7 @@ graph TB Executor --> Prompts[Prompt Templates] Router --> RemoteAgents[Registered A2A Agents] - MCP --> Prefect[FuzzForge Backend] + MCP --> Temporal[FuzzForge Backend] Memory --> SessionDB[Session Store] Memory --> Semantic[Semantic Recall] Memory --> Graphs[Cognee Graph] @@ -44,7 +44,7 @@ sequenceDiagram participant CLI as CLI / HTTP Surface participant Exec as FuzzForgeExecutor participant ADK as ADK Runner - participant Prefect as Prefect Backend + participant Temporal as Temporal Backend participant Cognee as Cognee participant Artifact as Artifact Cache @@ -52,8 +52,8 @@ sequenceDiagram CLI->>Exec: Normalised request + context ID Exec->>ADK: Tool invocation (LiteLLM) ADK-->>Exec: Structured response / tool result - Exec->>Prefect: (optional) submit workflow via MCP - Prefect-->>Exec: Run status updates + Exec->>Temporal: (optional) submit workflow via MCP + Temporal-->>Exec: Run status updates Exec->>Cognee: (optional) knowledge query / ingestion Cognee-->>Exec: Graph results Exec->>Artifact: Persist generated files @@ -69,7 +69,7 @@ sequenceDiagram ## Core Components - **FuzzForgeAgent** (`ai/src/fuzzforge_ai/agent.py`) assembles the runtime: it loads environment variables, constructs the executor, and builds an ADK `Agent` backed by `LiteLlm`. The singleton accessor `get_fuzzforge_agent()` keeps CLI and server instances aligned and shares the generated agent card. -- **FuzzForgeExecutor** (`ai/src/fuzzforge_ai/agent_executor.py`) is the brain. It registers tools, manages session storage (SQLite or in-memory via `DatabaseSessionService` / `InMemorySessionService`), and coordinates artifact storage. The executor also tracks long-running Prefect workflows inside `pending_runs`, produces `TaskStatusUpdateEvent` objects, and funnels every response through ADK’s `Runner` so traces include tool metadata. +- **FuzzForgeExecutor** (`ai/src/fuzzforge_ai/agent_executor.py`) is the brain. It registers tools, manages session storage (SQLite or in-memory via `DatabaseSessionService` / `InMemorySessionService`), and coordinates artifact storage. The executor also tracks long-running Temporal workflows inside `pending_runs`, produces `TaskStatusUpdateEvent` objects, and funnels every response through ADK’s `Runner` so traces include tool metadata. - **Remote agent registry** (`ai/src/fuzzforge_ai/remote_agent.py`) holds metadata for downstream agents and handles capability discovery over HTTP. Auto-registration is configured by `ConfigManager` so known agents attach on startup. - **Memory services**: - `FuzzForgeMemoryService` and `HybridMemoryManager` (`ai/src/fuzzforge_ai/memory_service.py`) provide conversation recall and bridge to Cognee datasets when configured. @@ -77,15 +77,15 @@ sequenceDiagram ## Workflow Automation -The executor wraps Prefect MCP actions exposed by the backend: +The executor wraps Temporal MCP actions exposed by the backend: | Tool | Source | Purpose | | --- | --- | --- | | `list_workflows_mcp` | `ai/src/fuzzforge_ai/agent_executor.py` | Enumerate available scans | | `submit_security_scan_mcp` | `agent_executor.py` | Launch a scan and persist run metadata | -| `get_run_status_mcp` | `agent_executor.py` | Poll Prefect for status and push task events | +| `get_run_status_mcp` | `agent_executor.py` | Poll Temporal for status and push task events | | `get_comprehensive_scan_summary` | `agent_executor.py` | Collect findings and bundle artifacts | -| `get_backend_status_mcp` | `agent_executor.py` | Block submissions until Prefect reports `ready` | +| `get_backend_status_mcp` | `agent_executor.py` | Block submissions until Temporal reports `ready` | The CLI surface mirrors these helpers as natural-language prompts (`You> run fuzzforge workflow …`). ADK’s `Runner` handles retries and ensures each tool call yields structured `Event` objects for downstream instrumentation. diff --git a/docs/docs/ai/configuration.md b/docs/docs/ai/configuration.md index cb42783..2da0c11 100644 --- a/docs/docs/ai/configuration.md +++ b/docs/docs/ai/configuration.md @@ -87,7 +87,7 @@ If the Cognee variables are omitted, graph-specific tools remain available but r FUZZFORGE_MCP_URL=http://localhost:8010/mcp ``` -The agent uses this endpoint to list, launch, and monitor Prefect workflows. +The agent uses this endpoint to list, launch, and monitor Temporal workflows. ## Tracing & Observability diff --git a/docs/docs/ai/ingestion.md b/docs/docs/ai/ingestion.md index 0af3c9e..8e7ad58 100644 --- a/docs/docs/ai/ingestion.md +++ b/docs/docs/ai/ingestion.md @@ -53,7 +53,7 @@ All runs automatically skip `.fuzzforge/**` and `.git/**` to avoid recursive ing You> refresh the project knowledge graph for ./backend Assistant> Kicks off `fuzzforge ingest` with recursive scan -You> search project knowledge for "prefect workflow" using INSIGHTS +You> search project knowledge for "temporal workflow" using INSIGHTS Assistant> Routes to Cognee `search_project_knowledge` You> ingest_to_dataset("Design doc for new scanner", "insights") @@ -70,7 +70,7 @@ LLM_PROVIDER=openai LITELLM_MODEL=gpt-5-mini OPENAI_API_KEY=sk-your-key -# FuzzForge backend (Prefect-powered) +# FuzzForge backend (Temporal-powered) FUZZFORGE_MCP_URL=http://localhost:8010/mcp # Optional: knowledge graph provider diff --git a/docs/docs/ai/intro.md b/docs/docs/ai/intro.md index 073c4b1..491e200 100644 --- a/docs/docs/ai/intro.md +++ b/docs/docs/ai/intro.md @@ -4,7 +4,7 @@ sidebar_position: 1 # FuzzForge AI Module -FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge security platform through natural language. It orchestrates local tooling, registered Agent-to-Agent (A2A) peers, and the Prefect-powered backend while keeping long-running context in memory and project knowledge graphs. +FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge security platform through natural language. It orchestrates local tooling, registered Agent-to-Agent (A2A) peers, and the Temporal-powered backend while keeping long-running context in memory and project knowledge graphs. ## Quick Start @@ -36,7 +36,7 @@ FuzzForge AI is the multi-agent layer that lets you operate the FuzzForge securi ```bash fuzzforge ai agent ``` - Keep the backend running (Prefect API at `FUZZFORGE_MCP_URL`) so workflow commands succeed. + Keep the backend running (Temporal API at `FUZZFORGE_MCP_URL`) so workflow commands succeed. ## Everyday Workflow @@ -65,7 +65,7 @@ Inside `fuzzforge ai agent` you can mix slash commands and free-form prompts: /sendfile SecurityAgent src/report.md "Please review" You> route_to SecurityAnalyzer: scan ./backend for secrets You> run fuzzforge workflow static_analysis_scan on ./test_projects/demo -You> search project knowledge for "prefect status" using INSIGHTS +You> search project knowledge for "temporal status" using INSIGHTS ``` Artifacts created during the conversation are served from `.fuzzforge/artifacts/` and exposed through the A2A HTTP API. @@ -88,7 +88,7 @@ Use these to validate the setup once the agent shell is running: - `run fuzzforge workflow static_analysis_scan on ./backend with target_branch=main` - `show findings for that run once it finishes` - `refresh the project knowledge graph for ./backend` -- `search project knowledge for "prefect readiness" using INSIGHTS` +- `search project knowledge for "temporal readiness" using INSIGHTS` - `/recall terraform secrets` - `/memory status` - `ROUTE_TO SecurityAnalyzer: audit infrastructure_vulnerable` diff --git a/docs/docs/ai/prompts.md b/docs/docs/ai/prompts.md index 8649b7f..7ac5859 100644 --- a/docs/docs/ai/prompts.md +++ b/docs/docs/ai/prompts.md @@ -33,7 +33,7 @@ Assistant> Streams the `get_comprehensive_scan_summary` output and attaches the You> refresh the project knowledge graph for ./backend Assistant> Launches `fuzzforge ingest --path ./backend --recursive` and reports file counts. -You> search project knowledge for "prefect readiness" using INSIGHTS +You> search project knowledge for "temporal readiness" using INSIGHTS Assistant> Routes to Cognee via `query_project_knowledge_api` and returns the top matches. You> recall "api key rotation" @@ -52,7 +52,7 @@ Assistant> Uploads the file as an artifact and notifies the remote agent. ## Prompt Tips -- Use explicit verbs (`list`, `run`, `search`) to trigger the Prefect workflow helpers. +- Use explicit verbs (`list`, `run`, `search`) to trigger the Temporal workflow helpers. - Include parameter names inline (`with target_branch=main`) so the executor maps values to MCP tool inputs without additional clarification. - When referencing prior runs, reuse the assistant’s run IDs or ask for "the last run"—the session store tracks them per context ID. - If Cognee is not configured, graph queries return a friendly notice; set `LLM_COGNEE_*` variables to enable full answers. diff --git a/docs/docs/concept/architecture.md b/docs/docs/concept/architecture.md index b4fcced..a7e7429 100644 --- a/docs/docs/concept/architecture.md +++ b/docs/docs/concept/architecture.md @@ -25,9 +25,9 @@ At a glance, FuzzForge is organized into several layers, each with a clear respo - **Client Layer:** Where users and external systems interact (CLI, API clients, MCP server). - **API Layer:** The FastAPI backend, which exposes REST endpoints and manages requests. -- **Orchestration Layer:** Prefect server and workers, which schedule and execute workflows. -- **Execution Layer:** Docker Engine and containers, where workflows actually run. -- **Storage Layer:** PostgreSQL database, Docker volumes, and a result cache for persistence. +- **Orchestration Layer:** Temporal server and vertical workers, which schedule and execute workflows. +- **Execution Layer:** Long-lived vertical worker containers with pre-installed toolchains, where workflows run. +- **Storage Layer:** PostgreSQL database, MinIO (S3-compatible storage), and worker cache for persistence. Here’s a simplified view of how these layers fit together: @@ -46,8 +46,8 @@ graph TB end subgraph "Orchestration Layer" - Prefect[Prefect Server] - Workers[Prefect Workers] + Temporal[Temporal Server] + Workers[Vertical Workers] Scheduler[Workflow Scheduler] end @@ -69,9 +69,9 @@ graph TB FastAPI --> Router Router --> Middleware - Middleware --> Prefect + Middleware --> Temporal - Prefect --> Workers + Temporal --> Workers Workers --> Scheduler Scheduler --> Docker diff --git a/docs/docs/how-to/create-workflow.md b/docs/docs/how-to/create-workflow.md index f964e63..4a97c91 100644 --- a/docs/docs/how-to/create-workflow.md +++ b/docs/docs/how-to/create-workflow.md @@ -363,12 +363,12 @@ class DependencyAnalysisWorkflow: return sarif_report ``` -**Key differences from Prefect:** -- Use `@workflow.defn` class instead of `@flow` function -- Use `@activity.defn` instead of `@task` -- Must call `get_target` activity to download from MinIO with isolation mode +**Key Temporal Workflow Concepts:** +- Use `@workflow.defn` class decorator to define workflows +- Use `@activity.defn` decorator for activity functions +- Call `get_target` activity to download targets from MinIO with workspace isolation - Use `workflow.execute_activity()` with explicit timeouts and retry policies -- Use `workflow.logger` for logging (appears in Temporal UI) +- Use `workflow.logger` for logging (appears in Temporal UI and backend logs) - Call `cleanup_cache` activity at end to clean up workspace --- diff --git a/docs/docs/how-to/mcp-integration.md b/docs/docs/how-to/mcp-integration.md index 79a5506..67c5a52 100644 --- a/docs/docs/how-to/mcp-integration.md +++ b/docs/docs/how-to/mcp-integration.md @@ -204,7 +204,7 @@ curl -X POST http://localhost:8000/workflows/infrastructure_scan/submit \ │ │ ▼ ▼ ┌──────────────────┐ ┌─────────────────┐ - │ MCP Tools │ │ Prefect │ + │ MCP Tools │ │ Temporal │ │ - scan submit │ │ Workflows │ │ - results │ │ - Security │ │ - analysis │ │ - Fuzzing │ diff --git a/docs/index.md b/docs/index.md index 8e30cb8..fc2a6a8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # FuzzForge Documentation -Welcome to FuzzForge, a comprehensive security analysis platform built on Prefect 3 that automates security testing workflows. FuzzForge provides 6 production-ready workflows that run static analysis, secret detection, infrastructure scanning, penetration testing, and custom fuzzing campaigns with Docker-based isolation and SARIF-compliant reporting. +Welcome to FuzzForge, a comprehensive security analysis platform built on Temporal that automates security testing workflows. FuzzForge provides production-ready workflows that run static analysis, secret detection, infrastructure scanning, penetration testing, and custom fuzzing campaigns with Docker-based isolation and SARIF-compliant reporting. ## 🚀 Quick Navigation diff --git a/sdk/src/fuzzforge_sdk/docker_logs.py b/sdk/src/fuzzforge_sdk/docker_logs.py deleted file mode 100644 index cdc158a..0000000 --- a/sdk/src/fuzzforge_sdk/docker_logs.py +++ /dev/null @@ -1,387 +0,0 @@ -""" -Docker log integration for enhanced error reporting. - -This module provides functionality to fetch and parse Docker container logs -to provide better context for deployment and workflow execution errors. -""" -# Copyright (c) 2025 FuzzingLabs -# -# Licensed under the Business Source License 1.1 (BSL). See the LICENSE file -# at the root of this repository for details. -# -# After the Change Date (four years from publication), this version of the -# Licensed Work will be made available under the Apache License, Version 2.0. -# See the LICENSE-APACHE file or http://www.apache.org/licenses/LICENSE-2.0 -# -# Additional attribution and requirements are provided in the NOTICE file. - - -import logging -import re -import subprocess -import json -from typing import Dict, Any, List, Optional -from datetime import datetime, timezone -from dataclasses import dataclass - -logger = logging.getLogger(__name__) - - -@dataclass -class ContainerLogEntry: - """A single log entry from a container.""" - timestamp: datetime - level: str - message: str - stream: str # 'stdout' or 'stderr' - raw: str - - -@dataclass -class ContainerDiagnostics: - """Complete diagnostics for a container.""" - container_id: Optional[str] - status: str - exit_code: Optional[int] - error: Optional[str] - logs: List[ContainerLogEntry] - resource_usage: Dict[str, Any] - volume_mounts: List[Dict[str, str]] - - -class DockerLogIntegration: - """ - Integration with Docker to fetch container logs and diagnostics. - - This class provides methods to fetch container logs, parse common error - patterns, and extract meaningful diagnostic information from Docker - containers related to FuzzForge workflow execution. - """ - - def __init__(self): - self.docker_available = self._check_docker_availability() - - # Common error patterns in container logs - self.error_patterns = { - 'permission_denied': [ - r'permission denied', - r'operation not permitted', - r'cannot access.*permission denied' - ], - 'out_of_memory': [ - r'out of memory', - r'oom killed', - r'cannot allocate memory' - ], - 'image_pull_failed': [ - r'failed to pull image', - r'pull access denied', - r'image not found' - ], - 'volume_mount_failed': [ - r'invalid mount config', - r'mount denied', - r'no such file or directory.*mount' - ], - 'network_error': [ - r'network is unreachable', - r'connection refused', - r'timeout.*connect' - ] - } - - def _check_docker_availability(self) -> bool: - """Check if Docker is available and accessible.""" - try: - result = subprocess.run(['docker', 'version', '--format', 'json'], - capture_output=True, text=True, timeout=5) - return result.returncode == 0 - except (subprocess.TimeoutExpired, FileNotFoundError, subprocess.SubprocessError): - return False - - def get_container_logs(self, container_name_or_id: str, tail: int = 100) -> List[ContainerLogEntry]: - """ - Fetch logs from a Docker container. - - Args: - container_name_or_id: Container name or ID - tail: Number of log lines to retrieve - - Returns: - List of parsed log entries - """ - if not self.docker_available: - logger.warning("Docker not available, cannot fetch container logs") - return [] - - try: - cmd = ['docker', 'logs', '--timestamps', '--tail', str(tail), container_name_or_id] - result = subprocess.run(cmd, capture_output=True, text=True, timeout=10) - - if result.returncode != 0: - logger.error(f"Failed to fetch logs for container {container_name_or_id}: {result.stderr}") - return [] - - return self._parse_docker_logs(result.stdout + result.stderr) - - except subprocess.TimeoutExpired: - logger.error(f"Timeout fetching logs for container {container_name_or_id}") - return [] - except Exception as e: - logger.error(f"Error fetching container logs: {e}") - return [] - - def _parse_docker_logs(self, raw_logs: str) -> List[ContainerLogEntry]: - """Parse raw Docker logs into structured entries.""" - entries = [] - - for line in raw_logs.strip().split('\n'): - if not line.strip(): - continue - - entry = self._parse_log_line(line) - if entry: - entries.append(entry) - - return entries - - def _parse_log_line(self, line: str) -> Optional[ContainerLogEntry]: - """Parse a single log line with timestamp.""" - # Docker log format: 2023-10-01T12:00:00.000000000Z message - timestamp_match = re.match(r'^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s+(.*)', line) - - if timestamp_match: - timestamp_str, message = timestamp_match.groups() - try: - timestamp = datetime.fromisoformat(timestamp_str.replace('Z', '+00:00')) - except ValueError: - timestamp = datetime.now(timezone.utc) - else: - timestamp = datetime.now(timezone.utc) - message = line - - # Determine log level from message content - level = self._extract_log_level(message) - - # Determine stream (simplified - Docker doesn't clearly separate in combined output) - stream = 'stderr' if any(keyword in message.lower() for keyword in ['error', 'failed', 'exception']) else 'stdout' - - return ContainerLogEntry( - timestamp=timestamp, - level=level, - message=message.strip(), - stream=stream, - raw=line - ) - - def _extract_log_level(self, message: str) -> str: - """Extract log level from message content.""" - message_lower = message.lower() - - if any(keyword in message_lower for keyword in ['error', 'failed', 'exception', 'fatal']): - return 'ERROR' - elif any(keyword in message_lower for keyword in ['warning', 'warn']): - return 'WARNING' - elif any(keyword in message_lower for keyword in ['info', 'information']): - return 'INFO' - elif any(keyword in message_lower for keyword in ['debug']): - return 'DEBUG' - else: - return 'INFO' - - def get_container_diagnostics(self, container_name_or_id: str) -> ContainerDiagnostics: - """ - Get complete diagnostics for a container including logs, status, and resource usage. - - Args: - container_name_or_id: Container name or ID - - Returns: - Complete container diagnostics - """ - if not self.docker_available: - return ContainerDiagnostics( - container_id=None, - status="unknown", - exit_code=None, - error="Docker not available", - logs=[], - resource_usage={}, - volume_mounts=[] - ) - - # Get container inspect data - inspect_data = self._get_container_inspect(container_name_or_id) - - # Get logs - logs = self.get_container_logs(container_name_or_id) - - # Extract key information - if inspect_data: - state = inspect_data.get('State', {}) - config = inspect_data.get('Config', {}) - host_config = inspect_data.get('HostConfig', {}) - - status = state.get('Status', 'unknown') - exit_code = state.get('ExitCode') - error = state.get('Error', '') - - # Get volume mounts - mounts = inspect_data.get('Mounts', []) - volume_mounts = [ - { - 'source': mount.get('Source', ''), - 'destination': mount.get('Destination', ''), - 'mode': mount.get('Mode', ''), - 'type': mount.get('Type', '') - } - for mount in mounts - ] - - # Get resource limits - resource_usage = { - 'memory_limit': host_config.get('Memory', 0), - 'cpu_limit': host_config.get('CpuQuota', 0), - 'cpu_period': host_config.get('CpuPeriod', 0) - } - - else: - status = "not_found" - exit_code = None - error = f"Container {container_name_or_id} not found" - volume_mounts = [] - resource_usage = {} - - return ContainerDiagnostics( - container_id=container_name_or_id, - status=status, - exit_code=exit_code, - error=error, - logs=logs, - resource_usage=resource_usage, - volume_mounts=volume_mounts - ) - - def _get_container_inspect(self, container_name_or_id: str) -> Optional[Dict[str, Any]]: - """Get container inspection data.""" - try: - cmd = ['docker', 'inspect', container_name_or_id] - result = subprocess.run(cmd, capture_output=True, text=True, timeout=5) - - if result.returncode != 0: - return None - - data = json.loads(result.stdout) - return data[0] if data else None - - except (subprocess.TimeoutExpired, json.JSONDecodeError, Exception) as e: - logger.debug(f"Failed to inspect container {container_name_or_id}: {e}") - return None - - def analyze_error_patterns(self, logs: List[ContainerLogEntry]) -> Dict[str, List[str]]: - """ - Analyze logs for common error patterns. - - Args: - logs: List of log entries to analyze - - Returns: - Dictionary mapping error types to matching log messages - """ - detected_errors = {} - - for error_type, patterns in self.error_patterns.items(): - matches = [] - - for log_entry in logs: - for pattern in patterns: - if re.search(pattern, log_entry.message, re.IGNORECASE): - matches.append(log_entry.message) - break # Don't match the same message multiple times - - if matches: - detected_errors[error_type] = matches - - return detected_errors - - def get_container_names_by_label(self, label_filter: str) -> List[str]: - """ - Get container names that match a specific label filter. - - Args: - label_filter: Label filter (e.g., "prefect.flow-run-id=12345") - - Returns: - List of container names - """ - if not self.docker_available: - return [] - - try: - cmd = ['docker', 'ps', '-a', '--filter', f'label={label_filter}', '--format', '{{.Names}}'] - result = subprocess.run(cmd, capture_output=True, text=True, timeout=5) - - if result.returncode != 0: - return [] - - return [name.strip() for name in result.stdout.strip().split('\n') if name.strip()] - - except Exception as e: - logger.debug(f"Failed to get containers by label {label_filter}: {e}") - return [] - - def suggest_fixes(self, error_analysis: Dict[str, List[str]]) -> List[str]: - """ - Suggest fixes based on detected error patterns. - - Args: - error_analysis: Result from analyze_error_patterns() - - Returns: - List of suggested fixes - """ - suggestions = [] - - if 'permission_denied' in error_analysis: - suggestions.extend([ - "Check file permissions on the target path", - "Ensure the Docker daemon has access to the mounted volumes", - "Try running with elevated privileges or adjust volume ownership" - ]) - - if 'out_of_memory' in error_analysis: - suggestions.extend([ - "Increase memory limits for the workflow", - "Check if the target files are too large for available memory", - "Consider using streaming processing for large datasets" - ]) - - if 'image_pull_failed' in error_analysis: - suggestions.extend([ - "Check network connectivity to Docker registry", - "Verify image name and tag are correct", - "Ensure Docker registry credentials are configured" - ]) - - if 'volume_mount_failed' in error_analysis: - suggestions.extend([ - "Verify the target path exists and is accessible", - "Check volume mount syntax and permissions", - "Ensure the path is not already in use by another process" - ]) - - if 'network_error' in error_analysis: - suggestions.extend([ - "Check network connectivity", - "Verify backend services are running (docker-compose up -d)", - "Check firewall settings and port availability" - ]) - - if not suggestions: - suggestions.append("Review the container logs above for specific error details") - - return suggestions - - -# Global instance for easy access -docker_integration = DockerLogIntegration() \ No newline at end of file diff --git a/sdk/src/fuzzforge_sdk/exceptions.py b/sdk/src/fuzzforge_sdk/exceptions.py index 34e5f3e..c587658 100644 --- a/sdk/src/fuzzforge_sdk/exceptions.py +++ b/sdk/src/fuzzforge_sdk/exceptions.py @@ -1,8 +1,9 @@ """ -Enhanced exceptions for FuzzForge SDK with rich context and Docker integration. +Enhanced exceptions for FuzzForge SDK with rich context. -Provides comprehensive error information including container logs, diagnostics, -and actionable suggestions for troubleshooting. +Provides comprehensive error information and actionable suggestions for troubleshooting. +Note: Container diagnostics are not available in Temporal architecture as workflows +run in long-lived worker containers rather than ephemeral per-workflow containers. """ # Copyright (c) 2025 FuzzingLabs # @@ -21,8 +22,6 @@ import re from typing import Optional, Dict, Any, List from dataclasses import dataclass, asdict -from .docker_logs import docker_integration, ContainerDiagnostics - @dataclass class ErrorContext: @@ -31,7 +30,6 @@ class ErrorContext: request_method: Optional[str] = None request_data: Optional[Dict[str, Any]] = None response_data: Optional[Dict[str, Any]] = None - container_diagnostics: Optional[ContainerDiagnostics] = None suggested_fixes: List[str] = None error_patterns: Dict[str, List[str]] = None related_run_id: Optional[str] = None @@ -62,49 +60,10 @@ class FuzzForgeError(Exception): self.context = context or ErrorContext() self.original_exception = original_exception - # Auto-populate container diagnostics if we have a run ID - if self.context.related_run_id and not self.context.container_diagnostics: - self._fetch_container_diagnostics() - - def _fetch_container_diagnostics(self): - """Fetch container diagnostics for the related run.""" - if not self.context.related_run_id: - return - - try: - # Try to find containers by Prefect run ID label - label_filter = f"prefect.flow-run-id={self.context.related_run_id}" - container_names = docker_integration.get_container_names_by_label(label_filter) - - if container_names: - # Use the most recent container - container_name = container_names[0] - diagnostics = docker_integration.get_container_diagnostics(container_name) - - # Analyze error patterns in logs - if diagnostics.logs: - error_analysis = docker_integration.analyze_error_patterns(diagnostics.logs) - suggestions = docker_integration.suggest_fixes(error_analysis) - - self.context.container_diagnostics = diagnostics - self.context.error_patterns = error_analysis - self.context.suggested_fixes.extend(suggestions) - - except Exception: - # Don't fail the main error because of diagnostics issues - pass - def get_summary(self) -> str: """Get a summary of the error with key details.""" parts = [self.message] - if self.context.container_diagnostics: - diag = self.context.container_diagnostics - if diag.status != 'running': - parts.append(f"Container status: {diag.status}") - if diag.exit_code is not None: - parts.append(f"Exit code: {diag.exit_code}") - if self.context.error_patterns: detected = list(self.context.error_patterns.keys()) parts.append(f"Detected issues: {', '.join(detected)}") @@ -153,18 +112,11 @@ class FuzzForgeHTTPError(FuzzForgeError): self.response_text = response_text def get_summary(self) -> str: - base = f"HTTP {self.status_code}: {self.message}" - - if self.context.container_diagnostics: - diag = self.context.container_diagnostics - if diag.exit_code is not None and diag.exit_code != 0: - base += f" (Container exit code: {diag.exit_code})" - - return base + return f"HTTP {self.status_code}: {self.message}" class DeploymentError(FuzzForgeHTTPError): - """Enhanced deployment errors with container diagnostics.""" + """Enhanced deployment errors.""" def __init__( self, @@ -181,23 +133,9 @@ class DeploymentError(FuzzForgeHTTPError): context.workflow_name = workflow_name - # If we have a container name, get its diagnostics immediately - if container_name: - try: - diagnostics = docker_integration.get_container_diagnostics(container_name) - context.container_diagnostics = diagnostics - - # Analyze logs for error patterns - if diagnostics.logs: - error_analysis = docker_integration.analyze_error_patterns(diagnostics.logs) - suggestions = docker_integration.suggest_fixes(error_analysis) - - context.error_patterns = error_analysis - context.suggested_fixes.extend(suggestions) - - except Exception: - # Don't fail on diagnostics - pass + # Note: Container diagnostics are not fetched in Temporal architecture. + # Workflows run in long-lived worker containers, not per-workflow containers. + # The container_name parameter is kept for backward compatibility but not used. full_message = f"Deployment failed for workflow '{workflow_name}': {message}" super().__init__(full_message, status_code, response_text, context) @@ -292,22 +230,9 @@ class ContainerError(FuzzForgeError): if context is None: context = ErrorContext() - # Immediately fetch container diagnostics - try: - diagnostics = docker_integration.get_container_diagnostics(container_name) - context.container_diagnostics = diagnostics - - # Analyze logs for patterns - if diagnostics.logs: - error_analysis = docker_integration.analyze_error_patterns(diagnostics.logs) - suggestions = docker_integration.suggest_fixes(error_analysis) - - context.error_patterns = error_analysis - context.suggested_fixes.extend(suggestions) - - except Exception: - # Don't fail on diagnostics - pass + # Note: Container diagnostics are not fetched in Temporal architecture. + # Workflows run in long-lived worker containers, not per-workflow containers. + # The container_name parameter is kept for backward compatibility but not used. full_message = f"Container error ({container_name}): {message}" if exit_code is not None: diff --git a/sdk/test_exception_handling.py b/sdk/test_exception_handling.py new file mode 100644 index 0000000..7330db0 --- /dev/null +++ b/sdk/test_exception_handling.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +""" +Quick smoke test for SDK exception handling after exceptions.py modifications. +Tests that the modified _fetch_container_diagnostics() no-op doesn't break exception flows. +""" + +import sys +from pathlib import Path + +# Add SDK to path +sdk_path = Path(__file__).parent / "src" +sys.path.insert(0, str(sdk_path)) + +from fuzzforge_sdk.exceptions import ( + FuzzForgeError, + FuzzForgeHTTPError, + WorkflowNotFoundError, + RunNotFoundError, + ErrorContext, + DeploymentError, + WorkflowExecutionError, + ValidationError, +) + + +def test_basic_import(): + """Test that all exception classes can be imported.""" + print("✓ All exception classes imported successfully") + + +def test_error_context(): + """Test ErrorContext instantiation.""" + context = ErrorContext( + url="http://localhost:8000/test", + related_run_id="test-run-123", + workflow_name="test_workflow" + ) + assert context.url == "http://localhost:8000/test" + assert context.related_run_id == "test-run-123" + assert context.workflow_name == "test_workflow" + print("✓ ErrorContext instantiation works") + + +def test_base_exception(): + """Test base FuzzForgeError.""" + context = ErrorContext(related_run_id="test-run-456") + + error = FuzzForgeError("Test error message", context=context) + + assert error.message == "Test error message" + assert error.context.related_run_id == "test-run-456" + print("✓ FuzzForgeError creation works") + + +def test_http_error(): + """Test HTTP error creation.""" + error = FuzzForgeHTTPError( + message="Test HTTP error", + status_code=500, + response_text='{"error": "Internal server error"}' + ) + + assert error.status_code == 500 + assert error.message == "Test HTTP error" + assert error.context.response_data == {"error": "Internal server error"} + print("✓ FuzzForgeHTTPError creation works") + + +def test_workflow_not_found(): + """Test WorkflowNotFoundError with suggestions.""" + error = WorkflowNotFoundError( + workflow_name="nonexistent_workflow", + available_workflows=["security_assessment", "secret_detection"] + ) + + assert error.workflow_name == "nonexistent_workflow" + assert len(error.context.suggested_fixes) > 0 + print("✓ WorkflowNotFoundError with suggestions works") + + +def test_run_not_found(): + """Test RunNotFoundError.""" + error = RunNotFoundError(run_id="missing-run-123") + + assert error.run_id == "missing-run-123" + assert error.context.related_run_id == "missing-run-123" + assert len(error.context.suggested_fixes) > 0 + print("✓ RunNotFoundError creation works") + + +def test_deployment_error(): + """Test DeploymentError.""" + error = DeploymentError( + workflow_name="test_workflow", + message="Deployment failed", + deployment_id="deploy-123", + container_name="test-container-456" # Kept for backward compatibility + ) + + assert error.workflow_name == "test_workflow" + assert error.deployment_id == "deploy-123" + print("✓ DeploymentError creation works") + + +def test_workflow_execution_error(): + """Test WorkflowExecutionError.""" + error = WorkflowExecutionError( + workflow_name="security_assessment", + run_id="run-789", + message="Execution timeout" + ) + + assert error.workflow_name == "security_assessment" + assert error.run_id == "run-789" + assert error.context.related_run_id == "run-789" + print("✓ WorkflowExecutionError creation works") + + +def test_validation_error(): + """Test ValidationError.""" + error = ValidationError( + field_name="target_path", + message="Path does not exist", + provided_value="/nonexistent/path", + expected_format="Valid directory path" + ) + + assert error.field_name == "target_path" + assert error.provided_value == "/nonexistent/path" + assert len(error.context.suggested_fixes) > 0 + print("✓ ValidationError with suggestions works") + + +def test_exception_string_representation(): + """Test exception summary and string conversion.""" + error = FuzzForgeHTTPError( + message="Test error", + status_code=404, + response_text="Not found" + ) + + summary = error.get_summary() + assert "404" in summary + assert "Test error" in summary + + str_repr = str(error) + assert str_repr == summary + print("✓ Exception string representation works") + + +def test_exception_detailed_info(): + """Test detailed error information.""" + context = ErrorContext( + url="http://localhost:8000/test", + workflow_name="test_workflow" + ) + error = FuzzForgeError("Test error", context=context) + + info = error.get_detailed_info() + assert info["message"] == "Test error" + assert info["type"] == "FuzzForgeError" + assert info["url"] == "http://localhost:8000/test" + assert info["workflow_name"] == "test_workflow" + print("✓ Exception detailed info works") + + +def main(): + """Run all tests.""" + print("\n" + "="*60) + print("SDK Exception Handling Smoke Tests") + print("="*60 + "\n") + + tests = [ + test_basic_import, + test_error_context, + test_base_exception, + test_http_error, + test_workflow_not_found, + test_run_not_found, + test_deployment_error, + test_workflow_execution_error, + test_validation_error, + test_exception_string_representation, + test_exception_detailed_info, + ] + + passed = 0 + failed = 0 + + for test_func in tests: + try: + test_func() + passed += 1 + except Exception as e: + print(f"✗ {test_func.__name__} FAILED: {e}") + failed += 1 + + print("\n" + "="*60) + print(f"Results: {passed} passed, {failed} failed") + print("="*60 + "\n") + + if failed > 0: + print("❌ SDK exception handling has issues") + return 1 + else: + print("✅ SDK exception handling works correctly") + print("✅ The no-op _fetch_container_diagnostics() doesn't break exception flows") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test_projects/rust_fuzz_test/cargo-results.sarif b/test_projects/rust_fuzz_test/cargo-results.sarif deleted file mode 100644 index 9e4208e..0000000 --- a/test_projects/rust_fuzz_test/cargo-results.sarif +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - "runs": [], - "version": "2.1.0" -} \ No newline at end of file diff --git a/test_projects/rust_fuzz_test/fuzz/Cargo.toml b/test_projects/rust_fuzz_test/fuzz/Cargo.toml index e107442..b28a2c1 100644 --- a/test_projects/rust_fuzz_test/fuzz/Cargo.toml +++ b/test_projects/rust_fuzz_test/fuzz/Cargo.toml @@ -26,3 +26,10 @@ path = "fuzz_targets/fuzz_divide.rs" test = false doc = false bench = false + +[[bin]] +name = "fuzz_waterfall" +path = "fuzz_targets/fuzz_waterfall.rs" +test = false +doc = false +bench = false diff --git a/test_projects/rust_fuzz_test/src/lib.rs b/test_projects/rust_fuzz_test/src/lib.rs index 179ed11..3f271d9 100644 --- a/test_projects/rust_fuzz_test/src/lib.rs +++ b/test_projects/rust_fuzz_test/src/lib.rs @@ -41,6 +41,73 @@ pub fn divide_numbers(data: &[u8]) -> Option { Some(a / b) } +/// Waterfall vulnerability: checks secret character by character +/// This is a classic sequential comparison vulnerability that creates +/// distinct code paths for coverage-guided fuzzing to discover. +pub fn check_secret_waterfall(data: &[u8]) -> usize { + const SECRET: &[u8] = b"FUZZINGLABS"; + + if data.is_empty() { + return 0; + } + + let mut matches = 0; + + // Check each character sequentially + // Each comparison creates a distinct code path for coverage guidance + for i in 0..std::cmp::min(data.len(), SECRET.len()) { + if data[i] != SECRET[i] { + // Wrong character - stop checking + return matches; + } + + matches += 1; + + // Add explicit comparisons to help coverage-guided fuzzing + // Each comparison creates a distinct code path for the fuzzer to detect + if matches >= 1 && data[0] == b'F' { + // F + } + if matches >= 2 && data[1] == b'U' { + // FU + } + if matches >= 3 && data[2] == b'Z' { + // FUZ + } + if matches >= 4 && data[3] == b'Z' { + // FUZZ + } + if matches >= 5 && data[4] == b'I' { + // FUZZI + } + if matches >= 6 && data[5] == b'N' { + // FUZZIN + } + if matches >= 7 && data[6] == b'G' { + // FUZZING + } + if matches >= 8 && data[7] == b'L' { + // FUZZINGL + } + if matches >= 9 && data[8] == b'A' { + // FUZZINGLA + } + if matches >= 10 && data[9] == b'B' { + // FUZZINGLAB + } + if matches >= 11 && data[10] == b'S' { + // FUZZINGLABS + } + } + + // VULNERABILITY: Panics when complete secret found + if matches == SECRET.len() && data.len() >= SECRET.len() { + panic!("SECRET COMPROMISED! Found: {:?}", &data[..SECRET.len()]); + } + + matches +} + #[cfg(test)] mod tests { use super::*; @@ -55,4 +122,17 @@ mod tests { let data = vec![3, 1, 2, 3, 4]; assert_eq!(process_buffer(&data), vec![3, 1, 2]); } + + #[test] + fn test_waterfall_partial_match() { + assert_eq!(check_secret_waterfall(b"F"), 1); + assert_eq!(check_secret_waterfall(b"FU"), 2); + assert_eq!(check_secret_waterfall(b"FUZZ"), 4); + } + + #[test] + #[should_panic(expected = "SECRET COMPROMISED")] + fn test_waterfall_full_match() { + check_secret_waterfall(b"FUZZINGLABS"); + } } diff --git a/test_projects/vulnerable_app/baseline-test.sarif b/test_projects/vulnerable_app/baseline-test.sarif deleted file mode 100644 index 012fada..0000000 --- a/test_projects/vulnerable_app/baseline-test.sarif +++ /dev/null @@ -1,2548 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - "runs": [ - { - "invocations": [ - { - "endTimeUtc": "2025-10-13T13:56:22.175424Z", - "executionSuccessful": true - } - ], - "originalUriBaseIds": { - "WORKSPACE": { - "description": "The workspace root directory", - "uri": "file:///cache/800afd77-0c92-44ba-ac10-b76a5c36090c/workspace/" - } - }, - "results": [ - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .env" - }, - "properties": { - "findingId": "0bf9e5f4-b9dd-45ff-bfe2-1e7e1de6e875", - "metadata": { - "file_size": 1546, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".git-credentials", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .git-credentials" - }, - "properties": { - "findingId": "bb454561-76c1-4e15-b5ca-7c1e4cd7ca15", - "metadata": { - "file_size": 168, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .git-credentials" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "private_key.pem", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at private_key.pem" - }, - "properties": { - "findingId": "03653809-53b1-4538-ad4e-a4ca0a772edf", - "metadata": { - "file_size": 381, - "file_type": "application/pem-certificate-chain" - }, - "title": "Potentially sensitive file: private_key.pem" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "wallet.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at wallet.json" - }, - "properties": { - "findingId": "6eff764b-88a8-4d59-9785-dcad4cd7df60", - "metadata": { - "file_size": 1206, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: wallet.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".npmrc", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .npmrc" - }, - "properties": { - "findingId": "30228e73-1f2b-493c-9cc2-ae2c85ffe9ac", - "metadata": { - "file_size": 238, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .npmrc" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env" - }, - "properties": { - "findingId": "4aca32ef-a59c-4ccd-bcfc-d674ed1e97af", - "metadata": { - "file_size": 897, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env.template", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env.template" - }, - "properties": { - "findingId": "46e5a5f6-86c4-45c3-9a9b-7f7e96578dfa", - "metadata": { - "file_size": 569, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env.template" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/credentials.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/credentials.json" - }, - "properties": { - "findingId": "5eb292a4-625a-44b9-be09-1a3bce6a413b", - "metadata": { - "file_size": 1057, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: credentials.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/api_keys.txt", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/api_keys.txt" - }, - "properties": { - "findingId": "90c57980-728d-4aa3-93cd-d6fa161fb119", - "metadata": { - "file_size": 1138, - "file_type": "text/plain" - }, - "title": "Potentially sensitive file: api_keys.txt" - }, - "ruleId": "sensitive_file_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "app.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM users WHERE id = {user_id}\"" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "964eedf8-3a34-4bcf-aaa8-297ee33f490e", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "STRIPE_API_KEY = \"sk_live_4eC39HqLyjWDarjtT1zdp7dc\"" - }, - "startLine": 25 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/api_handler.py" - }, - "properties": { - "findingId": "1ad3b265-0805-4074-af5c-8f9de17987c2", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Authentication Token and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "SECRET_TOKEN = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Authentication Token in src/api_handler.py" - }, - "properties": { - "findingId": "2618afcd-e4da-49d7-bfd3-c6a8b399656f", - "metadata": { - "secret_type": "Authentication Token" - }, - "title": "Hardcoded Authentication Token detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = eval(user_data) # Code injection vulnerability" - }, - "startLine": 34 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "5bb9c1aa-830e-48b1-ac3d-beabe84c3605", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "func = eval(f\"lambda x: {code}\") # Dangerous eval" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "b06b814d-88a0-45b7-81aa-cc4398a22b66", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(compiled, data) # Code execution vulnerability" - }, - "startLine": 49 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Arbitrary code execution" - }, - "properties": { - "findingId": "12646361-1f36-4e35-b14f-eb44abaf3f29", - "metadata": { - "function": "exec()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(\"cat \" + filename) # Command injection" - }, - "startLine": 44 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "da239acf-1c81-49f2-9232-d20c7af09348", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"echo '{log_message}' >> /var/log/app.log\") # Command injection via logs" - }, - "startLine": 71 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "c0105aff-8273-42aa-906c-c2c79003822d", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to subprocess with shell=True" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = subprocess.call(command, shell=True) # Command injection risk" - }, - "startLine": 39 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function subprocess with shell=True: Command injection risk" - }, - "properties": { - "findingId": "4e339aab-1325-4cb2-8293-5ed2a8a04c02", - "metadata": { - "function": "subprocess with shell=True", - "risk": "Command injection risk" - }, - "title": "Dangerous function: subprocess with shell=True" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "9fd4b1d7-7a65-4f03-8867-2d55b5514d7d", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "025d8f27-5e65-48e6-89d0-f181dcf30ffb", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"UPDATE users SET profile = '%s' WHERE id = %s\" % (data, user_id)" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "0d832606-5578-41b5-a247-981a2bda8c21", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "426e398a-13c9-48fe-9f1f-f26f65249b46", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "16408845-486a-4b9b-8766-b36a815a4d21", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "final_query = base_query + where_clause" - }, - "startLine": 75 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "a491d896-0ec1-4644-8af9-c5fc98ddad35", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"mysqldump -u {DB_USER} -p{DB_PASSWORD} production > {backup_name}\")" - }, - "startLine": 69 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "6f1e42b9-2e1f-432d-b5f8-efe8dc9d0c93", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to pickle.load()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "user_prefs = pickle.loads(data) # Dangerous pickle deserialization" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function pickle.load(): Deserialization vulnerability" - }, - "properties": { - "findingId": "570808dd-5c48-4209-afd1-7aeee71526dd", - "metadata": { - "function": "pickle.load()", - "risk": "Deserialization vulnerability" - }, - "title": "Dangerous function: pickle.load()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in scripts/backup.js" - }, - "properties": { - "findingId": "316a81e3-4d3a-4644-83dc-922dea76a3ba", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in scripts/backup.js" - }, - "properties": { - "findingId": "69965f9c-07c9-4469-8ba9-97fd5bdfc658", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval(userInput); // Code injection vulnerability" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "097851fb-abae-42eb-b6c9-c8132518883d", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to new Function()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "return new Function(code); // Code injection vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function new Function(): Arbitrary code execution" - }, - "properties": { - "findingId": "98629361-7024-4274-a677-d5d348812d8d", - "metadata": { - "function": "new Function()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: new Function()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.body.innerHTML = message; // XSS vulnerability" - }, - "startLine": 33 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "558e9f51-d9d2-4c2e-9953-a9cee6835e6e", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.getElementById('content').innerHTML = html; // XSS vulnerability" - }, - "startLine": 37 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "01c0e6f2-37cb-4a22-b2f5-a666278ae8af", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to document.write()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.write(data); // XSS vulnerability" - }, - "startLine": 42 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function document.write(): XSS vulnerability" - }, - "properties": { - "findingId": "c2363aa8-0571-4e73-b59f-4c449e6a6942", - "metadata": { - "function": "document.write()", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: document.write()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "private static final String PRIVATE_KEY = \"-----BEGIN RSA PRIVATE KEY-----\\nMIIEpAIBAAKCAQ...\";" - }, - "startLine": 77 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/Main.java" - }, - "properties": { - "findingId": "8b380c03-e59d-42a8-8eac-faac04557d88", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "2f5d9ee7-05a8-4e8a-bd6f-8bf3175e95ce", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "ac5d89e3-17f6-45f2-b254-01a8a2d45ba9", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "ba76d0d9-d13a-43ef-bcf8-4e2a3677a8c5", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "f07f4cd1-194f-4051-9cc3-68c56410d44b", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval($code); // Code execution vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "ad255a22-7163-4725-86dd-74e0210c7241", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "ac507bd3-d872-4bfc-8dcb-f420fb925f45", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "c7a788d4-911d-446f-b0da-384d80cc09f8", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function system(): Command execution" - }, - "properties": { - "findingId": "c783b431-10d5-42e6-8864-9e2534942ad1", - "metadata": { - "function": "system()", - "risk": "Command execution" - }, - "title": "Dangerous function: system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to shell_exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function shell_exec(): Command execution" - }, - "properties": { - "findingId": "bd70c615-556e-4e8f-8f5a-ba8317daac0c", - "metadata": { - "function": "shell_exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: shell_exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$user_id = $_GET['id'];" - }, - "startLine": 12 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "f2613945-a3af-4aef-ac3c-c3bf9a1e6b6b", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "51ac47fc-933d-4564-94ba-19f5e0163226", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "fa75ecf2-04ca-483c-88e9-737db4296f95", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "passthru(\"ps aux | grep \" . $_GET['process']);" - }, - "startLine": 24 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "76a1dfd3-2a0c-4b6f-b377-bf38bad29295", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "include($_GET['page'] . '.php');" - }, - "startLine": 31 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "87f0e990-e1eb-49f8-a54b-e9e1b7fb1fb7", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "echo \"Welcome, \" . $_GET['name'];" - }, - "startLine": 45 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "6ca5a574-9a27-4732-a0b7-fca0f9d9202d", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$_SESSION['user'] = $_GET['user'];" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "89b0d644-5694-422e-8e89-de7558e9e8d0", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$file = $_GET['file'];" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "5c1feb32-4872-47ef-b7e6-544be9ad0b46", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 13 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "d45aaa98-4a69-4c77-98e8-cb1f2d839b38", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "bdfa9adc-fa0a-49b0-85fd-bc19cab18779", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$code = $_POST['code'];" - }, - "startLine": 27 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "1d66b8d0-2cee-47af-a3b4-0d1b20945da2", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "require_once($_POST['template']);" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "4440648e-e2fd-4aba-a084-39bf0ab495bd", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$search = $_POST['search'];" - }, - "startLine": 40 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "1807a81a-ccb4-42ad-948c-48e62a575703", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "print(\"Your search: \" . $_POST['query']);" - }, - "startLine": 46 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "da13eaf1-0e6a-4f02-8e53-5d430468f5a7", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = md5($_POST['password']); // Weak hashing" - }, - "startLine": 53 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "c61a1aff-7574-448c-b857-7819e44aac29", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$encrypted = base64_encode($_POST['sensitive_data']); // Not encryption" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "e5c36f20-f3e2-483b-9643-b6cc8288a601", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 61 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "09d5d5e7-2514-4824-949f-fc1738aa51e6", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = $_POST['password'];" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "3d8d9924-01d4-467b-a4e6-fe95151fe31e", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "ELASTICSEARCH_API_KEY = \"elastic_api_key_789xyz\"" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/utils.rb" - }, - "properties": { - "findingId": "4c565b36-27b3-464f-b99b-d8e2d85f50e0", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Hardcoded Password and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "REDIS_PASSWORD = \"redis_cache_password_456\"" - }, - "startLine": 63 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Hardcoded Password in src/utils.rb" - }, - "properties": { - "findingId": "f8e2edc4-38c2-4d67-b829-c084a16d5a48", - "metadata": { - "secret_type": "Hardcoded Password" - }, - "title": "Hardcoded Hardcoded Password detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "6a154086-37d9-4b8d-961f-f4c6b45023d9", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "d1c46dc8-4c69-4a69-9264-2034c1f5a62b", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "889e1bb3-6a0b-455e-b242-46ff90a345ae", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "60424cc3-95ea-47cf-a014-25b0f4b3c089", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - } - ], - "tool": { - "driver": { - "informationUri": "https://fuzzforge.io", - "name": "FuzzForge Security Assessment", - "rules": [ - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for sensitive_file vulnerabilities with medium severity" - }, - "id": "sensitive_file_medium", - "name": "Sensitive File", - "properties": { - "category": "sensitive_file", - "severity": "medium", - "tags": [ - "security", - "sensitive_file", - "medium" - ] - }, - "shortDescription": { - "text": "sensitive_file vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for sql_injection vulnerabilities with high severity" - }, - "id": "sql_injection_high", - "name": "Sql Injection", - "properties": { - "category": "sql_injection", - "severity": "high", - "tags": [ - "security", - "sql_injection", - "high" - ] - }, - "shortDescription": { - "text": "sql_injection vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with high severity" - }, - "id": "hardcoded_secret_high", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "high", - "tags": [ - "security", - "hardcoded_secret", - "high" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with medium severity" - }, - "id": "hardcoded_secret_medium", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "medium", - "tags": [ - "security", - "hardcoded_secret", - "medium" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for dangerous_function vulnerabilities with medium severity" - }, - "id": "dangerous_function_medium", - "name": "Dangerous Function", - "properties": { - "category": "dangerous_function", - "severity": "medium", - "tags": [ - "security", - "dangerous_function", - "medium" - ] - }, - "shortDescription": { - "text": "dangerous_function vulnerability" - } - } - ], - "version": "1.0.0" - } - } - } - ], - "version": "2.1.0" -} \ No newline at end of file diff --git a/test_projects/vulnerable_app/ci-test-results.sarif b/test_projects/vulnerable_app/ci-test-results.sarif deleted file mode 100644 index b321e1e..0000000 --- a/test_projects/vulnerable_app/ci-test-results.sarif +++ /dev/null @@ -1,2548 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - "runs": [ - { - "invocations": [ - { - "endTimeUtc": "2025-10-13T14:21:29.706528Z", - "executionSuccessful": true - } - ], - "originalUriBaseIds": { - "WORKSPACE": { - "description": "The workspace root directory", - "uri": "file:///cache/a43da6fc-b20f-404e-9b02-7b240ebbecfe/workspace/" - } - }, - "results": [ - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .env" - }, - "properties": { - "findingId": "cc515bb2-58b6-44db-b2c5-e9b60b5a3063", - "metadata": { - "file_size": 1546, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".git-credentials", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .git-credentials" - }, - "properties": { - "findingId": "fc041fdf-6d40-4d24-9fb0-c0f476ea9911", - "metadata": { - "file_size": 168, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .git-credentials" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "private_key.pem", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at private_key.pem" - }, - "properties": { - "findingId": "2d54d55a-d862-4d96-9a17-77c7ec0c34e1", - "metadata": { - "file_size": 381, - "file_type": "application/pem-certificate-chain" - }, - "title": "Potentially sensitive file: private_key.pem" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "wallet.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at wallet.json" - }, - "properties": { - "findingId": "6ec2f179-7379-4dfa-9355-66e4ae057244", - "metadata": { - "file_size": 1206, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: wallet.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".npmrc", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .npmrc" - }, - "properties": { - "findingId": "d94fe444-5779-489b-99ec-c2fe5d66735a", - "metadata": { - "file_size": 238, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .npmrc" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env" - }, - "properties": { - "findingId": "d5218805-3b79-4c72-89cf-e3e3414ef712", - "metadata": { - "file_size": 897, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env.template", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env.template" - }, - "properties": { - "findingId": "904bba63-d0c8-4ae1-a5e2-b9e682bb3796", - "metadata": { - "file_size": 569, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env.template" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/credentials.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/credentials.json" - }, - "properties": { - "findingId": "524c97c2-556c-4bad-9aef-af2d9ea9fdf0", - "metadata": { - "file_size": 1057, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: credentials.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/api_keys.txt", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/api_keys.txt" - }, - "properties": { - "findingId": "69152d16-c878-43a5-964f-cc8e874f31b3", - "metadata": { - "file_size": 1138, - "file_type": "text/plain" - }, - "title": "Potentially sensitive file: api_keys.txt" - }, - "ruleId": "sensitive_file_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "app.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM users WHERE id = {user_id}\"" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "3db5a4fa-def2-4d81-9187-0fb46e873260", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "STRIPE_API_KEY = \"sk_live_4eC39HqLyjWDarjtT1zdp7dc\"" - }, - "startLine": 25 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/api_handler.py" - }, - "properties": { - "findingId": "d5811980-a082-4554-a974-97b05aef2848", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Authentication Token and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "SECRET_TOKEN = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Authentication Token in src/api_handler.py" - }, - "properties": { - "findingId": "7ecf6060-7802-4bf7-86d8-89abda215ee7", - "metadata": { - "secret_type": "Authentication Token" - }, - "title": "Hardcoded Authentication Token detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = eval(user_data) # Code injection vulnerability" - }, - "startLine": 34 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "654a07d3-ec43-41ce-bd1b-5478447ae459", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "func = eval(f\"lambda x: {code}\") # Dangerous eval" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "6fa2c1fa-7037-4e33-a5ec-ef5b473b3298", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(compiled, data) # Code execution vulnerability" - }, - "startLine": 49 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Arbitrary code execution" - }, - "properties": { - "findingId": "d6869bca-82dd-4e70-81ae-8fa1fdec1e21", - "metadata": { - "function": "exec()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(\"cat \" + filename) # Command injection" - }, - "startLine": 44 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "902154e2-206c-4de5-ac7c-d9a09c0a7c17", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"echo '{log_message}' >> /var/log/app.log\") # Command injection via logs" - }, - "startLine": 71 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "1ec0b2c2-8cfc-4310-9dae-7984bebfaafd", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to subprocess with shell=True" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = subprocess.call(command, shell=True) # Command injection risk" - }, - "startLine": 39 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function subprocess with shell=True: Command injection risk" - }, - "properties": { - "findingId": "02314322-0b91-4fd8-aa18-6207534ee4fe", - "metadata": { - "function": "subprocess with shell=True", - "risk": "Command injection risk" - }, - "title": "Dangerous function: subprocess with shell=True" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "a3a7ba8b-5c98-4950-b6b9-05b5641ac39a", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "e522927e-32a9-4b27-8b6a-9d9f9655d5fa", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"UPDATE users SET profile = '%s' WHERE id = %s\" % (data, user_id)" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "e59be6f6-b9ae-45a8-b769-f6cd02e5639a", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "b1c2408a-08eb-44d8-9047-f96f1c408725", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "05fce48b-a983-4325-99a6-a84ade928fed", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "final_query = base_query + where_clause" - }, - "startLine": 75 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "3a4ffe16-92f2-479e-873f-91b179b9540c", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"mysqldump -u {DB_USER} -p{DB_PASSWORD} production > {backup_name}\")" - }, - "startLine": 69 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "67ceec61-d8ab-4086-95cd-b6e1fcac073d", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to pickle.load()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "user_prefs = pickle.loads(data) # Dangerous pickle deserialization" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function pickle.load(): Deserialization vulnerability" - }, - "properties": { - "findingId": "d15d3c30-89b6-4d1a-82ab-9fc190511f28", - "metadata": { - "function": "pickle.load()", - "risk": "Deserialization vulnerability" - }, - "title": "Dangerous function: pickle.load()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in scripts/backup.js" - }, - "properties": { - "findingId": "2b36262d-8938-40e2-ac2e-a339f9171adb", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in scripts/backup.js" - }, - "properties": { - "findingId": "6affa3c2-bb9e-4b5f-b6ce-6f9850c01b14", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval(userInput); // Code injection vulnerability" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "eff8670f-7221-48c0-909e-97f7d215c135", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to new Function()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "return new Function(code); // Code injection vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function new Function(): Arbitrary code execution" - }, - "properties": { - "findingId": "dd85ef8c-c3aa-4710-a542-67e7ab3af5ae", - "metadata": { - "function": "new Function()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: new Function()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.body.innerHTML = message; // XSS vulnerability" - }, - "startLine": 33 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "135f66a8-3db0-4853-8193-792ba4b59ff9", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.getElementById('content').innerHTML = html; // XSS vulnerability" - }, - "startLine": 37 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "30a32dab-2f1a-4f50-9aab-f5ccd0ae52f5", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to document.write()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.write(data); // XSS vulnerability" - }, - "startLine": 42 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function document.write(): XSS vulnerability" - }, - "properties": { - "findingId": "eb007f9b-d668-4dc7-91f5-865ac1b78b93", - "metadata": { - "function": "document.write()", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: document.write()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "private static final String PRIVATE_KEY = \"-----BEGIN RSA PRIVATE KEY-----\\nMIIEpAIBAAKCAQ...\";" - }, - "startLine": 77 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/Main.java" - }, - "properties": { - "findingId": "5535345d-83be-44fc-b896-41062e938017", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "bc06de90-1243-458b-8d48-10d101f2ddab", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "3eceeffb-4dee-4cb1-8324-2517f0b9b73a", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "70108ee3-5765-4b87-9db5-b218d610e220", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "0ab6f323-b71a-493e-8696-98c9405d97cd", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval($code); // Code execution vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "2dd3bf66-e217-4e26-878f-558780694202", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "b74df19e-bec3-4441-b8ac-c99a62e006f1", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "0c504d72-5906-4da9-a4d5-06eb749f562b", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function system(): Command execution" - }, - "properties": { - "findingId": "e26456e1-2dc8-45b8-baec-f237c3f6b4f8", - "metadata": { - "function": "system()", - "risk": "Command execution" - }, - "title": "Dangerous function: system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to shell_exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function shell_exec(): Command execution" - }, - "properties": { - "findingId": "344eb264-b3fd-4a43-9383-d86b1116d04f", - "metadata": { - "function": "shell_exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: shell_exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$user_id = $_GET['id'];" - }, - "startLine": 12 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "84455665-f937-4e88-99e0-c432faff53b7", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "5705b4aa-a203-42c2-9dc1-d77377e8a313", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "c47b8712-3f01-48cc-8e72-ecf12fd61721", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "passthru(\"ps aux | grep \" . $_GET['process']);" - }, - "startLine": 24 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "27d0dec5-b5c4-4cf9-a484-5be53c462cde", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "include($_GET['page'] . '.php');" - }, - "startLine": 31 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "23a6f646-7be5-4a71-b430-c91c30774f2d", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "echo \"Welcome, \" . $_GET['name'];" - }, - "startLine": 45 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "0362a853-8955-4bff-a26b-d8add0546433", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$_SESSION['user'] = $_GET['user'];" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "6e835930-728f-40f0-bcd6-df7227b5b8da", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$file = $_GET['file'];" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "6bac31df-5a5e-45b8-977b-f768bd7d539f", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 13 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "0ffa4e28-4336-40d6-b8e6-cfc720f902e2", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "23a0c11e-d263-413c-b33c-aad2d6a8f5a5", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$code = $_POST['code'];" - }, - "startLine": 27 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "be6a2715-09de-4983-bcd3-9d83a0b27451", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "require_once($_POST['template']);" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "ec1e17e7-41ff-4754-af03-af4a05c61726", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$search = $_POST['search'];" - }, - "startLine": 40 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "3b8b39af-782c-4a63-9dcd-3a955cd75ce2", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "print(\"Your search: \" . $_POST['query']);" - }, - "startLine": 46 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "7b1498fc-2ca5-46f8-b013-918df23060d6", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = md5($_POST['password']); // Weak hashing" - }, - "startLine": 53 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "6beeb596-fb56-4abc-9454-cd3dbd71b5c9", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$encrypted = base64_encode($_POST['sensitive_data']); // Not encryption" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "cec6391c-3ae2-47dd-9c4c-69aceecd293d", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 61 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "f7081144-146c-4991-b7d0-197a5a6add82", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = $_POST['password'];" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "b5fe13cc-44f3-43a9-8451-074dbb343a09", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "ELASTICSEARCH_API_KEY = \"elastic_api_key_789xyz\"" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/utils.rb" - }, - "properties": { - "findingId": "3a76ed37-5224-49fb-8288-a0ff72315b4c", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Hardcoded Password and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "REDIS_PASSWORD = \"redis_cache_password_456\"" - }, - "startLine": 63 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Hardcoded Password in src/utils.rb" - }, - "properties": { - "findingId": "3f7d90bc-8f5a-4a25-924e-3f174226e499", - "metadata": { - "secret_type": "Hardcoded Password" - }, - "title": "Hardcoded Hardcoded Password detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "a17207a1-eeab-4901-9e40-a50133226dc2", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "f173884c-48ac-447d-abd0-fa5c32b36ce8", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "e10563d9-6604-4dd2-bb98-9869b99e6dec", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "9d32784f-0ecf-468f-be79-3a72cb70a8cd", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - } - ], - "tool": { - "driver": { - "informationUri": "https://fuzzforge.io", - "name": "FuzzForge Security Assessment", - "rules": [ - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for sensitive_file vulnerabilities with medium severity" - }, - "id": "sensitive_file_medium", - "name": "Sensitive File", - "properties": { - "category": "sensitive_file", - "severity": "medium", - "tags": [ - "security", - "sensitive_file", - "medium" - ] - }, - "shortDescription": { - "text": "sensitive_file vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for sql_injection vulnerabilities with high severity" - }, - "id": "sql_injection_high", - "name": "Sql Injection", - "properties": { - "category": "sql_injection", - "severity": "high", - "tags": [ - "security", - "sql_injection", - "high" - ] - }, - "shortDescription": { - "text": "sql_injection vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with high severity" - }, - "id": "hardcoded_secret_high", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "high", - "tags": [ - "security", - "hardcoded_secret", - "high" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with medium severity" - }, - "id": "hardcoded_secret_medium", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "medium", - "tags": [ - "security", - "hardcoded_secret", - "medium" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for dangerous_function vulnerabilities with medium severity" - }, - "id": "dangerous_function_medium", - "name": "Dangerous Function", - "properties": { - "category": "dangerous_function", - "severity": "medium", - "tags": [ - "security", - "dangerous_function", - "medium" - ] - }, - "shortDescription": { - "text": "dangerous_function vulnerability" - } - } - ], - "version": "1.0.0" - } - } - } - ], - "version": "2.1.0" -} \ No newline at end of file diff --git a/test_projects/vulnerable_app/ci-test.sarif b/test_projects/vulnerable_app/ci-test.sarif deleted file mode 100644 index 565947a..0000000 --- a/test_projects/vulnerable_app/ci-test.sarif +++ /dev/null @@ -1,2548 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - "runs": [ - { - "invocations": [ - { - "endTimeUtc": "2025-10-13T14:22:02.992436Z", - "executionSuccessful": true - } - ], - "originalUriBaseIds": { - "WORKSPACE": { - "description": "The workspace root directory", - "uri": "file:///cache/674c3f20-2145-44d7-9c0a-42ec5e6c1bbe/workspace/" - } - }, - "results": [ - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .env" - }, - "properties": { - "findingId": "789a1789-52ff-45cb-a660-1e9a0f4ecb53", - "metadata": { - "file_size": 1546, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".git-credentials", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .git-credentials" - }, - "properties": { - "findingId": "d9c3a279-d206-4554-8fa6-c9554e094b8a", - "metadata": { - "file_size": 168, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .git-credentials" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "private_key.pem", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at private_key.pem" - }, - "properties": { - "findingId": "aa0ed63c-e8fb-4a53-a163-43c6691484ca", - "metadata": { - "file_size": 381, - "file_type": "application/pem-certificate-chain" - }, - "title": "Potentially sensitive file: private_key.pem" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "wallet.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at wallet.json" - }, - "properties": { - "findingId": "9cfc6fcb-362c-4b03-acd7-401c4063d6ca", - "metadata": { - "file_size": 1206, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: wallet.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".npmrc", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .npmrc" - }, - "properties": { - "findingId": "50927a5c-5e1b-4ab1-a244-6909c1e46ae7", - "metadata": { - "file_size": 238, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .npmrc" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env" - }, - "properties": { - "findingId": "a6acdf42-1d34-44b4-9660-ef9808fbb1df", - "metadata": { - "file_size": 897, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": ".fuzzforge/.env.template", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at .fuzzforge/.env.template" - }, - "properties": { - "findingId": "4fe420a1-4bbc-4dca-ad45-48f120dcc6bd", - "metadata": { - "file_size": 569, - "file_type": "application/octet-stream" - }, - "title": "Potentially sensitive file: .env.template" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/credentials.json", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/credentials.json" - }, - "properties": { - "findingId": "11cf821c-4a88-449d-bc60-2073f588f058", - "metadata": { - "file_size": 1057, - "file_type": "application/json" - }, - "title": "Potentially sensitive file: credentials.json" - }, - "ruleId": "sensitive_file_medium" - }, - { - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "data/api_keys.txt", - "uriBaseId": "WORKSPACE" - } - } - } - ], - "message": { - "text": "Found potentially sensitive file at data/api_keys.txt" - }, - "properties": { - "findingId": "5f5b0c4b-7780-43dc-986c-0798d5cadcf1", - "metadata": { - "file_size": 1138, - "file_type": "text/plain" - }, - "title": "Potentially sensitive file: api_keys.txt" - }, - "ruleId": "sensitive_file_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "app.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM users WHERE id = {user_id}\"" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "5a3a4b61-aac8-4dc8-8690-dbd7c4b7cd00", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "STRIPE_API_KEY = \"sk_live_4eC39HqLyjWDarjtT1zdp7dc\"" - }, - "startLine": 25 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/api_handler.py" - }, - "properties": { - "findingId": "6f76b93a-9ef7-4e60-b28c-99d407def69d", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Authentication Token and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "SECRET_TOKEN = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Authentication Token in src/api_handler.py" - }, - "properties": { - "findingId": "8f8ca33a-beef-4993-95d1-ac619c1131b4", - "metadata": { - "secret_type": "Authentication Token" - }, - "title": "Hardcoded Authentication Token detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = eval(user_data) # Code injection vulnerability" - }, - "startLine": 34 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "d26f7d9f-3ccb-41d3-bb89-e07872e3011c", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "func = eval(f\"lambda x: {code}\") # Dangerous eval" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "85a7bb47-6d99-4c62-aa4a-07ac52788f1d", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(compiled, data) # Code execution vulnerability" - }, - "startLine": 49 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Arbitrary code execution" - }, - "properties": { - "findingId": "3677163c-22dd-4aa0-ba64-bb39e295353e", - "metadata": { - "function": "exec()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(\"cat \" + filename) # Command injection" - }, - "startLine": 44 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "f51474d4-b336-49aa-a49e-e1d2ee4022b4", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"echo '{log_message}' >> /var/log/app.log\") # Command injection via logs" - }, - "startLine": 71 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "1548153c-66f7-4590-aa91-2e6fd4fcc0a6", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to subprocess with shell=True" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/api_handler.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "result = subprocess.call(command, shell=True) # Command injection risk" - }, - "startLine": 39 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function subprocess with shell=True: Command injection risk" - }, - "properties": { - "findingId": "58c3a149-f23b-40c8-94d4-4e6056e156c6", - "metadata": { - "function": "subprocess with shell=True", - "risk": "Command injection risk" - }, - "title": "Dangerous function: subprocess with shell=True" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "06de8ae9-49dc-4914-ac00-5f647ed44e66", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "c67f3ba5-f076-4b40-94f0-d4509e9a1a0e", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"UPDATE users SET profile = '%s' WHERE id = %s\" % (data, user_id)" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String formatting in SQL" - }, - "properties": { - "findingId": "0ad7f210-7001-4cd0-a770-b242e1c99c08", - "metadata": { - "vulnerability_type": "String formatting in SQL" - }, - "title": "Potential SQL Injection: String formatting in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = f\"SELECT * FROM products WHERE name LIKE '%{search_term}%' AND category = '{category}'\"" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via F-string in SQL query" - }, - "properties": { - "findingId": "5981bea3-c5eb-4526-925e-5632f389ca0f", - "metadata": { - "vulnerability_type": "F-string in SQL query" - }, - "title": "Potential SQL Injection: F-string in SQL query" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "query = \"SELECT * FROM users WHERE username = '\" + user_input + \"'\"" - }, - "startLine": 43 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "aa77e153-0ebd-4769-80d6-717c15eb8735", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "final_query = base_query + where_clause" - }, - "startLine": 75 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "5188d0ff-83ac-4003-af1c-cf892825916e", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to os.system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "os.system(f\"mysqldump -u {DB_USER} -p{DB_PASSWORD} production > {backup_name}\")" - }, - "startLine": 69 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function os.system(): Command injection risk" - }, - "properties": { - "findingId": "fd1cc762-9f1b-47f7-a325-76efec666309", - "metadata": { - "function": "os.system()", - "risk": "Command injection risk" - }, - "title": "Dangerous function: os.system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to pickle.load()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/database.py", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "user_prefs = pickle.loads(data) # Dangerous pickle deserialization" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function pickle.load(): Deserialization vulnerability" - }, - "properties": { - "findingId": "4399c5ae-9989-4789-8502-715df31ee6d4", - "metadata": { - "function": "pickle.load()", - "risk": "Deserialization vulnerability" - }, - "title": "Dangerous function: pickle.load()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in scripts/backup.js" - }, - "properties": { - "findingId": "ce0c3572-b193-4005-81e8-931c54d306be", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BITCOIN_PRIVATE_KEY = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\";" - }, - "startLine": 81 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in scripts/backup.js" - }, - "properties": { - "findingId": "0eaefd35-ce0e-49ca-868f-5fcc2371b232", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval(userInput); // Code injection vulnerability" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "86a8716d-a8a7-4a1e-8f22-d63158eea7d7", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to new Function()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "return new Function(code); // Code injection vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function new Function(): Arbitrary code execution" - }, - "properties": { - "findingId": "650a6683-abda-4b07-8cf8-c74a16bcc3b9", - "metadata": { - "function": "new Function()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: new Function()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.body.innerHTML = message; // XSS vulnerability" - }, - "startLine": 33 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "6af80143-27c7-47ca-865d-b31386ac4b82", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to innerHTML" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.getElementById('content').innerHTML = html; // XSS vulnerability" - }, - "startLine": 37 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function innerHTML: XSS vulnerability" - }, - "properties": { - "findingId": "c5305cb6-4a77-4f60-a92a-903dd9c21a0a", - "metadata": { - "function": "innerHTML", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: innerHTML" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to document.write()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/backup.js", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "document.write(data); // XSS vulnerability" - }, - "startLine": 42 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function document.write(): XSS vulnerability" - }, - "properties": { - "findingId": "7272dbd9-e0af-43ba-a9cc-d5222f824626", - "metadata": { - "function": "document.write()", - "risk": "XSS vulnerability" - }, - "title": "Dangerous function: document.write()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "private static final String PRIVATE_KEY = \"-----BEGIN RSA PRIVATE KEY-----\\nMIIEpAIBAAKCAQ...\";" - }, - "startLine": 77 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/Main.java" - }, - "properties": { - "findingId": "8584c0ef-39b4-4d48-baa3-417467389a78", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "4ac695f7-5883-4fb1-b4b9-b16b481eea7a", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via String concatenation in SQL" - }, - "properties": { - "findingId": "eed6f3e9-bcf9-4f17-aeab-353ece10d026", - "metadata": { - "vulnerability_type": "String concatenation in SQL" - }, - "title": "Potential SQL Injection: String concatenation in SQL" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM users WHERE id = \" + userId; // SQL injection" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "e5ba6110-8336-45c3-97d0-dcb387d109d4", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Use parameterized queries or prepared statements instead" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/Main.java", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "String query = \"SELECT * FROM products WHERE name LIKE '%\" + searchTerm + \"%'\";" - }, - "startLine": 29 - } - } - } - ], - "message": { - "text": "Detected potential SQL injection vulnerability via Dynamic query building" - }, - "properties": { - "findingId": "00a752d2-f838-4c76-8449-a3ecbd8abbbe", - "metadata": { - "vulnerability_type": "Dynamic query building" - }, - "title": "Potential SQL Injection: Dynamic query building" - }, - "ruleId": "sql_injection_high" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to eval()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "eval($code); // Code execution vulnerability" - }, - "startLine": 28 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function eval(): Arbitrary code execution" - }, - "properties": { - "findingId": "e67cbb50-6d5f-4e7f-b220-84d1eb8ffadc", - "metadata": { - "function": "eval()", - "risk": "Arbitrary code execution" - }, - "title": "Dangerous function: eval()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "742e01ca-0a37-4539-ad5f-da1ec4174fc1", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function exec(): Command execution" - }, - "properties": { - "findingId": "2a7b3fcf-ac4e-4616-9064-6e48b605a10d", - "metadata": { - "function": "exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to system()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function system(): Command execution" - }, - "properties": { - "findingId": "995aa9c3-2ed2-495c-9dc8-1d91bf9cd165", - "metadata": { - "function": "system()", - "risk": "Command execution" - }, - "title": "Dangerous function: system()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to shell_exec()" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function shell_exec(): Command execution" - }, - "properties": { - "findingId": "6ceadef6-1525-4329-ac35-0bbc2a720727", - "metadata": { - "function": "shell_exec()", - "risk": "Command execution" - }, - "title": "Dangerous function: shell_exec()" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$user_id = $_GET['id'];" - }, - "startLine": 12 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "673d4e07-c719-4f59-a9d6-f850dade5ddb", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "system(\"ls -la \" . $_GET['directory']);" - }, - "startLine": 21 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "69f5aa15-f4ab-43f8-9df7-c2f5d23e94d8", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "shell_exec(\"ping \" . $_GET['host']);" - }, - "startLine": 23 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "a7de9c78-7eaf-4cbc-8926-7c72dac6a4fd", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "passthru(\"ps aux | grep \" . $_GET['process']);" - }, - "startLine": 24 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "925f5149-f183-430b-94e7-c6fd0514d4a9", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "include($_GET['page'] . '.php');" - }, - "startLine": 31 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "30b04545-1620-4c08-a0d4-8675b3f4b1bb", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "echo \"Welcome, \" . $_GET['name'];" - }, - "startLine": 45 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "d71e01a7-3ba6-4f38-a26d-e62ea7cc84d2", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$_SESSION['user'] = $_GET['user'];" - }, - "startLine": 50 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "2cabaf1b-d312-4329-bb69-a2b46c8c6e23", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_GET usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$file = $_GET['file'];" - }, - "startLine": 57 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_GET usage: Input validation missing" - }, - "properties": { - "findingId": "92eb9cbc-3753-4ae1-8e74-92ca8a2d8107", - "metadata": { - "function": "Direct $_GET usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_GET usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 13 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "7cc146ee-85c5-4ab7-9d95-59eefefbe144", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "exec(\"cat \" . $_POST['file']);" - }, - "startLine": 22 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "4dbb6a03-8f55-429c-8640-22803d90d04c", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$code = $_POST['code'];" - }, - "startLine": 27 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "bd89e203-0ca2-41e8-9964-ba237c09e789", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "require_once($_POST['template']);" - }, - "startLine": 32 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "4d01eaaa-1803-40cc-8850-d87fcd531de0", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$search = $_POST['search'];" - }, - "startLine": 40 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "cd361948-c762-44db-8444-f2ceafa350d3", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "print(\"Your search: \" . $_POST['query']);" - }, - "startLine": 46 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "c2810f7b-36d0-43da-926c-032fcede5227", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = md5($_POST['password']); // Weak hashing" - }, - "startLine": 53 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "cf78be8f-5a81-4e9b-a9e1-b3c645d7e7ed", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$encrypted = base64_encode($_POST['sensitive_data']); // Not encryption" - }, - "startLine": 54 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "0421e17a-6c38-400c-b01c-4e1dbd69ccfd", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$username = $_POST['username'];" - }, - "startLine": 61 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "52682189-4109-461d-a965-cd8964e2b452", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Consider safer alternatives to Direct $_POST usage" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/deploy.php", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "$password = $_POST['password'];" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Use of potentially dangerous function Direct $_POST usage: Input validation missing" - }, - "properties": { - "findingId": "b546ec2a-94ea-47f7-95b7-b6b3fd729d6a", - "metadata": { - "function": "Direct $_POST usage", - "risk": "Input validation missing" - }, - "title": "Dangerous function: Direct $_POST usage" - }, - "ruleId": "dangerous_function_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded API Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "ELASTICSEARCH_API_KEY = \"elastic_api_key_789xyz\"" - }, - "startLine": 64 - } - } - } - ], - "message": { - "text": "Found potential hardcoded API Key in src/utils.rb" - }, - "properties": { - "findingId": "9a49fe87-069e-422d-ad32-5a7f7d4c265b", - "metadata": { - "secret_type": "API Key" - }, - "title": "Hardcoded API Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Hardcoded Password and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/utils.rb", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "REDIS_PASSWORD = \"redis_cache_password_456\"" - }, - "startLine": 63 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Hardcoded Password in src/utils.rb" - }, - "properties": { - "findingId": "2bcadd40-a1c1-414c-8d74-62493f29ef2c", - "metadata": { - "secret_type": "Hardcoded Password" - }, - "title": "Hardcoded Hardcoded Password detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "db2319c5-b551-4a14-bb26-a0d7ae2c5fa5", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Private Key and use environment variables or secure vault" - } - } - ], - "level": "error", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Private Key in src/app.go" - }, - "properties": { - "findingId": "2575602f-a5ff-45f3-9cb4-eb9e145f21ec", - "metadata": { - "secret_type": "Private Key" - }, - "title": "Hardcoded Private Key detected" - }, - "ruleId": "hardcoded_secret_high" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const BitcoinPrivateKey = \"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS\"" - }, - "startLine": 59 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "767f2d87-6a61-4d3e-bc58-5bd49caf678f", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - }, - { - "fixes": [ - { - "description": { - "text": "Remove hardcoded Potential Secret Hash and use environment variables or secure vault" - } - } - ], - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/app.go", - "uriBaseId": "WORKSPACE" - }, - "region": { - "snippet": { - "text": "const EthereumPrivateKey = \"0x4c0883a69102937d6231471b5dbb6204fe512961708279f3e2e1a2e4567890abc\"" - }, - "startLine": 62 - } - } - } - ], - "message": { - "text": "Found potential hardcoded Potential Secret Hash in src/app.go" - }, - "properties": { - "findingId": "8b3c32e4-51b1-4ff6-9bb7-6ab74b3be112", - "metadata": { - "secret_type": "Potential Secret Hash" - }, - "title": "Hardcoded Potential Secret Hash detected" - }, - "ruleId": "hardcoded_secret_medium" - } - ], - "tool": { - "driver": { - "informationUri": "https://fuzzforge.io", - "name": "FuzzForge Security Assessment", - "rules": [ - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for sensitive_file vulnerabilities with medium severity" - }, - "id": "sensitive_file_medium", - "name": "Sensitive File", - "properties": { - "category": "sensitive_file", - "severity": "medium", - "tags": [ - "security", - "sensitive_file", - "medium" - ] - }, - "shortDescription": { - "text": "sensitive_file vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for sql_injection vulnerabilities with high severity" - }, - "id": "sql_injection_high", - "name": "Sql Injection", - "properties": { - "category": "sql_injection", - "severity": "high", - "tags": [ - "security", - "sql_injection", - "high" - ] - }, - "shortDescription": { - "text": "sql_injection vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "error" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with high severity" - }, - "id": "hardcoded_secret_high", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "high", - "tags": [ - "security", - "hardcoded_secret", - "high" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for hardcoded_secret vulnerabilities with medium severity" - }, - "id": "hardcoded_secret_medium", - "name": "Hardcoded Secret", - "properties": { - "category": "hardcoded_secret", - "severity": "medium", - "tags": [ - "security", - "hardcoded_secret", - "medium" - ] - }, - "shortDescription": { - "text": "hardcoded_secret vulnerability" - } - }, - { - "defaultConfiguration": { - "level": "warning" - }, - "fullDescription": { - "text": "Detection rule for dangerous_function vulnerabilities with medium severity" - }, - "id": "dangerous_function_medium", - "name": "Dangerous Function", - "properties": { - "category": "dangerous_function", - "severity": "medium", - "tags": [ - "security", - "dangerous_function", - "medium" - ] - }, - "shortDescription": { - "text": "dangerous_function vulnerability" - } - } - ], - "version": "1.0.0" - } - } - } - ], - "version": "2.1.0" -} \ No newline at end of file diff --git a/test_projects/vulnerable_app/fuzzing-results.sarif b/test_projects/vulnerable_app/fuzzing-results.sarif deleted file mode 100644 index 9e26dfe..0000000 --- a/test_projects/vulnerable_app/fuzzing-results.sarif +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file