@eurekadevsecops/radar 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ # Parameters:
2
+ # $1 - Path to the source code folder that should be scanned
3
+ # $2 - Path to the assets folder
4
+ # $3 - Path to the output folder where scan results should be stored
5
+
6
+ set -e
7
+ opengrep --disable-version-check --config $2/rules.yaml --sarif-output $3/radar-sast.sarif $1 2>&1
@@ -9,7 +9,7 @@ class Telemetry {
9
9
 
10
10
  constructor() {
11
11
  this.enabled = !!this.#EUREKA_AGENT_TOKEN
12
- this.#EWA_URL = this.#claims(this.#EUREKA_AGENT_TOKEN).aud
12
+ this.#EWA_URL = this.#claims(this.#EUREKA_AGENT_TOKEN).aud.replace(/\/$/, '')
13
13
  }
14
14
 
15
15
  async send(path, params, body, token) {
@@ -80,17 +80,19 @@ class Telemetry {
80
80
 
81
81
  #toPostURL(path, params, token) {
82
82
  const claims = this.#claims(token ?? this.#EUREKA_AGENT_TOKEN)
83
- if (path === `scans/started`) return `${claims.aud}/scans/started`
84
- if (path === `scans/:scanID/completed`) return `${claims.aud}/scans/${params.scanID}/completed`
85
- if (path === `scans/:scanID/failed`) return `${claims.aud}/scans/${params.scanID}/completed`
86
- if (path === `scans/:scanID/metadata`) return `${claims.aud}/scans/${params.scanID}/metadata`
87
- if (path === `scans/:scanID/results`) return `${claims.aud}/scans/${params.scanID}/results`
83
+ const aud = claims.aud.replace(/\/$/, '')
84
+ if (path === `scans/started`) return `${aud}/scans/started`
85
+ if (path === `scans/:scanID/completed`) return `${aud}/scans/${params.scanID}/completed`
86
+ if (path === `scans/:scanID/failed`) return `${aud}/scans/${params.scanID}/completed`
87
+ if (path === `scans/:scanID/metadata`) return `${aud}/scans/${params.scanID}/metadata`
88
+ if (path === `scans/:scanID/results`) return `${aud}/scans/${params.scanID}/results`
88
89
  throw new Error(`Internal Error: Unknown telemetry event: POST ${path}`)
89
90
  }
90
91
 
91
92
  #toReceiveURL(path, params, token) {
92
93
  const claims = this.#claims(token ?? this.#EUREKA_AGENT_TOKEN)
93
- if (path === `scans/:scanID/summary`) return `${claims.aud}/scans/${params.scanID}/summary?profileId=${process.env.EUREKA_PROFILE}`
94
+ const aud = claims.aud.replace(/\/$/, '')
95
+ if (path === `scans/:scanID/summary`) return `${aud}/scans/${params.scanID}/summary?profileId=${process.env.EUREKA_PROFILE}`
94
96
  throw new Error(`Internal Error: Unknown telemetry event: GET ${path}`)
95
97
  }
96
98