Building 70 Projects ranging from beginner to advanced so anyone can β learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company π
Go aicertificationcloud-engineeringcybercybersecuritycybersecurity-analystcybersecurity-certificationcybersecurity-certificationscybersecurity-educationcybersecurity-jobscybersecurity-portfoliocybersecurity-projectscybersecurity-toolsgrchackinglearningpentestingproject-repositoryprojetcspython
fix(demo): wire AuditSubscriber so events reach the audit log
CarterPerez-dev33cddb57cd63
diff --git a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/bundle.cr b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/bundle.crindex 1f5e7274..23282a04 100644--- a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/bundle.cr+++ b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/bundle.cr@@ -105,9 +105,9 @@ module CRE::Complianceprivate def build_manifest(entries : Array(FileEntry)) : String{- "framework" => @framework,- "generated" => Time.utc.to_rfc3339,- "files" => entries.map { |e|+ "framework" => @framework,+ "generated" => Time.utc.to_rfc3339,+ "files" => entries.map { |e|{"name" => e.name, "sha256" => e.sha256_hex, "size" => e.size}},}.to_jsondiff --git a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/control_mapping.cr b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/control_mapping.crindex a1dc8b12..9cef80f6 100644--- a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/control_mapping.cr+++ b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/compliance/control_mapping.cr@@ -23,12 +23,12 @@ module CRE::Compliance}PCI_DSS = {- "rotation.completed" => ["8.3.9", "8.6.3"],- "rotation.failed" => ["8.3.9", "10.2.1"],- "policy.violation" => ["8.6.3", "10.2.1"],- "drift.detected" => ["10.2.1", "11.5.2"],- "audit.batch.sealed" => ["10.5.2", "10.5.3"],- "key.rotation.kek" => ["3.7.4"],+ "rotation.completed" => ["8.3.9", "8.6.3"],+ "rotation.failed" => ["8.3.9", "10.2.1"],+ "policy.violation" => ["8.6.3", "10.2.1"],+ "drift.detected" => ["10.2.1", "11.5.2"],+ "audit.batch.sealed" => ["10.5.2", "10.5.3"],+ "key.rotation.kek" => ["3.7.4"],}ISO27001 = {diff --git a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/demo/tier_1.cr b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/demo/tier_1.crindex 22475c05..3f384aa1 100644--- a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/demo/tier_1.cr+++ b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/demo/tier_1.cr@@ -5,6 +5,7 @@require "../engine/event_bus"require "../engine/rotation_orchestrator"+require "../engine/subscribers/audit_subscriber"require "../persistence/sqlite/sqlite_persistence"require "../rotators/env_file"require "../audit/audit_log"@@ -51,15 +52,18 @@ module CRE::Demoio.puts CRE::Tui::Ansi.bold("Step 3 - Rotating (4-step contract):")bus = CRE::Engine::EventBus.newch = bus.subscribe(buffer: 256)+ audit_sub = CRE::Engine::Subscribers::AuditSubscriber.new(bus, log)+ audit_sub.startbus.runrotator = CRE::Rotators::EnvFileRotator.neworchestrator = CRE::Engine::RotationOrchestrator.new(bus, persist)state = orchestrator.run(cred, rotator)- sleep 0.05.seconds+ sleep 0.15.secondsdrain_steps(ch, io)+ audit_sub.stopbus.stopio.puts ""