From afe565e4d50cc2e04ab5d44719f9771b7ee3ff6d Mon Sep 17 00:00:00 2001 From: Shawn Burke Date: Tue, 1 Jul 2025 09:50:31 +1000 Subject: [PATCH] ServiceNow integration and accept file --- README.relay.md | 1 + agent/common/integration.go | 3 ++- .../snykbroker/accept_files/accept.servicenow.json | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 agent/server/snykbroker/accept_files/accept.servicenow.json diff --git a/README.relay.md b/README.relay.md index 67e055c..d17744a 100644 --- a/README.relay.md +++ b/README.relay.md @@ -82,6 +82,7 @@ Generally the naming works like: | **Bitbucket Hosted** | `BITBUCKET_API=https://bitbucket.mycompany.com`, `BITBUCKET_USERNAME`, `BITBUCKET_PASSWORD` | | **Jira** | `JIRA_API=https://jira.mycompany.com`, `JIRA_USERNAME`, `JIRA_TOKEN` | | **Jira Bearer/Cloud** | Arg `-s bearer`, `JIRA_API=https://mycompany.atlassian.com`, `JIRA_TOKEN` | +| **ServiceNow** | `SERVICENOW_INSTANCE_NAME=my-instance` from "https://my-instance.service-now.com", `SERVICENOW_USERNAME`, `SERVICENOW_PASSWORD` | ## How it works diff --git a/agent/common/integration.go b/agent/common/integration.go index cf1ed8e..d6793b9 100644 --- a/agent/common/integration.go +++ b/agent/common/integration.go @@ -29,6 +29,7 @@ const ( IntegrationSonarqube Integration = "sonarqube" IntegrationBitbucket Integration = "bitbucket" IntegrationPrometheus Integration = "prometheus" + IntegrationServiceNow Integration = "servicenow" ) var subtypes = map[Integration][]string{ @@ -60,7 +61,7 @@ func ParseIntegration(s string) (Integration, error) { } func ValidIntegrations() []Integration { - return []Integration{IntegrationGithub, IntegrationJira, IntegrationGitlab, IntegrationBitbucket, IntegrationSonarqube, IntegrationPrometheus} + return []Integration{IntegrationGithub, IntegrationJira, IntegrationGitlab, IntegrationBitbucket, IntegrationSonarqube, IntegrationPrometheus, IntegrationServiceNow} } type IntegrationInfo struct { diff --git a/agent/server/snykbroker/accept_files/accept.servicenow.json b/agent/server/snykbroker/accept_files/accept.servicenow.json new file mode 100644 index 0000000..76b83cf --- /dev/null +++ b/agent/server/snykbroker/accept_files/accept.servicenow.json @@ -0,0 +1,14 @@ +{ + "private": [ + { + "method": "any", + "path": "/*", + "origin": "https://${SERVICENOW_INSTANCE_NAME}.service-now.com", + "auth": { + "scheme": "basic", + "username": "${SERVICENOW_USERNAME}", + "password": "${SERVICENOW_PASSWORD}" + } + } + ] +}