@@ -306,7 +306,8 @@ def load_alert_template(template_id: str) -> Optional[Dict]:
306306def send_phase_alert (
307307 phase_name : str ,
308308 base_time : datetime ,
309- uam_config : dict
309+ uam_config : dict ,
310+ strip_helios_prefix : bool = False
310311) -> bool :
311312 """Send alert for a specific phase with correct timing.
312313
@@ -378,6 +379,12 @@ def send_phase_alert(
378379 else :
379380 alert [key ] = value
380381
382+ # Strip "HELIOS - " prefix from alert title if requested
383+ if strip_helios_prefix :
384+ title = alert .get ("finding_info" , {}).get ("title" , "" )
385+ if title .startswith ("HELIOS - " ):
386+ alert ["finding_info" ]["title" ] = title [len ("HELIOS - " ):]
387+
381388 # Send alert via UAM ingest API
382389 try :
383390 ingest_url = uam_config ['uam_ingest_url' ].rstrip ('/' ) + '/v1/alerts'
@@ -663,15 +670,26 @@ def generate_m365_sharepoint_exfil(base_time: datetime) -> List[Dict]:
663670 return events
664671
665672
666- def generate_apollo_ransomware_scenario (siem_context : Optional [Dict ] = None ) -> Dict :
673+ def generate_apollo_ransomware_scenario (
674+ siem_context : Optional [Dict ] = None ,
675+ suppress_alerts : Optional [bool ] = None ,
676+ strip_helios_prefix : Optional [bool ] = None ,
677+ ) -> Dict :
667678 """Generate the complete Apollo ransomware scenario (Proofpoint + M365 only)
668679
669680 Args:
670681 siem_context: Optional dict with SIEM query results for timestamp correlation.
671682 Expected format: {"results": [...], "anchors": {...}}
672683 If provided, timestamps are calculated relative to existing EDR/WEL data.
673684 If None, falls back to offset from current time.
685+ suppress_alerts: If True, skip sending UAM alerts. Env fallback: SCENARIO_SUPPRESS_ALERTS.
686+ strip_helios_prefix: If True, remove "HELIOS - " prefix from alert titles. Env fallback: SCENARIO_STRIP_HELIOS_PREFIX.
674687 """
688+ # Resolve options from args or env vars
689+ if suppress_alerts is None :
690+ suppress_alerts = os .getenv ('SCENARIO_SUPPRESS_ALERTS' , 'false' ).lower () == 'true'
691+ if strip_helios_prefix is None :
692+ strip_helios_prefix = os .getenv ('SCENARIO_STRIP_HELIOS_PREFIX' , 'false' ).lower () == 'true'
675693
676694 # Determine base time based on SIEM context or fallback
677695 use_correlation = False
@@ -714,7 +732,7 @@ def generate_apollo_ransomware_scenario(siem_context: Optional[Dict] = None) ->
714732 print ("=" * 80 + "\n " )
715733
716734 # Initialize alert detonation from env vars
717- alerts_enabled = os .getenv ('SCENARIO_ALERTS_ENABLED' , 'false' ).lower () == 'true'
735+ alerts_enabled = ( not suppress_alerts ) and os .getenv ('SCENARIO_ALERTS_ENABLED' , 'false' ).lower () == 'true'
718736 uam_config = None
719737
720738 if alerts_enabled :
@@ -779,6 +797,8 @@ def generate_apollo_ransomware_scenario(siem_context: Optional[Dict] = None) ->
779797 print ("\n 🚨 ALERT DETONATION ENABLED" )
780798 print (f" UAM Ingest: { uam_ingest_url } " )
781799 print (f" Account ID: { uam_account_id } " )
800+ if strip_helios_prefix :
801+ print (f" Strip HELIOS prefix: Yes" )
782802 print ("=" * 80 )
783803 else :
784804 print ("⚠️ SCENARIO_ALERTS_ENABLED=true but UAM credentials missing" )
@@ -821,13 +841,13 @@ def generate_apollo_ransomware_scenario(siem_context: Optional[Dict] = None) ->
821841 # Send corresponding alert if enabled and phase has alert mapping
822842 if alerts_enabled and phase_name in ALERT_PHASE_MAPPING :
823843 print (f" 📤 Sending alert for { phase_name } ..." , end = " " )
824- success = send_phase_alert (phase_name , phase_base_time , uam_config )
844+ success = send_phase_alert (phase_name , phase_base_time , uam_config , strip_helios_prefix = strip_helios_prefix )
825845 print (f"{ '✓' if success else '✗' } " )
826846
827847 # Send RDP alert after data exfiltration phase
828848 if alerts_enabled and phase_name == "📤 PHASE 4: Data Exfiltration" :
829849 print (f" 📤 Sending RDP download alert..." , end = " " )
830- success = send_phase_alert ("rdp_download" , phase_base_time , uam_config )
850+ success = send_phase_alert ("rdp_download" , phase_base_time , uam_config , strip_helios_prefix = strip_helios_prefix )
831851 print (f"{ '✓' if success else '✗' } " )
832852
833853 # Send standalone WEL alerts (not tied to a specific event generation phase)
@@ -841,7 +861,7 @@ def generate_apollo_ransomware_scenario(siem_context: Optional[Dict] = None) ->
841861 ]
842862 for alert_key , alert_desc in wel_alerts :
843863 print (f" 📤 { alert_desc } ..." , end = " " )
844- success = send_phase_alert (alert_key , base_time , uam_config )
864+ success = send_phase_alert (alert_key , base_time , uam_config , strip_helios_prefix = strip_helios_prefix )
845865 print (f"{ '✓' if success else '✗' } " )
846866
847867 all_events .sort (key = lambda x : x ["timestamp" ])
0 commit comments