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:
55
compliance-core/src/traits/issue_tracker.rs
Normal file
55
compliance-core/src/traits/issue_tracker.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
use crate::error::CoreError;
|
||||
use crate::models::TrackerIssue;
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
pub trait IssueTracker: Send + Sync {
|
||||
fn name(&self) -> &str;
|
||||
|
||||
async fn create_issue(
|
||||
&self,
|
||||
owner: &str,
|
||||
repo: &str,
|
||||
title: &str,
|
||||
body: &str,
|
||||
labels: &[String],
|
||||
) -> Result<TrackerIssue, CoreError>;
|
||||
|
||||
async fn update_issue_status(
|
||||
&self,
|
||||
owner: &str,
|
||||
repo: &str,
|
||||
external_id: &str,
|
||||
status: &str,
|
||||
) -> Result<(), CoreError>;
|
||||
|
||||
async fn add_comment(
|
||||
&self,
|
||||
owner: &str,
|
||||
repo: &str,
|
||||
external_id: &str,
|
||||
body: &str,
|
||||
) -> Result<(), CoreError>;
|
||||
|
||||
async fn create_pr_review(
|
||||
&self,
|
||||
owner: &str,
|
||||
repo: &str,
|
||||
pr_number: u64,
|
||||
body: &str,
|
||||
comments: Vec<ReviewComment>,
|
||||
) -> Result<(), CoreError>;
|
||||
|
||||
async fn find_existing_issue(
|
||||
&self,
|
||||
owner: &str,
|
||||
repo: &str,
|
||||
fingerprint: &str,
|
||||
) -> Result<Option<TrackerIssue>, CoreError>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ReviewComment {
|
||||
pub path: String,
|
||||
pub line: u32,
|
||||
pub body: String,
|
||||
}
|
||||
5
compliance-core/src/traits/mod.rs
Normal file
5
compliance-core/src/traits/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
pub mod issue_tracker;
|
||||
pub mod scanner;
|
||||
|
||||
pub use issue_tracker::IssueTracker;
|
||||
pub use scanner::{ScanOutput, Scanner};
|
||||
17
compliance-core/src/traits/scanner.rs
Normal file
17
compliance-core/src/traits/scanner.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::path::Path;
|
||||
|
||||
use crate::error::CoreError;
|
||||
use crate::models::{Finding, SbomEntry, ScanType};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct ScanOutput {
|
||||
pub findings: Vec<Finding>,
|
||||
pub sbom_entries: Vec<SbomEntry>,
|
||||
}
|
||||
|
||||
#[allow(async_fn_in_trait)]
|
||||
pub trait Scanner: Send + Sync {
|
||||
fn name(&self) -> &str;
|
||||
fn scan_type(&self) -> ScanType;
|
||||
async fn scan(&self, repo_path: &Path, repo_id: &str) -> Result<ScanOutput, CoreError>;
|
||||
}
|
||||
Reference in New Issue
Block a user