Skip to content

Commit 4c9e62d

Browse files
committed
update the spec
1 parent a21f768 commit 4c9e62d

File tree

2 files changed

+83
-251
lines changed

2 files changed

+83
-251
lines changed

javav2/example_code/inspector/src/main/java/org/example/InspectorFindingsDemo.java

Lines changed: 0 additions & 203 deletions
This file was deleted.

scenarios/basics/inspector/SPECIFICATION.md

Lines changed: 83 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This SDK Basics scenario demonstrates how to interact with Amazon Inspector, a basics scenario that showcases AWS services and SDKs. It is primarily intended for the AWS code examples team to use while developing this example in additional languages.
44

5+
## Resources
6+
This Basics scenario does not require any additional AWS resources.
7+
58
### Relevant documentation
69

710
* [Getting started with Amazon Inspector](https://docs.aws.amazon.com/inspector/latest/user/getting_started.html)
@@ -11,79 +14,111 @@ This SDK Basics scenario demonstrates how to interact with Amazon Inspector, a b
1114

1215
### API Actions Used
1316

17+
* [CreateFilter](https://docs.aws.amazon.com/inspector/v2/APIReference/API_CreateFilter.html)
18+
1419
* [Enable](https://docs.aws.amazon.com/inspector/v2/APIReference/API_Enable.html)
20+
21+
* [ListCoverageStatistics](https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListCoverageStatistics.html)
22+
23+
24+
* [ListUsageTotals](https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListUsageTotals.html)
25+
1526
* [BatchGetAccountStatus](https://docs.aws.amazon.com/inspector/v2/APIReference/API_BatchGetAccountStatus.html)
27+
28+
* [ListFilters](https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListFilters.html)
29+
1630
* [ListFindings](https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListFindings.html)
31+
1732
* [BatchGetFindingDetails](https://docs.aws.amazon.com/inspector/v2/APIReference/API_BatchGetFindingDetails.html)
33+
1834
* [ListCoverage](https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListCoverage.html)
19-
* [Disable](https://docs.aws.amazon.com/inspector/v2/APIReference/API_Disable.html)
2035

21-
## Proposed example structure
36+
* [DeleteFilter](https://docs.aws.amazon.com/inspector/v2/APIReference/API_DeleteFilter.html)
2237

23-
The output below demonstrates how this example would run for the customer. It includes a Hello service example (included for all services), and the scenario description. The scenario code would also be presented as Action snippets, with a code snippet for each SDK action.
2438

25-
### Hello
39+
## Hello Amazon Inspector
2640

27-
The Hello example is a separate runnable example. - Set up the Inspector service client - Check the current account status for Inspector - Display available scan types and regions
41+
The Hello example is intended for users not familiar with this service to easily get up and running. It sets up the Inspector service client, checks the current account status for Inspector and displays available scan types.
2842

2943
## Scenario
3044

31-
#### Setup
45+
This scenario demonstrates the basic usage of **Amazon Inspector** using a Java program. It focuses on checking account status, enabling Inspector, listing findings, reviewing coverage, and managing filters.
3246

33-
* Enable Amazon Inspector for the account
34-
* Verify Inspector is successfully activated
35-
* Display account status and enabled scan types
47+
---
3648

37-
#### Coverage Assessment
49+
### Setup
3850

39-
* List coverage statistics for EC2 instances, ECR repositories, and Lambda functions
40-
* Display resource coverage details
41-
* Show scanning status for different resource types
51+
* Check Amazon Inspector account status
52+
* Enable Inspector for available resource types (if not already enabled)
53+
* Display account status summary
4254

43-
#### Findings Management
55+
---
56+
57+
### Coverage Assessment
58+
59+
* List coverage details for scanned resources
60+
* Display overall coverage statistics
61+
* Review scan status for resources (general overview)
62+
63+
---
64+
65+
### Findings Management
4466

4567
* List security findings across all resource types
46-
* Filter findings by severity level (CRITICAL, HIGH, MEDIUM, LOW)
47-
* Retrieve detailed information for specific findings
68+
* Create an example filter to suppress low-severity findings
69+
* List existing filters
70+
71+
---
4872

49-
#### Vulnerability Analysis
73+
### Usage and Costs
5074

51-
* Display vulnerability details including CVE information
52-
* Show affected resources and remediation guidance
53-
* Filter findings by resource type (EC2, ECR, Lambda)
75+
* Check usage totals and metrics for Inspector
76+
* Review coverage statistics
5477

55-
#### Cleanup
78+
---
5679

57-
* Optionally disable Inspector scanning (with user confirmation)
58-
* Display final account status
80+
### Outcome
81+
82+
By following this scenario, users learn how to:
83+
84+
* Check Inspector account status and configuration
85+
* Enable Inspector for different resource types
86+
* List and analyze security findings
87+
* Monitor scan coverage
88+
* Create and manage filters
89+
* Track usage and coverage statistics
5990

6091
## Errors
6192

62-
SDK Code examples include basic exception handling for each action used. The table below describes an appropriate exception which will be handled in the code for each service action.
63-
64-
|Action |Error |Handling |
65-
|--- |--- |--- |
66-
|`Enable` |ValidationException |Validate resource types and account permissions. |
67-
|`Enable` |AccessDeniedException |Notify user of insufficient permissions and exit. |
68-
|`BatchGetAccountStatus` |ValidationException |Validate account IDs format. |
69-
|`BatchGetAccountStatus` |AccessDeniedException |Handle permission errors gracefully. |
70-
|`ListFindings` |ValidationException |Validate filter criteria and pagination parameters. |
71-
|`ListFindings` |InternalServerException |Retry operation with exponential backoff. |
72-
|`BatchGetFindingDetails` |ValidationException |Validate finding ARNs format. |
73-
|`BatchGetFindingDetails` |AccessDeniedException |Handle access denied for specific findings. |
74-
|`ListCoverage` |ValidationException |Validate filter and pagination parameters. |
75-
|`Disable` |ValidationException |Validate resource types for disabling. |
76-
|`Disable` |ConflictException |Handle cases where Inspector cannot be disabled. |
93+
The table below describes the exceptions handled in the program for each action.
7794

78-
## Metadata
95+
| Action | Exception | Handling |
96+
|-------------------------------|---------------------------|--------------------------------------------------------------------------|
97+
| `Enable` | `ValidationException` | Prints a message indicating Inspector may already be enabled. |
98+
| `listUsageTotals` | `ValidationException` | Validation error listing usage totals.
99+
| `BatchGetAccountStatus` | `AccessDeniedException` | Prints AWS service error details and rethrows the exception. |
100+
| `ListFindings` | `ValidationException` | Prints validation error details. |
101+
| `ListCoverage` | `ValidationException` | Prints validation error details. |
102+
| `ListCoverageStatistics` | `ValidationException` | Prints validation error details. |
103+
| `createFilter` | `ValidationException` | Prints validation error details. |
104+
| `ListFilters` | `ValidationException` | Prints AWS service error details and rethrows the exception. |
105+
| `deleteFilter` | `ResourceNotFoundException` | Prints AWS service error details and rethrows the exception. |
106+
| `batchGetFindingDetails` | `ResourceNotFoundException` | Prints AWS service error details and rethrows the exception. |
79107

80-
|action / scenario |metadata file |metadata key |
81-
|--- |--- |--- |
82-
|`Enable` |inspector_metadata.yaml |inspector_Enable |
83-
|`BatchGetAccountStatus` |inspector_metadata.yaml |inspector_BatchGetAccountStatus |
84-
|`ListFindings` |inspector_metadata.yaml |inspector_ListFindings |
85-
|`BatchGetFindingDetails` |inspector_metadata.yaml |inspector_BatchGetFindingDetails |
86-
|`ListCoverage` |inspector_metadata.yaml |inspector_ListCoverage |
87-
|`Disable` |inspector_metadata.yaml |inspector_Disable |
88-
|`Amazon Inspector Basics Scenario` |inspector_metadata.yaml |inspector_Scenario |
89108

109+
## Metadata
110+
111+
| Action / Scenario | Metadata File | Metadata Key |
112+
|-----------------------------------------|------------------------|-------------------------------|
113+
| `Enable` | inspector_metadata.yaml | inspector_EnableInspector |
114+
| `BatchGetAccountStatus` | inspector_metadata.yaml | inspector_GetAccountStatus |
115+
| `ListFindings` | inspector_metadata.yaml | inspector_ListFindings |
116+
| `ListCoverage` | inspector_metadata.yaml | inspector_ListCoverage |
117+
| `ListCoverageStatistics` | inspector_metadata.yaml | inspector_ListCoverageStatistics |
118+
| `ListUsageTotals` | inspector_metadata.yaml | inspector_ListUsageTotals |
119+
| `CreateFilter` | inspector_metadata.yaml | inspector_CreateFilter |
120+
| `ListFilters` | inspector_metadata.yaml | inspector_ListFilters |
121+
| `DeleteFilter` | inspector_metadata.yaml | inspector_DeleteFilter` |
122+
| `batchGetFindingDetails` | inspector_metadata.yaml | inspector_BatchGetFindingDetails |
123+
| `Amazon Inspector Hello` | inspector_metadata.yaml | inspector_Hello |
124+
| `Amazon Inspector Basics Scenario` | inspector_metadata.yaml | inspector_Scenario

0 commit comments

Comments
 (0)