diff --git a/README.md b/README.md index 13f21a7..c06f7b8 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ proxy: ... -+ sysdig: -+ endpoint: ${SYSDIG_SECURE_ENDPOINT} -+ backlink: https://... # Optional override base link for backlinks. Must end in '/'. ++sysdig: ++ endpoint: ${SYSDIG_SECURE_ENDPOINT} ++ backlink: https://... # Optional override base link for backlinks. Must end in '/'. ``` - Set the environment variable `SYSDIG_SECURE_ENDPOINT` to your Sysdig Secure Endpoint. diff --git a/src/lib/endpoints.ts b/src/lib/endpoints.ts index 5af273c..6866d25 100644 --- a/src/lib/endpoints.ts +++ b/src/lib/endpoints.ts @@ -24,18 +24,20 @@ export const API_INVENTORY = "/api/cspm/v1/inventory/resources"; */ let DEFAULT_BACKLINK_BASE: string = "https://secure.sysdig.com/" -const BACKLINKS: Record = { +let SECURE_PREFIX: string = "secure/#/"; + +const SECURE_BACKLINKS: Record = { // Backlink path to Vulnerability Management at Runtime - "vm-runtime": "#/vulnerabilities/runtime/", + "vm-runtime": SECURE_PREFIX + "vulnerabilities/runtime/", // Backlink path to Vulnerability Management at Registry - "vm-registry": "#/vulnerabilities/registry/", + "vm-registry": SECURE_PREFIX + "vulnerabilities/registry/", // Backlink path to Vulnerability Management at Pipeline - "vm-pipeline": "#/vulnerabilities/pipeline/", + "vm-pipeline": SECURE_PREFIX + "vulnerabilities/pipeline/", // Backlink path to Inventory - "inventory": "#/inventory" + "inventory": SECURE_PREFIX + "inventory" } export function getBacklink(endpoint: string | undefined, backlink: string | undefined, section: string) : string { @@ -47,7 +49,7 @@ export function getBacklink(endpoint: string | undefined, backlink: string | und backlink_base = endpoint } - let backlink_section : string = BACKLINKS[section]; + let backlink_section : string = SECURE_BACKLINKS[section]; if (backlink_section === undefined) { return "";