You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/policy/README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ Spacelift as a development platform is built around this concept and allows defi
12
12
-**Login**: [Who gets to log in](login-policy.md) to your Spacelift account and with what level of access.
13
13
-**Access**: [Who gets to access individual Stacks](stack-access-policy.md) and with what level of access. Access policies have been replaced by [space access control](../spaces/access-control.md).
14
14
-**Approval**: [Who can approve or reject a run](approval-policy.md) and how a run can be approved.
15
-
-**Initialization**: [Which runs and tasks can be started](run-initialization-policy.md). Initialization policies have been replaced by [approval policies](./approval-policy.md).
15
+
-**Initialization**: [Which runs and tasks can be started](deprecated/run-initialization-policy.md). Initialization policies have been replaced by [approval policies](./approval-policy.md).
16
16
-**Notification**: [Routing and filtering notifications](notification-policy.md).
17
17
-**Plan**: [Which changes can be applied](terraform-plan-policy.md).
18
18
-**Push**: [How Git push events are interpreted](push-policy/README.md).
19
-
-**Task**: [Which one-off commands can be executed](task-run-policy.md). Task run policies have been replaced by [approval policies](./approval-policy.md).
19
+
-**Task**: [Which one-off commands can be executed](deprecated/task-run-policy.md). Task run policies have been replaced by [approval policies](./approval-policy.md).
20
20
-**Trigger**: [What happens when blocking runs terminate](trigger-policy.md). Trigger policies have been mostly replaced by [stack dependencies](../stack/stack-dependencies.md).
21
21
22
22
Please refer to the following table for information on what each policy types returns, and the rules available within each policy.
@@ -26,11 +26,11 @@ Please refer to the following table for information on what each policy types re
26
26
|[Login](login-policy.md)| Allow or deny login, grant admin access | Positive and negative |`boolean`|`allow`, `admin`, `deny`, `deny_admin`|
27
27
|[Access](stack-access-policy.md)| Grant or deny appropriate level of stack access | Positive and negative |`boolean`|`read`, `write`, `deny`, `deny_write`|
28
28
|[Approval](approval-policy.md)| Who can approve or reject a run and how a run can be approved | Positive and negative |`boolean`|`approve, reject`|
29
-
|[Initialization](run-initialization-policy.md)| Blocks suspicious [runs](../run/README.md) before they [start](../run/README.md#initializing)| Negative |`set<string>`|`deny`|
29
+
|[Initialization](deprecated/run-initialization-policy.md)| Blocks suspicious [runs](../run/README.md) before they [start](../run/README.md#initializing)| Negative |`set<string>`|`deny`|
|[Plan](terraform-plan-policy.md)| Gives feedback on [runs](../run/README.md) after [planning](../run/proposed.md#planning) phase | Negative |`set<string>`|`deny`, `warn`|
32
32
|[Push](push-policy/README.md)| Determines how a Git push event is interpreted | Positive and negative |`boolean`|`track`, `propose`, `ignore`, `ignore_track`, `notrigger`, `notify`|
33
-
|[Task](task-run-policy.md)| Blocks suspicious [tasks](../run/task.md) from running | Negative |`set<string>`|`deny`|
33
+
|[Task](deprecated/task-run-policy.md)| Blocks suspicious [tasks](../run/task.md) from running | Negative |`set<string>`|`deny`|
34
34
|[Trigger](trigger-policy.md)| Selects [stacks](../stack/README.md) for which to trigger a [tracked run](../run/tracked.md)| Positive |`set<string>`|`trigger`|
35
35
36
36
!!! tip
@@ -103,11 +103,11 @@ Please refer to the following table for information on what each policy types re
103
103
|[Login](login-policy.md)| Allow or deny login, grant admin access | Positive and negative |`boolean`|`allow`, `admin`, `deny`, `deny_admin`|
104
104
|[Access](stack-access-policy.md)| Grant or deny appropriate level of stack access | Positive and negative |`boolean`|`read`, `write`, `deny`, `deny_write`|
105
105
|[Approval](approval-policy.md)| Who can approve or reject a run and how a run can be approved | Positive and negative |`boolean`|`approve`, `reject`|
106
-
|[Initialization](run-initialization-policy.md)| Blocks suspicious [runs](../run/README.md) before they [start](../run/README.md#initializing)| Negative |`set<string>`|`deny`|
106
+
|[Initialization](deprecated/run-initialization-policy.md)| Blocks suspicious [runs](../run/README.md) before they [start](../run/README.md#initializing)| Negative |`set<string>`|`deny`|
|[Plan](terraform-plan-policy.md)| Gives feedback on [runs](../run/README.md) after [planning](../run/proposed.md#planning) phase | Negative |`set<string>`|`deny`, `warn`|
109
109
|[Push](push-policy/README.md)| Determines how a Git push event is interpreted | Positive and negative |`boolean`|`track`, `propose`, `ignore`, `ignore_track`, `notrigger`, `notify`|
110
-
|[Task](task-run-policy.md)| Blocks suspicious [tasks](../run/task.md) from running | Negative |`set<string>`|`deny`|
110
+
|[Task](deprecated/task-run-policy.md)| Blocks suspicious [tasks](../run/task.md) from running | Negative |`set<string>`|`deny`|
111
111
|[Trigger](trigger-policy.md)| Selects [stacks](../stack/README.md) for which to trigger a [tracked run](../run/tracked.md)| Positive |`set<string>`|`trigger`|
112
112
113
113
!!! tip
@@ -121,7 +121,7 @@ Please refer to the following table for information on what each policy types re
121
121
122
122
### Set of strings
123
123
124
-
The second group of policies ([initialization](run-initialization-policy.md), [plan](terraform-plan-policy.md), and [task](task-run-policy.md)) is expected to generate a [**set of strings**](https://www.openpolicyagent.org/docs/latest/policy-language/#generating-sets){: rel="nofollow"} that serve as _direct feedback_ to the user. Those rules are generally negative in that they **can only block** certain actions. Only their lack counts as an implicit success.
124
+
The second group of policies ([initialization](deprecated/run-initialization-policy.md), [plan](terraform-plan-policy.md), and [task](deprecated/task-run-policy.md)) is expected to generate a [**set of strings**](https://www.openpolicyagent.org/docs/latest/policy-language/#generating-sets){: rel="nofollow"} that serve as _direct feedback_ to the user. Those rules are generally negative in that they **can only block** certain actions. Only their lack counts as an implicit success.
125
125
126
126
Here's a practical difference between the two types:
127
127
@@ -410,7 +410,7 @@ Each of Spacelift's policies supports an additional boolean rule called `sample`
410
410
sample { true }
411
411
```
412
412
413
-
If that feels a bit simplistic, you can adjust this rule to capture only certain types of inputs. For example, in this case we only want to capture evaluations that returned in an empty list for `deny` reasons (e.g. with a [plan](terraform-plan-policy.md) or [task](task-run-policy.md) policy):
413
+
If that feels a bit simplistic, you can adjust this rule to capture only certain types of inputs. For example, in this case we only want to capture evaluations that returned in an empty list for `deny` reasons (e.g. with a [plan](terraform-plan-policy.md) or [task](deprecated/task-run-policy.md) policy):
414
414
415
415
=== "Rego v1"
416
416
```opa
@@ -446,7 +446,7 @@ Capturing all evaluations sounds tempting, but it will also be extremely messy.
446
446
447
447
### Policy workbench in practice
448
448
449
-
To show you how to work with the policy workbench, we are going to use a [task policy](task-run-policy.md) that allowlists just two tasks: an innocent `ls`, and tainting a particular resource. It also only samples successful evaluations, where the list of `deny` reasons is empty.
449
+
To show you how to work with the policy workbench, we are going to use a [task policy](deprecated/task-run-policy.md) that allowlists just two tasks: an innocent `ls`, and tainting a particular resource. It also only samples successful evaluations, where the list of `deny` reasons is empty.
450
450
451
451
!!! info
452
452
This example comes from our [test Terraform repo](https://github.com/spacelift-io/terraform-starter){: rel="nofollow"}, which gives you hands-on experience with most Spacelift functionalities within 10-15 minutes.
@@ -571,7 +571,7 @@ We can then test it in the console using `opa test` command (note the glob, whic
571
571
PASS: 2/2
572
572
```
573
573
574
-
Testing policies that provide feedback to the users is only slightly more complex. Instead of checking for boolean values, you'll be testing for set equality. Let's define a simple [run initialization policy](run-initialization-policy.md) that **denies commits** to a particular branch:
574
+
Testing policies that provide feedback to the users is only slightly more complex. Instead of checking for boolean values, you'll be testing for set equality. Let's define a simple [run initialization policy](deprecated/run-initialization-policy.md) that **denies commits** to a particular branch:
Spacelift has deprecated two policy types in favor of the more powerful and flexible **approval policy**:
6
+
7
+
-**Initialization Policy** - Previously controlled whether runs could start
8
+
-**Task Policy** - Previously controlled which task commands could be executed
9
+
10
+
Both have been replaced by [approval policies](../approval-policy.md), which provide:
11
+
12
+
- Unified control for both runs and tasks
13
+
- Human review workflows with comments
14
+
- Role-based approval requirements
15
+
- Richer decision-making context
16
+
17
+
## Migration Path
18
+
19
+
All functionality from initialization and task policies can be replicated in approval policies, often with enhanced capabilities.
20
+
21
+
**[→ View the complete migration guide](./migrate-to-approval-policy.md)** with side-by-side examples and real-world use cases.
22
+
23
+
## Deprecated Policy Types
24
+
25
+
| Policy Type | What It Did | Replaced By |
26
+
|-------------|-------------|-------------|
27
+
|[Initialization](./run-initialization-policy.md)| Blocked runs before they started based on runtime config, branch names, or other pre-execution checks |[Approval Policy](../approval-policy.md)|
28
+
|[Task](./task-run-policy.md)| Restricted which commands could be executed as tasks based on user roles or command patterns |[Approval Policy](../approval-policy.md)|
0 commit comments