Skip to content

Commit 16b57b5

Browse files
committed
Add SN Import Set guide
1 parent 485cd13 commit 16b57b5

File tree

1 file changed

+62
-15
lines changed
  • docs/integrations/servicenow/guardrails-to-servicenow-sync

1 file changed

+62
-15
lines changed

docs/integrations/servicenow/guardrails-to-servicenow-sync/index.md

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nav:
1313
Before you get started, if you have not already completed, follow the [Importing a ServiceNow instance into Guardrails](/guardrails/docs/integrations/import-servicenow-instance) integration guide to associate your ServiceNow instance to Turbot Guardrails.
1414

1515
### Install Turbot Guardrails ServiceNow Cloud Mods
16+
1617
Beyond the `@turbot/servicenow` mod already installed as part of the ServiceNow instance import above, there are other [ServiceNow mods](/guardrails/docs/mods/servicenow) which need to be installed in your Guardrails workspace. These mods enable the policies and controls for the applicable cloud resources you would like to sync into your ServiceNow CMDB.
1718

1819
Example of related cloud mods:
@@ -29,12 +30,13 @@ Example of related cloud mods:
2930
* `@turbot/servicenow-gcp-storage`
3031
* ...
3132

32-
Note: each Mod will have dependencies to other mods. For example, the `@turbot/servicenow-aws-s3` mod depends on the other Turbot Guardrails mod related to aws-s3, `@turbot/aws-s3`.
33+
Note: Each mod will have dependencies to other mods. For example, the `@turbot/servicenow-aws-s3` mod depends on the other Turbot Guardrails mod related to aws-s3, `@turbot/aws-s3`.
3334

3435
Install the mods that align to the cloud resources Turbot Guardrails is already managing, that you would like to sync to ServiceNow.
3536

3637
### Setup Guardrails Watches for deletions and archiving
37-
No action is needed as the default policy is `Enforce: Enabled` on the Watches controls.
38+
39+
No action is needed as the default policy is `Enforce: Enabled` on the Watches controls.
3840

3941
In rare use cases you may need to adjust along with your Customer Success SME. For background about the policy and control:
4042

@@ -45,22 +47,26 @@ Policies that are already set are:
4547
* `ServiceNow > Turbot > Watches > Azure`
4648
* `ServiceNow > Turbot > Watches > GCP`
4749

48-
## Table and Configuration Item sync policies
50+
## Tables and Configuration Items
51+
52+
Guardrails can directly manage tables and records in your ServiceNow instance to sync cloud resource data.
53+
54+
### Table and Configuration Item sync policies
4955

5056
Once you have the applicable mods installed, new policies and controls will be added to the associated cloud resource type in Turbot Guardrails, `AWS > S3 > Bucket`.
5157

5258
The primary function of the sync control is to ensure that cloud resources discovered and continously updated from AWS, Azure, and GCP in the Guardrail's CMDB is also extended to the ServiceNow system and CMDB tables. This synchronization is automatic and occurs whenever the data in the Guardrail CMDB is updated.
5359

54-
## Table management
60+
### Table management
5561

5662
The sync depends on defining a ServiceNow table to sync the records to. Each cloud resource type (AWS S3 Buckets, Azure Compute Instances, etc) are associated to their own table in the ServiceNow CMDB. Syncing can occur on:
5763
* New tables managed by Guardrails, e.g. `cmdb_ci_guardrails`
5864
* Extension tables managed by Guardrails, e.g. `cmdb_ci_aws_s3_bucket` extends global table `cmdb_ci_cloud_storage_account`.
5965
* Existing tables in SNOW, managed by Guardrails, e.g. `cloud_ci`
6066

61-
### Creating or modifying tables
67+
#### Creating or modifying tables
6268

63-
The Table management policy types follow a similar policy construct to the Configuration Item policies below:
69+
The Table management policy types follow a similar policy construct to the Configuration Item policies below:
6470

6571
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Table`
6672
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Table > Definition`
@@ -87,10 +93,11 @@ Working with tables from Guardrails or in ServiceNow:
8793
* Size: ServiceNow permits increasing the size of a column, but reducing it below the size of the largest existing data entry is not allowed. The Guardrails policy only supports increasing the column size and does not allow for a size reduction.
8894
* Name: Changing a column's name in the Guardrails policy configuration leads to adding a new column with the new name in the ServiceNow table. The original column remains unchanged. If the column name is changed in ServiceNow, it is treated as a new column and needs to be remapped in the Guardrails policy.
8995

