Initial commit: Compliance Scanner Agent
Autonomous security and compliance scanning agent for git repositories. Features: SAST (Semgrep), SBOM (Syft), CVE monitoring (OSV.dev/NVD), GDPR/OAuth pattern detection, LLM triage, issue creation (GitHub/GitLab/Jira), PR reviews, and Dioxus fullstack dashboard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
53
compliance-agent/src/main.rs
Normal file
53
compliance-agent/src/main.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
mod agent;
|
||||
mod config;
|
||||
mod database;
|
||||
mod error;
|
||||
mod api;
|
||||
mod llm;
|
||||
mod pipeline;
|
||||
mod scheduler;
|
||||
#[allow(dead_code)]
|
||||
mod trackers;
|
||||
mod webhooks;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")))
|
||||
.init();
|
||||
|
||||
dotenvy::dotenv().ok();
|
||||
|
||||
tracing::info!("Loading configuration...");
|
||||
let config = config::load_config()?;
|
||||
|
||||
tracing::info!("Connecting to MongoDB...");
|
||||
let db = database::Database::connect(&config.mongodb_uri, &config.mongodb_database).await?;
|
||||
db.ensure_indexes().await?;
|
||||
|
||||
let agent = agent::ComplianceAgent::new(config.clone(), db.clone());
|
||||
|
||||
tracing::info!("Starting scheduler...");
|
||||
let scheduler_agent = agent.clone();
|
||||
let scheduler_handle = tokio::spawn(async move {
|
||||
if let Err(e) = scheduler::start_scheduler(&scheduler_agent).await {
|
||||
tracing::error!("Scheduler error: {e}");
|
||||
}
|
||||
});
|
||||
|
||||
tracing::info!("Starting webhook server...");
|
||||
let webhook_agent = agent.clone();
|
||||
let webhook_handle = tokio::spawn(async move {
|
||||
if let Err(e) = webhooks::start_webhook_server(&webhook_agent).await {
|
||||
tracing::error!("Webhook server error: {e}");
|
||||
}
|
||||
});
|
||||
|
||||
tracing::info!("Starting REST API on port {}...", config.agent_port);
|
||||
api::start_api_server(agent, config.agent_port).await?;
|
||||
|
||||
let _ = tokio::join!(scheduler_handle, webhook_handle);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user