-
Notifications
You must be signed in to change notification settings - Fork 0
Report security-control capability separately from state #54
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
Merged
Merged
Changes from all commits
Commits
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
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
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
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
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
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,52 @@ | ||
| # Security-control capability results | ||
|
|
||
| ## Decision | ||
|
|
||
| Security verification reports a per-control result in `controls` while retaining the | ||
| legacy `state` booleans and top-level `ok`. The additive result separates whether a | ||
| control is observable from whether it is enabled: | ||
|
|
||
| | `status` | `capability` | `enabled` | Meaning | | ||
| | --- | --- | --- | --- | | ||
| | `enabled` | `available` | `true` | GitHub reported the control enabled. | | ||
| | `disabled` | `available` | `false` | GitHub reported the control disabled. | | ||
| | `unavailable` | `unavailable` | `null` | The repository response omitted this control; it is unavailable to this read, not proven absent from every plan or policy. | | ||
| | `forbidden` | `unknown` | `null` | GitHub returned 403, so the caller cannot determine capability or state. | | ||
| | `unknown` | `unknown` | `null` | GitHub returned a masked/not-found 404 or an unexpected response shape. | | ||
|
|
||
| Each result also has a closed `reason` value. Expected 403/404 failures expose only a | ||
| numeric `httpStatus` and a static recovery action; raw GitHub response messages are not | ||
| copied into verification output. | ||
|
|
||
| ## Conservative 404 treatment | ||
|
|
||
| GitHub can mask authorization failures as 404. Therefore `not_found_or_masked` never | ||
| means "unsupported" or "disabled" in the additive result. Confirm the repository | ||
| reference and caller access before drawing a plan, policy, or feature-availability | ||
| conclusion. Live read-only evidence must use the same qualification. | ||
|
|
||
| ## Legacy compatibility | ||
|
|
||
| `state` remains the six-boolean object returned to existing callers. `ok` remains the | ||
| logical AND of those booleans; it is not redefined around the new taxonomy. Existing | ||
| successful endpoint responses remain enabled unless they explicitly contain | ||
| `enabled: false`, omitted analysis fields remain `false`, and endpoint 404s remain | ||
| `false`. A handled 403 has no earlier successful-result equivalent and is represented | ||
| conservatively as `false` in `state` while `controls` records `forbidden`/`unknown`. | ||
|
|
||
| New callers should use `controls` for diagnostics and use `state`/`ok` only when they | ||
| need the compatibility contract. | ||
|
|
||
| ## Recovery | ||
|
|
||
| Recovery text is deliberately bounded and static: | ||
|
|
||
| 1. For `disabled`, review repository policy and enable the control only if required. | ||
| 2. For `unavailable`, review repository plan, organization policy, and caller visibility. | ||
| 3. For `forbidden`, grant only the minimum repository administration or | ||
| security-manager permission needed for the read, then retry. | ||
| 4. For `not_found_or_masked`, confirm `owner/name` and caller access without assuming | ||
| the feature is unsupported. | ||
|
|
||
| Verification is read-only. Use `github_configure_security` separately and deliberately | ||
| when a policy-approved state change is required. |
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
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
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
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,16 @@ | ||
| { | ||
| "name": "disabled", | ||
| "repository": { | ||
| "status": 200, | ||
| "body": { | ||
| "security_and_analysis": { | ||
| "secret_scanning": { "status": "disabled" }, | ||
| "secret_scanning_push_protection": { "status": "disabled" }, | ||
| "secret_scanning_non_provider_patterns": { "status": "disabled" }, | ||
| "secret_scanning_validity_checks": { "status": "disabled" } | ||
| } | ||
| } | ||
| }, | ||
| "privateVulnerabilityReporting": { "status": 200, "body": { "enabled": false } }, | ||
| "dependabotSecurityUpdates": { "status": 200, "body": { "enabled": false } } | ||
| } |
Oops, something went wrong.
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.
For
dependabotSecurityUpdates: false, GitHub documentsGET /repos/{owner}/{repo}/automated-security-fixesreturning 404 when Dependabot security updates are not enabled (https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository). Because endpoint reads now share this 404 branch, a successfulDELETEis converted toenabled: null/unknown instead of disabled; thenconfigureRepositorySecuritycan never mark that requested disable as verified. Please special-case the automated-security-fixes 404 as the documented disabled state where appropriate.Useful? React with 👍 / 👎.