-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aws][feat] Add collection of Inspector resource (#2242)
Co-authored-by: Matthias Veit <[email protected]>
- Loading branch information
1 parent
6cacdf9
commit 8626219
Showing
7 changed files
with
695 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
237 changes: 237 additions & 0 deletions
237
plugins/aws/test/resources/files/inspector2/list-findings__EQUALS_test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
{ | ||
"findings": [ | ||
{ | ||
"awsAccountId": "foo", | ||
"codeVulnerabilityDetails": { | ||
"cwes": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"detectorId": "foo", | ||
"detectorName": "foo", | ||
"detectorTags": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"filePath": { | ||
"endLine": 123, | ||
"fileName": "foo", | ||
"filePath": "foo", | ||
"startLine": 123 | ||
}, | ||
"referenceUrls": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"ruleId": "foo", | ||
"sourceLambdaLayerArn": "foo" | ||
}, | ||
"description": "foo", | ||
"epss": { | ||
"score": 1.234 | ||
}, | ||
"exploitAvailable": "NO", | ||
"exploitabilityDetails": { | ||
"lastKnownExploitAt": "2024-10-14T18:00:11Z" | ||
}, | ||
"findingArn": "foo", | ||
"firstObservedAt": "2024-10-14T18:00:11Z", | ||
"fixAvailable": "NO", | ||
"inspectorScore": 1.234, | ||
"inspectorScoreDetails": { | ||
"adjustedCvss": { | ||
"adjustments": [ | ||
{ | ||
"metric": "foo", | ||
"reason": "foo" | ||
}, | ||
{ | ||
"metric": "foo", | ||
"reason": "foo" | ||
}, | ||
{ | ||
"metric": "foo", | ||
"reason": "foo" | ||
} | ||
], | ||
"cvssSource": "foo", | ||
"score": 1.234, | ||
"scoreSource": "foo", | ||
"scoringVector": "foo", | ||
"version": "foo" | ||
} | ||
}, | ||
"lastObservedAt": "2024-10-14T18:00:11Z", | ||
"networkReachabilityDetails": { | ||
"networkPath": { | ||
"steps": [ | ||
{ | ||
"componentId": "foo", | ||
"componentType": "foo" | ||
}, | ||
{ | ||
"componentId": "foo", | ||
"componentType": "foo" | ||
}, | ||
{ | ||
"componentId": "foo", | ||
"componentType": "foo" | ||
} | ||
] | ||
}, | ||
"openPortRange": { | ||
"begin": 123, | ||
"end": 123 | ||
}, | ||
"protocol": "UDP" | ||
}, | ||
"packageVulnerabilityDetails": { | ||
"cvss": [ | ||
{ | ||
"baseScore": 1.234, | ||
"scoringVector": "foo", | ||
"source": "foo", | ||
"version": "foo" | ||
}, | ||
{ | ||
"baseScore": 1.234, | ||
"scoringVector": "foo", | ||
"source": "foo", | ||
"version": "foo" | ||
}, | ||
{ | ||
"baseScore": 1.234, | ||
"scoringVector": "foo", | ||
"source": "foo", | ||
"version": "foo" | ||
} | ||
], | ||
"referenceUrls": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"relatedVulnerabilities": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"source": "foo", | ||
"sourceUrl": "https://example.com", | ||
"vendorCreatedAt": "2024-10-14T18:00:11Z", | ||
"vendorSeverity": "foo", | ||
"vendorUpdatedAt": "2024-10-14T18:00:11Z", | ||
"vulnerabilityId": "foo", | ||
"vulnerablePackages": [ | ||
{ | ||
"arch": "foo", | ||
"epoch": 123, | ||
"filePath": "foo", | ||
"fixedInVersion": "foo", | ||
"name": "foo", | ||
"packageManager": "CARGO", | ||
"release": "foo", | ||
"remediation": "foo", | ||
"sourceLambdaLayerArn": "foo", | ||
"sourceLayerHash": "foo", | ||
"version": "foo" | ||
} | ||
] | ||
}, | ||
"remediation": { | ||
"recommendation": { | ||
"Url": "https://example.com", | ||
"text": "foo" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"details": { | ||
"awsEc2Instance": { | ||
"iamInstanceProfileArn": "foo", | ||
"imageId": "foo", | ||
"ipV4Addresses": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"ipV6Addresses": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"keyName": "foo", | ||
"launchedAt": "2024-10-14T18:00:11Z", | ||
"platform": "foo", | ||
"subnetId": "foo", | ||
"type": "foo", | ||
"vpcId": "foo" | ||
}, | ||
"awsEcrContainerImage": { | ||
"architecture": "foo", | ||
"author": "foo", | ||
"imageHash": "foo", | ||
"imageTags": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"platform": "foo", | ||
"pushedAt": "2024-10-14T18:00:11Z", | ||
"registry": "foo", | ||
"repositoryName": "foo" | ||
}, | ||
"awsLambdaFunction": { | ||
"architectures": [ | ||
"ARM64", | ||
"ARM64", | ||
"ARM64" | ||
], | ||
"codeSha256": "foo", | ||
"executionRoleArn": "foo", | ||
"functionName": "foo", | ||
"lastModifiedAt": "2024-10-14T18:00:11Z", | ||
"layers": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"packageType": "ZIP", | ||
"runtime": "NODEJS_12_X", | ||
"version": "foo", | ||
"vpcConfig": { | ||
"securityGroupIds": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"subnetIds": [ | ||
"foo", | ||
"foo", | ||
"foo" | ||
], | ||
"vpcId": "foo" | ||
} | ||
} | ||
}, | ||
"id": "foo", | ||
"partition": "foo", | ||
"region": "foo", | ||
"tags": { | ||
"0": "foo" | ||
}, | ||
"type": "AWS_ECR_CONTAINER_IMAGE" | ||
} | ||
], | ||
"severity": "LOW", | ||
"status": "SUPPRESSED", | ||
"title": "foo", | ||
"type": "PACKAGE_VULNERABILITY", | ||
"updatedAt": "2024-10-14T18:00:11Z" | ||
} | ||
], | ||
"nextToken": "foo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from fix_plugin_aws.resource.inspector import AwsInspectorFinding | ||
from test.resources import round_trip_for | ||
|
||
|
||
def test_inspector_findings() -> None: | ||
round_trip_for(AwsInspectorFinding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters