

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 的 Amazon Inspector 範例 AWS CLI
<a name="cli_inspector2_code_examples"></a>

下列程式碼範例示範如何使用 AWS Command Line Interface 搭配 Amazon Inspector 執行動作和實作常見案例。

*Actions* 是大型程式的程式碼摘錄，必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數，但您可以在其相關情境中查看內容中的動作。

每個範例均包含完整原始碼的連結，您可在連結中找到如何設定和執行內容中程式碼的相關指示。

**Topics**
+ [動作](#actions)

## 動作
<a name="actions"></a>

### `add-attributes-to-findings`
<a name="inspector_AddAttributesToFindings_cli_topic"></a>

以下程式碼範例顯示如何使用 `add-attributes-to-findings`。

**AWS CLI**  
**將屬性新增至調查結果**  
下列 `add-attribute-to-finding` 命令會將索引鍵為 `Example` 且值為 `example` 的屬性指派給 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU` 的調查結果：  

```
aws inspector add-attributes-to-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU --attributes key=Example,value=example
```
輸出：  

```
{
    "failedItems": {}
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南》*中的 Amazon Inspector 調查結果。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AddAttributesToFindings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/add-attributes-to-findings.html)。

### `associate-member`
<a name="inspector2_AssociateMember_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-member`。

**AWS CLI**  
**範例：將 AWS 帳戶與 Amazon Inspector 委派管理員建立關聯**  
下列`associate-member`範例會將 AWS 帳戶與 Amazon Inspector 委派管理員建立關聯。  

```
aws inspector2 associate-member \
    --account-id 123456789012
```
輸出：  

```
{
    "accountId": "123456789012"
}
```
如需詳細資訊，請參閱《[Amazon Inspector 使用者指南》中的使用 AWS Organizations 在 Amazon Inspector 中管理多個帳戶](https://docs.aws.amazon.com/inspector/latest/user/managing-multiple-accounts.html)。 *Amazon Inspector *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateMember](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/associate-member.html)。

### `create-assessment-target`
<a name="inspector_CreateAssessmentTarget_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-assessment-target`。

**AWS CLI**  
**建立評估目標**  
下列 `create-assessment-target` 命令會使用 ARN 為 `arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv` 的資源群組來建立名為 `ExampleAssessmentTarget` 的評估目標：  

```
aws inspector create-assessment-target --assessment-target-name ExampleAssessmentTarget --resource-group-arn arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv
```
輸出：  

```
{
    "assessmentTargetArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateAssessmentTarget](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/create-assessment-target.html)。

### `create-assessment-template`
<a name="inspector_CreateAssessmentTemplate_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-assessment-template`。

**AWS CLI**  
**建立評估範本**  
下列 `create-assessment-template` 命令會為 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX` 的評估目標建立名為 `ExampleAssessmentTemplate` 的評估範本：  

```
aws inspector create-assessment-template --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX --assessment-template-name ExampleAssessmentTemplate --duration-in-seconds 180 --rules-package-arns arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p --user-attributes-for-findings key=ExampleTag,value=examplevalue
```
輸出：  

```
{
    "assessmentTemplateArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateAssessmentTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/create-assessment-template.html)。

### `create-filter`
<a name="inspector2_CreateFilter_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-filter`。

**AWS CLI**  
**建立篩選條件**  
下列 `create-filter` 範例會建立隱藏規則，該規則會省略 ECR 執行個體類型調查結果。  

```
aws inspector2 create-filter \
    --name "ExampleSuppressionRuleECR" \
    --description "This suppression rule omits ECR instance type findings" \
    --action SUPPRESS \
    --filter-criteria 'resourceType=[{comparison="EQUALS", value="AWS_ECR_INSTANCE"}]'
```
輸出：  

```
{
    "arn": "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的[篩選 Amazon Inspector 調查結果](https://docs.aws.amazon.com/inspector/latest/user/findings-managing-filtering.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateFilter](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/create-filter.html)。

### `create-findings-report`
<a name="inspector2_CreateFindingsReport_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-findings-report`。

**AWS CLI**  
**建立調查結果報告**  
下列 `create-findings-report` 範例會建立調查結果報告。  

```
aws inspector2 create-findings-report \
    --report-format CSV \
    --s3-destination bucketName=inspector-sbom-123456789012,keyPrefix=sbom-key,kmsKeyArn=arn:aws:kms:us-west-2:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333 \
    --filter-criteria '{"ecrImageRepositoryName":[{"comparison":"EQUALS","value":"debian"}]}'
```
輸出：  

```
{
    "reportId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
}
```
如需詳細資訊，請參閱《Amazon Inspector 指南》**中的[管理 Amazon Inspector 中的調查結果](https://docs.aws.amazon.com/inspector/latest/user/findings-managing.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateFindingsReport](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/create-findings-report.html)。

### `create-resource-group`
<a name="inspector_CreateResourceGroup_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-resource-group`。

**AWS CLI**  
**建立資源群組**  
下列 `create-resource-group` 命令會使用索引鍵為 `Name` 和值為 `example` 的標籤來建立資源群組：  

```
aws inspector create-resource-group --resource-group-tags key=Name,value=example
```
輸出：  

```
{
   "resourceGroupArn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateResourceGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/create-resource-group.html)。

### `create-sbom-export`
<a name="inspector2_CreateSbomExport_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-sbom-export`。

**AWS CLI**  
**建立軟體物料清單 (SBOM) 報告**  
下列 `create-sbom-export` 範例會建立軟體物料清單 (SBOM) 報告。  

```
aws inspector2 create-sbom-export \
    --report-format SPDX_2_3 \
    --resource-filter-criteria 'ecrRepositoryName=[{comparison="EQUALS",value="debian"}]' \
    --s3-destination bucketName=inspector-sbom-123456789012,keyPrefix=sbom-key,kmsKeyArn=arn:aws:kms:us-west-2:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333
```
輸出：  

```
{
    "reportId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
}
```
如需詳細資訊，請參閱《Amazon Inspector 使用者指南》**中的[使用 Amazon Inspector 匯出 SBOM](https://docs.aws.amazon.com/inspector/latest/user/sbom-export.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateSbomExport](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/create-sbom-export.html)。

### `delete-assessment-run`
<a name="inspector_DeleteAssessmentRun_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-assessment-run`。

**AWS CLI**  
**刪除評估執行**  
下列 `delete-assessment-run` 命令會刪除 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe` 的評估執行：  

```
aws inspector delete-assessment-run --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteAssessmentRun](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/delete-assessment-run.html)。

### `delete-assessment-target`
<a name="inspector_DeleteAssessmentTarget_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-assessment-target`。

**AWS CLI**  
**刪除評估目標**  
下列 `delete-assessment-target` 命令會刪除 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq` 的評估目標：  

```
aws inspector delete-assessment-target --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq
```
如需詳細資訊，請參閱《*Amazon Inspector 指南》*中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteAssessmentTarget](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/delete-assessment-target.html)。

### `delete-assessment-template`
<a name="inspector_DeleteAssessmentTemplate_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-assessment-template`。

**AWS CLI**  
**刪除評估範本**  
下列 `delete-assessment-template` 命令會刪除 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T` 的評估範本：  

```
aws inspector delete-assessment-template --assessment-template-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteAssessmentTemplate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/delete-assessment-template.html)。

### `delete-filter`
<a name="inspector2_DeleteFilter_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-filter`。

**AWS CLI**  
**刪除篩選條件**  
下列 `delete-filter` 範例會刪除篩選條件。  

```
aws inspector2 delete-filter \
    --arn "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444"
```
輸出：  

```
{
    "arn": "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的[篩選 Amazon Inspector 調查結果](https://docs.aws.amazon.com/inspector/latest/user/findings-managing-filtering.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteFilter](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/delete-filter.html)。

### `describe-assessment-runs`
<a name="inspector_DescribeAssessmentRuns_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-assessment-runs`。

**AWS CLI**  
**描述評估執行**  
下列 `describe-assessment-run` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE` 的評估執行：  

```
aws inspector describe-assessment-runs --assessment-run-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE
```
輸出：  

```
{
        "assessmentRuns": [
          {
                "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE",
                "assessmentTemplateArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw",
                "completedAt": 1458680301.4,
                "createdAt": 1458680170.035,
                "dataCollected": true,
                "durationInSeconds": 3600,
                "name": "Run 1 for ExampleAssessmentTemplate",
                "notifications": [],
                "rulesPackageArns": [
                  "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP"
                ],
                "startedAt": 1458680170.161,
                "state": "COMPLETED",
                "stateChangedAt": 1458680301.4,
                "stateChanges": [
                  {
                        "state": "CREATED",
                        "stateChangedAt": 1458680170.035
                  },
                  {
                        "state": "START_DATA_COLLECTION_PENDING",
                        "stateChangedAt": 1458680170.065
                  },
                  {
                        "state": "START_DATA_COLLECTION_IN_PROGRESS",
                        "stateChangedAt": 1458680170.096
                  },
                  {
                        "state": "COLLECTING_DATA",
                        "stateChangedAt": 1458680170.161
                  },
                  {
                        "state": "STOP_DATA_COLLECTION_PENDING",
                        "stateChangedAt": 1458680239.883
                  },
                  {
                        "state": "DATA_COLLECTED",
                        "stateChangedAt": 1458680299.847
                  },
                  {
                        "state": "EVALUATING_RULES",
                        "stateChangedAt": 1458680300.099
                  },
                  {
                        "state": "COMPLETED",
                        "stateChangedAt": 1458680301.4
                  }
                ],
                "userAttributesForFindings": []
          }
        ],
        "failedItems": {}
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAssessmentRuns](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-assessment-runs.html)。

### `describe-assessment-targets`
<a name="inspector_DescribeAssessmentTargets_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-assessment-targets`。

**AWS CLI**  
**描述評估目標**  
下列 `describe-assessment-targets` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq` 的評估目標：  

```
aws inspector describe-assessment-targets --assessment-target-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq
```
輸出：  

```
{
      "assessmentTargets": [
        {
              "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq",
              "createdAt": 1458074191.459,
              "name": "ExampleAssessmentTarget",
              "resourceGroupArn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI",
              "updatedAt": 1458074191.459
        }
      ],
      "failedItems": {}
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAssessmentTargets](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-assessment-targets.html)。

### `describe-assessment-templates`
<a name="inspector_DescribeAssessmentTemplates_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-assessment-templates`。

**AWS CLI**  
**描述評估範本**  
下列 `describe-assessment-templates` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw` 的評估範本：  

```
aws inspector describe-assessment-templates --assessment-template-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw
```
輸出：  

```
{
      "assessmentTemplates": [
        {
              "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw",
              "assessmentTargetArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq",
              "createdAt": 1458074191.844,
              "durationInSeconds": 3600,
              "name": "ExampleAssessmentTemplate",
              "rulesPackageArns": [
                "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP"
              ],
              "userAttributesForFindings": []
        }
      ],
      "failedItems": {}
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAssessmentTemplates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-assessment-templates.html)。

### `describe-cross-account-access-role`
<a name="inspector_DescribeCrossAccountAccessRole_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-cross-account-access-role`。

**AWS CLI**  
**描述跨帳戶存取權角色**  
下列`describe-cross-account-access-role`命令說明可讓 Amazon Inspector 存取您 AWS 帳戶的 IAM 角色：  

```
aws inspector describe-cross-account-access-role
```
輸出：  

```
{
        "registeredAt": 1458069182.826,
        "roleArn": "arn:aws:iam::123456789012:role/inspector",
        "valid": true
}
```
如需詳細資訊，請參閱《*Amazon Inspector 使用者指南*》中的設定 Amazon Inspector。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeCrossAccountAccessRole](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-cross-account-access-role.html)。

### `describe-findings`
<a name="inspector_DescribeFindings_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-findings`。

**AWS CLI**  
**描述調查結果**  
下列 `describe-findings` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4` 的調查結果：  

```
aws inspector describe-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4
```
輸出：  

```
{
      "failedItems": {},
      "findings": [
        {
              "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4",
              "assetAttributes": {
                "ipv4Addresses": [],
                "schemaVersion": 1
              },
              "assetType": "ec2-instance",
              "attributes": [],
              "confidence": 10,
              "createdAt": 1458680301.37,
              "description": "Amazon Inspector did not find any potential security issues during this assessment.",
              "indicatorOfCompromise": false,
              "numericSeverity": 0,
              "recommendation": "No remediation needed.",
              "schemaVersion": 1,
              "service": "Inspector",
              "serviceAttributes": {
                "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE",
                "rulesPackageArn": "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP",
                "schemaVersion": 1
              },
              "severity": "Informational",
              "title": "No potential security issues found",
              "updatedAt": 1458680301.37,
              "userAttributes": []
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南》*中的 Amazon Inspector 調查結果。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeFindings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-findings.html)。

### `describe-resource-groups`
<a name="inspector_DescribeResourceGroups_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-resource-groups`。

**AWS CLI**  
**描述資源群組**  
下列 `describe-resource-groups` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI` 的資源群組：  

```
aws inspector describe-resource-groups --resource-group-arns arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI
```
輸出：  

```
{
      "failedItems": {},
      "resourceGroups": [
        {
              "arn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI",
              "createdAt": 1458074191.098,
              "tags": [
                {
                      "key": "Name",
                      "value": "example"
                }
              ]
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeResourceGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-resource-groups.html)。

### `describe-rules-packages`
<a name="inspector_DescribeRulesPackages_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-rules-packages`。

**AWS CLI**  
**描述規則套件**  
下列 `describe-rules-packages` 命令描述 ARN 為 `arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p` 的規則套件：  

```
aws inspector describe-rules-packages --rules-package-arns arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p
```
輸出：  

```
{
      "failedItems": {},
      "rulesPackages": [
        {
              "arn": "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
              "description": "The rules in this package help verify whether the EC2 instances in your application are exposed to Common Vulnerabilities and
              Exposures (CVEs). Attacks can exploit unpatched vulnerabilities to compromise the confidentiality, integrity, or availability of your service
              or data. The CVE system provides a reference for publicly known information security vulnerabilities and exposures. For more information, see
              [https://cve.mitre.org/](https://cve.mitre.org/). If a particular CVE appears in one of the produced Findings at the end of a completed
              Inspector assessment, you can search [https://cve.mitre.org/](https://cve.mitre.org/) using the CVE's ID (for example, \"CVE-2009-0021\") to
              find detailed information about this CVE, its severity, and how to mitigate it. ",
              "name": "Common Vulnerabilities and Exposures",
              "provider": "Amazon Web Services, Inc.",
              "version": "1.1"
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 規則套件和規則。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeRulesPackages](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/describe-rules-packages.html)。

### `disassociate-member`
<a name="inspector2_DisassociateMember_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-member`。

**AWS CLI**  
**範例：將成員帳戶與 Amazon Inspector 委派管理員取消關聯**  
下列`disassociate-member`範例會取消 AWS 帳戶與 Amazon Inspector 委派管理員的關聯。  

```
aws inspector2 disassociate-member \
    --account-id 123456789012
```
輸出：  

```
{
    "accountId": "123456789012"
}
```
如需詳細資訊，請參閱《[Amazon Inspector 使用者指南》中的使用 AWS Organizations 在 Amazon Inspector 中管理多個帳戶](https://docs.aws.amazon.com/inspector/latest/user/managing-multiple-accounts.html)。 *Amazon Inspector *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DisassociateMember](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/disassociate-member.html)。

### `get-configuration`
<a name="inspector2_GetConfiguration_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-configuration`。

**AWS CLI**  
**取得 Inspector 掃描的設定組態**  
下列 `get-configuration` 範例取得 Inspector 掃描的設定組態。  

```
aws inspector2 get-configuration
```
輸出：  

```
{
    "ec2Configuration": {
        "scanModeState": {
            "scanMode": "EC2_HYBRID",
            "scanModeStatus": "SUCCESS"
        }
    },
    "ecrConfiguration": {
        "rescanDurationState": {
            "pullDateRescanDuration": "DAYS_90",
            "rescanDuration": "DAYS_30",
            "status": "SUCCESS",
            "updatedAt": "2024-05-14T21:16:20.237000+00:00"
        }
     }
}
```
如需詳細資訊，請參閱《Amazon Inspector 使用者指南》**中的[使用 Amazon Inspector 自動化的資源掃描](https://docs.aws.amazon.com/inspector/latest/user/scanning-resources.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/get-configuration.html)。

### `get-member`
<a name="inspector2_GetMember_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-member`。

**AWS CLI**  
**範例：取得組織的成員資訊**  
aws inspector2 get-member --account-id 123456789012  
輸出：  

```
{
        "member": {
        "accountId": "123456789012",
        "delegatedAdminAccountId": "123456789012",
        "relationshipStatus": "ENABLED",
        "updatedAt": "2023-09-11T09:57:20.520000-07:00"
    }
}
```
如需詳細資訊，請參閱《[Amazon Inspector 使用者指南》中的使用 AWS Organizations 在 Amazon Inspector 中管理多個帳戶](https://docs.aws.amazon.com/inspector/latest/user/managing-multiple-accounts.html)。 *Amazon Inspector *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetMember](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/get-member.html)。

### `get-telemetry-metadata`
<a name="inspector_GetTelemetryMetadata_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-telemetry-metadata`。

**AWS CLI**  
**取得遙測中繼資料**  
下列 `get-telemetry-metadata` 命令會產生相關資料資訊，系統是針對 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE` 的評估執行收集的這些資料：  

```
aws inspector get-telemetry-metadata --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE
```
輸出：  

```
{
      "telemetryMetadata": [
        {
              "count": 2,
              "dataSize": 345,
              "messageType": "InspectorDuplicateProcess"
        },
        {
              "count": 3,
              "dataSize": 255,
              "messageType": "InspectorTimeEventMsg"
        },
        {
              "count": 4,
              "dataSize": 1082,
              "messageType": "InspectorNetworkInterface"
        },
        {
              "count": 2,
              "dataSize": 349,
              "messageType": "InspectorDnsEntry"
        },
        {
              "count": 11,
              "dataSize": 2514,
              "messageType": "InspectorDirectoryInfoMsg"
        },
        {
              "count": 1,
              "dataSize": 179,
              "messageType": "InspectorTcpV6ListeningPort"
        },
        {
              "count": 101,
              "dataSize": 10949,
              "messageType": "InspectorTerminal"
        },
        {
              "count": 26,
              "dataSize": 5916,
              "messageType": "InspectorUser"
        },
        {
              "count": 282,
              "dataSize": 32148,
              "messageType": "InspectorDynamicallyLoadedCodeModule"
        },
        {
              "count": 18,
              "dataSize": 10172,
              "messageType": "InspectorCreateProcess"
        },
        {
              "count": 3,
              "dataSize": 8001,
              "messageType": "InspectorProcessPerformance"
        },
        {
              "count": 1,
              "dataSize": 360,
              "messageType": "InspectorOperatingSystem"
        },
        {
              "count": 6,
              "dataSize": 546,
              "messageType": "InspectorStopProcess"
        },
        {
              "count": 1,
              "dataSize": 1553,
              "messageType": "InspectorInstanceMetaData"
        },
        {
              "count": 2,
              "dataSize": 434,
              "messageType": "InspectorTcpV4Connection"
        },
        {
              "count": 474,
              "dataSize": 2960322,
              "messageType": "InspectorPackageInfo"
        },
        {
              "count": 3,
              "dataSize": 2235,
              "messageType": "InspectorSystemPerformance"
        },
        {
              "count": 105,
              "dataSize": 46048,
              "messageType": "InspectorCodeModule"
        },
        {
              "count": 1,
              "dataSize": 182,
              "messageType": "InspectorUdpV6ListeningPort"
        },
        {
              "count": 2,
              "dataSize": 371,
              "messageType": "InspectorUdpV4ListeningPort"
        },
        {
              "count": 18,
              "dataSize": 8362,
              "messageType": "InspectorKernelModule"
        },
        {
              "count": 29,
              "dataSize": 48788,
              "messageType": "InspectorConfigurationInfo"
        },
        {
              "count": 1,
              "dataSize": 79,
              "messageType": "InspectorMonitoringStart"
        },
        {
              "count": 5,
              "dataSize": 0,
              "messageType": "InspectorSplitMsgBegin"
        },
        {
              "count": 51,
              "dataSize": 4593,
              "messageType": "InspectorGroup"
        },
        {
              "count": 1,
              "dataSize": 184,
              "messageType": "InspectorTcpV4ListeningPort"
        },
        {
              "count": 1159,
              "dataSize": 3146579,
              "messageType": "Total"
        },
        {
              "count": 5,
              "dataSize": 0,
              "messageType": "InspectorSplitMsgEnd"
        },
        {
              "count": 1,
              "dataSize": 612,
              "messageType": "InspectorLoadImageInProcess"
        }
      ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetTelemetryMetadata](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/get-telemetry-metadata.html)。

### `list-account-permissions`
<a name="inspector2_ListAccountPermissions_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-account-permissions`。

**AWS CLI**  
**列出帳戶許可**  
下列 `list-account-permissions` 範例列出帳戶許可。  

```
aws inspector2 list-account-permissions
```
輸出：  

```
{
    "permissions": [
        {
            "operation": "ENABLE_SCANNING",
            "service": "ECR"
        },
        {
            "operation": "DISABLE_SCANNING",
            "service": "ECR"
        },
        {
            "operation": "ENABLE_REPOSITORY",
            "service": "ECR"
        },
        {
            "operation": "DISABLE_REPOSITORY",
            "service": "ECR"
        },
        {
            "operation": "ENABLE_SCANNING",
            "service": "EC2"
        },
        {
            "operation": "DISABLE_SCANNING",
            "service": "EC2"
        },
        {
            "operation": "ENABLE_SCANNING",
            "service": "LAMBDA"
        },
        {
            "operation": "DISABLE_SCANNING",
            "service": "LAMBDA"
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 使用者指南*》中的 [適用於 Amazon Inspector 的 Identity and Access Management](https://docs.aws.amazon.com/inspector/latest/user/security-iam.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAccountPermissions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-account-permissions.html)。

### `list-assessment-run-agents`
<a name="inspector_ListAssessmentRunAgents_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-assessment-run-agents`。

**AWS CLI**  
**列出評估執行代理程式**  
下列 `list-assessment-run-agents` 命令列出具有指定 ARN 之執行評估的代理程式。  

```
aws inspector list-assessment-run-agents \
    --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE
```
輸出：  

```
{
    "assessmentRunAgents": [
        {
            "agentHealth": "HEALTHY",
            "agentHealthCode": "HEALTHY",
            "agentId": "i-49113b93",
            "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE",
            "telemetryMetadata": [
                {
                    "count": 2,
                    "dataSize": 345,
                    "messageType": "InspectorDuplicateProcess"
                },
                {
                    "count": 3,
                    "dataSize": 255,
                    "messageType": "InspectorTimeEventMsg"
                },
                {
                    "count": 4,
                    "dataSize": 1082,
                    "messageType": "InspectorNetworkInterface"
                },
                {
                    "count": 2,
                    "dataSize": 349,
                    "messageType": "InspectorDnsEntry"
                },
                {
                    "count": 11,
                    "dataSize": 2514,
                    "messageType": "InspectorDirectoryInfoMsg"
                },
                {
                    "count": 1,
                    "dataSize": 179,
                    "messageType": "InspectorTcpV6ListeningPort"
                },
                {
                    "count": 101,
                    "dataSize": 10949,
                    "messageType": "InspectorTerminal"
                },
                {
                    "count": 26,
                    "dataSize": 5916,
                    "messageType": "InspectorUser"
                },
                {
                    "count": 282,
                    "dataSize": 32148,
                    "messageType": "InspectorDynamicallyLoadedCodeModule"
                },
                {
                    "count": 18,
                    "dataSize": 10172,
                    "messageType": "InspectorCreateProcess"
                },
                {
                    "count": 3,
                    "dataSize": 8001,
                    "messageType": "InspectorProcessPerformance"
                },
                {
                    "count": 1,
                    "dataSize": 360,
                    "messageType": "InspectorOperatingSystem"
                },
                {
                    "count": 6,
                    "dataSize": 546,
                    "messageType": "InspectorStopProcess"
                },
                {
                    "count": 1,
                    "dataSize": 1553,
                    "messageType": "InspectorInstanceMetaData"
                },
                {
                    "count": 2,
                    "dataSize": 434,
                    "messageType": "InspectorTcpV4Connection"
                },
                {
                    "count": 474,
                    "dataSize": 2960322,
                    "messageType": "InspectorPackageInfo"
                },
                {
                    "count": 3,
                    "dataSize": 2235,
                    "messageType": "InspectorSystemPerformance"
                },
                {
                    "count": 105,
                    "dataSize": 46048,
                    "messageType": "InspectorCodeModule"
                },
                {
                    "count": 1,
                    "dataSize": 182,
                    "messageType": "InspectorUdpV6ListeningPort"
                },
                {
                    "count": 2,
                    "dataSize": 371,
                    "messageType": "InspectorUdpV4ListeningPort"
                },
                {
                    "count": 18,
                    "dataSize": 8362,
                    "messageType": "InspectorKernelModule"
                },
                {
                    "count": 29,
                    "dataSize": 48788,
                    "messageType": "InspectorConfigurationInfo"
                },
                {
                    "count": 1,
                    "dataSize": 79,
                    "messageType": "InspectorMonitoringStart"
                },
                {
                    "count": 5,
                    "dataSize": 0,
                    "messageType": "InspectorSplitMsgBegin"
                },
                {
                    "count": 51,
                    "dataSize": 4593,
                    "messageType": "InspectorGroup"
                },
                {
                    "count": 1,
                    "dataSize": 184,
                    "messageType": "InspectorTcpV4ListeningPort"
                },
                {
                    "count": 1159,
                    "dataSize": 3146579,
                    "messageType": "Total"
                },
                {
                    "count": 5,
                    "dataSize": 0,
                    "messageType": "InspectorSplitMsgEnd"
                },
                {
                    "count": 1,
                    "dataSize": 612,
                    "messageType": "InspectorLoadImageInProcess"
                }
            ]
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 使用者指南*》中的 [AWS 代理程式](https://docs.aws.amazon.com/inspector/latest/userguide/inspector_agents.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAssessmentRunAgents](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-assessment-run-agents.html)。

### `list-assessment-runs`
<a name="inspector_ListAssessmentRuns_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-assessment-runs`。

**AWS CLI**  
**列出評估執行**  
下列 `list-assessment-runs` 命令會列出所有現有的評估執行。  

```
aws inspector list-assessment-runs
```
輸出：  

```
{
    "assessmentRunArns": [
        "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE",
        "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v"
    ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 使用者指南*》中的 [Amazon Inspector 評估範本和評估執行](https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAssessmentRuns](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-assessment-runs.html)。

### `list-assessment-targets`
<a name="inspector_ListAssessmentTargets_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-assessment-targets`。

**AWS CLI**  
**列出評估目標**  
下列 `list-assessment-targets` 命令會列出所有現有的評估目標：  

```
aws inspector list-assessment-targets
```
輸出：  

```
{
       "assessmentTargetArns": [
       "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"
       ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAssessmentTargets](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-assessment-targets.html)。

### `list-assessment-templates`
<a name="inspector_ListAssessmentTemplates_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-assessment-templates`。

**AWS CLI**  
**列出評估範本**  
下列 `list-assessment-templates` 命令會列出所有現有的評估範本：  

```
aws inspector list-assessment-templates
```
輸出：  

```
{
       "assessmentTemplateArns": [
       "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw",
       "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-Uza6ihLh"
       ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAssessmentTemplates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-assessment-templates.html)。

### `list-coverage-statistics`
<a name="inspector2_ListCoverageStatistics_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-coverage-statistics`。

**AWS CLI**  
**範例 1：依群組列出涵蓋範圍統計資料**  
下列`list-coverage-statistics`範例會依群組列出您 AWS 環境的涵蓋範圍統計資料。  

```
aws inspector2 list-coverage-statistics \
   --group-by RESOURCE_TYPE
```
輸出：  

```
{
    "countsByGroup": [
        {
            "count": 56,
            "groupKey": "AWS_LAMBDA_FUNCTION"
        },
        {
            "count": 27,
            "groupKey": "AWS_ECR_REPOSITORY"
        },
        {
            "count": 18,
            "groupKey": "AWS_EC2_INSTANCE"
        },
        {
            "count": 3,
            "groupKey": "AWS_ECR_CONTAINER_IMAGE"
        },
        {
            "count": 1,
            "groupKey": "AWS_ACCOUNT"
        }
    ],
    "totalCounts": 105
}
```
如需詳細資訊，請參閱[《Amazon Inspector 使用者指南》中的評估 AWS 環境的 Amazon Inspector 涵蓋範圍](https://docs.aws.amazon.com/inspector/latest/user/assessing-coverage.html)。 *Amazon Inspector *  
**範例 2：依資源類型列出涵蓋範圍統計資料**  
下列`list-coverage-statistics`範例會依資源類型列出您 AWS 環境的涵蓋範圍統計資料。  

```
aws inspector2 list-coverage-statistics
    --filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_ECR_REPOSITORY"}]}'
    --group-by SCAN_STATUS_REASON
```
輸出：  

```
{
    "countsByGroup": [
        {
            "count": 27,
            "groupKey": "SUCCESSFUL"
        }
    ],
    "totalCounts": 27
}
```
如需詳細資訊，請參閱[《Amazon Inspector 使用者指南》中的評估 AWS 環境的 Amazon Inspector 涵蓋](https://docs.aws.amazon.com/inspector/latest/user/assessing-coverage.html)範圍。 *Amazon Inspector *  
**範例 3：依 ECR 儲存庫名稱列出涵蓋範圍統計資料**  
下列`list-coverage-statistics`範例會依 ECR 儲存庫名稱列出您 AWS 環境的涵蓋範圍統計資料。  

```
aws inspector2 list-coverage-statistics
   --filter-criteria '{"ecrRepositoryName":[{"comparison":"EQUALS","value":"debian"}]}'
   --group-by SCAN_STATUS_REASON
```
輸出：  

```
{
    "countsByGroup": [
        {
            "count": 3,
            "groupKey": "SUCCESSFUL"
        }
    ],
    "totalCounts": 3
}
```
如需詳細資訊，請參閱[《Amazon Inspector 使用者指南》中的評估 AWS 環境的 Amazon Inspector 涵蓋範圍](https://docs.aws.amazon.com/inspector/latest/user/assessing-coverage.html)。 *Amazon Inspector *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListCoverageStatistics](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-coverage-statistics.html)。

### `list-coverage`
<a name="inspector2_ListCoverage_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-coverage`。

**AWS CLI**  
**範例 1：列出環境的涵蓋範圍詳細資訊**  
下列 `list-coverage` 範例列出環境的涵蓋範圍詳細資訊。  

```
aws inspector2 list-coverage
```
輸出：  

```
{
    "coveredResources": [
        {
            "accountId": "123456789012",
            "lastScannedAt": "2024-05-20T16:23:20-07:00",
            "resourceId": "i-EXAMPLE55555555555",
            "resourceMetadata": {
                "ec2": {
                    "amiId": "ami-EXAMPLE6666666666",
                    "platform": "LINUX"
                }
            },
            "resourceType": "AWS_EC2_INSTANCE",
            "scanStatus": {
                "reason": "SUCCESSFUL",
                "statusCode": "ACTIVE"
            },
            "scanType": "PACKAGE"
        }
    ]
}
```
**範例 2：列出 Lambda 函式資源類型的涵蓋範圍詳細資訊**  
下列`list-coverage`範例列出您的 Lambda 函數資源類型詳細資訊。  

```
aws inspector2 list-coverage
    --filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_LAMBDA_FUNCTION"}]}'
```
輸出：  

```
{
    "coveredResources": [
        {
            "accountId": "123456789012",
            "resourceId": "arn:aws:lambda:us-west-2:123456789012:function:Eval-container-scan-results:$LATEST",
            "resourceMetadata": {
                "lambdaFunction": {
                    "functionName": "Eval-container-scan-results",
                    "functionTags": {},
                    "layers": [],
                    "runtime": "PYTHON_3_7"
                }
            },
            "resourceType": "AWS_LAMBDA_FUNCTION",
            "scanStatus": {
                "reason": "SUCCESSFUL",
                "statusCode": "ACTIVE"
            },
            "scanType": "CODE"
        }
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListCoverage](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-coverage.html)。

### `list-delegated-admin-accounts`
<a name="inspector2_ListDelegatedAdminAccounts_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-delegated-admin-accounts`。

**AWS CLI**  
**列出組織委派管理員帳戶的相關資訊**  
下列 `list-delegated-admin-accounts` 範例列出組織委派管理員帳戶的相關資訊。  

```
aws inspector2 list-delegated-admin-accounts
```
輸出：  

```
{
    "delegatedAdminAccounts": [
        {
            "accountId": "123456789012",
            "status": "ENABLED"
        }
    ]
}
```
如需詳細資訊，請參閱《Amazon Inspector 使用者指南》**中的[為 Amazon Inspector 指定委派管理員](https://docs.aws.amazon.com/inspector/latest/user/admin-member-relationship.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListDelegatedAdminAccounts](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-delegated-admin-accounts.html)。

### `list-event-subscriptions`
<a name="inspector_ListEventSubscriptions_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-event-subscriptions`。

**AWS CLI**  
**列出事件訂閱**  
下列 `list-event-subscriptions` 命令會列出 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0` 之評估範本的所有事件訂閱：  

```
aws inspector list-event-subscriptions --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0
```
輸出：  

```
{
      "subscriptions": [
        {
              "eventSubscriptions": [
                {
                      "event": "ASSESSMENT_RUN_COMPLETED",
                      "subscribedAt": 1459455440.867
                }
              ],
              "resourceArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0",
              "topicArn": "arn:aws:sns:us-west-2:123456789012:exampletopic"
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListEventSubscriptions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-event-subscriptions.html)。

### `list-filters`
<a name="inspector2_ListFilters_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-filters`。

**AWS CLI**  
**列出與您用來啟用 Amazon Inspector 之帳戶相關聯的篩選條件**  
下列 `list-filters` 範例列出與您用來啟用 Amazon Inspector 之帳戶相關聯的篩選條件。  

```
aws inspector2 list-filters
```
輸出：  

```
{
    "filters": [
        {
            "action": "SUPPRESS",
            "arn": "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444",
            "createdAt": "2024-05-15T21:11:08.602000+00:00",
            "criteria": {
                "resourceType": [
                    {
                        "comparison": "EQUALS",
                        "value": "AWS_EC2_INSTANCE"
                    },
                ]
            },
            "description": "This suppression rule omits EC2 instance type findings",
            "name": "ExampleSuppressionRuleEC2",
            "ownerId": "o-EXAMPLE222",
            "tags": {},
            "updatedAt": "2024-05-15T21:11:08.602000+00:00"
        },
        {
            "action": "SUPPRESS",
            "arn": "arn:aws:inspector2:us-east-1:813737243517:owner/o-EXAMPLE222/filter/EXAMPLE444444444",
            "createdAt": "2024-05-15T21:28:27.054000+00:00",
            "criteria": {
                "resourceType": [
                    {
                        "comparison": "EQUALS",
                        "value": "AWS_ECR_INSTANCE"
                    }
                ]
            },
            "description": "This suppression rule omits ECR instance type findings",
            "name": "ExampleSuppressionRuleECR",
            "ownerId": "o-EXAMPLE222",
            "tags": {},
            "updatedAt": "2024-05-15T21:28:27.054000+00:00"
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的[篩選 Amazon Inspector 調查結果](https://docs.aws.amazon.com/inspector/latest/user/findings-managing-filtering.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListFilters](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-filters.html)。

### `list-findings`
<a name="inspector_ListFindings_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-findings`。

**AWS CLI**  
**列出調查結果**  
下列 `list-findings` 命令會列出所有產生的調查結果：  

```
aws inspector list-findings
```
輸出：  

```
{
        "findingArns": [
        "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4",
        "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v/finding/0-tyvmqBLy"
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南》*中的 Amazon Inspector 調查結果。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListFindings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-findings.html)。

### `list-members`
<a name="inspector2_ListMembers_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-members`。

**AWS CLI**  
**範例 1：列出與組織 Amazon Inspector 委派管理員相關聯的所有成員帳戶**  
aws inspector2 list-members --only-associated  
輸出：  

```
{
        {
             "members": [
        {
             "accountId": "123456789012",
             "delegatedAdminAccountId": "123456789012",
             "relationshipStatus": "ENABLED",
             "updatedAt": "2023-09-11T09:57:20.520000-07:00"
        },
        {
             "accountId": "123456789012",
             "delegatedAdminAccountId": "123456789012",
             "relationshipStatus": "ENABLED",
             "updatedAt": "2024-08-12T10:13:01.472000-07:00"
        },
        {
             "accountId": "625032911453",
             "delegatedAdminAccountId": "123456789012",
             "relationshipStatus": "ENABLED",
             "updatedAt": "2023-09-11T09:57:20.438000-07:00"
        },
        {
            "accountId": "715411239211",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "ENABLED",
            "updatedAt": "2024-04-24T09:14:57.471000-07:00"
        }
    ]
}
```
如需詳細資訊，請參閱《[Amazon Inspector 使用者指南》中的使用 AWS Organizations 管理 Amazon Inspector 中的多個帳戶](https://docs.aws.amazon.com/inspector/latest/user/managing-multiple-accounts.html)。 *Amazon Inspector *  
**範例 2：列出與組織 Amazon Inspector 委派管理員相關聯和取消關聯的所有成員帳戶**  
aws inspector2 list-members --no-only-associated  
輸出：  

```
{
        {
            "members": [
        {
            "accountId": "123456789012",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "REMOVED",
            "updatedAt": "2024-05-15T11:34:53.326000-07:00"
        },
        {
            "accountId": "123456789012",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "ENABLED",
            "updatedAt": "2023-09-11T09:57:20.520000-07:00"
        },
        {
            "accountId": "123456789012",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "ENABLED",
            "updatedAt": "2024-08-12T10:13:01.472000-07:00"
        },
        {
            "accountId": "123456789012",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "ENABLED",
            "updatedAt": "2023-09-11T09:57:20.438000-07:00"
        },
        {
            "accountId": "123456789012",
            "delegatedAdminAccountId": "123456789012",
            "relationshipStatus": "ENABLED",
            "updatedAt": "2024-04-24T09:14:57.471000-07:00"
        }
    ]
}
```
如需詳細資訊，請參閱《[Amazon Inspector 使用者指南》中的使用 AWS Organizations 在 Amazon Inspector 中管理多個帳戶](https://docs.aws.amazon.com/inspector/latest/user/managing-multiple-accounts.html)。 *Amazon Inspector *  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListMembers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-members.html)。

### `list-rules-packages`
<a name="inspector_ListRulesPackages_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-rules-packages`。

**AWS CLI**  
**列出規則套件**  
下列 `list-rules-packages` 命令列出所有可用的 Inspector 規則套件：  

```
aws inspector list-rules-packages
```
輸出：  

```
{
       "rulesPackageArns": [
         "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p",
         "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc",
         "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ",
         "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD"
       ]
 }
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 規則套件和規則。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListRulesPackages](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-rules-packages.html)。

### `list-tags-for-resource`
<a name="inspector_ListTagsForResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-tags-for-resource`。

**AWS CLI**  
**列出資源的標籤**  
下列 `list-tags-for-resource` 命令會列出與 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu` 之評估範本相關聯的所有標籤：  

```
aws inspector list-tags-for-resource --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu
```
輸出：  

```
{
      "tags": [
        {
              "key": "Name",
              "value": "Example"
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/list-tags-for-resource.html)。

### `list-usage-totals`
<a name="inspector2_ListUsageTotals_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-usage-totals`。

**AWS CLI**  
**列出過去 30 天的用量總計**  
下列 `list-usage-totals` 範例列出過去 30 天的用量總計。  

```
aws inspector2 list-usage-totals
```
輸出：  

```
{
    "totals": [
        {
            "accountId": "123456789012",
            "usage": [
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 4.6022044647,
                    "total": 1893.4784083333334,
                    "type": "EC2_AGENTLESS_INSTANCE_HOURS"
                },
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 18.892449279,
                    "total": 10882.050784722222,
                    "type": "EC2_INSTANCE_HOURS"
                },
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 5.4525363736,
                    "total": 6543.043648333333,
                    "type": "LAMBDA_FUNCTION_CODE_HOURS"
                },
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 3.9064080309,
                    "total": 9375.379274166668,
                    "type": "LAMBDA_FUNCTION_HOURS"
                },
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 0.06,
                    "total": 6.0,
                    "type": "ECR_RESCAN"
                },
                {
                    "currency": "USD",
                    "estimatedMonthlyCost": 0.09,
                    "total": 1.0,
                    "type": "ECR_INITIAL_SCAN"
                }
            ]
        }
    ]
}
```
如需詳細資訊，請參閱《Amazon Inspector 使用者指南》**中的[監控 Amazon Inspector 中的用量和成本](https://docs.aws.amazon.com/inspector/latest/user/usage.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListUsageTotals](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/list-usage-totals.html)。

### `preview-agents`
<a name="inspector_PreviewAgents_cli_topic"></a>

以下程式碼範例顯示如何使用 `preview-agents`。

**AWS CLI**  
**預覽代理程式**  
下列 `preview-agents` 命令會使用預覽 EC2 執行個體上安裝的代理程式，這些執行個體屬於 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq` 之評估目標的一部分：  

```
aws inspector preview-agents --preview-agents-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq
```
輸出：  

```
{
      "agentPreviews": [
        {
              "agentId": "i-49113b93"
        }
      ]
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [PreviewAgents](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/preview-agents.html)。

### `register-cross-account-access-role`
<a name="inspector_RegisterCrossAccountAccessRole_cli_topic"></a>

以下程式碼範例顯示如何使用 `register-cross-account-access-role`。

**AWS CLI**  
**註冊跨帳戶存取權角色**  
下列 `register-cross-account-access-role` 命令會註冊 ARN 為 `arn:aws:iam::123456789012:role/inspector` 的 IAM 角色，在您呼叫 the preview-agents 命令時的評估執行開始時，Amazon Inspector 會使用此角色來列出 EC2 執行個體。  

```
aws inspector register-cross-account-access-role --role-arn arn:aws:iam::123456789012:role/inspector
```
如需詳細資訊，請參閱《*Amazon Inspector 使用者指南*》中的設定 Amazon Inspector。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [RegisterCrossAccountAccessRole](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/register-cross-account-access-role.html)。

### `remove-attributes-from-findings`
<a name="inspector_RemoveAttributesFromFindings_cli_topic"></a>

以下程式碼範例顯示如何使用 `remove-attributes-from-findings`。

**AWS CLI**  
**從調查結果移除屬性**  
下列 `remove-attributes-from-finding` 命令會從 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU` 的調查結果中移除索引鍵為 `Example` 且值為 `example` 的屬性：  

```
aws inspector remove-attributes-from-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU --attribute-keys key=Example,value=example
```
輸出：  

```
{
      "failedItems": {}
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南》*中的 Amazon Inspector 調查結果。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [RemoveAttributesFromFindings](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/remove-attributes-from-findings.html)。

### `set-tags-for-resource`
<a name="inspector_SetTagsForResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `set-tags-for-resource`。

**AWS CLI**  
**設定資源的標籤**  
下列 `set-tags-for-resource` 命令會將索引鍵為 `Example` 且值為 `example` 的標籤設為 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0` 的評估範本：  

```
aws inspector set-tags-for-resource --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 --tags key=Example,value=example
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [SetTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/set-tags-for-resource.html)。

### `start-assessment-run`
<a name="inspector_StartAssessmentRun_cli_topic"></a>

以下程式碼範例顯示如何使用 `start-assessment-run`。

**AWS CLI**  
**啟動評估執行**  
下列 `start-assessment-run` 命令會使用 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T` 的評估範本，啟動名為 `examplerun` 的評估執行：  

```
aws inspector start-assessment-run --assessment-run-name examplerun --assessment-template-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T
```
輸出：  

```
{
      "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY"
}
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [StartAssessmentRun](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/start-assessment-run.html)。

### `stop-assessment-run`
<a name="inspector_StopAssessmentRun_cli_topic"></a>

以下程式碼範例顯示如何使用 `stop-assessment-run`。

**AWS CLI**  
**停止評估執行**  
下列 `stop-assessment-run` 命令會停止 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY` 的執行評估：  

```
aws inspector stop-assessment-run --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [StopAssessmentRun](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/stop-assessment-run.html)。

### `subscribe-to-event`
<a name="inspector_SubscribeToEvent_cli_topic"></a>

以下程式碼範例顯示如何使用 `subscribe-to-event`。

**AWS CLI**  
**訂閱事件**  
下列範例會啟用以下程序：將關於 `ASSESSMENT_RUN_COMPLETED` 事件的 Amazon SNS 通知傳送給 ARN 為 `arn:aws:sns:us-west-2:123456789012:exampletopic` 的主題  

```
aws inspector subscribe-to-event \
    --event ASSESSMENT_RUN_COMPLETED \
    --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 \
    --topic-arn arn:aws:sns:us-west-2:123456789012:exampletopic
```
此命令不會產生輸出。  
如需詳細資訊，請參閱《Amazon Inspector 指南》**中的 [Amazon Inspector 評估範本和評估執行](https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [SubscribeToEvent](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/subscribe-to-event.html)。

### `unsubscribe-from-event`
<a name="inspector_UnsubscribeFromEvent_cli_topic"></a>

以下程式碼範例顯示如何使用 `unsubscribe-from-event`。

**AWS CLI**  
**從事件中取消訂閱**  
下列 `unsubscribe-from-event` 命令會停用以下程序：將關於 `ASSESSMENT_RUN_COMPLETED` 事件的 Amazon SNS 通知傳送給 ARN 為 `arn:aws:sns:us-west-2:123456789012:exampletopic` 的主題：  

```
aws inspector unsubscribe-from-event --event ASSESSMENT_RUN_COMPLETED --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 --topic arn:aws:sns:us-west-2:123456789012:exampletopic
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估範本和評估執行。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UnsubscribeFromEvent](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/unsubscribe-from-event.html)。

### `update-assessment-target`
<a name="inspector_UpdateAssessmentTarget_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-assessment-target`。

**AWS CLI**  
**更新評估目標**  
下列 `update-assessment-target` 命令會更新 ARN 為 `arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX` 和名稱為 `Example` 的評估目標，以及更新 ARN 為 `arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt` 的資源群組：  

```
aws inspector update-assessment-target --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX --assessment-target-name Example --resource-group-arn arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt
```
如需詳細資訊，請參閱《*Amazon Inspector 指南*》中的 Amazon Inspector 評估目標。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateAssessmentTarget](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector/update-assessment-target.html)。

### `update-filter`
<a name="inspector2_UpdateFilter_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-filter`。

**AWS CLI**  
**更新篩選條件**  
下列 `update-filter` 範例會更新篩選條件，以省略 Lambda 調查結果，而非 ECR 執行個體調查結果。  

```
aws inspector2 update-filter \
   --filter-arn "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444" \
   --name "ExampleSuppressionRuleLambda" \
   --description "This suppression rule omits Lambda instance findings" \
   --reason "Updating filter to omit Lambda instance findings instead of ECR instance findings"
```
輸出：  

```
{
    "filters": [
        {
            "action": "SUPPRESS",
            "arn": "arn:aws:inspector2:us-west-2:123456789012:owner/o-EXAMPLE222/filter/EXAMPLE444444444",
            "createdAt": "2024-05-15T21:28:27.054000+00:00",
            "criteria": {
                "resourceType": [
                    {
                        "comparison": "EQUALS",
                        "value": "AWS_ECR_INSTANCE"
                    }
                ]
            },
            "description": "This suppression rule omits Lambda instance findings",
            "name": "ExampleSuppressionRuleLambda",
            "ownerId": "o-EXAMPLE222",
            "reason": "Updating filter to omit Lambda instance findings instead of ECR instance findings",
            "tags": {},
            "updatedAt": "2024-05-15T22:23:13.665000+00:00"
        }
    ]
}
```
如需詳細資訊，請參閱《Amazon Inspector 指南》**中的[管理 Amazon Inspector 中的調查結果](https://docs.aws.amazon.com/inspector/latest/user/findings-managing.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateFilter](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/inspector2/update-filter.html)。