---
title: Troubleshooting Agentless Scanning
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Cloud Security > Cloud Security Troubleshooting >
  Troubleshooting Agentless Scanning
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Troubleshooting Agentless Scanning

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

If you experience issues with Agentless Scanning, use the following troubleshooting guidelines. If you need further assistance, contact [Datadog Support](https://docs.datadoghq.com/help/).

## No results after deployment{% #no-results-after-deployment %}

**Applies to**: Datadog-hosted and self-hosted scanning

After deploying Agentless Scanning, results do not appear immediately. First results typically appear within 30 minutes of deployment. In rare cases, such as IAM configuration issues, it can take up to two hours.

If no results appear after two hours:

- Check that the cloud integration is properly configured. On the [Cloud Security Setup](https://app.datadoghq.com/security/configuration/csm/setup) page, verify that your cloud account appears with Agentless Scanning enabled.
- For **self-hosted scanning**, verify the following:
  - The scanner infrastructure was deployed. In your cloud provider console, check that scanner instances are running.
  - [Remote Configuration](https://docs.datadoghq.com/remote_configuration.md) is enabled on the API key you used to set up Agentless Scanning. Scanners receive their scan instructions through Remote Configuration.
- For **Datadog-hosted scanning**, verify the following:
  - The Datadog integration role is set up in your AWS account, and Datadog is collecting data from the account through the [AWS integration](https://docs.datadoghq.com/integrations/amazon_web_services.md).
  - The Agentless Scanning managed IAM policy and the AWS managed `SecurityAudit` policy are attached to the Datadog integration role.
  - Scanning is enabled for the account:
    - If you set up scanning using CloudFormation, check the account's Agentless Scanning settings on the [Cloud Security Setup](https://app.datadoghq.com/security/configuration/csm/setup) page, or use the [Agentless Scanning API](https://docs.datadoghq.com/api/latest/agentless-scanning.md#get-aws-scan-options).
    - If you set up scanning using Terraform, check the [`datadog_agentless_scanning_aws_scan_options`](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/agentless_scanning_aws_scan_options) resource for the account.
  - Datadog has detected any recent changes to the IAM role or policy. Detection can take some time after you make a change.

## Enable Remote Configuration on the API key{% #enable-remote-configuration-on-the-api-key %}

**Applies to**: Self-hosted scanning

To authenticate and authorize Agentless scanners to receive scan instructions, enable Remote Configuration on the relevant API Key. Only users who have the [`api_keys_write`](https://docs.datadoghq.com/account_management/rbac/permissions.md#api-and-application-keys) RBAC permission can enable Remote Configuration on the API Key.

**Note:** If you have [`api_keys_write`](https://docs.datadoghq.com/account_management/rbac/permissions.md#api-and-application-keys) RBAC permission, but are missing Remote Configuration [Organization](https://app.datadoghq.com/organization-settings/remote-config) level permissions, you cannot enable Remote Configuration on a new or an existing API Key. You only have permission to disable Remote Configuration on an existing API Key. To view and manage your organization's API Keys, see [API Keys](https://app.datadoghq.com/organization-settings/api-keys) in Datadog.

## Google Cloud: Failed to create state bucket (storage.buckets.create 403){% #gcp-failed-to-create-state-bucket-storagebucketscreate-403 %}

**Applies to**: Self-hosted scanning on Google Cloud

If the Google Cloud Shell setup fails at **"Setting up Terraform state storage"** with an error like:

```
Failed to create state bucket: datadog-agentless-tfstate-<project>
HTTPError 403: ... does not have storage.buckets.create access to the Google Cloud project.
```

the identity running the script does not have permission to create or manage GCS buckets in the scanner project.

**Fix (choose one):**

1. **Grant Storage permissions** on the scanner project to the user (or service account) running the script. For example, grant **Storage Admin** (`roles/storage.admin`) on that project, or a custom role that includes `storage.buckets.create`, `storage.buckets.get`, and `storage.buckets.update`.
1. **Reuse an existing bucket:** Use a bucket that already exists (create it with an identity that has Storage permissions if needed), then set `TF_STATE_BUCKET` to that bucket name when running the script. The script will use the existing bucket for Terraform state and will not try to create one.

## Deployment fails due to VPC creation restrictions{% #deployment-fails-due-to-vpc-creation-restrictions %}

**Applies to**: Self-hosted scanning

This issue applies to self-hosted scanners. If your organization is using Terraform and uses Service Control Policies (SCPs) that restrict Virtual Private Cloud (VPC) creation, scanner deployment fails because the scanner creates a new VPC by default.

To fix this, use the [**custom VPC**](https://github.com/DataDog/terraform-module-datadog-agentless-scanner/tree/main/examples/custom_vpc) option during setup to deploy the scanner into an existing VPC instead of creating a new one.

## Scanner instances appear as vulnerable hosts{% #scanner-instances-appear-as-vulnerable-hosts %}

**Applies to**: Self-hosted scanning

Self-hosted Agentless scanner instances are ephemeral EC2 instances (or equivalent) deployed within your cloud account to perform scans. This issue does not apply to Datadog-hosted scanning, which runs no scanner instances in your account. Because they run a standard operating system image (for example, the latest Ubuntu LTS), they may appear in vulnerability findings related to OS packages.

These findings reflect vulnerabilities identified in the underlying OS image and do not indicate a misconfiguration of your environment.

Scanner instances are tagged `DatadogAgentlessScanner:true`. To exclude them from your vulnerability views, filter out this tag in the [Cloud Security Vulnerabilities Explorer](https://app.datadoghq.com/security/csm/vm).

## Hosts with the Datadog Agent are not scanned{% #hosts-with-the-datadog-agent-are-not-scanned %}

**Applies to**: Datadog-hosted and self-hosted scanning

This is expected behavior. To prevent duplicate scanning, Agentless Scanning skips hosts where the Datadog Agent runs with both [Cloud Security Vulnerabilities](https://docs.datadoghq.com/security/cloud_security_management/vulnerabilities.md) and Misconfigurations enabled.

If the Agent has only one of these features enabled, Agentless Scanning still scans the host for the other one.

## Unexpected cross-region scanning costs{% #unexpected-cross-region-scanning-costs %}

**Applies to**: Self-hosted scanning

In some self-hosted deployments, cross-region data transfer may contribute to cloud provider network costs, depending on how scanners and resources are distributed across regions.

To optimize traffic locality, consider deploying scanners in regions that contain a significant number of hosts. As a general guideline, Datadog recommends deploying a scanner in each region that contains more than 150 hosts.

See [Deploying Agentless Scanning](https://docs.datadoghq.com/security/cloud_security_management/setup/agentless_scanning/deployment_methods.md?agentless_scanner_hosting=self_hosted) for detailed guidance on recommended deployment topologies.

## Unavailable for GovCloud and FIPS{% #unavailable-for-govcloud-and-fips %}

**Applies to**: Datadog-hosted and self-hosted scanning

Agentless Scanning is not available in GovCloud and is not FIPS compliant. This applies to both self-hosted and Datadog-hosted scanning.

## Scans run in a different region than your resources{% #scans-run-in-a-different-region-than-your-resources %}

**Applies to**: Datadog-hosted scanning

With Datadog-hosted scanning, Datadog scans your resources in the region of your Datadog site, not the region where your resources are located. This is expected behavior. For details, see [Datadog-hosted data residency](https://docs.datadoghq.com/security/cloud_security_management/setup/agentless_scanning.md#datadog-hosted-data-residency). If your data must be processed in your own cloud account or region, use self-hosted scanning for that account.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Setting up Agentless Scanning](https://docs.datadoghq.com/security/cloud_security_management/setup/agentless_scanning.md)
- [Deploying Agentless Scanning](https://docs.datadoghq.com/security/cloud_security_management/setup/agentless_scanning/deployment_methods.md)
