Skip to content

Commit 6ab64df

Browse files
committed
Cleaning up log creation
1 parent 8b9f727 commit 6ab64df

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

Dockerfile.allinone

Whitespace-only changes.

entrypoint_allinone.sh

Whitespace-only changes.

src/main.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ fn load_shield_config() -> Option<ShieldConfig> {
105105
if yaml_path.exists() {
106106
let content = fs::read_to_string(yaml_path).ok()?;
107107
let config: ShieldConfig = serde_yaml::from_str(&content).ok()?;
108-
println!("📋 Loaded shieldci.yml configuration");
108+
println!("Loaded shieldci.yml configuration");
109109
Some(config)
110110
} else {
111-
println!("⚠️ No shieldci.yml found, falling back to auto-detection");
111+
println!("No shieldci.yml found, falling back to auto-detection");
112112
None
113113
}
114114
}
@@ -156,12 +156,12 @@ fn fetch_config_from_shell() -> TargetConfig {
156156

157157
fn launch_sandbox(config: &TargetConfig) {
158158
if !config.build_command.is_empty() {
159-
println!("⚙️ Running build: {}", config.build_command);
159+
println!("Running build: {}", config.build_command);
160160
let parts: Vec<&str> = config.build_command.split_whitespace().collect();
161161
let _ = Command::new(parts[0]).args(&parts[1..]).status();
162162
}
163163

164-
println!("🚀 Launching {} server on {}...", config.framework, config.target_url);
164+
println!("Launching {} server", config.framework);
165165
let run_parts: Vec<&str> = config.run_command.split_whitespace().collect();
166166
Command::new(run_parts[0])
167167
.args(&run_parts[1..])
@@ -172,16 +172,16 @@ fn launch_sandbox(config: &TargetConfig) {
172172
}
173173

174174
async fn wait_for_target(url: &str, max_retries: u8) -> Result<(), String> {
175-
println!("Waiting for target {} to come online...", url);
175+
println!("Waiting for target to come online");
176176
let client = Client::builder().timeout(Duration::from_secs(2)).build().unwrap();
177177
for _ in 1..=max_retries {
178178
if client.get(url).send().await.is_ok() {
179-
println!("Target is up and responding!");
179+
println!("Target is up and responding");
180180
return Ok(());
181181
}
182182
sleep(Duration::from_secs(2)).await;
183183
}
184-
Err(format!("Target {} failed to respond.", url))
184+
Err(format!("Target failed to respond."))
185185
}
186186

187187
fn build_endpoint_context(config: &ShieldConfig, base_url: &str) -> String {
@@ -237,7 +237,7 @@ fn flatten_codebase(dir: &str) -> String {
237237
}
238238

239239
async fn ask_llm(system_prompt: &str) -> ToolCall {
240-
println!("🧠 Invoking local model via Ollama API...");
240+
println!("Invoking ShieldCI LLM");
241241
let client = Client::new();
242242
let req_body = serde_json::json!({
243243
"model": "llama3.1",
@@ -265,7 +265,7 @@ async fn ask_llm(system_prompt: &str) -> ToolCall {
265265
}
266266

267267
async fn execute_mcp_tool_stdio(tool_call: &ToolCall) -> Result<String, Box<dyn std::error::Error>> {
268-
println!("🤝 Initiating MCP Handshake & Strike: {} on {}", tool_call.tool, tool_call.target);
268+
println!("Initiating MCP Handshake & Strike: {}", tool_call.tool);
269269

270270
let mut child = Command::new("docker")
271271
.args(["run", "-i", "--rm", "shieldci-kali-image"])
@@ -303,7 +303,7 @@ async fn execute_mcp_tool_stdio(tool_call: &ToolCall) -> Result<String, Box<dyn
303303
}
304304

305305
async fn generate_report(trace: &str, codebase: &str, success: bool) -> String {
306-
println!("📝 Compiling final security assessment...");
306+
println!("Compiling final security assessment");
307307
let client = Client::new();
308308
let status = if success { "VULNERABILITY DISCOVERED" } else { "NO VULNERABILITIES DETECTED" };
309309

@@ -458,7 +458,7 @@ async fn main() {
458458

459459
// ── Generate dynamic test plan ──
460460
let test_plan = generate_test_plan(&shield_config, &docker_url);
461-
println!("\n📋 Test Plan ({} tests):", test_plan.len());
461+
println!("\nTest Plan ({} tests):", test_plan.len());
462462
for (i, (phase, tool, target)) in test_plan.iter().enumerate() {
463463
println!(" {}. [{}] {} → {}", i + 1, phase, tool, target);
464464
}
@@ -469,7 +469,7 @@ async fn main() {
469469

470470
// ── Execute each planned test ──
471471
for (i, (phase, tool, target)) in test_plan.iter().enumerate() {
472-
println!("\n--- Test {}/{}: {} ---", i + 1, total, phase);
472+
println!("\nTest {}/{}: {}", i + 1, total, phase);
473473

474474
let tool_call = ToolCall { tool: tool.clone(), target: target.clone() };
475475
let output = execute_mcp_tool_stdio(&tool_call).await.unwrap_or_else(|e| e.to_string());
@@ -482,7 +482,7 @@ async fn main() {
482482

483483
if output.to_lowercase().contains("vulnerable") || output.to_lowercase().contains("payload") {
484484
exploit_found = true;
485-
println!("🚨 Vulnerability detected in: {}", phase);
485+
println!("Vulnerability detected in: {}", phase);
486486
}
487487
}
488488

@@ -538,14 +538,14 @@ async fn main() {
538538

539539
if output.to_lowercase().contains("vulnerable") || output.to_lowercase().contains("payload") {
540540
exploit_found = true;
541-
println!("🚨 Vulnerability detected by adaptive strike!");
541+
println!("Vulnerability detected by adaptive strike!");
542542
}
543543
}
544544

545545
// ── Generate final report ──
546546
let report = generate_report(&attack_trace, &codebase, exploit_found).await;
547547
fs::write("SHIELD_REPORT.md", &report).expect("Unable to write report");
548-
println!("\n--- FINAL REPORT ---\n{}\n Saved to SHIELD_REPORT.md", report);
548+
println!("\n--- FINAL REPORT ---\n{}\n Saved to SHIELD_REPORT.md", report);
549549

550550
// ── Write structured JSON output for frontend API ──
551551
let vulnerabilities = parse_vulns_from_trace(&attack_trace);
@@ -556,7 +556,7 @@ async fn main() {
556556
};
557557
let json_output = serde_json::to_string_pretty(&scan_output).unwrap_or_default();
558558
fs::write("shield_results.json", &json_output).expect("Unable to write results JSON");
559-
println!("Saved structured results to shield_results.json");
559+
println!("Saved structured results to shield_results.json");
560560
}
561561

562562
/// Extract vulnerability entries from the attack trace.

0 commit comments

Comments
 (0)