Policy types for @turbot/servicenow-aws-cloudtrail

AWS > CloudTrail > Trail > ServiceNow

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNow
Targets

AWS > CloudTrail > Trail > ServiceNow > Configuration Item

Synchronize the data for the AWS > CloudTrail > Trail based on the policies AWS > CloudTrail > Trail > ServiceNow > Configuration Item > *

The Configuration Item control is responsible for automatically synchronizing records in a designated ServiceNow table, maintaining an up-to-date reflection of the AWS > CloudTrail > Trail information within the ServiceNow CMDB.

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowConfigurationItem
Valid Value
[
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
],
"example": [
"Skip"
],
"default": "Skip"
}

AWS > CloudTrail > Trail > ServiceNow > Configuration Item > Record

The policy facilitates the accurate representation of cloud resource within the ServiceNow environment, ensuring that critical data is effectively mapped and managed. Attribute of an AWS > CloudTrail > Trail is systematically mapped to a specific column in a ServiceNow table.

The policy allows enabling organizations to select and map only those attributes that are most relevant to their operational needs. It significantly reduces the manual effort involved in data transfer and minimizes the risk of errors, thereby enhancing the overall efficiency of data management.

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowConfigurationItemRecord
Default Template Input
"{\n resource: trail{\n data\n metadata\n turbot {\n akas\n id\n tags\n title\n }\n }\n}\n"
Default Template
"account_id: {{ $.resource.metadata.aws.accountId | dump | safe }}\nadvanced_event_selectors: {{ $.resource.data.AdvancedEventSelectors | dump | safe }}\narn: {{ $.resource.data.TrailARN | dump | safe }}\ncloudtrail_name: {{ $.resource.data.Name | dump | safe }}\ncloudwatch_logs_role_arn: {{ $.resource.data.CloudwatchLogsRoleArn | dump | safe }}\nevent_selectors: {{ $.resource.data.EventSelectors | dump | safe }}\nhome_region: {{ $.resource.data.HomeRegion | dump | safe }}\ninclude_global_service_events: {{ $.resource.data.IncludeGlobalServiceEvents | dump | safe }}\nis_logging: {{ $.resource.data.Status.IsLogging | dump | safe }}\nis_multi_region_trail: {{ $.resource.data.IsMultiRegionTrail | dump | safe }}\nis_organization_trail: {{ $.resource.data.IsOrganizationTrail | dump | safe }}\nkms_key_id: {{ $.resource.data.KmsKeyId | dump | safe }}\nlatest_delivery_error: {{ $.resource.data.Status.LatestDeliveryError | dump | safe }}\nlatest_delivery_time: {{ $.resource.data.Status.LatestDeliveryTime | dump | safe }}\nlatest_digest_delivery_error: {{ $.resource.data.Status.LatestDigestDeliveryError | dump | safe }}\nlatest_digest_delivery_time: {{ $.resource.data.Status.LatestDigestDeliveryTime | dump | safe }}\nlog_file_validation_enabled: {{ $.resource.data.LogFileValidationEnabled | dump | safe }}\nlog_group_arn: {{ $.resource.data.LogGroupArn | dump | safe }}\nregion: {{ $.resource.metadata.aws.regionName | dump | safe }}\ns3_bucket_name: {{ $.resource.data.S3BucketName | dump | safe }}\ns3_key_prefix: {{ $.resource.data.S3KeyPrefix | dump | safe }}\nstart_logging_time: {{ $.resource.data.Status.StartLoggingTime | dump | safe }}\nstop_logging_time: {{ $.resource.data.Status.StopLoggingTime | dump | safe }}\ntags: {{ $.resource.turbot.tags | dump | safe }}\n"
Schema
{
"type": "object"
}

AWS > CloudTrail > Trail > ServiceNow > Configuration Item > Table Definition

