From 31463680f98d7dd162e8f584b45335681f863a43 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 24 Jun 2025 18:40:35 +0100 Subject: [PATCH 1/5] chore: add sbom_generation file --- sbom_generation.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sbom_generation.yaml diff --git a/sbom_generation.yaml b/sbom_generation.yaml new file mode 100644 index 0000000..7e731d9 --- /dev/null +++ b/sbom_generation.yaml @@ -0,0 +1,27 @@ +# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + +# This OCI DevOps build specification file [1] generates a Software Bill of Materials (SBOM) of the repository. +# The file is needed to run checks for third-party vulnerabilities and business approval according to Oracle's GitHub policies. +# [1] https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm + +version: 0.1 +component: build +timeoutInSeconds: 1000 +shell: bash + +steps: + - type: Command + name: "Install dependencies & cyclonedx-node-npm package" + command: | + cd extension-api + yarn install && yarn add -D @cyclonedx/cyclonedx-npm@1.19.3 + - type: Command + name: "Run cyclonedx-node-npm on extension-api" + command: | + cd extension-api + # For more details, visit https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/README.md + npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file artifactSBOM.json --spec-version 1.4 --flatten-components +outputArtifacts: + - name: artifactSBOM + type: BINARY + location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json From 18ced43eb93d217f33e9e0a2d60d04f3845a8033 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 24 Jun 2025 18:59:47 +0100 Subject: [PATCH 2/5] chore: use latest version of @cyclonedx/cyclonedx-npm --- sbom_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index 7e731d9..e5010c6 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -14,7 +14,7 @@ steps: name: "Install dependencies & cyclonedx-node-npm package" command: | cd extension-api - yarn install && yarn add -D @cyclonedx/cyclonedx-npm@1.19.3 + yarn install && yarn add -D @cyclonedx/cyclonedx-npm - type: Command name: "Run cyclonedx-node-npm on extension-api" command: | From f5156f0c3259415123a7fdd2bd2dc0201630738a Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Mon, 30 Jun 2025 20:08:17 +0100 Subject: [PATCH 3/5] fix: switch to using cyclonedx-node-yarn --- sbom_generation.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index e5010c6..2d01a3c 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -11,16 +11,27 @@ shell: bash steps: - type: Command - name: "Install dependencies & cyclonedx-node-npm package" + name: "Install corepack" command: | cd extension-api - yarn install && yarn add -D @cyclonedx/cyclonedx-npm + npm install -g corepack - type: Command - name: "Run cyclonedx-node-npm on extension-api" + name: "Install latest yarn" command: | cd extension-api - # For more details, visit https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/README.md - npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file artifactSBOM.json --spec-version 1.4 --flatten-components + yarn set version stable + yarn install + - type: Command + name: "Install extension-api dependencies" + command: | + cd extension-api + yarn install + - type: Command + name: "Run cyclonedx-node-yarn on extension-api" + command: | + cd extension-api + # For more details, visit https://github.com/CycloneDX/cyclonedx-node-yarn/blob/main/README.md + yarn dlx -q @cyclonedx/yarn-plugin-cyclonedx --production --output-format JSON --output-file artifactSBOM.json --spec-version 1.4 outputArtifacts: - name: artifactSBOM type: BINARY From 99666cce1629935d69c877cee9982be1cbcc081c Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 1 Jul 2025 16:53:51 +0100 Subject: [PATCH 4/5] fix: add step to install node 22 and matching npm --- sbom_generation.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index 2d01a3c..e927132 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -10,6 +10,14 @@ timeoutInSeconds: 1000 shell: bash steps: + - type: Command + name: "Install Node.js 22 and matching npm" + command: | + # Ref https://github.com/oracle/netsuite-suitecloud-sdk/blob/master/sbom_generation.yaml + curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - + yum install -y nodejs + node -v + npm -v - type: Command name: "Install corepack" command: | From c7d1225b130da5d1b8dae202b8be933a47e499b2 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 1 Jul 2025 17:06:38 +0100 Subject: [PATCH 5/5] fix: downgrade node version to 18 --- sbom_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index e927132..0b2709f 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -14,7 +14,7 @@ steps: name: "Install Node.js 22 and matching npm" command: | # Ref https://github.com/oracle/netsuite-suitecloud-sdk/blob/master/sbom_generation.yaml - curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - + curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - yum install -y nodejs node -v npm -v