-
Notifications
You must be signed in to change notification settings - Fork 6
Add metric DocumentCSAFRedRestricted #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anatheka
wants to merge
25
commits into
main
Choose a base branch
from
50-documentcsafredrestricted
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+69
−27
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7ce125a
Add metric DocumentCSAFRedRestricted
anatheka 7b61616
Add category
anatheka 45e84c6
Update structure
anatheka e84a6ff
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 835a72b
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 36c6d98
Add and update metric
anatheka 0205ad8
Merge branch '50-documentcsafredrestricted' of github.com:Cybersecuri…
anatheka b2146ba
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 1888106
Merge branch 'main' into 50-documentcsafredrestricted
anatheka dc61124
Enhance yaml file; update metric
anatheka ea68a54
Merge branch '50-documentcsafredrestricted' of github.com:Cybersecuri…
anatheka 9aaa0cb
Fix package path
anatheka 7e28276
Update DocumentCSAFRedRestricted.yaml
anatheka feb82d0
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 16893a1
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 921f8af
Update DocumentCSAFRedRestricted.yaml
anatheka 8ed9dfa
Clean up files
anatheka e76ec87
Merge branch 'main' into 50-documentcsafredrestricted
anatheka b112765
Fix merge
anatheka b64dc46
Clean up
anatheka e68d3fc
Merge branch 'main' into 50-documentcsafredrestricted
anatheka a1f7206
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 120345e
Merge branch 'main' into 50-documentcsafredrestricted
anatheka f34196c
Merge branch 'main' into 50-documentcsafredrestricted
anatheka 09c0434
Add name and update ID
anatheka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
metrics/CSAF/DocumentCSAFRedRestricted/DocumentCSAFRedRestricted.yaml
This file contains hidden or 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,9 @@ | ||
| --- # Metadata | ||
| - id: DocumentCSAFRedRestricted | ||
| - description: This rule assesses whether a [SecurityAdvisoryDocument] that provides the property [RemoteDocumentLocation] is access protected by ensuring that the [noAuthentication] property is not utilized. | ||
| - version: 1.0 | ||
| - comments: A SecurityAdvisoryDocument labeled as "Amber" or "Red" must be protected by access controls. The specification can be found at https://docs.oasis-open.org/csaf/csaf/v2.0/os/csaf-v2.0-os.html#715-requirement-5-tlpamber-and-tlpred. | ||
| --- # Configuration data | ||
| - p1: | ||
| - operator: == | ||
| - targetValue: true | ||
This file contains hidden or 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,4 @@ | ||
| { | ||
| "operator": "==", | ||
| "target_value": true | ||
| } |
This file contains hidden or 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,25 @@ | ||
| package metrics.csaf.document_csaf_red_restricted | ||
|
anatheka marked this conversation as resolved.
Outdated
|
||
|
|
||
| import data.compare | ||
| import rego.v1 | ||
| import input as document | ||
|
|
||
| default applicable := false | ||
|
|
||
| default compliant := false | ||
|
|
||
| restricted := ["RED", "AMBER"] | ||
|
|
||
| applicable if { | ||
| # check resource type | ||
| "SecurityAdvisoryDocument" in document.type | ||
|
|
||
| # check, if document is restricted (i.e. RED/AMBER) labeled | ||
| document.labels.tlp in restricted | ||
| } | ||
|
|
||
| compliant if { | ||
| # RED/AMBER must NOT be freely accessible | ||
| auth := document.documentLocation.remoteDocumentLocation.authenticity | ||
| not auth.noAuthentication | ||
| } | ||
This file contains hidden or 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,43 @@ | ||
| { | ||
| "creationTime": "2020-07-01T10:09:07Z", | ||
| "documentLocation": { | ||
| "remoteDocumentLocation": { | ||
| "authenticity": { | ||
| "certificateBasedAuthentication": {} | ||
| }, | ||
| "path": "https://127.0.0.1:62479/.well-known/csaf/white/2020/some-id.json", | ||
| "transportEncryption": { | ||
| "cipherSuites": [ | ||
| { | ||
| "authenticationMechanism": "", | ||
| "keyExchangeAlgorithm": "", | ||
| "macAlgorithm": "SHA-256", | ||
| "sessionCipher": "AES-128-GCM" | ||
| } | ||
| ], | ||
| "enabled": true, | ||
| "enforced": false, | ||
| "protocol": "TLS", | ||
| "protocolVersion": 1.3 | ||
| } | ||
| } | ||
| }, | ||
| "filetype": "JSON", | ||
| "id": "some-id", | ||
| "labels": { | ||
| "tlp": "RED" | ||
| }, | ||
| "name": "Buffer overflow in Test Product", | ||
| "raw": "", | ||
| "schemaValidation": { | ||
| "errors": [], | ||
| "format": "Common Security Advisory Framework", | ||
| "schemaUrl": "https://docs.oasis-open.org/csaf/csaf/v2.0/csaf_json_schema.json" | ||
| }, | ||
| "securityFeatures": [], | ||
| "type": [ | ||
| "SecurityAdvisoryDocument", | ||
| "Document", | ||
| "Resource" | ||
| ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a reference to p1 missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the reference p1 to the noAuthentication property, but it doesn’t make any difference since the Rego rule does not check against the target value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I would just find it more intuitive to reference [noAuthentication] with p1 and then set the p1 targetValue to false ("noAuthentication should not be set")