From ee883bfebfed958c7148e731e016928f1bf7abc3 Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Thu, 19 Dec 2024 11:42:32 +0530 Subject: [PATCH 1/6] sa versioned test workflow added --- .../versioned-security-agent-pre.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/versioned-security-agent-pre.yaml diff --git a/.github/workflows/versioned-security-agent-pre.yaml b/.github/workflows/versioned-security-agent-pre.yaml new file mode 100644 index 0000000000..4d84cccfc6 --- /dev/null +++ b/.github/workflows/versioned-security-agent-pre.yaml @@ -0,0 +1,55 @@ + +# Daily workflow to run versioned tests with security agent enabled +# This also can be used to run versioned tests with a newer versioned of +# security agent since we pin it. + +name: Versioned Tests w/ Security Agent-pre + +on: + workflow_dispatch: + inputs: + mode: + description: Versioned test mode + type: choice + options: + - major + - minor + default: major + required: false + version: + type: string + description: Version of security agent to test + required: false + schedule: + - cron: '0 9 * * 1-5' + +jobs: + security-agent-tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm install + - name: Install Version ${{ inputs.version }} of security agent + if: ${{ inputs.version }} + # run: npm install @newrelic/security-agent@${{ inputs.version }} + # run: npm install github:newrelic/csec-node-agent#main + run: npm install github:newrelic/csec-node-agent#${{ inputs.version }} + - name: Run Docker Services + run: npm run services + - name: Versioned Tests w/ Security Agent + run: TEST_CHILD_TIMEOUT=600000 npm run versioned:security + env: + VERSIONED_MODE: --${{ inputs.mode || 'major' }} + JOBS: 4 # 2 per CPU seems to be the sweet spot in GHA (July 2022) + SKIP_C8: true \ No newline at end of file From 4bf73928b1ec006795a38feecfdfcc3186c2e348 Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Thu, 23 Jan 2025 16:44:17 +0530 Subject: [PATCH 2/6] metric count update --- test/versioned/express/ignoring.test.js | 2 +- test/versioned/hapi/ignoring.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/versioned/express/ignoring.test.js b/test/versioned/express/ignoring.test.js index dfa0186c9f..9d4e77f549 100644 --- a/test/versioned/express/ignoring.test.js +++ b/test/versioned/express/ignoring.test.js @@ -41,7 +41,7 @@ test('ignoring an Express route', async function (t) { if (isExpress5 === true) { expectedMetrics = 13 } else { - expectedMetrics = 11 + expectedMetrics = 12 } } plan.equal( diff --git a/test/versioned/hapi/ignoring.test.js b/test/versioned/hapi/ignoring.test.js index 5bd90f7e54..3ef5e3ebf1 100644 --- a/test/versioned/hapi/ignoring.test.js +++ b/test/versioned/hapi/ignoring.test.js @@ -31,7 +31,7 @@ test('ignoring a Hapi route', async (t) => { const metrics = agent.metrics._metrics.unscoped // loading k2 adds instrumentation metrics for packages it instruments - const expectedMetrics = helper.isSecurityAgentEnabled(agent) ? 11 : 3 + const expectedMetrics = helper.isSecurityAgentEnabled(agent) ? 12 : 3 plan.equal( Object.keys(metrics).length, expectedMetrics, From 39aabc4d57d54addd2f828ebcea7b4eafa741810 Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Thu, 23 Jan 2025 16:58:11 +0530 Subject: [PATCH 3/6] updated metric count for express5 --- test/versioned/express/ignoring.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/versioned/express/ignoring.test.js b/test/versioned/express/ignoring.test.js index 9d4e77f549..e5535a15c2 100644 --- a/test/versioned/express/ignoring.test.js +++ b/test/versioned/express/ignoring.test.js @@ -39,7 +39,7 @@ test('ignoring an Express route', async function (t) { let expectedMetrics = 3 if (helper.isSecurityAgentEnabled(agent) === true) { if (isExpress5 === true) { - expectedMetrics = 13 + expectedMetrics = 14 } else { expectedMetrics = 12 } From 767172eb775e7705747f1de8444515fce817b84c Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Mon, 3 Feb 2025 15:47:19 +0530 Subject: [PATCH 4/6] updated @newrelic/security-agent to v2.3.0 --- THIRD_PARTY_NOTICES.md | 14 ++++----- package.json | 2 +- third_party_manifest.json | 60 +++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index cc13d2804e..3a5f3583fc 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -511,7 +511,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co ### @newrelic/security-agent -This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.2.0](https://github.com/newrelic/csec-node-agent/tree/v2.2.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.2.0/LICENSE): +This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.3.0](https://github.com/newrelic/csec-node-agent/tree/v2.3.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.3.0/LICENSE): ``` ## New Relic Software License v1.0 @@ -2035,7 +2035,7 @@ IN THE SOFTWARE. ### require-in-the-middle -This product includes source derived from [require-in-the-middle](https://github.com/elastic/require-in-the-middle) ([v7.4.0](https://github.com/elastic/require-in-the-middle/tree/v7.4.0)), distributed under the [MIT License](https://github.com/elastic/require-in-the-middle/blob/v7.4.0/LICENSE): +This product includes source derived from [require-in-the-middle](https://github.com/elastic/require-in-the-middle) ([v7.5.0](https://github.com/elastic/require-in-the-middle/tree/v7.5.0)), distributed under the [MIT License](https://github.com/elastic/require-in-the-middle/blob/v7.5.0/LICENSE): ``` The MIT License (MIT) @@ -2065,7 +2065,7 @@ SOFTWARE. ### semver -This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.6.3](https://github.com/npm/node-semver/tree/v7.6.3)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.6.3/LICENSE): +This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.7.0](https://github.com/npm/node-semver/tree/v7.7.0)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.7.0/LICENSE): ``` The ISC License @@ -2121,7 +2121,7 @@ SOFTWARE. ### @aws-sdk/client-s3 -This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.726.1](https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE): +This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.740.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.740.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.740.0/LICENSE): ``` Apache License @@ -2330,7 +2330,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co ### @aws-sdk/s3-request-presigner -This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.726.1](https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE): +This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.740.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.740.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.740.0/LICENSE): ``` Apache License @@ -4158,7 +4158,7 @@ SOFTWARE. ### eslint-plugin-jsdoc -This product includes source derived from [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) ([v50.6.1](https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.6.1)), distributed under the [BSD-3-Clause License](https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.6.1/LICENSE): +This product includes source derived from [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) ([v50.6.3](https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.6.3)), distributed under the [BSD-3-Clause License](https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.6.3/LICENSE): ``` Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) @@ -4190,7 +4190,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### eslint -This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.18.0](https://github.com/eslint/eslint/tree/v9.18.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.18.0/LICENSE): +This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.19.0](https://github.com/eslint/eslint/tree/v9.19.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.19.0/LICENSE): ``` Copyright OpenJS Foundation and other contributors, diff --git a/package.json b/package.json index 07bc6d5aab..240821ebd1 100644 --- a/package.json +++ b/package.json @@ -197,7 +197,7 @@ "dependencies": { "@grpc/grpc-js": "^1.12.2", "@grpc/proto-loader": "^0.7.5", - "@newrelic/security-agent": "^2.2.0", + "@newrelic/security-agent": "^2.3.0", "@opentelemetry/api": "^1.9.0", "@opentelemetry/core": "^1.30.0", "@opentelemetry/resources": "^1.30.1", diff --git a/third_party_manifest.json b/third_party_manifest.json index 4d3f9d949c..f8fd1fb27e 100644 --- a/third_party_manifest.json +++ b/third_party_manifest.json @@ -1,5 +1,5 @@ { - "lastUpdated": "Fri Jan 24 2025 16:28:36 GMT-0500 (Eastern Standard Time)", + "lastUpdated": "Mon Feb 03 2025 15:47:22 GMT+0530 (India Standard Time)", "projectName": "New Relic Node Agent", "projectUrl": "https://github.com/newrelic/node-newrelic", "includeOptDeps": true, @@ -68,15 +68,15 @@ "licenseTextSource": "file", "publisher": "Google Inc." }, - "@newrelic/security-agent@2.2.0": { + "@newrelic/security-agent@2.3.0": { "name": "@newrelic/security-agent", - "version": "2.2.0", - "range": "^2.2.0", + "version": "2.3.0", + "range": "^2.3.0", "licenses": "UNKNOWN", "repoUrl": "https://github.com/newrelic/csec-node-agent", - "versionedRepoUrl": "https://github.com/newrelic/csec-node-agent/tree/v2.2.0", + "versionedRepoUrl": "https://github.com/newrelic/csec-node-agent/tree/v2.3.0", "licenseFile": "node_modules/@newrelic/security-agent/LICENSE", - "licenseUrl": "https://github.com/newrelic/csec-node-agent/blob/v2.2.0/LICENSE", + "licenseUrl": "https://github.com/newrelic/csec-node-agent/blob/v2.3.0/LICENSE", "licenseTextSource": "file", "publisher": "newrelic" }, @@ -245,29 +245,29 @@ "licenseUrl": "https://github.com/nodejs/readable-stream/blob/v3.6.2/LICENSE", "licenseTextSource": "file" }, - "require-in-the-middle@7.4.0": { + "require-in-the-middle@7.5.0": { "name": "require-in-the-middle", - "version": "7.4.0", + "version": "7.5.0", "range": "^7.4.0", "licenses": "MIT", "repoUrl": "https://github.com/elastic/require-in-the-middle", - "versionedRepoUrl": "https://github.com/elastic/require-in-the-middle/tree/v7.4.0", + "versionedRepoUrl": "https://github.com/elastic/require-in-the-middle/tree/v7.5.0", "licenseFile": "node_modules/require-in-the-middle/LICENSE", - "licenseUrl": "https://github.com/elastic/require-in-the-middle/blob/v7.4.0/LICENSE", + "licenseUrl": "https://github.com/elastic/require-in-the-middle/blob/v7.5.0/LICENSE", "licenseTextSource": "file", "publisher": "Thomas Watson Steen", "email": "w@tson.dk", "url": "https://twitter.com/wa7son" }, - "semver@7.6.3": { + "semver@7.7.0": { "name": "semver", - "version": "7.6.3", + "version": "7.7.0", "range": "^7.5.2", "licenses": "ISC", "repoUrl": "https://github.com/npm/node-semver", - "versionedRepoUrl": "https://github.com/npm/node-semver/tree/v7.6.3", + "versionedRepoUrl": "https://github.com/npm/node-semver/tree/v7.7.0", "licenseFile": "node_modules/semver/LICENSE", - "licenseUrl": "https://github.com/npm/node-semver/blob/v7.6.3/LICENSE", + "licenseUrl": "https://github.com/npm/node-semver/blob/v7.7.0/LICENSE", "licenseTextSource": "file", "publisher": "GitHub Inc." }, @@ -286,28 +286,28 @@ } }, "devDependencies": { - "@aws-sdk/client-s3@3.726.1": { + "@aws-sdk/client-s3@3.740.0": { "name": "@aws-sdk/client-s3", - "version": "3.726.1", + "version": "3.740.0", "range": "^3.556.0", "licenses": "Apache-2.0", "repoUrl": "https://github.com/aws/aws-sdk-js-v3", - "versionedRepoUrl": "https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1", + "versionedRepoUrl": "https://github.com/aws/aws-sdk-js-v3/tree/v3.740.0", "licenseFile": "node_modules/@aws-sdk/client-s3/LICENSE", - "licenseUrl": "https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE", + "licenseUrl": "https://github.com/aws/aws-sdk-js-v3/blob/v3.740.0/LICENSE", "licenseTextSource": "file", "publisher": "AWS SDK for JavaScript Team", "url": "https://aws.amazon.com/javascript/" }, - "@aws-sdk/s3-request-presigner@3.726.1": { + "@aws-sdk/s3-request-presigner@3.740.0": { "name": "@aws-sdk/s3-request-presigner", - "version": "3.726.1", + "version": "3.740.0", "range": "^3.556.0", "licenses": "Apache-2.0", "repoUrl": "https://github.com/aws/aws-sdk-js-v3", - "versionedRepoUrl": "https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1", + "versionedRepoUrl": "https://github.com/aws/aws-sdk-js-v3/tree/v3.740.0", "licenseFile": "node_modules/@aws-sdk/s3-request-presigner/LICENSE", - "licenseUrl": "https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE", + "licenseUrl": "https://github.com/aws/aws-sdk-js-v3/blob/v3.740.0/LICENSE", "licenseTextSource": "file", "publisher": "AWS SDK for JavaScript Team", "url": "https://aws.amazon.com/javascript/" @@ -553,29 +553,29 @@ "email": "maochenyan@gmail.com", "url": "https://github.com/stevemao" }, - "eslint-plugin-jsdoc@50.6.1": { + "eslint-plugin-jsdoc@50.6.3": { "name": "eslint-plugin-jsdoc", - "version": "50.6.1", + "version": "50.6.3", "range": "^50.6.1", "licenses": "BSD-3-Clause", "repoUrl": "https://github.com/gajus/eslint-plugin-jsdoc", - "versionedRepoUrl": "https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.6.1", + "versionedRepoUrl": "https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.6.3", "licenseFile": "node_modules/eslint-plugin-jsdoc/LICENSE", - "licenseUrl": "https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.6.1/LICENSE", + "licenseUrl": "https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.6.3/LICENSE", "licenseTextSource": "file", "publisher": "Gajus Kuizinas", "email": "gajus@gajus.com", "url": "http://gajus.com" }, - "eslint@9.18.0": { + "eslint@9.19.0": { "name": "eslint", - "version": "9.18.0", + "version": "9.19.0", "range": "^9.17.0", "licenses": "MIT", "repoUrl": "https://github.com/eslint/eslint", - "versionedRepoUrl": "https://github.com/eslint/eslint/tree/v9.18.0", + "versionedRepoUrl": "https://github.com/eslint/eslint/tree/v9.19.0", "licenseFile": "node_modules/eslint/LICENSE", - "licenseUrl": "https://github.com/eslint/eslint/blob/v9.18.0/LICENSE", + "licenseUrl": "https://github.com/eslint/eslint/blob/v9.19.0/LICENSE", "licenseTextSource": "file", "publisher": "Nicholas C. Zakas", "email": "nicholas+npm@nczconsulting.com" From 89b7f3ef6f246172226989f634511ed581236410 Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Mon, 3 Feb 2025 15:51:37 +0530 Subject: [PATCH 5/6] Upated @newrelic/security-agent to v2.3.0 and metric count update for versioned tests --- .../versioned-security-agent-pre.yaml | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 .github/workflows/versioned-security-agent-pre.yaml diff --git a/.github/workflows/versioned-security-agent-pre.yaml b/.github/workflows/versioned-security-agent-pre.yaml deleted file mode 100644 index 4d84cccfc6..0000000000 --- a/.github/workflows/versioned-security-agent-pre.yaml +++ /dev/null @@ -1,55 +0,0 @@ - -# Daily workflow to run versioned tests with security agent enabled -# This also can be used to run versioned tests with a newer versioned of -# security agent since we pin it. - -name: Versioned Tests w/ Security Agent-pre - -on: - workflow_dispatch: - inputs: - mode: - description: Versioned test mode - type: choice - options: - - major - - minor - default: major - required: false - version: - type: string - description: Version of security agent to test - required: false - schedule: - - cron: '0 9 * * 1-5' - -jobs: - security-agent-tests: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: npm install - - name: Install Version ${{ inputs.version }} of security agent - if: ${{ inputs.version }} - # run: npm install @newrelic/security-agent@${{ inputs.version }} - # run: npm install github:newrelic/csec-node-agent#main - run: npm install github:newrelic/csec-node-agent#${{ inputs.version }} - - name: Run Docker Services - run: npm run services - - name: Versioned Tests w/ Security Agent - run: TEST_CHILD_TIMEOUT=600000 npm run versioned:security - env: - VERSIONED_MODE: --${{ inputs.mode || 'major' }} - JOBS: 4 # 2 per CPU seems to be the sweet spot in GHA (July 2022) - SKIP_C8: true \ No newline at end of file From a846faf65ca79eb9693a356b68815668c30a6b4d Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Mon, 3 Feb 2025 15:53:57 +0530 Subject: [PATCH 6/6] third party menifest update --- third_party_manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party_manifest.json b/third_party_manifest.json index f8fd1fb27e..8510c2b9b6 100644 --- a/third_party_manifest.json +++ b/third_party_manifest.json @@ -1,5 +1,5 @@ { - "lastUpdated": "Mon Feb 03 2025 15:47:22 GMT+0530 (India Standard Time)", + "lastUpdated": "Mon Feb 03 2025 15:53:41 GMT+0530 (India Standard Time)", "projectName": "New Relic Node Agent", "projectUrl": "https://github.com/newrelic/node-newrelic", "includeOptDeps": true,