Skip to content

Commit 336c47e

Browse files
authored
docs: update links to IaC schemas (aquasecurity#6477)
1 parent 06b4473 commit 336c47e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

docs/docs/scanner/misconfiguration/custom/schema.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
Policies can be defined with custom schemas that allow inputs to be verified against them. Adding a policy schema
55
enables Trivy to show more detailed error messages when an invalid input is encountered.
66

7-
In Trivy we have been able to define a schema for a [Dockerfile](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/dockerfile.json)
8-
Without input schemas, a policy would be as follows:
7+
In Trivy we have been able to define a schema for a [Dockerfile](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json). Without input schemas, a policy would be as follows:
98

109
!!! example
1110
```
@@ -36,7 +35,7 @@ schema as such
3635
```
3736

3837
Here `input: schema["dockerfile"]` points to a schema that expects a valid `Dockerfile` as input. An example of this
39-
can be found [here](https://github.com/aquasecurity/defsec/blob/master/pkg/rego/schemas/dockerfile.json)
38+
can be found [here](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json).
4039

4140
Now if this policy is evaluated against, a more descriptive error will be available to help fix the problem.
4241

@@ -50,9 +49,9 @@ Now if this policy is evaluated against, a more descriptive error will be availa
5049

5150
Currently, out of the box the following schemas are supported natively:
5251

53-
1. [Docker](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/dockerfile.json)
54-
2. [Kubernetes](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/kubernetes.json)
55-
3. [Cloud](https://github.com/aquasecurity/trivy-iac/blob/main/pkg/rego/schemas/cloud.json)
52+
1. [Docker](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json)
53+
2. [Kubernetes](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/kubernetes.json)
54+
3. [Cloud](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/cloud.json)
5655

5756

5857
## Custom Policies with Custom Schemas

docs/tutorials/misconfiguration/custom-checks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ When you are writing a check, it's important to understand the input to the chec
88

99
Since Rego is primarily tailored to query JSON objects, all incoming configuration files needs to be first converted to structured objects, which is available to the Rego code as the input variable. This is nothing that users have to do manually in Trivy. Instead, Rego makes it possible to pass in custom Schemas that detail how files are converted. Once Rego has access to a custom Schema, it will know in which format to access configuration files such as a Dockerfile.
1010

11-
[Here you can find the schemas](https://github.com/aquasecurity/defsec/tree/master/pkg/rego/schemas) that define how different configuration files are converted to JSON by Trivy.
12-
This tutorial will make use of the [dockerfile.json schema](https://github.com/aquasecurity/defsec/tree/master/pkg/rego/schemas). The schema will need to be parsed into your custom check.
11+
[Here you can find the schemas](https://github.com/aquasecurity/trivy/tree/main/pkg/iac/rego/schemas) that define how different configuration files are converted to JSON by Trivy.
12+
This tutorial will make use of the [dockerfile.json schema](https://github.com/aquasecurity/trivy/blob/main/pkg/iac/rego/schemas/dockerfile.json). The schema will need to be parsed into your custom check.
1313

1414
Users can also use the [Schema Explorer](https://aquasecurity.github.io/trivy-schemas/) to view the structure of the data provided to Rego.
1515

0 commit comments

Comments
 (0)