This policy specifically allows users to define two key aspects: the name of the ServiceNow table where the AWS > CloudTrail > Trail data will be stored, and the details of the columns used for archiving purposes.

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowConfigurationItemTableDefinition
Default Template Input
[
"{\n serviceNowInstance: resources(filter: \"resourceTypeId:tmod:@turbot/servicenow#/resource/types/instance level:self limit:1\") {\n items {\n turbot {\n id\n }\n }\n }\n}\n",
"{\n tableDefinition: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowTableDefinition resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n applicationScope: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow#/policy/types/serviceNowApplicationScope resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n}\n"
]
Default Template
"tableName: "{%- if $.applicationScope.items | length == 0 or $.tableDefinition.items | length == 0 %} {%- else %}{{$.applicationScope.items[0].value}}_{{$.tableDefinition.items[0].value.table.name | lower}}{% endif %}"\n"
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"tableName"
],
"properties": {
"tableName": {
"type": "string"
},
"archiveColumns": {
"type": "object"
}
}
}

AWS > CloudTrail > Trail > ServiceNow > Table

Configure a Table for AWS > CloudTrail > Trail resource type in ServiceNow via the AWS > CloudTrail > Trail > ServiceNow > Table > * policies.

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowTable
Valid Value
[
"Skip",
"Check: Configured",
"Enforce: Configured"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Configured",
"Enforce: Configured"
],
"example": [
"Skip"
],
"default": "Skip"
}

AWS > CloudTrail > Trail > ServiceNow > Table > Definition

The policy enables the definition of ServiceNow table properties, including its name and the base table from which it extends, and details the specific columns required for representing AWS > CloudTrail > Trail data.

URI
tmod:@turbot/servicenow-aws-cloudtrail#/policy/types/trailServiceNowTableDefinition
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"table",
"columns"
],
"properties": {
"table": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string"
},
"extendsTable": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
}
}
},
"columns": {
"type": "array",
"description": "An array of columns with their mappings to the CMDB.",
"default": [],
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the column in the table.",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string",
"description": "The label for the column."
},
"type": {
"description": "The data type of the column.",
"type": "string"
},
"size": {
"type": "integer",
"description": "The length for data type."
}
}
}
}
},
"default": {
"table": {
"name": "guardrails_aws_cloudtrail_trail",
"label": "AWS > CloudTrail > Trail",
"extendsTable": "cmdb_ci"
},
"columns": [
{
"name": "account_id",
"label": "Account ID"
},
{
"name": "advanced_event_selectors",
"label": "Advanced Event Selectors",
"type": "string",
"size": 1000
},
{
"name": "arn",
"label": "ARN"
},
{
"name": "cloudtrail_name",
"label": "Cloud Trail Name"
},
{
"name": "cloudwatch_logs_role_arn",
"label": "Cloudwatch Logs Role ARN"
},
{
"name": "event_selectors",
"label": "Event Selectors",
"type": "string",
"size": 1000
},
{
"name": "home_region",
"label": "Home Region"
},
{
"name": "include_global_service_events",
"label": "Include Global Service Events",
"type": "boolean"
},
{
"name": "is_logging",
"label": "IS Logging",
"type": "boolean"
},
{
"name": "is_multi_region_trail",
"label": "IS Multi Region Trail",
"type": "boolean"
},
{
"name": "is_organization_trail",
"label": "IS Organization Trail",
"type": "boolean"
},
{
"name": "kms_key_id",
"label": "KMS Key ID"
},
{
"name": "latest_delivery_error",
"label": "Latest Delivery Error"
},
{
"name": "latest_delivery_time",
"label": "Latest Delivery Time"
},
{
"name": "latest_digest_delivery_error",
"label": "Latest Digest Delivery Error"
},
{
"name": "latest_digest_delivery_time",
"label": "Latest Digest Delivery Time"
},
{
"name": "log_file_validation_enabled",
"label": "Log File Validation Enabled",
"type": "boolean"
},
{
"name": "log_group_arn",
"label": "Log Group ARN"
},
{
"name": "region",
"label": "Region"
},
{
"name": "s3_bucket_name",
"label": "S3 Bucket Name"
},
{
"name": "s3_key_prefix",
"label": "S3 Key Prefix"
},
{
"name": "start_logging_time",
"label": "Start Logging Time"
},
{
"name": "stop_logging_time",
"label": "Stop Logging Time"
},
{
"name": "tags",
"label": "Tags",
"type": "string",
"size": 1000
}
]
}
}