Note : This endpoint is a private preview.
If you are interested in accessing this API, fill out this form .
GET https://api.ap1.datadoghq.com/api/v2/security/scanned-assets-metadata https://api.ap2.datadoghq.com/api/v2/security/scanned-assets-metadata https://api.datadoghq.eu/api/v2/security/scanned-assets-metadata https://api.ddog-gov.com/api/v2/security/scanned-assets-metadata https://api.us2.ddog-gov.com/api/v2/security/scanned-assets-metadata https://api.datadoghq.com/api/v2/security/scanned-assets-metadata https://api.us3.datadoghq.com/api/v2/security/scanned-assets-metadata https://api.us5.datadoghq.com/api/v2/security/scanned-assets-metadata
Overview
Get a list of security scanned assets metadata for an organization.
For the “List Vulnerabilities” endpoint, see the Pagination section .
For the “List Vulnerabilities” endpoint, see the Filtering section .
For the “List Vulnerabilities” endpoint, see the Metadata section .
This endpoint returns additional metadata for cloud resources that is not available from the standard resource endpoints. To access a richer dataset, call this endpoint together with the relevant resource endpoint(s) and merge (join) their results using the resource identifier.
Hosts
To enrich host data, join the response from the Hosts endpoint with the response from the scanned-assets-metadata endpoint on the following key fields:
ENDPOINT JOIN KEY TYPE /api/v1/hosts host_list.host_name string /api/v2/security/scanned-assets-metadata data.attributes.asset.name string
Host Images
To enrich host image data, join the response from the Hosts endpoint with the response from the scanned-assets-metadata endpoint on the following key fields:
ENDPOINT JOIN KEY TYPE /api/v1/hosts host_list.tags_by_source[“Amazon Web Services”][“image”] string /api/v2/security/scanned-assets-metadata data.attributes.asset.name string
Container Images
To enrich container image data, join the response from the Container Images endpoint with the response from the scanned-assets-metadata endpoint on the following key fields:
ENDPOINT JOIN KEY TYPE /api/v2/container_images data.attributes.name@data.attributes.repo_digeststring /api/v2/security/scanned-assets-metadata data.attributes.asset.name string
This endpoint requires the
appsec_vm_read permission.
Arguments Query Strings Its value must come from the links section of the response of the first request. Do not manually edit it.
The page number to be retrieved. It should be equal to or greater than 1.
The type of the scanned asset. Allowed enum values: Host, HostImage, Image
The name of the scanned asset.
filter[last_success.origin]
The origin of last success scan.
The environment of last success scan.
Response Code Example Copy
# Curl command curl -X GET "https://api.ap1.datadoghq.com "https://api.ap2.datadoghq.com "https://api.datadoghq.eu "https://api.ddog-gov.com "https://api.us2.ddog-gov.com "https://api.datadoghq.com "https://api.us3.datadoghq.com "https://api.us5.datadoghq.com /api/v2/security/scanned-assets-metadata " \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} "
"""
List scanned assets metadata returns "OK" response
"""
from datadog_api_client import ApiClient , Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi
configuration = Configuration ()
configuration . unstable_operations [ "list_scanned_assets_metadata" ] = True
with ApiClient ( configuration ) as api_client :
api_instance = SecurityMonitoringApi ( api_client )
response = api_instance . list_scanned_assets_metadata ()
print ( response )
Instructions First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" python3 "example.py"
# List scanned assets metadata returns "OK" response
require "datadog_api_client"
DatadogAPIClient . configure do | config |
config . unstable_operations [ "v2.list_scanned_assets_metadata" . to_sym ] = true
end
api_instance = DatadogAPIClient :: V2 :: SecurityMonitoringAPI . new
p api_instance . list_scanned_assets_metadata ()
Instructions First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" rb "example.rb"
// List scanned assets metadata returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main () {
ctx := datadog . NewDefaultContext ( context . Background ())
configuration := datadog . NewConfiguration ()
configuration . SetUnstableOperationEnabled ( "v2.ListScannedAssetsMetadata" , true )
apiClient := datadog . NewAPIClient ( configuration )
api := datadogV2 . NewSecurityMonitoringApi ( apiClient )
resp , r , err := api . ListScannedAssetsMetadata ( ctx , * datadogV2 . NewListScannedAssetsMetadataOptionalParameters ())
if err != nil {
fmt . Fprintf ( os . Stderr , "Error when calling `SecurityMonitoringApi.ListScannedAssetsMetadata`: %v\n" , err )
fmt . Fprintf ( os . Stderr , "Full HTTP response: %v\n" , r )
}
responseContent , _ := json . MarshalIndent ( resp , "" , " " )
fmt . Fprintf ( os . Stdout , "Response from `SecurityMonitoringApi.ListScannedAssetsMetadata`:\n%s\n" , responseContent )
}
Instructions First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" go run "main.go"
// List scanned assets metadata returns "OK" response
import com.datadog.api.client.ApiClient ;
import com.datadog.api.client.ApiException ;
import com.datadog.api.client.v2.api.SecurityMonitoringApi ;
import com.datadog.api.client.v2.model.ScannedAssetsMetadata ;
public class Example {
public static void main ( String [] args ) {
ApiClient defaultClient = ApiClient . getDefaultApiClient ();
defaultClient . setUnstableOperationEnabled ( "v2.listScannedAssetsMetadata" , true );
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi ( defaultClient );
try {
ScannedAssetsMetadata result = apiInstance . listScannedAssetsMetadata ();
System . out . println ( result );
} catch ( ApiException e ) {
System . err . println ( "Exception when calling SecurityMonitoringApi#listScannedAssetsMetadata" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
Instructions First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" java "Example.java"
// List scanned assets metadata returns "OK" response
use datadog_api_client ::datadog ;
use datadog_api_client ::datadogV2 ::api_security_monitoring ::ListScannedAssetsMetadataOptionalParams ;
use datadog_api_client ::datadogV2 ::api_security_monitoring ::SecurityMonitoringAPI ;
#[tokio::main]
async fn main () {
let mut configuration = datadog ::Configuration ::new ();
configuration . set_unstable_operation_enabled ( "v2.ListScannedAssetsMetadata" , true );
let api = SecurityMonitoringAPI ::with_config ( configuration );
let resp = api
. list_scanned_assets_metadata ( ListScannedAssetsMetadataOptionalParams ::default ())
. await ;
if let Ok ( value ) = resp {
println! ( " {:#?} " , value );
} else {
println! ( " {:#?} " , resp . unwrap_err ());
}
}
Instructions First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" cargo run
/**
* List scanned assets metadata returns "OK" response
*/
import { client , v2 } from "@datadog/datadog-api-client" ;
const configuration = client . createConfiguration ();
configuration . unstableOperations [ "v2.listScannedAssetsMetadata" ] = true ;
const apiInstance = new v2 . SecurityMonitoringApi ( configuration );
apiInstance
. listScannedAssetsMetadata ()
. then (( data : v2.ScannedAssetsMetadata ) => {
console . log (
"API called successfully. Returned data: " + JSON . stringify ( data )
);
})
. catch (( error : any ) => console . error ( error ));
Instructions First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE = "datadoghq.com us3.datadoghq.com us5.datadoghq.com datadoghq.eu ap1.datadoghq.com ap2.datadoghq.com ddog-gov.com us2.ddog-gov.com " DD_API_KEY = "<DD_API_KEY>" DD_APP_KEY = "<DD_APP_KEY>" tsc "example.ts"