fix(wazuh): persist break-glass packets safely
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m25s
CD Pipeline / build-and-deploy (push) Failing after 9m41s
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
ogt
2026-07-15 21:15:03 +08:00
parent 05b575d809
commit ff9798bdab
3 changed files with 55 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ from src.services.awooop_ansible_check_mode_service import (
)
from src.services.awooop_ansible_post_verifier import postconditions_for_catalog
from src.services.iwooos_wazuh_controlled_executor_runtime import (
_LIVE_RUNTIME_SQL,
build_iwooos_wazuh_controlled_executor_runtime_readback,
)
@@ -46,6 +47,12 @@ def _current_wazuh_source_recurrence(observed_at: str) -> dict[str, object]:
}
def test_wazuh_runtime_sql_reads_schema_safe_packet_fallback() -> None:
assert "ansible_break_glass_capability_work_item_queued" in _LIVE_RUNTIME_SQL
assert "remediation_executed" in _LIVE_RUNTIME_SQL
assert "semantic_operation_type" in _LIVE_RUNTIME_SQL
def _durable_scheduled_wazuh_source_recurrence(
observed_at: str,
identity_anchor: str = (
@@ -600,9 +607,14 @@ async def test_failed_wazuh_check_atomically_queues_deduplicated_packet(
assert len(calls) == 2
insert_sql, insert_params = calls[1]
assert "ansible_break_glass_capability_work_item_queued" in insert_sql
assert "remediation_executed" in insert_sql
assert "pg_get_constraintdef" in insert_sql
assert "WHERE NOT EXISTS" in insert_sql
packet_input = json.loads(str(insert_params["input"]))
assert packet_input["work_item_id"] == "P0-03-WAZUH-ALERT-INGRESS"
assert packet_input["semantic_operation_type"] == (
"ansible_break_glass_capability_work_item_queued"
)
assert packet_input["secret_value_exposed"] is False