Skip to content

Commit

Permalink
Doc for API Spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor committed Aug 21, 2024
1 parent 6e8962a commit adcdb44
Show file tree
Hide file tree
Showing 3 changed files with 262 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/resources/api_spec.md
Original file line number Diff line number Diff line change
@@ -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/
108 changes: 108 additions & 0 deletions docs/resources/integration_data_dog.md
Original file line number Diff line number Diff line change
@@ -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/
112 changes: 112 additions & 0 deletions docs/resources/integration_ms_teams.md
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit adcdb44

Please sign in to comment.