From 862a512899ed05dad627155778453156a3cf3021 Mon Sep 17 00:00:00 2001 From: Edoardo Pirovano Date: Fri, 4 Nov 2022 13:58:27 +0000 Subject: [PATCH] Prune results of Ruby query from SARIF --- lib/upload-lib.js | 37 +++++++++++- lib/upload-lib.js.map | 2 +- lib/upload-lib.test.js | 100 +++++++++++++++++++++++++++++++ lib/upload-lib.test.js.map | 2 +- lib/util.js.map | 2 +- src/upload-lib.test.ts | 118 ++++++++++++++++++++++++++++++++++++- src/upload-lib.ts | 45 +++++++++++++- src/util.ts | 29 +++++---- 8 files changed, 316 insertions(+), 19 deletions(-) diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 817d88dc66..0acb3a213d 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -22,9 +22,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateUniqueCategory = exports.waitForProcessing = exports.buildPayload = exports.validateSarifFileSchema = exports.countResultsInSarif = exports.uploadFromRunner = exports.uploadFromActions = exports.findSarifFilesInDir = exports.populateRunAutomationDetails = exports.combineSarifFiles = void 0; +exports.pruneInvalidResults = exports.validateUniqueCategory = exports.waitForProcessing = exports.buildPayload = exports.validateSarifFileSchema = exports.countResultsInSarif = exports.uploadFromRunner = exports.uploadFromActions = exports.findSarifFilesInDir = exports.populateRunAutomationDetails = exports.combineSarifFiles = void 0; const fs = __importStar(require("fs")); const path = __importStar(require("path")); +const process_1 = require("process"); const zlib_1 = __importDefault(require("zlib")); const core = __importStar(require("@actions/core")); const file_url_1 = __importDefault(require("file-url")); @@ -269,6 +270,8 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe let sarif = combineSarifFiles(sarifFiles); sarif = await fingerprints.addFingerprints(sarif, sourceRoot, logger); sarif = populateRunAutomationDetails(sarif, category, analysisKey, environment); + if (process_1.env["CODEQL_DISABLE_SARIF_PRUNING"] !== "true") + sarif = pruneInvalidResults(sarif, logger); const toolNames = util.getToolNames(sarif); validateUniqueCategory(sarif); const sarifPayload = JSON.stringify(sarif); @@ -376,4 +379,36 @@ exports.validateUniqueCategory = validateUniqueCategory; function sanitize(str) { return (str !== null && str !== void 0 ? str : "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } +function pruneInvalidResults(sarif, logger) { + var _a, _b, _c, _d, _e, _f, _g, _h; + let pruned = 0; + const newRuns = []; + for (const run of sarif.runs || []) { + if (((_b = (_a = run.tool) === null || _a === void 0 ? void 0 : _a.driver) === null || _b === void 0 ? void 0 : _b.name) === "CodeQL" && + ((_d = (_c = run.tool) === null || _c === void 0 ? void 0 : _c.driver) === null || _d === void 0 ? void 0 : _d.semanticVersion) === "2.11.2") { + // Version 2.11.2 of the CodeQL CLI had many false positives in the + // rb/weak-cryptographic-algorithm query which we prune here. The + // issue is tracked in https://github.com/github/codeql/issues/11107. + const newResults = []; + for (const result of run.results || []) { + if (result.ruleId === "rb/weak-cryptographic-algorithm" && + (((_f = (_e = result.message) === null || _e === void 0 ? void 0 : _e.text) === null || _f === void 0 ? void 0 : _f.includes(" MD5 ")) || + ((_h = (_g = result.message) === null || _g === void 0 ? void 0 : _g.text) === null || _h === void 0 ? void 0 : _h.includes(" SHA1 ")))) { + pruned += 1; + continue; + } + newResults.push(result); + } + newRuns.push({ ...run, results: newResults }); + } + else { + newRuns.push(run); + } + } + if (pruned > 0) { + logger.info(`Pruned ${pruned} results believed to be invalid from SARIF file.`); + } + return { ...sarif, runs: newRuns }; +} +exports.pruneInvalidResults = pruneInvalidResults; //# sourceMappingURL=upload-lib.js.map \ No newline at end of file diff --git a/lib/upload-lib.js.map b/lib/upload-lib.js.map index b568bf9f08..ed7c74a425 100644 --- a/lib/upload-lib.js.map +++ b/lib/upload-lib.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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AC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC"} \ No newline at end of file diff --git a/lib/upload-lib.test.js b/lib/upload-lib.test.js index 3fe37ed45e..9f8a6f9d75 100644 --- a/lib/upload-lib.test.js +++ b/lib/upload-lib.test.js @@ -28,6 +28,7 @@ const ava_1 = __importDefault(require("ava")); const logging_1 = require("./logging"); const testing_utils_1 = require("./testing-utils"); const uploadLib = __importStar(require("./upload-lib")); +const upload_lib_1 = require("./upload-lib"); const util_1 = require("./util"); (0, testing_utils_1.setupTests)(ava_1.default); ava_1.default.beforeEach(() => { @@ -200,6 +201,105 @@ ava_1.default.beforeEach(() => { t.throws(() => uploadLib.validateUniqueCategory(sarif1)); t.throws(() => uploadLib.validateUniqueCategory(sarif2)); }); +(0, ava_1.default)("pruneInvalidResults", (t) => { + const loggedMessages = []; + const mockLogger = { + info: (message) => { + loggedMessages.push(message); + }, + }; + const sarif = { + runs: [ + { + tool: otherTool, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + { + tool: affectedCodeQLVersion, + results: [ + resultWithOtherRuleId, + resultWithBadMessage1, + resultWithBadMessage2, + resultWithGoodMessage, + ], + }, + { + tool: unaffectedCodeQLVersion, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + ], + }; + const result = (0, upload_lib_1.pruneInvalidResults)(sarif, mockLogger); + const expected = { + runs: [ + { + tool: otherTool, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + { + tool: affectedCodeQLVersion, + results: [resultWithOtherRuleId, resultWithGoodMessage], + }, + { + tool: unaffectedCodeQLVersion, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + ], + }; + t.deepEqual(result, expected); + t.deepEqual(loggedMessages.length, 1); + t.assert(loggedMessages[0].includes("Pruned 2 results")); +}); +const affectedCodeQLVersion = { + driver: { + name: "CodeQL", + semanticVersion: "2.11.2", + }, +}; +const unaffectedCodeQLVersion = { + driver: { + name: "CodeQL", + semanticVersion: "2.11.3", + }, +}; +const otherTool = { + driver: { + name: "Some other tool", + semanticVersion: "2.11.2", + }, +}; +const resultWithOtherRuleId = { + ruleId: "doNotPrune", + message: { + text: "should not be pruned even though it says MD5 in it", + }, + locations: [], + partialFingerprints: {}, +}; +const resultWithGoodMessage = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should not be pruned SHA128 is not a FP", + }, + locations: [], + partialFingerprints: {}, +}; +const resultWithBadMessage1 = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should be pruned MD5 is a FP", + }, + locations: [], + partialFingerprints: {}, +}; +const resultWithBadMessage2 = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should be pruned SHA1 is a FP", + }, + locations: [], + partialFingerprints: {}, +}; function createMockSarif(id, tool) { return { runs: [ diff --git a/lib/upload-lib.test.js.map b/lib/upload-lib.test.js.map index db6990ba45..5f6ab565ae 100644 --- a/lib/upload-lib.test.js.map +++ b/lib/upload-lib.test.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.test.js","sourceRoot":"","sources":["../src/upload-lib.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,8CAAuB;AAEvB,uCAA4C;AAC5C,mDAA6C;AAC7C,wDAA0C;AAC1C,iCAMgB;AAEhB,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,iCA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,IAAI,EAAE,yCAAyC;KAChD;IACD,SAAS,EAAE,EAAE;IACb,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,iCAAiC;IACzC,OAAO,EAAE;QACP,IAAI,EAAE,8BAA8B;KACrC;IACD,SAAS,EAAE,EAAE;IACb,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF,MAAM,qBAAqB,GAAG;IAC5B,MAAM,EAAE,iCAAiC;IACzC,OAAO,EAAE;QACP,IAAI,EAAE,+BAA+B;KACtC;IACD,SAAS,EAAE,EAAE;IACb,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF,SAAS,eAAe,CAAC,EAAW,EAAE,IAAa;IACjD,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,iBAAiB,EAAE;oBACjB,EAAE;iBACH;gBACD,IAAI,EAAE;oBACJ,MAAM,EAAE;wBACN,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib/util.js.map b/lib/util.js.map index f4f66d3cdd..c90791d7fe 100644 --- a/lib/util.js.map +++ b/lib/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,+BAAiC;AAEjC,oDAAsC;AACtC,8CAAsB;AACtB,sEAA4C;AAC5C,+CAAiC;AAEjC,kDAAoC;AACpC,6CAA8D;AAC9D,2EAA6D;AAC7D,qCAA8D;AAC9D,iDAIwB;AACxB,mDAA6D;AAI7D;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAE3C;;GAEG;AACU,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;GAEG;AACU,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAE7D;;GAE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AClB;AACH,CAAC;AAVD,8CAUC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,WAAW,CAC/B,SAAiB,EACjB,OAAmB,EACnB,SAAqB;IAErB,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QAC1B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC7B,QAAQ,GAAG,IAAI,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,MAAM,OAAO,GAAuB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1D,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,QAAQ;gBAAE,SAAS,EAAE,CAAC;YAC3B,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC;AAnBD,kCAmBC;AAED;;;;;;;;;GASG;AACH,SAAgB,cAAc;;IAC5B,OAAO;IACL,+CAA+C;IAC/C,CAAA,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,0CAAE,QAAQ,CAAC,cAAc,CAAC;;QACpD,6CAA6C;QAC7C,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,0CAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;;QACtD,8DAA8D;QAC9D,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,0CAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA,CAC9D,CAAC;AACJ,CAAC;AATD,wCASC"} \ No newline at end of file diff --git a/src/upload-lib.test.ts b/src/upload-lib.test.ts index 84e1adf5a2..a979f6fcf7 100644 --- a/src/upload-lib.test.ts +++ b/src/upload-lib.test.ts @@ -3,14 +3,16 @@ import * as path from "path"; import test from "ava"; -import { getRunnerLogger } from "./logging"; +import { getRunnerLogger, Logger } from "./logging"; import { setupTests } from "./testing-utils"; import * as uploadLib from "./upload-lib"; +import { pruneInvalidResults } from "./upload-lib"; import { + GitHubVariant, + GitHubVersion, initializeEnvironment, Mode, - GitHubVersion, - GitHubVariant, + SarifFile, withTmpDir, } from "./util"; @@ -344,6 +346,116 @@ test("validateUniqueCategory for multiple runs", (t) => { t.throws(() => uploadLib.validateUniqueCategory(sarif2)); }); +test("pruneInvalidResults", (t) => { + const loggedMessages: string[] = []; + const mockLogger = { + info: (message: string) => { + loggedMessages.push(message); + }, + } as Logger; + + const sarif: SarifFile = { + runs: [ + { + tool: otherTool, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + { + tool: affectedCodeQLVersion, + results: [ + resultWithOtherRuleId, + resultWithBadMessage1, + resultWithBadMessage2, + resultWithGoodMessage, + ], + }, + { + tool: unaffectedCodeQLVersion, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + ], + }; + const result = pruneInvalidResults(sarif, mockLogger); + + const expected: SarifFile = { + runs: [ + { + tool: otherTool, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + { + tool: affectedCodeQLVersion, + results: [resultWithOtherRuleId, resultWithGoodMessage], + }, + { + tool: unaffectedCodeQLVersion, + results: [resultWithBadMessage1, resultWithGoodMessage], + }, + ], + }; + + t.deepEqual(result, expected); + t.deepEqual(loggedMessages.length, 1); + t.assert(loggedMessages[0].includes("Pruned 2 results")); +}); + +const affectedCodeQLVersion = { + driver: { + name: "CodeQL", + semanticVersion: "2.11.2", + }, +}; + +const unaffectedCodeQLVersion = { + driver: { + name: "CodeQL", + semanticVersion: "2.11.3", + }, +}; + +const otherTool = { + driver: { + name: "Some other tool", + semanticVersion: "2.11.2", + }, +}; + +const resultWithOtherRuleId = { + ruleId: "doNotPrune", + message: { + text: "should not be pruned even though it says MD5 in it", + }, + locations: [], + partialFingerprints: {}, +}; + +const resultWithGoodMessage = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should not be pruned SHA128 is not a FP", + }, + locations: [], + partialFingerprints: {}, +}; + +const resultWithBadMessage1 = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should be pruned MD5 is a FP", + }, + locations: [], + partialFingerprints: {}, +}; + +const resultWithBadMessage2 = { + ruleId: "rb/weak-cryptographic-algorithm", + message: { + text: "should be pruned SHA1 is a FP", + }, + locations: [], + partialFingerprints: {}, +}; + function createMockSarif(id?: string, tool?: string) { return { runs: [ diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 114b3d5078..6b866a0d31 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -1,5 +1,6 @@ import * as fs from "fs"; import * as path from "path"; +import { env } from "process"; import zlib from "zlib"; import * as core from "@actions/core"; @@ -15,7 +16,7 @@ import { Logger } from "./logging"; import { parseRepositoryNwo, RepositoryNwo } from "./repository"; import * as sharedEnv from "./shared-environment"; import * as util from "./util"; -import { SarifFile } from "./util"; +import { SarifFile, SarifResult, SarifRun } from "./util"; // Takes a list of paths to sarif files and combines them together, // returning the contents of the combined sarif file. @@ -396,6 +397,9 @@ async function uploadFiles( environment ); + if (env["CODEQL_DISABLE_SARIF_PRUNING"] !== "true") + sarif = pruneInvalidResults(sarif, logger); + const toolNames = util.getToolNames(sarif); validateUniqueCategory(sarif); @@ -546,3 +550,42 @@ export function validateUniqueCategory(sarif: SarifFile): void { function sanitize(str?: string) { return (str ?? "_").replace(/[^a-zA-Z0-9_]/g, "_").toLocaleUpperCase(); } + +export function pruneInvalidResults( + sarif: SarifFile, + logger: Logger +): SarifFile { + let pruned = 0; + const newRuns: SarifRun[] = []; + for (const run of sarif.runs || []) { + if ( + run.tool?.driver?.name === "CodeQL" && + run.tool?.driver?.semanticVersion === "2.11.2" + ) { + // Version 2.11.2 of the CodeQL CLI had many false positives in the + // rb/weak-cryptographic-algorithm query which we prune here. The + // issue is tracked in https://github.com/github/codeql/issues/11107. + const newResults: SarifResult[] = []; + for (const result of run.results || []) { + if ( + result.ruleId === "rb/weak-cryptographic-algorithm" && + (result.message?.text?.includes(" MD5 ") || + result.message?.text?.includes(" SHA1 ")) + ) { + pruned += 1; + continue; + } + newResults.push(result); + } + newRuns.push({ ...run, results: newResults }); + } else { + newRuns.push(run); + } + } + if (pruned > 0) { + logger.info( + `Pruned ${pruned} results believed to be invalid from SARIF file.` + ); + } + return { ...sarif, runs: newRuns }; +} diff --git a/src/util.ts b/src/util.ts index d3b3a1dcc8..3014b90e72 100644 --- a/src/util.ts +++ b/src/util.ts @@ -52,21 +52,28 @@ export const DID_AUTOBUILD_GO_ENV_VAR_NAME = export interface SarifFile { version?: string | null; - runs: Array<{ - tool?: { - driver?: { - name?: string; - }; - }; - automationDetails?: { - id?: string; + runs: SarifRun[]; +} + +export interface SarifRun { + tool?: { + driver?: { + name?: string; + semanticVersion?: string; }; - artifacts?: string[]; - results?: SarifResult[]; - }>; + }; + automationDetails?: { + id?: string; + }; + artifacts?: string[]; + results?: SarifResult[]; } export interface SarifResult { + ruleId?: string; + message?: { + text?: string; + }; locations: Array<{ physicalLocation: { artifactLocation: {