Skip to content

Feat/synthetics audit#3

Merged
asomensari-es merged 4 commits into
mainfrom
feat/synthetics-audit
Jul 9, 2026
Merged

Feat/synthetics audit#3
asomensari-es merged 4 commits into
mainfrom
feat/synthetics-audit

Conversation

@asomensari-es

Copy link
Copy Markdown
Owner

Adding Synthetic Monitoring audit and cleanup capabilities

Adilson Somensari added 4 commits July 9, 2026 17:39
Extends cleanup mode with two read-modify-write asset types:
- workload_entity: removes one entity GUID from a workload's static entity list
- workflow_entity: removes one entity GUID from workflow issue filter predicates;
  aborts if removal would leave the workflow with no predicates

Adds unit tests for all previously uncovered audit fetchers (dashboards,
workflows, workloads, service levels) and for the cleanup deleteAsset dispatch;
audit coverage rises from ~45% to ~68%, cleanup from ~92% to ~95%.

Updates README with entity removal quick-start examples and corrects the
cleanup flags table to list all four supported asset types.
Audit mode now scans synthetic monitors for two finding categories:
- Disabled monitors (any type): config finding flagging monitors with
  status=DISABLED so they can be cleaned up or re-enabled
- Hardcoded IDs in scripts: SCRIPT_API and SCRIPT_BROWSER monitor scripts
  are scanned using the existing ScanText pattern engine; appId, entityGuid,
  hostId, and other hardcoded references are reported per-monitor

Cleanup mode adds synthetics_monitor as a full-deletion asset type using
the syntheticsDeleteMonitor NerdGraph mutation. The monitor's entity GUID
(asset_id from the audit CSV) is passed directly to the mutation.

All new code is covered by unit tests (fetch_synthetics.go at 97.1%).
README and CLI help text updated with new skip value and cleanup type.
… endpoint

SyntheticsScriptApiMonitor and SyntheticsScriptBrowserMonitor are accessible
via actor.account.synthetics, not actor.entity(guid). The entity API returns
SyntheticMonitorEntity which has no script field. Switch the script fetch query
to actor.account.synthetics.script(monitorGuid) which returns
SyntheticsMonitorScriptQueryResponse with the text field.

Confirmed via NerdGraph schema introspection.
@asomensari-es asomensari-es merged commit 9f435a1 into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant