From adcdb445edb9f84f97695cedebda764ccb86f1bd Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 21 Aug 2024 11:59:08 +0400 Subject: [PATCH] Doc for API Spec --- docs/resources/api_spec.md | 42 ++++++++++ docs/resources/integration_data_dog.md | 108 ++++++++++++++++++++++++ docs/resources/integration_ms_teams.md | 112 +++++++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 docs/resources/api_spec.md create mode 100644 docs/resources/integration_data_dog.md create mode 100644 docs/resources/integration_ms_teams.md diff --git a/docs/resources/api_spec.md b/docs/resources/api_spec.md new file mode 100644 index 0000000..22c730b --- /dev/null +++ b/docs/resources/api_spec.md @@ -0,0 +1,42 @@ +--- +layout: "wallarm" +page_title: "Wallarm: wallarm_api_spec" +subcategory: "API Specification" +description: |- + Provides the resource to manage API Specs[1] in Wallarm. +--- + +# wallarm_api_spec + +Provides the resource to manage API Spec in Wallarm. + +## Example Usage + +```hcl +# Creates an API specification for Wallarm +resource "wallarm_api_spec" "api_spec" { + client_id = 1 + title = "Example API Spec" + description = "This is an example API specification created by Terraform." + file_remote_url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/api-with-examples.yaml" + regular_file_update = true + api_detection = true + domains = ["ex.com"] + instances = [1] +} +``` + +## Argument Reference + +* `client_id` - (required) ID of the client to apply the API specification to. +* `title` - (required) The title of the API specification. +* `description` - (optional) A description of the API specification. +* `file_remote_url` - (required) The remote URL to the API specification file. This is useful for pulling specifications from external sources. +* `regular_file_update` - (optional) Indicator of whether the API specification file should be regularly updated from the file_remote_url. Can be true or false. Default: false. +* `api_detection` - (optional) Indicator of whether Wallarm should automatically detect APIs based on this specification. +* `domains` - (required) List of domains associated with the API. +* `instances` - (required) List of Wallarm node instances where the API specification should be applied. + +## Attributes Reference +* `api_spec_id` - Integer ID of the created API specification. +[1]: https://docs.wallarm.com/api-specification-enforcement/overview/ diff --git a/docs/resources/integration_data_dog.md b/docs/resources/integration_data_dog.md new file mode 100644 index 0000000..b6e9020 --- /dev/null +++ b/docs/resources/integration_data_dog.md @@ -0,0 +1,108 @@ +--- +layout: "wallarm" +page_title: "Wallarm: wallarm_integration_data_dog" +subcategory: "Integration" +description: |- + Provides the resource to manage DataDog integrations. +--- + +# wallarm_integration_data_dog + +Provides the resource to manage integrations to send [notifications to DataDog][1]. + +The types of events available to be sent to DataDog: +- Detected hits +- System related: newly added users, deleted or disabled integration +- Detected vulnerabilities +- Changes in exposed assets: updates in hosts, services, and domains + +## Example Usage + +```hcl +# Creates an integration to send notifications to DataDog Logic + +resource "wallarm_integration_data_dog" "data_dog_integration" { + name = "New Terraform DataDog Integration" + region = "US1" + token = "eb7ddfc33acaaacaacaca55a398" + + event { + event_type = "hit" + active = true + } + + event { + event_type = "scope" + active = true + } + + event { + event_type = "system" + active = false + } +} + +``` + + +## Argument Reference + +* `client_id` - (optional) ID of the client to apply the integration to. The value is required for [multi-tenant scenarios][2]. +* `active` - (optional) indicator of the integration status. Can be: `true` for active integration and `false` for disabled integration (notifications are not sent). + + Default: `false` +* `name` - (optional) integration name. +* `token` - (required) DataDog token. +* `region` - (required) DataDog region. + +## Event + +`event` are events for integration to monitor. Can be: + +* `event_type` - (optional) event type. Can be: + - `hit` - detected hits + - `vuln_low` - detected vulnerabilities + - `system` - system related + - `scope` - scope changes + + Default: `vuln_low` +* `active` - (optional) indicator of the event type status. Can be: `true` for active events and `false` for disabled events (notifications are not sent). +Default: `true` + + +Example: + +```hcl + # ... omitted + + event { + event_type = "hit" + active = true + } + + event { + event_type = "scope" + active = false + } + + event { + event_type = "system" + active = true + } + + event { + event_type = "vuln" + active = false + } + + # ... omitted +``` + +## Attributes Reference + +* `integration_id` - integer ID of the created integration. +* `created_by` - email of the user who created the integration. +* `is_active` - indicator of the integration status. Can be: `true` and `false`. + +[1]: https://docs.wallarm.com/user-guides/settings/integrations/datadog/ +[2]: https://docs.wallarm.com/installation/multi-tenant/overview/ diff --git a/docs/resources/integration_ms_teams.md b/docs/resources/integration_ms_teams.md new file mode 100644 index 0000000..0aafdb0 --- /dev/null +++ b/docs/resources/integration_ms_teams.md @@ -0,0 +1,112 @@ +--- +layout: "wallarm" +page_title: "Wallarm: wallarm_integration_ms_teams" +subcategory: "Integration" +description: |- + Provides the resource to manage MS Teams integrations. +--- + +# wallarm_integration_ms_teams + +Provides the resource to manage [integrations via MS Teams][1]. + +The types of events available to be sent via MS Teams: +- Detected hits +- System related: newly added users, deleted or disabled integration +- Detected vulnerabilities +- Changes in exposed assets: updates in hosts, services, and domains + +## Example Usage + +```hcl +# Creates an integration to send notifications via +# MS Teams to the provided URL and corresponding HTTP method + +resource "wallarm_integration_ms_teams" "teams_integration" { + name = "New Terraform MS Teams Integration" + webhook_url = "https://gar8347sk.webhook.office.com/webhookb2/a92734837" + active = true + + event { + event_type = "hit" + active = true + } + + event { + event_type = "scope" + active = true + } + + event { + event_type = "system" + active = true + } + + event { + event_type = "vuln" + active = true + } +} +``` + + +## Argument Reference + +* `client_id` - (optional) ID of the client to apply the integration to. The value is required for [multi-tenant scenarios][2]. +* `active` - (optional) indicator of the integration status. Can be: `true` for active integration and `false` for disabled integration (notifications are not sent). + + Default: `false` +* `name` - (optional) integration name. +Default: `POST` +* `webhook_url` - (required) MS Teams URL with the schema (https://). +## Event + +`event` are events for integration to monitor. Can be: + +* `event_type` - (optional) event type. Can be: + - `hit` - detected hits + - `vuln` - detected vulnerabilities + - `system` - system related + - `scope` - scope changes + + Default: `vuln` +* `active` - (optional) indicator of the event type status. Can be: `true` for active events and `false` for disabled events (notifications are not sent). +Default: `true` + + +Example: + +```hcl + # ... omitted + + event { + event_type = "hit" + active = true + } + + event { + event_type = "scope" + active = false + } + + event { + event_type = "system" + active = true + } + + event { + event_type = "vuln" + active = false + } + + # ... omitted +``` + +## Attributes Reference + +* `integration_id` - integer ID of the created integration. +* `created_by` - email of the user who created the integration. +* `is_active` - indicator of the integration status. Can be: `true` and `false`. + +[1]: https://docs.wallarm.com/user-guides/settings/integrations/microsoft-teams/ +[2]: https://docs.wallarm.com/installation/multi-tenant/overview/