90-
## Configuration Items syncing
96+
### Configuration Items syncing
97+
9198
Once the table in ServiceNow is set up, the next step is to configure the Configuration Item (CI) sync control. The purpose of this control is to handle the actual process of synchronizing data from Guardrail's CMDB to the ServiceNow table per the cloud resource type in scope.
9299

93-
The CI sync control is managed through a specific policy format in Guardrails. This policy directs how data from various cloud resource types is synced to ServiceNow. The following is the structure for the CI sync policies:
100+
The CI sync control is managed through a specific policy format in Guardrails. This policy directs how data from various cloud resource types is synced to ServiceNow. The following is the structure for the CI sync policies:
94101

95102
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Configuration Item`
96103
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Configuration Item > Record`
@@ -104,11 +111,11 @@ Examples include AWS S3 buckets, Azure Compute instances, GCP SQL instance, etc,
104111
* `AWS > S3 > Bucket > ServiceNow > Configuration Item > Record`
105112
* Defines how records are identified, e.g `tags` column data comes from `$.bucket.tags` data in the Guardrails CMDB.
106113
* Defaults to common data inputs and matches the column definition defaulted in `AWS > S3 > Bucket > ServiceNow > Table > Definition`. Further details on adjusting the inputs for different source data, and alignment to new or changed columns from the Table Definition.
107-
*` AWS > S3 > Bucket > ServiceNow > Configuration Item > Table Definition`
114+
* `AWS > S3 > Bucket > ServiceNow > Configuration Item > Table Definition`
108115
* Defines where the table definition configurations are located. Can be updated for advanced use cases to adjust application scope, tables to sync to, etc.
109116
* Defaults are set for most use cases and would not be required to adjust at least for when getting started. Although it defaults to the name defined in `AWS > S3 > Bucket > ServiceNow > Table > Definition`, you have the option to direct the data to an existing table of your choice.
110117

111-
### Further details about the CI sync controls
118+
#### Further details about the CI sync controls
112119

113120
To illustrate the setup process of sync control, let's use the example of synchronizing an AWS S3 Bucket:
114121

@@ -121,7 +128,7 @@ To illustrate the setup process of sync control, let's use the example of synchr
121128
* **"Enforce: Archived":** This action archives the record in the ServiceNow table.
122129
* **"Enforce: Deleted":** This action deletes the record in the ServiceNow table.
123130
* **"Enforce: Sync":** Ensures data synchronization. Data will be removed from the ServiceNow table once it is deleted from the Guardrails CMDB.
124-
* **"Enforce: Sync, Archive on Delete":** This policy enforces data synchronization and dictates that data should be archived in ServiceNow when it is deleted from the Guardrails CMDB.
131+
* **"Enforce: Sync, archive on Delete":** This policy enforces data synchronization and dictates that data should be archived in ServiceNow when it is deleted from the Guardrails CMDB.
125132

126133
2. Data Mapping:
127134

