-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve examples for resources policy and policy_rules (#545)
- Loading branch information
Showing
4 changed files
with
60 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
resource "cyral_policy" "some_resource_name" { | ||
name = "" | ||
description = "" | ||
resource "cyral_policy" "this" { | ||
name = "My first policy" | ||
description = "This is my first policy" | ||
enabled = true | ||
data = [""] | ||
data_label_tags = [""] | ||
tags = [""] | ||
data = ["EMAIL"] | ||
metadata_tags = ["Risk Level 1"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,26 @@ | ||
resource "cyral_policy_rule" "some_resource_name" { | ||
policy_id = "" | ||
hosts = [""] | ||
identities { | ||
db_roles = [""] | ||
groups = [""] | ||
services = [""] | ||
users = [""] | ||
} | ||
deletes { | ||
additional_checks = "" | ||
data = [""] | ||
dataset_rewrites { | ||
dataset = "" | ||
repo = "" | ||
substitution = "" | ||
parameters = [""] | ||
} | ||
rows = 1 | ||
severity = "low" | ||
} | ||
reads { | ||
additional_checks = "" | ||
data = [""] | ||
dataset_rewrites { | ||
dataset = "" | ||
repo = "" | ||
substitution = "" | ||
parameters = [""] | ||
} | ||
rows = 1 | ||
severity = "low" | ||
} | ||
updates { | ||
additional_checks = "" | ||
data = [""] | ||
dataset_rewrites { | ||
dataset = "" | ||
repo = "" | ||
substitution = "" | ||
parameters = [""] | ||
} | ||
rows = 1 | ||
severity = "low" | ||
} | ||
# An example of a policy and a policy rule with a rego policy | ||
# in `additional_checks`. | ||
resource "cyral_policy" "this" { | ||
name = "My first policy" | ||
description = "This is my first policy" | ||
enabled = true | ||
data = ["EMAIL"] | ||
metadata_tags = ["Risk Level 1"] | ||
} | ||
|
||
resource "cyral_policy_rule" "this" { | ||
policy_id = cyral_policy.this.id | ||
deletes { | ||
additional_checks = <<EOT | ||
is_valid_request { | ||
filter := request.filters[_] | ||
filter.field == "entity.user.is_real" | ||
filter.op == "=" | ||
filter.value == false | ||
} | ||
EOT | ||
data = ["EMAIL"] | ||
rows = -1 | ||
severity = "low" | ||
} | ||
} |