feat: Add Snyk integration with On New Issue Detected trigger and Ign…#3021
feat: Add Snyk integration with On New Issue Detected trigger and Ign…#3021nebojsaj1726 wants to merge 7 commits intosuperplanehq:mainfrom
Conversation
…ore Issue action Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
…cy in Snyk integration Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
web_src/src/pages/workflowv2/mappers/snyk/on_new_issue_detected.ts
Outdated
Show resolved
Hide resolved
|
@nebojsaj1726 thanks for submitting this one! I tried to get it to work, but I'm a bit stuck, the integrations shows as connected: However, even though I have some issues: And the component is configured: I am not receiving any events. Few general notes on UX
|
|
@nebojsaj1726 I also came across https://docs.snyk.io/snyk-api/using-specific-snyk-apis/snyk-apps-apis/create-a-snyk-app-using-the-snyk-api |
|
@AleksandarCole Thanks for the feedback. Re: Not receiving events - Are you using a Snyk Business or Enterprise plan? I verified the integration logic works by manually setting the webhook to 'ready' status in the database and sending test payloads via curl with proper HMAC signatures - events fired correctly. Re: UX improvements - All good points, can implement:
Re: Snyk Apps API - Interesting suggestion. The current implementation uses simple API token auth (similar to most integrations). Snyk Apps would provide OAuth-based auth with better token management and refresh, but adds complexity:
We could explore this as a follow-up enhancement once the basic integration is working. |
|
@nebojsaj1726 I understand now, I guess they let you configure PAT but you can't really use it. The fact that only Let me know if there's some way to achieve this for non-enterprise, if not I guess we have to flag this not as |
|
@AleksandarCole I looked on this and as i saw here https://docs.snyk.io/snyk-api and here https://docs.snyk.io/snyk-api/authentication-for-api - the entire Snyk API is restricted to Enterprise customers. Free/Team plan tokens only work for CLI and IDE authentication, not API calls Given this limitation, if you want to keep this integration and add appropriate warnings/notifications about the Enterprise requirement, please let me know and I can push the UI improvements. |
|
Thanks again @nebojsaj1726, I will have to figure out the best way to test this first. Feel free to push the UI changes. After that I will have to find a bit of time for a more detailed review and to do a deeper dive into this before we merge. |
Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
Signed-off-by: Nebojsa Jacovic <nebojsa.jacovic@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| type Organization struct { | ||
| ID string `json:"id"` | ||
| Name string `json:"name"` | ||
| } |
There was a problem hiding this comment.
Unused Organization struct and Organizations metadata field
Low Severity
The Organization struct and the Organizations field in Metadata are defined but never populated anywhere. The Sync method only sets the User field when calling SetMetadata, leaving Organizations always nil. Other integrations in the codebase keep their Metadata structs tight with only fields that are actually populated during sync. This dead code adds unnecessary noise and could mislead future developers into thinking organization data is being tracked.





Summary
This PR introduces the Snyk security integration to SuperPlane. It establishes the base connection using an API Token and Organization ID, adds the
onNewIssueDetectedwebhook trigger and theignoreIssueaction component.Implements #2627
Features
Implementation Details
snykwith HTTP client for Snyk API (https://api.snyk.io).Testing Notes
The Snyk free plan does not support API access for webhooks, so webhook registration returns 403:
Workaround for testing: The webhook was manually marked as ready in the local database to bypass the provisioning failure. This allowed local testing by curling the webhook endpoint
/api/v1/webhooks/{webhook-uuid}with the example payload to simulate incoming Snyk events.The integration code itself is correct and will work on Snyk Business/Enterprise plans that support webhook API access. The full pipeline (trigger → action) was verified to work correctly — the trigger emits events when receiving webhooks, and the action component executes and calls the Snyk API as expected (403 response due to free plan limitation, but the integration logic is sound).
Test Plan
make test PKG_TEST_PACKAGES=./pkg/integrations/snyk/...)make lint && make check.build.app)make check.build.ui)Checklist