fix: policy behavior when no data capture#10
Merged
Conversation
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Adjusts GitHub organization policies to treat missing/undisclosed telemetry as “skipped” rather than incorrectly failing (e.g., when data capture is disabled or the token lacks permissions), by introducing skip_reason outputs and refining null/missing input handling.
Changes:
- Add
skip_reasonto SSO and IP allow-list policies when relevant input data is unavailable. - Change input defaults from empty object/list to
nullto distinguish “missing telemetry” from “misconfigured setting”. - Update/add policy tests to validate skip behavior for IP allow-list and expose skip reason for SSO.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| policies/gh_org_sso_enabled.rego | Introduces skip_reason when sso data is unavailable, but currently leaves violation evaluation unguarded. |
| policies/gh_org_sso_enabled_test.rego | Adds a test asserting skip_reason for sso: null (but doesn’t assert expected violation behavior). |
| policies/gh_org_ip_allowlist_enabled.rego | Introduces skip_reason and prevents violations when ip_allow_list data is missing/null. |
| policies/gh_org_ip_allowlist_enabled_test.rego | Updates tests to ensure missing/null input yields no violations and produces the expected skip_reason. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.