Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: (IaC) include evidence field in json output [IAC-3161] #5611

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/iac/test/v2/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export interface IacSuccess {
path: string[];
msg: string;
isIgnored: boolean;
evidence?: string;
}

export interface Remediation {
Expand Down Expand Up @@ -332,6 +333,7 @@ function passedVulnerabilitiesToIacSuccesses(
// IAC-2962: This field is included in IacIssue, so adding it here as well
msg: v.resource.formattedPath,
isIgnored: v.ignored,
evidence: v.context?.evidence,
};
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as os from 'os';

const policyEngineChecksums = `
2e09361c270a1134c625c91e730d17a904f8a8c8f6607ffbe188cf0f539ed75c snyk-iac-test_0.56.2_Darwin_x86_64
5e74c8b4193f28e65eb512d3c881a12837685ec1a747a44a3e922d69d0ad0637 snyk-iac-test_0.56.2_Linux_x86_64
788cb65446ff69df95db9c8791a154bba22272fb5859f3c52a8ebb757881deec snyk-iac-test_0.56.2_Windows_x86_64.exe
d8720484d64ecdfcadc6d0d57c339c6aa825f758724f58fc487c817e4db5199c snyk-iac-test_0.56.2_Darwin_arm64
da46dd35f2bed090c7ab61ad6fee23c0c6634b8d94a608681749342bac0cbdc9 snyk-iac-test_0.56.2_Linux_arm64
124b8f9225a4ed5c244e7e1991ed26448ea8e35413a9e265cb5c4185f9af9538 snyk-iac-test_0.57.0_Darwin_x86_64
26ae8c3cc8cc4d8a7fa5f3c0a94a9c30b043bc2c3f1c19582d5f3c4879b056c4 snyk-iac-test_0.57.0_Linux_x86_64
9a1e25084d7ff064568f4b14ad6808e9fdee5711fbbbe3e618b51b3d5962d2cc snyk-iac-test_0.57.0_Windows_x86_64.exe
f2e569723e9b60cbcc02de92b9b65e15d59896d0f6bfe4de72f44c09b7fb5a95 snyk-iac-test_0.57.0_Darwin_arm64
fe6c6f56c4acf15575c407d6fcb7e33e36f301f29f6256fdf22c9cfd7eae5cc2 snyk-iac-test_0.57.0_Linux_arm64
`;

export const policyEngineVersion = getPolicyEngineVersion();
Expand Down
3 changes: 3 additions & 0 deletions src/lib/iac/test/v2/scan/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export interface Vulnerability {
severity: SEVERITY;
ignored: boolean;
resource: Resource;
context?: {
evidence?: string;
};
}

export interface Rule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
],
"infrastructureAsCodeSuccesses": [
{
"evidence": "cidr_block: 10.1.0.0/16",
"id": "SNYK-CC-00328",
"severity": "medium",
"type": "terraformconfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@
"file": "vpc_group.tf",
"line": 9,
"column": 1
},
"context": {
"evidence": "cidr_block: 10.1.0.0/16"
}
},
{
Expand Down
Loading