From 31463680f98d7dd162e8f584b45335681f863a43 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 24 Jun 2025 18:40:35 +0100 Subject: [PATCH 1/9] 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/9] 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/9] 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/9] 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/9] 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 From a4e4aaa86f46095c09865ee9d97dad2748993ab9 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 8 Jul 2025 13:51:12 +0100 Subject: [PATCH 6/9] fix: use @cyclonedx/cyclonedx-npm for generating sbom artifacts --- sbom_generation.yaml | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index 0b2709f..3484530 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -11,36 +11,17 @@ 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_18.x | bash - - yum install -y nodejs - node -v - npm -v - - type: Command - name: "Install corepack" - command: | - cd extension-api - npm install -g corepack - - type: Command - name: "Install latest yarn" - command: | - cd extension-api - yarn set version stable - yarn install - - type: Command - name: "Install extension-api dependencies" + name: "Install dependencies" command: | cd extension-api - yarn install + npm install - type: Command - name: "Run cyclonedx-node-yarn on extension-api" + name: "Run cyclonedx-node-npm 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 + # 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 + location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json \ No newline at end of file From 11df29b5cf7195c919e7ad00a160108baf5a8030 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Tue, 8 Jul 2025 13:55:22 +0100 Subject: [PATCH 7/9] chore: pre-install @cyclonedx/cyclonedx-npm as a dev dependency --- sbom_generation.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index 3484530..fdfd631 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -11,10 +11,10 @@ shell: bash steps: - type: Command - name: "Install dependencies" + name: "Install dependencies & cyclonedx-node-npm package" command: | cd extension-api - npm install + npm install && npm install --save-dev @cyclonedx/cyclonedx-npm - type: Command name: "Run cyclonedx-node-npm on extension-api" command: | From 0d0bf3c993b13e6bdf83a2345ce18b73a617f8d8 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Wed, 9 Jul 2025 10:54:57 +0100 Subject: [PATCH 8/9] fix: lock @cyclonedx/cyclonedx-npm version to 2.1.0 --- sbom_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index fdfd631..50ed25a 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 - npm install && npm install --save-dev @cyclonedx/cyclonedx-npm + npm install && npm install --save-dev @cyclonedx/cyclonedx-npm@2.1.0 - type: Command name: "Run cyclonedx-node-npm on extension-api" command: | From 56cc02f2180901bc60fa272b8658b409f45657b4 Mon Sep 17 00:00:00 2001 From: Mohcine BAADI Date: Wed, 9 Jul 2025 11:09:10 +0100 Subject: [PATCH 9/9] fix: use correct path for outputArtifacts --- sbom_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbom_generation.yaml b/sbom_generation.yaml index 50ed25a..16cf04e 100644 --- a/sbom_generation.yaml +++ b/sbom_generation.yaml @@ -24,4 +24,4 @@ steps: outputArtifacts: - name: artifactSBOM type: BINARY - location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json \ No newline at end of file + location: ${OCI_PRIMARY_SOURCE_DIR}/extension-api/artifactSBOM.json \ No newline at end of file