@@ -148,7 +155,7 @@ In `AWS > S3 > Bucket > ServiceNow > Configuration Item > Table Definition`, you
148155
```yaml
149156
table:
150157
name: cmdb_aws_s3_bucket
151-
label: AWS > S3 > Bucket
158+
label: AWS > S3 > Bucket
152159
extendsTable: cmdb_ci_cloud_storage_account
153160
```
154161
@@ -169,11 +176,11 @@ columns:
169176
```
170177

171178
4. Archiving records in ServiceNow
172-
Archiving is a strategic process to retain records that are not actively used but are still valuable for historical or compliance purposes.
179+
Archiving is a strategic process to retain records that are not actively used but are still valuable for historical or compliance purposes.
173180

174181
When `AWS > S3 > Bucket > ServiceNow > Configuration Item` is set to `Enforce: Sync`, data will be removed from the ServiceNow table once it is deleted from the Guardrails CMDB (when the cloud resource is deleted).
175182

176-
When `AWS > S3 > Bucket > ServiceNow > Configuration Item` is set to `Enforce: Enforce: Sync, Archive on Delete`, data will NOT be removed from the ServiceNow table, it will be archived. Archival is a specific attribute or column, such as `status` which is updated to indicate archival.
183+
When `AWS > S3 > Bucket > ServiceNow > Configuration Item` is set to `Enforce: Enforce: Sync, archive on Delete`, data will NOT be removed from the ServiceNow table, it will be archived. Archival is a specific attribute or column, such as `status` which is updated to indicate archival.
177184

178185
For instance, in a table like `aws_s3_bucket`, if the record `bucket1` is to be archived, its status would be updated as follows:
179186

@@ -203,9 +210,49 @@ archiveColumns:
203210

204211
Note: the status column should be defined in the `AWS > S3 > Bucket > ServiceNow > Configuration Item > Table Definition` as well.
205212

213+
## Import sets
214+
215+
Guardrails can also sync cloud resource data by creating and sending [import sets](https://docs.servicenow.com/csh?topicname=c_ImportSetsKeyConcepts.html&version=latest) to import set tables, which then transform and map the data into ServiceNow tables.
216+
217+
### Import set policies
218+
219+
The following policy structure manages how import sets are sent:
220+
221+
* `ServiceNow > Import Set > Table Name [Default]`
222+
* Default staging table name for all resource types.
223+
* This policy has no no default value.
224+
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Import Set`
225+
* Sets whether import sets will be sent with the resource's data.
226+
* By default the policy is set to `Skip`, can be set to `Enforce: Sync` or `Enforce: Sync, archive on delete`.
227+
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Import Set > Record`
228+
* Defines how records are identified, e.g., `tags` column data comes from `$.bucket.tags` data in the Guardrails CMDB.
229+
* Defaults to common metadata from each cloud resource type in AWS, Azure and GCP.
230+
* Can adjust data based on your requirements.
231+
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Import Set > Table Name`
232+
* This is where the import sets will be sent to.
233+
* Defaults to `ServiceNow > Import Set > Table Name [Default]` policy value (which is empty by default).
234+
* `{Cloud Provider} > {Service} > {Resource Type} > ServiceNow > Import Set > Archive Columns`
235+
* Defines which record data is sent in an import set if the primary policy is set to `Enforce: Sync, archive on delete`.
236+
237+
### Archiving records
238+
239+
After resources are deleted from Guardrails CMDB, the import set controls cannot delete records directly in ServiceNow tables. However, you can use the controls to archive records in ServiceNow. Archiving is a strategic process to retain records that are not actively used but are still valuable for historical or compliance purposes.
240+
241+
For instance, if the `AWS > S3 > Bucket > ServiceNow > Import Set` policy is set to `Enforce: Sync, archive on delete`, you can then set archive column mappings to the `AWS > S3 > Bucket > ServiceNow > Import Set > Archive Columns` policy:
242+
243+
```json
244+
{
245+
bucket_name: {{ $.resource.data.Name }}
246+
resource_type_uri: "tmod:@turbot/aws-s3#/resource/types/bucket"
247+
status: "archived"
248+
}
249+
```
250+
251+
An import set will be then be created that contains the data above so the `status` column can be updated. Any coalesce fields for that record type should be included in the policy value to ensure the correct record is updated.
252+
206253
## Next Steps
207254

208255
1. Additional context and a demo about the feature is in the announcement post [Continuous Cloud CMDB Sync with ServiceNow & Turbot Guardrails](https://turbot.com/guardrails/blog/2023/12/cmdb-sync-guardrails-servicenow-integration).
209256
2. Consider integrating ServiceNow to Guardrails. Follow the [Enable ServiceNow sync to Guardrails](https://turbot.com/integrations/servicenow/servicenow-to-guardrails-sync) integration guide to configure real-time syncing of ServiceNow resource to Turbot Guardrails.
210257

211-
We want to hear from you! Join our [Slack Community](https://turbot.com/community/join) `#guardrails` channel to ask questions and share feedback.
258+
We want to hear from you! Join our [Slack Community](https://turbot.com/community/join) `#guardrails` channel to ask questions and share feedback.

0 commit comments

Comments
 (0)