Google Resource Manager
Google Cloud Platform Resource Manager.
IT Services · Google Resource Manager
Details
| ID | Google Resource Manager |
|---|---|
| Provider | |
| Category | IT Services |
| From Version | 5.0.0 |
| Docker Image | demisto/googleapi-python3:1.0.0.115338 |
| Supported Modules | Agentix XSIAM |
README
Configure Google Resource Manager on Cortex XSOAR
- Navigate to Settings > Integrations > Servers & Services.
- Search for Google Resource Manager.
- Click Add instance to create and configure a new integration instance.
- Name: a textual name for the integration instance.
- Project ID
- Private Key ID
- Private Key
- Client Email
- Client ID
- Client X509 Cert URL
- Use system proxy settings
- Click Test to validate the URLs, token, and connection.
Commands
You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
- Create a new project: grm-create-project
- Get information for a project: grm-get-project
- Get a list of all projects: grm-list-projects
- Update a project: grm-update-project
- Search organization resources: grm-search-organizations
- Get information for an organization: grm-get-organization
- Delete a project: grm-delete-project
- Restore a project: grm-undelete-project
1. Create a new project
Creates a new Project resource with the user-specified values passed as command arguments.
Base Command
grm-create-project
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The unique, user-assigned ID of the Project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 | Required |
| parent_id | The ID of the parent resource. Organizations' Name output is in the format "organizations/12345" where the numbers after the forward slash are the ID of the organization. To find Organization IDs available to assign as a parent resource try running the grm-search-organization command. | Required |
| label_keys | The label keys associated with this Project. Label keys must be between 1 and 63 characters long and conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. You can associate a maximum of 256 labels with a given resource. |
Optional |
| name | The user-assigned display name of the Project. It must be 4 to 30 characters. Supported characters: lowercase and uppercase letters, numbers, hyphens, single-quotes, double-quotes, spaces, and exclamation points. Example: My Project | Optional |
| parent_type | Represents the resource type the parent_id is for. Valid resource types: "organization" and "folder". | Required |
| label_values | The label values associated with this Project. Label values must be between 0 and 63 characters long and conform to the following regular expression [a-z]([-a-z0-9]*[a-z0-9])?. A label value can be empty. You can associate a maximum of 256 labels with a given resource. |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.State | String | The Project lifecycle state |
| GRM.Project.CreateTime | Date | createTime - The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-create-project project_id=faramir-111 parent_id=690006273490 parent_type=organization name="Faramir"
Context Example
{
"GRM.Project": {
"Name": "Faramir",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
}
Human Readable Output
Google Cloud Project Successfully Created
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | ACTIVE | 2019-01-15T12:30:21.267Z |
2. Getting information for a project
Retrieves the Project by the specified project_id, e.g., my-project-123.
Base Command
grm-get-project
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The unique ID of the Project to fetch, e.g., tokyo-rain-123. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.State | String | The Project lifecycle state |
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.CreateTime | Date | createTime - The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-get-project project_id=faramir-111
Context Example
{
"GRM.Project": {
"Name": "Faramir",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
}
Human Readable Output
Details of Fetched Google Cloud Project
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | ACTIVE | 2019-01-15T12:30:21.267Z |
3. Get a list of all projects
Lists projects that are visible to the user and satisfies the specified filter. Projects are returned in an unspecified order.
Base Command
grm-list-projects
Input
| Argument Name | Description | Required |
|---|---|---|
| filter | An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:
Examples:
|
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.State | String | The Project lifecycle state. |
| GRM.Project.CreateTime | Date | The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-list-projects filter="id:faramir*"
Context Example
{
"GRM.Project": [
{
"Name": "Faramir 2",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "877118493152",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-222",
"CreateTime": "2019-01-20T07:42:58.155Z"
},
{
"Name": "Faramir",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
]
}
Human Readable Output
Projects Filtered by 'id:faramir*'
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir 2 | Type: organization ID: 690006273490 |
877118493152 | faramir-222 | ACTIVE | 2019-01-20T07:42:58.155Z | |
| Faramir | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | ACTIVE | 2019-01-15T12:30:21.267Z |
4. Update a project
Updates the attributes of the Project identified by the specified project_id. Currently the only fields that can be updated are the project name and labels.
Base Command
grm-update-project
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The unique ID of the Project to update. Example: tokyo-rain-123 |
Required |
| name | The string to update the Project name with. It must be 4 to 30 characters. Supported characters are: lowercase and uppercase letters, numbers, hyphens, single-quotes, double-quotes, spaces, and exclamation points. Example: My Project |
Optional |
| parent_id | The ID of the parent resource. Organizations' Name output is in the format organizations/12345 where the numbers after the forward slash are the ID of the organization. To find Organization IDs available to assign as a parent resource try running the grm-search-organization command. |
Required |
| parent_type | The resource type the parent_id is for. Valid resource types: "organization" and "folder". | Required |
| label_keys | The label keys to associate with this Project. Label keys must be between 1 and 63 characters long and conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? You can associate a maximum of 256 labels with a given resource. |
Optional |
| label_values | The label values to associate with this Project. Label values must be between 0 and 63 characters long and conform to the following regular expression [a-z]([-a-z0-9]*[a-z0-9])?. A label value can be empty. You can associate a maximum of 256 labels with a given resource. |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.State | String | The Project lifecycle state. |
| GRM.Project.CreateTime | Date | The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-update-project project_id=faramir-111 parent_id=690006273490 parent_type=organization name="Faramir-Updated"
Context Example
{
"GRM.Project": {
"Name": "Faramir-Updated",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
}
Human Readable Output
Details of Updated Google Cloud Project
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir-Updated | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | ACTIVE | 2019-01-15T12:30:21.267Z |
5. Search organization resources
Searches Organization resources that are visible to the user and satisfies the specified filter. Organizations are returned in an unspecified order. New Organizations do not necessarily appear at the end of the results.
Base Command
grm-search-organizations
Input
| Argument Name | Description | Required |
|---|---|---|
| page_size | The maximum number of Organizations to return in the response. | Optional |
| page_token | A pagination token returned from a previous call to "organizations.search" that indicates from where the listing should continue | Optional |
| filter | An expression for filtering the Organizations returned in the results. Filter rules are case-insensitive. Organizations can be filtered by 'owner.directoryCustomerId' or by 'domain', where the domain is a G Suite domain, e.g., owner.directorycustomerid:123456789 Organizations with owner.directory_customer_id equal to 123456789. domain:google.com Organizations corresponding to the domain google.com. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Organization.Name | String | The resource name of the organization. This is the organization's relative path in the API. Its format is "organizations/[organization_id]" e.g. "organizations/1234". |
| GRM.Organization.State | String | The organization's current lifecycle state |
| GRM.Organization.CreateTime | Date | The time the organization resource was created |
| GRM.Organization.Owner.CustomerID | String | The G Suite customer ID used in the Directory API |
Command Example
grm-search-organizations
Context Example
{
"GRM.Organization": [
{
"Owner": {
"CustomerID": "C02f0zfqw"
},
"State": "ACTIVE",
"CreateTime": "2017-04-25T13:41:05.196Z",
"Name": "organizations/690006273490"
}
]
}
Human Readable Output
Organizations
| Owner | State | Name | CreateTime |
|---|---|---|---|
| CustomerID: C02f0zfqw | ACTIVE | organizations/690006273490 | 2017-04-25T13:41:05.196Z |
6. Get information for an organization
Returns an Organization resource identified by the specified resource name.
Base Command
grm-get-organization
Input
| Argument Name | Description | Required |
|---|---|---|
| name | The resource name of the Organization to fetch, e.g., "organizations/1234". | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Organization.Name | String | The resource name of the organization. This is the organization's relative path in the API. Its format is "organizations/[organization_id]" e.g., "organizations/1234" |
| GRM.Organization.State | String | The organization's current lifecycle state |
| GRM.Organization.CreateTime | Date | The time the organization resource was created |
| GRM.Organization.Owner.CustomerID | String | The G Suite customer ID used in the Directory API |
Command Example
grm-get-organization name=organizations/690006273490
Context Example
{
"GRM.Organization": {
"Owner": {
"CustomerID": "C02f0zfqw"
},
"State": "ACTIVE",
"CreateTime": "2017-04-25T13:41:05.196Z",
"Name": "organizations/690006273490"
}
}
Human Readable Output
Details of Fetched Organization
| Owner | State | Name | CreateTime |
|---|---|---|---|
| CustomerID: C02f0zfqw | ACTIVE | organizations/690006273490 | 2017-04-25T13:41:05.196Z |
7. Delete an organization
Marks the Project identified by the specified project_id to be deleted, e.g., my-project-123.
Base Command
grm-delete-project
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The unique ID of the Project to delete. Example: tokyo-rain-123 | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.State | String | The Project lifecycle state |
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.CreateTime | Date | createTime - The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-delete-project project_id=faramir-111
Context Example
{
"GRM.Project": {
"Name": "Faramir-Updated",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "DELETE_REQUESTED",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
}
Human Readable Output
Project State Successfully Set To DELETE_REQUESTED
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir-Updated | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | DELETE_REQUESTED | 2019-01-15T12:30:21.267Z |
8. Restore a project
Restores the Project identified by the specified project_id, e.g., my-project-123.
Base Command
grm-undelete-project
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The unique ID of the Project to restore. Example: tokyo-rain-123 | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GRM.Project.State | String | The Project lifecycle state |
| GRM.Project.Number | String | The number uniquely identifying the Project |
| GRM.Project.ID | String | The unique, user-assigned ID of the Project |
| GRM.Project.Name | String | The user-assigned display name of the Project |
| GRM.Project.CreateTime | Date | The time the resource was created |
| GRM.Project.Label | Unknown | The labels associated with this Project |
| GRM.Project.Parent.ID | String | ID of the parent resource |
| GRM.Project.Parent.Type | String | Type of the parent resource |
Command Example
grm-undelete-project project_id=faramir-111
Context Example
{
"GRM.Project": {
"Name": "Faramir-Updated",
"Parent": {
"Type": "organization",
"ID": "690006273490"
},
"Number": "110336878499",
"Label": null,
"State": "ACTIVE",
"ID": "faramir-111",
"CreateTime": "2019-01-15T12:30:21.267Z"
}
}
Human Readable Output
Project State Successfully Set To ACTIVE
| Name | Parent | Number | ID | State | Label | CreateTime |
|---|---|---|---|---|---|---|
| Faramir-Updated | Type: organization ID: 690006273490 |
110336878499 | faramir-111 | ACTIVE | 2019-01-15T12:30:21.267Z |
Configuration parameters
project_id— Project ID (required)private_key_id— Private Key IDprivate_key_id_creds—private_key— Private Keyprivate_key_creds—client_email— Client Emailclient_id— Client IDclient_email_creds— Client Emailclient_x509_cert_url— Client X509 Cert URL (required)proxy— Use system proxy settingsinsecure— Trust any certificate (not secure)
Commands (8)
-
grm-create-projectRequest that new Project resource be created with the user-specified values passed as command arguments.
-
grm-delete-projectMarks the Project identified by the specified project_id to be deleted, e.g., my-project-123.
-
grm-get-organizationFetches an Organization resource identified by the specified resource name.
-
grm-get-projectRetrieves the Project by the specified project_id, e.g., my-project-123.
-
grm-list-projectsLists projects that are visible to the user and satisfies the specified filter. Projects are returned in an unspecified order.
-
grm-search-organizationsSearches Organization resources that are visible to the user and satisfies the specified filter. Organizations are returned in an unspecified order. New Organizations do not necessarily appear at the end of the results.
-
grm-undelete-projectRestores the Project identified by the specified project_id, e.g., my-project-123.
-
grm-update-projectUpdates the attributes of the Project identified by the specified project_id. Currently the only fields that can be updated are the project name and labels.
1. **Create a Service Account** Follow the instructions [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) in the "Creating a Service Account" section. --- 2. **Delegate Domain Wide Authority and Authorize API Access** If you wish the Service Account to have authorized access to all Google Cloud Platform resources on behalf of all users for the associated G Suite domain then follow the instructions [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to Delegate Domain Wide Authority. --- 3. **Enable Access to the Google Resource Manager API** In Google Cloud Platform console Dashboard page for the project in which you created the Service Account scroll to the Getting Started section and click on "Explore and enable APIs". Alternatively you can click the Navigation Menu button in the top left and in the navigation menu click the "APIs & Services" button. Towards the top of the page click the button that says "+ ENABLE APIS AND SERVICES". Search "google resource manager" in the search bar and enable the API. --- 4. **Grant Permissions** In order for the Service Account to carry out certain Google Resource Manager API commands, it is required that you grant the Service Account roles with the necessary permissions. To give the Service Account Organization-wide permissions, navigate to your organization's page. You can do this by clicking the Navigation Menu in the top left of the page, hover over "IAM & admin" and click "Identity & Organization" in the resulting popout menu. It will direct you to a page that will tell you that the page is not viewable for projects and ask you to select an organization. Select your organization. Select "IAM" from the menu on the left. Click the "ADD" button towards the top of the page and add your Service Account by entering the Client Email associated with the Service Account. To grant your Service Account the ability to create new project assign your Service Account the roles of Owner and Project Creator. To grant your Service Account the ability to update projects, assign your Service Account the addional roles of Editor and Project Mover. --- 5. **Setup Integration Instance** All the integration parameters to set up an instance are in the Service Account Credentials File that was downloaded to your machine in step 1 when you created a Service Account. Copy each value to its matching integration parameter without its surrounding quotes.