

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

# 手動掃描映像是否有 Amazon ECR 中的作業系統漏洞
<a name="manual-scan"></a>

如果您的儲存庫未設定為在**推送時掃描**，您可以手動啟動映像掃描。影像每 24 小時可以掃描一次。如果已設定，則 24 小時包含推送時的初始掃描，以及任何手動掃描。

如需在掃描映像時某些常見問題的故障診斷詳細資訊，請參閱 [對 Amazon ECR 中的映像掃描進行故障診斷](image-scanning-troubleshooting.md)。

------
#### [ AWS 管理主控台 ]

使用下列步驟，利用 AWS 管理主控台以啟動手動映像掃描。

1.  在 https：/[/https://console.aws.amazon.com/ecr/private-registry/repositories](https://console---aws.amazon.com.rproxy.govskope.caecr/private-registry/repositories) 開啟 Amazon ECR 主控台

1. 從導覽列選擇您儲存庫所建立的區域。

1. 在導覽窗格中，選擇 **Repositories** (儲存庫)。

1. 在 **Repositories (儲存庫)** 頁面上，選擇包含要掃描之映像的儲存庫。

1. 在 **Images (映像)** 頁面上，選取要掃描的映像，然後選擇 **Scan (掃描)**。

------
#### [ AWS CLI ]
+ [ start-image-scan](https://docs.aws.amazon.com/cli/latest/reference/ecr/start-image-scan.html) (AWS CLI)

  下列範例使用映像標籤。

  ```
  aws ecr start-image-scan --repository-name name --image-id imageTag=tag_name --region us-east-2
  ```

  下列範例使用映像摘要。

  ```
  aws ecr start-image-scan --repository-name name --image-id imageDigest=sha256_hash --region us-east-2
  ```

------
#### [ AWS Tools for Windows PowerShell ]
+ [ Get-ECRImageScanFinding](https://docs.aws.amazon.com/powershell/latest/reference/items/Start-ECRImageScan.html) (AWS Tools for Windows PowerShell)

  下列範例使用映像標籤。

  ```
  Start-ECRImageScan -RepositoryName name -ImageId_ImageTag tag_name -Region us-east-2 -Force
  ```

  下列範例使用映像摘要。

  ```
  Start-ECRImageScan -RepositoryName name -ImageId_ImageDigest sha256_hash -Region us-east-2 -Force
  ```

------