Skip to content

Commit

Permalink
Merge pull request #48 from concentrator/post-fixes
Browse files Browse the repository at this point in the history
Post fixes
  • Loading branch information
KNechaevWallarm authored Dec 9, 2024
2 parents 57a99a1 + 1402f27 commit f4aea49
Show file tree
Hide file tree
Showing 30 changed files with 908 additions and 157 deletions.
55 changes: 53 additions & 2 deletions docs/resources/rule_attack_rechecker.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is because Terraform is designed to keep its configurations stable and not
# Disables the attacks checking for requests sent to the application with ID 7
resource "wallarm_rule_attack_rechecker" "disable_rechecker" {
enabled = false
enabled = false
action {
point = {
Expand Down Expand Up @@ -158,6 +158,57 @@ When `type` is `absent`, `point` must contain key with the default value. For `a

* `rule_id` - ID of the created rule.
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of created rule. For example, `rule_type = "ignore_regex"`.
* `rule_type` - type of created rule. For example, `rule_type = "attack_rechecker"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_attack_rechecker.disable_rechecker 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_attack_rechecker` - Terraform resource rule type.

### Import blocks

The rule can be imported using Terraform import blocks.

Resource block example:

```hcl
resource "wallarm_rule_attack_rechecker" "disable_rechecker" {
action {
point = {
instance = 7
}
}
enabled = false
}
```

Import block example:

```hcl
import {
to = wallarm_rule_attack_rechecker.disable_rechecker
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/change-request-for-active-verification/#disabling-enabling-the-active-threat-verification-module
55 changes: 53 additions & 2 deletions docs/resources/rule_attack_rechecker_rewrite.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ This is because Terraform is designed to keep its configurations stable and not
# for all the verification tests
resource "wallarm_rule_attack_rechecker_rewrite" "default_rewrite" {
rules = ["my.staging-application.com"]
rules = ["my.staging-application.com"]
point = [["header", "HOST"]]
}
resource "wallarm_rule_attack_rechecker_rewrite" "default_rewrite" {
rules = ["my.awesome-application.com"]
point = [["header", "HOST"]]
}
```

## Argument Reference
Expand Down Expand Up @@ -165,7 +169,54 @@ When `type` is `absent`, `point` must contain key with the default value. For `a

* `rule_id` - ID of the created rule.
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of the created rule. For example, `rule_type = "ignore_regex"`.
* `rule_type` - type of the created rule. For example, `rule_type = "attack_rechecker_rewrite"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_attack_rechecker_rewrite.default_rewrite 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_attack_rechecker_rewrite` - Terraform resource rule type.

### Import blocks

The rule can be imported using Terraform import blocks.

Resource block example:

```hcl
resource "wallarm_rule_attack_rechecker_rewrite" "default_rewrite" {
point = [["header", "HOST"]]
rules = ["my.staging-application.com"]
}
```

Import block example:

```hcl
import {
to = wallarm_rule_attack_rechecker_rewrite.default_rewrite
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/change-request-for-active-verification/#rewriting-the-request-before-attack-replaying
[2]: https://docs.wallarm.com/user-guides/scanner/intro/#active-threat-verification
53 changes: 53 additions & 0 deletions docs/resources/rule_binary_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,58 @@ When `type` is `absent`, `point` must contain key with the default value. For `a
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of the created rule. For example, `rule_type = "binary_data"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_binary_data.allow_bin_in_body 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_binary_data` - Terraform resource rule type.

### Import blocks

The rule can be imported using Terraform import blocks.

Resource block example:

```hcl
resource "wallarm_rule_binary_data" "allow_bin_in_body" {
action {
point = {
header = "HOST"
}
type = "iequal"
value = "example.com"
}
point = [["post"]]
}
```

Import block example:

```hcl
import {
to = wallarm_rule_binary_data.allow_bin_in_body
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/ignore-attacks-in-binary-data/
[2]: https://docs.wallarm.com/installation/multi-tenant/overview/
54 changes: 54 additions & 0 deletions docs/resources/rule_disable_attack_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,59 @@ When `type` is `absent`
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of the created rule. For example, `rule_type = "disable_attack_type"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_disable_attack_type.disable_sqli 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_disable_attack_type` - Terraform resource rule type.

### Import blocks

The rule can be imported using Terraform import blocks.

Resource block example:

```hcl
resource "wallarm_rule_disable_attack_type" "disable_sqli" {
action {
point = {
header = "HOST"
}
type = "iequal"
value = "example.com"
}
point = [["get_all"]]
attack_type = "sqli"
}
```

Import block example:

```hcl
import {
to = wallarm_rule_disable_attack_type.disable_sqli
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/ignore-attack-types/
[2]: https://docs.wallarm.com/installation/multi-tenant/overview/
52 changes: 52 additions & 0 deletions docs/resources/rule_ignore_regex.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,57 @@ When `type` is `absent`, `point` must contain key with the default value. For `a
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of the created rule. For example, `rule_type = "ignore_regex"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_ignore_regex.ignore_regex 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_ignore_regex` - Terraform resource rule type.

### Import blocks

The rule can be imported using Terraform import blocks.

Resource block example:

```hcl
resource "wallarm_rule_ignore_regex" "ignore_regex" {
action {
point = {
instance = 5
}
}
point = [["uri"]]
regex_id = 40671
}
```

Import block example:

```hcl
import {
to = wallarm_rule_ignore_regex.ignore_regex
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/regex-rule/#partial-disabling-of-a-new-detection-rule
[2]: https://docs.wallarm.com/installation/multi-tenant/overview/
44 changes: 40 additions & 4 deletions docs/resources/rule_masking.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resource "wallarm_rule_masking" "masking_json" {
}
}
point = [["post"],["json_doc"],["hash", "field"]]
point = [["post"], ["json_doc"], ["hash", "field"]]
}
```
Expand Down Expand Up @@ -188,20 +188,56 @@ When `type` is `absent`, `point` must contain key with the default value. For `a

* `rule_id` - ID of the created rule.
* `action_id` - the action ID (The conditions to apply on request).
* `rule_type` - type of created rule. For example, `rule_type = "ignore_regex"`.
* `rule_type` - type of created rule. For example, `rule_type = "sensitive_data"`.

## Import

The rule can be imported using a composite ID formed of client ID, action ID, rule ID and rule type.

```
$ terraform import wallarm_rule_masking.masking_json 6039/563855/11086881/wallarm_rule_masking
$ terraform import wallarm_rule_masking.masking_header 6039/563855/11086881
```

* `6039` - Client ID.
* `563855` - Action ID.
* `11086881` - Rule ID.
* `wallarm_rule_masking` - Rule type.
* `wallarm_rule_masking` - Terraform resource rule type.

### Import blocks

Resource block example:

```hcl
resource "wallarm_rule_masking" "masking_header" {
action {
point = {
instance = 1
}
}
point = [["header","AUTHORIZATION"]]
}
```

Import block example:

```hcl
import {
to = wallarm_rule_masking.masking_header
id = "6039/563855/11086881"
}
```

Before importing resources run:

```
$ terraform plan
```

If import looks good apply the configuration:

```
$ terraform apply
```

[1]: https://docs.wallarm.com/user-guides/rules/sensitive-data-rule/
[2]: https://docs.wallarm.com/installation/multi-tenant/overview/
Loading

0 comments on commit f4aea49

Please sign in to comment.