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.kosli.com/content/getting_started/environments.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,22 @@ Depending on the type of your environment, you can scope what to snapshot from t
74
74
| azure (functions and apps) | √ |||||
75
75
76
76
77
+
## Environment Compliance
78
+
79
+
An environment's compliance status is determined by its attached policies. The compliance state can be:
80
+
81
+
***Compliant** - All artifacts in the snapshot satisfy the requirements defined in attached policies
82
+
***Non-compliant** - One or more artifacts violate the requirements defined in attached policies
83
+
***Unknown** - No policies are attached to the environment, compliance requirements are undefined
84
+
85
+
When you create a new environment, it starts with an **unknown** compliance state since no policies are attached
86
+
by default. To establish compliance requirements, you need to attach at least one policy to the environment
87
+
(see [Environment Policies](/getting_started/policies))
88
+
89
+
**Note:** If you detach all policies from an environment, its compliance state returns to **unknown** since there are
90
+
no longer any defined requirements for artifacts running in it.
91
+
92
+
77
93
## Logical Environments
78
94
79
95
Logical environments are a way to group your Kosli environments so you can view all changes happening in your group in the same place. For example, if what you consider to be “Production” is a combination of a Kubernetes cluster, an S3 bucket, and a configuration file, you can combine the reports sent to these Kosli environments into a “Production” logical environment.
Copy file name to clipboardExpand all lines: docs.kosli.com/content/getting_started/policies.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,20 @@ summary: "Environment Policies enable you to define and enforce compliance requi
7
7
8
8
# Part 9: Environment Policies
9
9
10
-
Environment Policies enable you to define and enforce compliance requirements for artifact deployments across different environments. With Environment Policies, you can:
10
+
Environment Policies enable you to define and enforce compliance requirements for artifact deployments across
11
+
different environments. With Environment Policies, you can:
11
12
12
13
- Define specific requirements for each environment (e.g, dev, staging, prod)
13
14
- Enforce consistent compliance standards across your deployment pipeline
14
15
- Prevent non-compliant artifacts from being deployed (via admission controllers)
15
16
16
-
Policies are written in YAML and are immutable (updating a policy creates a new version). They can be attached to one or more environments, and an environment can have one or more policies attached to it.
17
+
Policies are written in YAML and are immutable (updating a policy creates a new version). They can be attached to
18
+
one or more environments, and an environment can have one or more policies attached to it.
17
19
18
20
## Create a Policy
19
21
20
-
You can create a policy via CLI or via the API. Here is a basic policy that requires provenance and specific attestations:
22
+
You can create a policy via CLI or via the API. Here is a basic policy that requires provenance and specific
23
+
attestations:
21
24
22
25
```yaml {.command}
23
26
# prod-policy.yaml
@@ -137,7 +140,9 @@ artifacts
137
140
138
141
#### Policy Expressions
139
142
140
-
Policy expressions allow you to create conditional rules using a simple and powerful syntax. Expressions are wrapped in `${{ }}` and can be used in policy rules to create dynamic conditions. An expression consists of operands and operators:
143
+
Policy expressions allow you to create conditional rules using a simple and powerful syntax. Expressions are wrapped
144
+
in `${{ }}` and can be used in policy rules to create dynamic conditions. An expression consists of operands
145
+
and operators:
141
146
142
147
**Operators**
143
148
@@ -169,7 +174,8 @@ Contexts are built-in objects which are accessible from an expression. Expressio
169
174
170
175
**Functions**
171
176
172
-
Functions are helpers that can be used when constructing conditions. They may or may not accept arguments. Arguments can be literals or context variables. Expressions can use following functions:
177
+
Functions are helpers that can be used when constructing conditions. They may or may not accept arguments. Arguments
178
+
can be literals or context variables. Expressions can use following functions:
173
179
174
180
- `exists(arg)` : checks whether the value of arg is not None/Null
175
181
- `matches(input, regex)` : checks if input matches regex
@@ -202,17 +208,23 @@ To detach a policy from an environment:
Any attachment/detachment operation automatically triggers an evaluation of the latest environment snapshot and creates a new one with an updated compliance status.
211
+
Any attachment/detachment operation automatically triggers an evaluation of the latest environment snapshot and
212
+
creates a new one with an updated compliance status.
206
213
207
214
{{% hint info %}}
208
-
If you detach all attached policies from an environment, the environment will have no defined requirements for artifacts running in it, and therefore, new environment snapshots will have status `unknown`
215
+
If you detach all attached policies from an environment, the environment compliance state will become **unknown**
216
+
since there are no longer any defined requirements for artifacts running in it. The environment will continue to
217
+
track snapshots, but its compliance cannot be evaluated without policies.
209
218
{{% /hint %}}
210
219
220
+
211
221
## Policy Enforcement Gates
212
222
213
-
Environment policies enable you to proactively block deploying a non-compliant artifact into an environment. This can be done as a deployment gate in your delivery pipeline or as an admission controller in your environment.
223
+
Environment policies enable you to proactively block deploying a non-compliant artifact into an environment. This
224
+
can be done as a deployment gate in your delivery pipeline or as an admission controller in your environment.
214
225
215
-
Regardless of where you place your policy enforcement gate, it will be using the `assert artifact` Kosli CLI command or its equivalent API call.
226
+
Regardless of where you place your policy enforcement gate, it will be using the `assert artifact` Kosli CLI command
Copy file name to clipboardExpand all lines: docs.kosli.com/content/understand_kosli/concepts.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,10 @@ Kosli supports various types of runtime environments:
105
105
106
106
An Environment Snapshot represents the reported status (running Artifacts) of your runtime environment at a specific point in time.
107
107
108
-
In each snapshot, Kosli links the running artifacts to the Flows and Trails that produced them. Snapshot compliance relies on the compliance status of each running artifact, while Environment compliance depends on its latest snapshot compliance.
108
+
In each snapshot, Kosli links the running artifacts to the Flows and Trails that produced them. Snapshot compliance
109
+
relies on the compliance status of each running artifact against the environment's attached policies. Environment
110
+
compliance depends on its latest snapshot compliance. Environments without attached policies have an **unknown**
111
+
compliance state.
109
112
110
113
Running artifacts that come from 3rd party sources, can be `allow-listed` in an Environment to make them compliant.
0 commit comments