Skip to content

Commit

Permalink
feat(client-inspector2): This release adds new fields like fixAvailab…
Browse files Browse the repository at this point in the history
…le, fixedInVersion and remediation to the finding model. The requirement to have vulnerablePackages in the finding model has also been removed. The documentation has been updated to reflect these changes.
  • Loading branch information
awstools committed Sep 7, 2022
1 parent b9c164b commit aa99840
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 33 deletions.
25 changes: 24 additions & 1 deletion clients/client-inspector2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,13 +1851,15 @@ export enum ScanStatusReason {
EC2_INSTANCE_STOPPED = "EC2_INSTANCE_STOPPED",
IMAGE_SIZE_EXCEEDED = "IMAGE_SIZE_EXCEEDED",
INTERNAL_ERROR = "INTERNAL_ERROR",
NO_INVENTORY = "NO_INVENTORY",
NO_RESOURCES_FOUND = "NO_RESOURCES_FOUND",
PENDING_DISABLE = "PENDING_DISABLE",
PENDING_INITIAL_SCAN = "PENDING_INITIAL_SCAN",
RESOURCE_TERMINATED = "RESOURCE_TERMINATED",
SCAN_ELIGIBILITY_EXPIRED = "SCAN_ELIGIBILITY_EXPIRED",
SCAN_FREQUENCY_MANUAL = "SCAN_FREQUENCY_MANUAL",
SCAN_FREQUENCY_SCAN_ON_PUSH = "SCAN_FREQUENCY_SCAN_ON_PUSH",
STALE_INVENTORY = "STALE_INVENTORY",
SUCCESSFUL = "SUCCESSFUL",
UNMANAGED_EC2_INSTANCE = "UNMANAGED_EC2_INSTANCE",
UNSUPPORTED_OS = "UNSUPPORTED_OS",
Expand Down Expand Up @@ -2166,6 +2168,11 @@ export interface FilterCriteria {
* <p>Details on the related vulnerabilities used to filter findings.</p>
*/
relatedVulnerabilities?: StringFilter[];

/**
* <p>Details on whether a fix is available through a version update. This value can be <code>YES</code>, <code>NO</code>, or <code>PARTIAL</code>. A <code>PARTIAL</code> fix means that some, but not all, of the packages identified in the finding have fixes available through updated versions.</p>
*/
fixAvailable?: StringFilter[];
}

export interface CreateFilterRequest {
Expand Down Expand Up @@ -2664,6 +2671,12 @@ export interface Filter {
tags?: Record<string, string>;
}

export enum FixAvailable {
NO = "NO",
PARTIAL = "PARTIAL",
YES = "YES",
}

/**
* <p>Information about the Amazon Inspector score given to a finding.</p>
*/
Expand Down Expand Up @@ -2806,6 +2819,11 @@ export interface VulnerablePackage {
* <p>The version of the package that contains the vulnerability fix.</p>
*/
fixedInVersion?: string;

/**
* <p>The code to run in your environment to update packages with a fix available.</p>
*/
remediation?: string;
}

/**
Expand All @@ -2820,7 +2838,7 @@ export interface PackageVulnerabilityDetails {
/**
* <p>The packages impacted by this vulnerability.</p>
*/
vulnerablePackages: VulnerablePackage[] | undefined;
vulnerablePackages?: VulnerablePackage[];

/**
* <p>The source of the vulnerability information.</p>
Expand Down Expand Up @@ -3047,6 +3065,11 @@ export interface Finding {
* <p>An object that contains the details of a package vulnerability finding.</p>
*/
packageVulnerabilityDetails?: PackageVulnerabilityDetails;

/**
* <p>Details on whether a fix is available through a version update. This value can be <code>YES</code>, <code>NO</code>, or <code>PARTIAL</code>. A <code>PARTIAL</code> fix means that some, but not all, of the packages identified in the finding have fixes available through updated versions.</p>
*/
fixAvailable?: FixAvailable | string;
}

export interface GetConfigurationRequest {}
Expand Down
7 changes: 7 additions & 0 deletions clients/client-inspector2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,9 @@ const serializeAws_restJson1FilterCriteria = (input: FilterCriteria, context: __
...(input.firstObservedAt != null && {
firstObservedAt: serializeAws_restJson1DateFilterList(input.firstObservedAt, context),
}),
...(input.fixAvailable != null && {
fixAvailable: serializeAws_restJson1StringFilterList(input.fixAvailable, context),
}),
...(input.inspectorScore != null && {
inspectorScore: serializeAws_restJson1NumberFilterList(input.inspectorScore, context),
}),
Expand Down Expand Up @@ -3890,6 +3893,8 @@ const deserializeAws_restJson1FilterCriteria = (output: any, context: __SerdeCon
output.firstObservedAt != null
? deserializeAws_restJson1DateFilterList(output.firstObservedAt, context)
: undefined,
fixAvailable:
output.fixAvailable != null ? deserializeAws_restJson1StringFilterList(output.fixAvailable, context) : undefined,
inspectorScore:
output.inspectorScore != null
? deserializeAws_restJson1NumberFilterList(output.inspectorScore, context)
Expand Down Expand Up @@ -3957,6 +3962,7 @@ const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext):
output.firstObservedAt != null
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.firstObservedAt)))
: undefined,
fixAvailable: __expectString(output.fixAvailable),
inspectorScore: __limitedParseDouble(output.inspectorScore),
inspectorScoreDetails:
output.inspectorScoreDetails != null
Expand Down Expand Up @@ -4639,6 +4645,7 @@ const deserializeAws_restJson1VulnerablePackage = (output: any, context: __Serde
name: __expectString(output.name),
packageManager: __expectString(output.packageManager),
release: __expectString(output.release),
remediation: __expectString(output.remediation),
sourceLayerHash: __expectString(output.sourceLayerHash),
version: __expectString(output.version),
} as any;
Expand Down
113 changes: 81 additions & 32 deletions codegen/sdk-codegen/aws-models/inspector2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"smithy": "1.0",
"smithy": "2.0",
"shapes": {
"com.amazonaws.inspector2#AccessDeniedException": {
"type": "structure",
Expand Down Expand Up @@ -109,15 +109,16 @@
}
},
"com.amazonaws.inspector2#AccountIdSet": {
"type": "set",
"type": "list",
"member": {
"target": "com.amazonaws.inspector2#AccountId"
},
"traits": {
"smithy.api#length": {
"min": 0,
"max": 100
}
},
"smithy.api#uniqueItems": {}
}
},
"com.amazonaws.inspector2#AccountList": {
Expand Down Expand Up @@ -1067,6 +1068,7 @@
"count": {
"target": "com.amazonaws.inspector2#AggCounts",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>The number of resources.</p>"
}
},
Expand Down Expand Up @@ -2975,6 +2977,12 @@
"traits": {
"smithy.api#documentation": "<p>Details on the related vulnerabilities used to filter findings.</p>"
}
},
"fixAvailable": {
"target": "com.amazonaws.inspector2#StringFilterList",
"traits": {
"smithy.api#documentation": "<p>Details on whether a fix is available through a version update. This value can be <code>YES</code>, <code>NO</code>, or <code>PARTIAL</code>. A <code>PARTIAL</code> fix means that some, but not all, of the packages identified in the finding have fixes available through updated versions.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -3122,6 +3130,12 @@
"traits": {
"smithy.api#documentation": "<p>An object that contains the details of a package vulnerability finding.</p>"
}
},
"fixAvailable": {
"target": "com.amazonaws.inspector2#FixAvailable",
"traits": {
"smithy.api#documentation": "<p>Details on whether a fix is available through a version update. This value can be <code>YES</code>, <code>NO</code>, or <code>PARTIAL</code>. A <code>PARTIAL</code> fix means that some, but not all, of the packages identified in the finding have fixes available through updated versions.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -3271,6 +3285,25 @@
]
}
},
"com.amazonaws.inspector2#FixAvailable": {
"type": "string",
"traits": {
"smithy.api#enum": [
{
"value": "YES",
"name": "YES"
},
{
"value": "NO",
"name": "NO"
},
{
"value": "PARTIAL",
"name": "PARTIAL"
}
]
}
},
"com.amazonaws.inspector2#FreeTrialAccountInfo": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -3800,23 +3833,6 @@
},
"com.amazonaws.inspector2#Inspector2": {
"type": "service",
"traits": {
"aws.api#service": {
"sdkId": "Inspector2",
"arnNamespace": "inspector2",
"cloudTrailEventSource": "inspector2.amazon.aws",
"cloudFormationName": "Inspector2"
},
"aws.auth#sigv4": {
"name": "inspector2"
},
"aws.protocols#restJson1": {},
"smithy.api#cors": {
"additionalAllowedHeaders": ["*"]
},
"smithy.api#documentation": "<p>Amazon Inspector is a vulnerability discovery service that automates continuous scanning for\n security vulnerabilities within your Amazon EC2 and Amazon ECR environments.</p>",
"smithy.api#title": "Inspector2"
},
"version": "2020-06-08",
"operations": [
{
Expand Down Expand Up @@ -3915,7 +3931,24 @@
{
"target": "com.amazonaws.inspector2#UpdateOrganizationConfiguration"
}
]
],
"traits": {
"aws.api#service": {
"sdkId": "Inspector2",
"arnNamespace": "inspector2",
"cloudTrailEventSource": "inspector2.amazon.aws",
"cloudFormationName": "Inspector2"
},
"aws.auth#sigv4": {
"name": "inspector2"
},
"aws.protocols#restJson1": {},
"smithy.api#cors": {
"additionalAllowedHeaders": ["*"]
},
"smithy.api#documentation": "<p>Amazon Inspector is a vulnerability discovery service that automates continuous scanning for\n security vulnerabilities within your Amazon EC2 and Amazon ECR environments.</p>",
"smithy.api#title": "Inspector2"
}
},
"com.amazonaws.inspector2#InspectorScoreDetails": {
"type": "structure",
Expand Down Expand Up @@ -4026,7 +4059,6 @@
"com.amazonaws.inspector2#ListAccountPermissionsMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 1024
Expand Down Expand Up @@ -4111,7 +4143,6 @@
"com.amazonaws.inspector2#ListCoverageMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 200
Expand Down Expand Up @@ -4312,7 +4343,6 @@
"com.amazonaws.inspector2#ListDelegatedAdminMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 5
Expand All @@ -4322,7 +4352,6 @@
"com.amazonaws.inspector2#ListFilterMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 100
Expand Down Expand Up @@ -4450,7 +4479,6 @@
"com.amazonaws.inspector2#ListFindingAggregationsMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 100
Expand Down Expand Up @@ -4554,7 +4582,6 @@
"com.amazonaws.inspector2#ListFindingsMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 100
Expand Down Expand Up @@ -4647,7 +4674,6 @@
"com.amazonaws.inspector2#ListMembersMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 50
Expand Down Expand Up @@ -4789,7 +4815,6 @@
"com.amazonaws.inspector2#ListUsageTotalsMaxResults": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 1,
"max": 500
Expand Down Expand Up @@ -5372,8 +5397,7 @@
"vulnerablePackages": {
"target": "com.amazonaws.inspector2#VulnerablePackageList",
"traits": {
"smithy.api#documentation": "<p>The packages impacted by this vulnerability.</p>",
"smithy.api#required": {}
"smithy.api#documentation": "<p>The packages impacted by this vulnerability.</p>"
}
},
"source": {
Expand Down Expand Up @@ -5476,7 +5500,6 @@
"com.amazonaws.inspector2#Port": {
"type": "integer",
"traits": {
"smithy.api#box": {},
"smithy.api#range": {
"min": 0,
"max": 65535
Expand Down Expand Up @@ -6064,6 +6087,14 @@
{
"value": "PENDING_DISABLE",
"name": "PENDING_DISABLE"
},
{
"value": "NO_INVENTORY",
"name": "NO_INVENTORY"
},
{
"value": "STALE_INVENTORY",
"name": "STALE_INVENTORY"
}
]
}
Expand Down Expand Up @@ -6922,12 +6953,14 @@
"total": {
"target": "com.amazonaws.inspector2#UsageValue",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>The total of usage.</p>"
}
},
"estimatedMonthlyCost": {
"target": "com.amazonaws.inspector2#MonthlyCostEstimate",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>The estimated monthly cost of Amazon Inspector.</p>"
}
},
Expand Down Expand Up @@ -7136,6 +7169,7 @@
"epoch": {
"target": "com.amazonaws.inspector2#PackageEpoch",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>The epoch of the vulnerable package.</p>"
}
},
Expand Down Expand Up @@ -7168,6 +7202,12 @@
"traits": {
"smithy.api#documentation": "<p>The version of the package that contains the vulnerability fix.</p>"
}
},
"remediation": {
"target": "com.amazonaws.inspector2#VulnerablePackageRemediation",
"traits": {
"smithy.api#documentation": "<p>The code to run in your environment to update packages with a fix available.</p>"
}
}
},
"traits": {
Expand All @@ -7179,6 +7219,15 @@
"member": {
"target": "com.amazonaws.inspector2#VulnerablePackage"
}
},
"com.amazonaws.inspector2#VulnerablePackageRemediation": {
"type": "string",
"traits": {
"smithy.api#length": {
"min": 1,
"max": 1024
}
}
}
}
}

0 comments on commit aa99840

Please sign in to comment.