-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into poc-initial-report
- Loading branch information
Showing
36 changed files
with
1,299 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: possible-bug | ||
assignees: '' | ||
--- | ||
|
||
### Environment | ||
Device and OS: | ||
App version: | ||
Kubernetes distro: | ||
Kubernetes version: | ||
provider: | ||
- [ ] kyverno | ||
- [ ] opa | ||
|
||
### Steps to reproduce | ||
1. | ||
|
||
### Expected result | ||
|
||
### Actual Result | ||
|
||
### Visual Proof (screenshots, videos, text, etc) | ||
|
||
### Severity/Priority | ||
|
||
### Additional Context | ||
Add any other context or screenshots about the technical debt here. |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'enhancement' | ||
assignees: '' | ||
--- | ||
|
||
### Is your feature request related to a problem? Please describe. | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
### Describe the solution you'd like | ||
|
||
- **Given** a state | ||
- **When** an action is taken | ||
- **Then** something happens | ||
|
||
### Describe alternatives you've considered | ||
(optional) A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
### Additional context | ||
Add any other context or screenshots about the feature request here. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Tech debt | ||
about: Record something that should be investigated or refactored in the future. | ||
title: '' | ||
labels: 'tech-debt' | ||
assignees: '' | ||
--- | ||
|
||
### Describe what should be investigated or refactored | ||
|
||
A clear and concise description of what should be changed/researched. Ex. This piece of the code is not DRY enough [...] | ||
|
||
### Links to any relevant code | ||
|
||
(optional) i.e. - <https://github.com/defenseunicorns/lula/blob/main/README.md?plain=1#L1> | ||
|
||
### Additional context | ||
|
||
Add any other context or screenshots about the technical debt here. |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Description | ||
|
||
... | ||
|
||
## Related Issue | ||
|
||
Fixes # | ||
<!-- or --> | ||
Relates to # | ||
|
||
## Type of change | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Other (security config, docs update, etc) | ||
|
||
## Checklist before merging | ||
|
||
- [ ] Test, docs, adr added or updated as needed | ||
- [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/lula/blob/main/CONTRIBUTING.md) followed |
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
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
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 |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Validation Identifiers | ||
|
||
- [Validation Identifiers](#validation-identifiers) | ||
- [Connecting Links with Lula Validations](#connecting-links-with-lula-validations) | ||
- [Rel](#rel) | ||
- [Importing Validations](#importing-validations) | ||
- [Local Validations](#local-validations) | ||
- [Remote Validations](#remote-validations) | ||
- [Checksums](#checksums) | ||
- [Multiple Validations](#multiple-validations) | ||
___ | ||
In OSCAL - `links` contains the following fields: | ||
```yaml | ||
links: | ||
- href: https://www.example.com/ | ||
rel: reference | ||
text: Example | ||
media-type: text/html | ||
resource-fragment: some-fragment | ||
``` | ||
These links are a "reference to a local or remote resource, that has a specific relation to the containing object" - [Component Definition Links](https://pages.nist.gov/OSCAL-Reference/models/v1.1.2/component-definition/json-reference/#/component-definition/components/links). | ||
As such, links are a native OSCAL attribute that Lula can use to map to Validations. | ||
## Connecting Links with Lula Validations | ||
After identifying a control and writing a Lula Validation, we need to store that Lula Validation within the OSCAL artifact for referencing. | ||
This is accomplished by adding a new `resource` to the `back-matter` as shown below: | ||
|
||
```yaml | ||
back-matter: | ||
resources: | ||
- uuid: a7377430-2328-4dc4-a9e2-b3f31dc1dff9 | ||
description: >- | ||
domain: | ||
type: kubernetes | ||
kubernetes-spec: | ||
resources: | ||
- name: podsvt | ||
resource-rule: | ||
group: | ||
version: v1 | ||
resource: pods | ||
namespaces: [validation-test] | ||
provider: | ||
type: opa | ||
opa-spec: | ||
rego: | | ||
package validate | ||
import future.keywords.every | ||
validate { | ||
every pod in input.podsvt { | ||
podLabel := pod.metadata.labels.foo | ||
podLabel == "bar" | ||
} | ||
} | ||
``` | ||
|
||
Now we need to map an existing control (or Component-Definition Implemented-Requirement) to this Lula Validation. | ||
|
||
### Rel | ||
The default workflow is to use the rel attribute to indicate that Lula has work to perform. | ||
|
||
In the instance of a standard validation - A link to a Lula Validation might look like this: | ||
```yaml | ||
links: | ||
- href: '#a7377430-2328-4dc4-a9e2-b3f31dc1dff9' | ||
rel: lula | ||
``` | ||
|
||
Where `href: '#a7377430-2328-4dc4-a9e2-b3f31dc1dff9'` points to an OSCAL object with a UUID reference and `rel: lula` indicates that the link is to a Lula Validation. | ||
UUID's should always be unique per object in the OSCAL artifact. | ||
|
||
|
||
> [!TIP] | ||
> You can generate a random UUID using `lula tools uuidgen` or a deterministic UUID using `lula tools uuidgen <string>`. | ||
|
||
## Importing Validations | ||
In addition to storing validaitons in the `BackMatter`, `links` may be used to fetch resources external to the `component-definition`. | ||
|
||
### Local Validations | ||
- must be prefixed with `file:` | ||
- `file:` must be a relative path to the `component-definition` or an absolute path | ||
```yaml | ||
links: | ||
- href: file:./validation.yaml | ||
rel: lula | ||
- href: file:/home/user/validations/validation.yaml | ||
rel: lula | ||
``` | ||
|
||
### Remote Validations | ||
- must be prefixed with `https:` or `http:` | ||
- `https:` or `http:` must be a valid URL | ||
```yaml | ||
links: | ||
- href: https://example.com/validation.yaml | ||
rel: lula | ||
``` | ||
|
||
### Checksums | ||
- A checksum may be provided in the href using the suffix `@<checksum>` | ||
- Supports `sha1`, `sha256`, `sha512`, `md5` | ||
```yaml | ||
links: | ||
- href: https://example.com/validation.yaml@0123456789abcdef | ||
rel: lula | ||
``` | ||
|
||
### Multiple Validations | ||
- A file with multiple validations may be provided in the link. | ||
- `---` should be used to separate each validation | ||
- `resource-fragment: <UUID>` will run the validation with the UUID specified | ||
- `resource-fragment: *` will run all validations | ||
```yaml | ||
// Only runs the validation with the UUID of a7377430-2328-4dc4-a9e2-b3f31dc1dff9 | ||
links: | ||
- href: https://example.com/multi-validations.yaml | ||
rel: lula | ||
resource-fragment: '#a7377430-2328-4dc4-a9e2-b3f31dc1dff9' | ||
// All validations | ||
- href: file:./multi-validations.yaml | ||
rel: lula | ||
resource-fragment: * | ||
``` | ||
___ | ||
> [!NOTE] | ||
> An example `component-definition` with remote validations can be found [here](../src/test/e2e/scenarios/remote-validations/component-definition.yaml). |
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
Oops, something went wrong.