Add DAST scanning and code knowledge graph features across the stack: - compliance-dast and compliance-graph workspace crates - Agent API handlers and routes for DAST targets/scans and graph builds - Core models and traits for DAST and graph domains - Dashboard pages for DAST targets/findings/overview and graph explorer/impact - Toast notification system with auto-dismiss for async action feedback - Button click animations and disabled states for better UX Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.4 KiB
Rust
48 lines
1.4 KiB
Rust
use crate::error::CoreError;
|
|
use crate::models::dast::{DastFinding, DastTarget};
|
|
|
|
/// Context passed to DAST agents containing discovered information
|
|
#[derive(Debug, Clone, Default)]
|
|
pub struct DastContext {
|
|
/// Discovered endpoints from crawling
|
|
pub endpoints: Vec<DiscoveredEndpoint>,
|
|
/// Technologies detected during recon
|
|
pub technologies: Vec<String>,
|
|
/// Existing SAST findings for prioritization
|
|
pub sast_hints: Vec<String>,
|
|
}
|
|
|
|
/// An endpoint discovered during crawling
|
|
#[derive(Debug, Clone)]
|
|
pub struct DiscoveredEndpoint {
|
|
pub url: String,
|
|
pub method: String,
|
|
pub parameters: Vec<EndpointParameter>,
|
|
pub content_type: Option<String>,
|
|
pub requires_auth: bool,
|
|
}
|
|
|
|
/// A parameter on a discovered endpoint
|
|
#[derive(Debug, Clone)]
|
|
pub struct EndpointParameter {
|
|
pub name: String,
|
|
/// "query", "body", "header", "path", "cookie"
|
|
pub location: String,
|
|
pub param_type: Option<String>,
|
|
pub example_value: Option<String>,
|
|
}
|
|
|
|
/// Trait for DAST testing agents (injection, XSS, auth bypass, etc.)
|
|
#[allow(async_fn_in_trait)]
|
|
pub trait DastAgent: Send + Sync {
|
|
/// Agent name (e.g., "sql_injection", "xss", "auth_bypass")
|
|
fn name(&self) -> &str;
|
|
|
|
/// Run the agent against a target with discovered context
|
|
async fn run(
|
|
&self,
|
|
target: &DastTarget,
|
|
context: &DastContext,
|
|
) -> Result<Vec<DastFinding>, CoreError>;
|
|
}
|