@cryptotaxi247 / CoPilot / commits / 279265dc

345 failed to invoke alert after latest upgrade (#346)

* Add conditional IoC handling in alert creation process * push lab build * Enable Discord notifications for Docker image updates in CI workflow * Update Docker workflow to use 'main' branch and 'latest' tags for backend and frontend images * Update docker.yml * Update Docker workflow to trigger on 'main' branch * Update Docker workflow to trigger on '345-failed-to-invoke-alert-after-latest-upgrade' branch * Update docker.yml

taylor_socfortress committed Dec 3, 2024 at 09:50 UTC 279265dcff9c44c1c289df035f897def7a69e62c
1 file changed +6 -1
backend/app/incidents/services/incident_alert.py
+6 -1
@@ -846,7 +846,12 @@ async def create_alert(
846 existing_alert,
847 )
848 await add_asset_to_copilot_alert(alert_payload, existing_alert, customer_code, session)
849 - await add_ioc_to_copilot_alert(alert_payload, existing_alert, customer_code, session)
849 + # If the alert has an IoC, add it to the alert
850 + if alert_payload.ioc_payload is not None:
851 + logger.info(f"Adding IoC to alert {existing_alert}")
852 + await add_ioc_to_copilot_alert(alert_payload, existing_alert, customer_code, session)
853 + else:
854 + logger.info(f"No IoC found for alert {existing_alert}")
855 return existing_alert
856 return await create_alert_full(alert_payload, customer_code, session)
857