> Source: [sk154512](https://support.checkpoint.com/results/sk/sk154512)

# sk154512 - How to search for Protected Assets using the CloudGuard Dome9 REST API

| Property | Value |
|----------|-------|
| Solution ID | sk154512 |
| Date Created | 2019-05-27 |
| Last Modified | 2022-02-22 |
| Technical Level | General |
| Products | Cloud Firewall |
| Versions | R82.10, R81.20, R82 |

## Solution

This note describes how to query information about assets in your cloud accounts using CloudGuard Dome9 REST API.  
This will use the [ProtectedAsset](https://api-v2-docs.dome9.com/#Dome9-API-ProtectedAsset) resource. The POST method for this resource, Search, includes a request block which specifies the specific assets to be queried. The response block returns details for these assets.

In the request block, you select specific assets to retrieve, filtering by provider, entity type, name, etc. You can also indicate the number of results to send in the response block (in the case where there are lots of results), and page through the results.

The results block returns details for the requested entities, and summary information as well. Not all details for the entity are returned. If results are paged, the response block includes the key to the next page (which is used by the subsequent request block, until the last page is retrieved).

<br />

**Prerequisites**

* API Keys for your CloudGuard Dome9 account (see [Create an API Key](https://sc1.checkpoint.com/documents/CloudGuard_Dome9/Default.htm#cshid=V2_API)).

**Query**

This is the basic request block

    
        {  "pageSize": 0, 
           "filter": 
            {  "freeTextPhrase": "string",    
               "fields": [ { 
                  "name": "string",
                  "value": "string"      }
                         ],
               "tags": [   { 
                  "key": "string",
                  "value": "string"      }
                        ],
               "includedEntityTypes": [
                  "string"    
                        ], 
               "excludedEntityTypes": [
                  "string"    
                        ]  
              },
             "searchAfter": [ 
                  "string" 
                        ]
        }
        
where

* **pageSize** specifies how many results to include in each response message. If there are more results than this, page through the results in subsequent request messages, using the **searchAfter** field from the previous response, which indicates the first result to include in the next response.
* the **filter** block sets filters to select assets in your account:
  * **freeTextPhrase** is a search string that selects assets that match it
  * **fields** is a list of assets (type and value). The value field is of the form "*aws\|S3Bucket*", where the first part indicates the provider, and the second, the entity.
  * **tags** is a list of tags (name and value)
  * **includedEntityTypes** is a whitelist of entities that can be included in the results; this list is processed before the filter block. Entities in this list are included in the aggregate results included in the response block.
  * **excludedEntityTypes** is a blacklist of entities that are excluded from the results;this list is processed before the filter block (so, for example, results for an excluded entity type will not be returned, even if it is included in the filter block). Entities in this list are also excluded from the aggregate results included in the response block.
* **searchAfter** specifies the first result to return in the next response. Use this to page through results if they require more than a single response (according to the **pageSize** setting)

<br />

Examples

The request block

     
        {
         pageSize: 25,
         filter: {
         fields: [
         {name: "organizationalUnitId",
          value: "b*******-****-****-****-***********1"}
         {name: "type",
          value: "aws|S3Bucket"}
                  ]
          }
         }
        
returns all S3 Bucket entities in the specified Organizational Unit (that is, all accounts and networks associated with the Org Unit)

The request

```
{   
```

```
  pageSize: 25,
```

```
  searchAfter: [ 
```

```
       "fbe8ba91-3806-413e-90ed-af830bb38834",
```

```
         "",
```

```
         null,
```

```
         "",
```

```
         "GcpIamPolicy",  "8|fbe8ba91-3806-413e-90ed-af830bb38834|IamPolicy"]
```

```
   filter: {
```

```
     fields: [
```

```
     {name: "organizationalUnitId",
```

```
      value: "b*******-****-****-****-***********1"}
```

```
     {name: "type", 
```

```
     value: "aws|S3Bucket"}
```

```
              ]
```

```
      }
```

```
     }
```

uses the **searchAfter** block to retrieve the next 25 results from the query (the **searchAfter** block was returned in the response to the first request).

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
