-
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.
feat(validation): account for controls not evaluated by Lula (#847)
* Account for controls not evaluated by Lula Signed-off-by: Ignasi Barrera <[email protected]> * review comments Signed-off-by: Ignasi Barrera <[email protected]> * imports Signed-off-by: Ignasi Barrera <[email protected]> --------- Signed-off-by: Ignasi Barrera <[email protected]> Co-authored-by: Brandt Keller <[email protected]>
- Loading branch information
1 parent
1e850c7
commit 3185a8f
Showing
4 changed files
with
163 additions
and
5 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
115 changes: 115 additions & 0 deletions
115
src/test/unit/common/oscal/valid-component-no-lula.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# add the descriptions inline | ||
component-definition: | ||
uuid: E6A291A4-2BC8-43A0-B4B2-FD67CAAE1F8F | ||
metadata: | ||
title: OSCAL Demo Tool | ||
last-modified: "2022-09-13T12:00:00Z" | ||
version: "20220913" | ||
oscal-version: 1.1.1 | ||
parties: | ||
# Should be consistent across all of the packages, but where is ground truth? | ||
- uuid: C18F4A9F-A402-415B-8D13-B51739D689FF | ||
type: organization | ||
name: Defense Unicorns | ||
links: | ||
- href: https://github.com/defenseunicorns/lula | ||
rel: website | ||
components: | ||
- uuid: A9D5204C-7E5B-4C43-BD49-34DF759B9F04 | ||
type: software | ||
title: lula | ||
description: | | ||
Defense Unicorns lula | ||
purpose: Validate compliance controls | ||
responsible-roles: | ||
- role-id: provider | ||
party-uuids: | ||
- C18F4A9F-A402-415B-8D13-B51739D689FF # matches parties entry for Defense Unicorns | ||
control-implementations: | ||
- uuid: A584FEDC-8CEA-4B0C-9F07-85C2C4AE751A | ||
source: https://github.com/defenseunicorns/lula | ||
description: Validate generic security requirements | ||
implemented-requirements: | ||
- uuid: 42C2FFDC-5F05-44DF-A67F-EEC8660AEFFD | ||
control-id: ID-1 | ||
remarks: >- | ||
Here are some remarks about this control. | ||
description: >- | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum | ||
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
links: | ||
- href: "#88AB3470-B96B-4D7C-BC36-02BF9563C46C" | ||
rel: lula | ||
- uuid: EB61471D-979F-4CA2-BAC4-DF10AB035405 | ||
control-id: ID-2 | ||
remarks: >- | ||
Here are some remarks about this control. | ||
description: >- | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | ||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum | ||
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
back-matter: | ||
resources: | ||
- uuid: 88AB3470-B96B-4D7C-BC36-02BF9563C46C | ||
remarks: >- | ||
Get data for all resources fields specified | ||
description: >- | ||
metadata: | ||
name: Validate pods with label foo=bar | ||
uuid: 88AB3470-B96B-4D7C-BC36-02BF9563C46C | ||
domain: | ||
type: kubernetes | ||
kubernetes-spec: | ||
resources: | ||
- name: jsoncm | ||
resource-rule: | ||
name: configmap-json | ||
version: v1 | ||
resource: configmaps | ||
namespaces: [validation-test] | ||
field: | ||
jsonpath: .data.person.json | ||
type: yaml | ||
- name: yamlcm | ||
resource-rule: | ||
name: configmap-yaml | ||
version: v1 | ||
resource: configmaps | ||
namespaces: [validation-test] | ||
field: | ||
jsonpath: .data.app-config.yaml | ||
type: yaml | ||
- name: secret | ||
resource-rule: | ||
name: example-secret | ||
version: v1 | ||
resource: secrets | ||
namespaces: [validation-test] | ||
field: | ||
jsonpath: .data.auth | ||
type: yaml | ||
base64: true | ||
- name: pod | ||
resource-rule: | ||
name: example-pod | ||
version: v1 | ||
resource: pods | ||
namespaces: [validation-test] | ||
field: | ||
jsonpath: .metadata.annotations.annotation.io/simple | ||
type: json | ||
provider: | ||
type: opa | ||
opa-spec: | ||
rego: | | ||
package validate | ||
import future.keywords.every | ||
validate { | ||
input.jsoncm.name == "bob" | ||
input.yamlcm.logging.level == "INFO" | ||
input.secret.username == "username" | ||
"item1" in input.pod.items | ||
} |