snyk: fix audit_logs event type filter#18929
Closed
efd6 wants to merge 1 commit intoelastic:mainfrom
Closed
Conversation
The Handlebars template stores the user's event filter config as state.event_filter, but the CEL program read state.events_filter (note the extra 's'). The optional field access returned none, so the "events" query parameter was never included in the API request, so event filtering was silently ignored. Additionally, format_query() on a list produces repeated keys (events=a&events=b). The Snyk API documents the parameter as a comma-separated list, so the fix joins the list into a single value (events=a,b). Snyk's OpenAPI spec names the parameter "event" (singular), but live testing confirms the API only honours "events" (plural) — "event" is silently ignored. The migration guide also documents the plural form: https://docs.snyk.io/snyk-api/api-end-of-life-eol-process-and-migration-guides/guides-to-migration/search-audit-logs-group-and-org-v1-api-to-ga-rest-audit-logs-api-migration-guide Tested against a live Snyk org endpoint with mito, confirming the filter now correctly narrows results.
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
cc @efd6 |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
`<!-- Type of change
Please label this PR with one of the following labels, depending on the scope of your change:
-->
Proposed commit message
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots