Replies: 2 comments
|
#1756 has been submitted to cover what was listed under PR 1 here |
|
Thanks @thetechgy! We’re grateful for the contribution and would definitely like to see GitHub security coverage in Maester. I reviewed the proposed design against our existing Maester framework and the Maester Test Expert guidance. The overall direction looks well aligned: a focused connection/infrastructure PR followed by CIS-mapped checks fits our contribution guidance to keep PRs small, discuss larger changes first, and follow existing patterns. The proposed per-control structure also matches the Maester pattern we use for checks: helper A few things we’d want to keep consistent as this moves into the CIS GitHub checks:
Could you also share the public CIS URL you plan to reference for the CIS GitHub Enterprise Cloud Benchmark v1.2.0? I found the general CIS WorkBench benchmark area ( I know you're busy, @merill, but any thoughts? :) |
Uh oh!
There was an error while loading. Please reload this page.
Summary
I’d like to work on adding Maester support for GitHub Enterprise Cloud Enterprise Managed Users (EMU) security posture checks aligned to the CIS GitHub Enterprise Cloud Benchmark v1.2.0.
Before opening a PR, I wanted to confirm that this direction fits Maester’s scope and get maintainer feedback on a few design decisions that are not already covered by the existing contribution guidance.
Goal
Add read-only Maester tests for GitHub Enterprise Cloud organization-level security settings, starting with a small set of CIS-mapped controls that can be validated through documented GitHub REST API endpoints.
The initial target is GitHub Enterprise Cloud EMU environments, but the implementation should also work for standard GitHub Enterprise Cloud organizations where the same REST API fields are available.
Proposed contribution strategy
I’m proposing two small PRs rather than one large PR.
PR 1 — GitHub connection foundation
Add GitHub connection infrastructure:
Connect-MtGitHubTest-MtConnectionInvoke-MtGitHubRequestmaester-config.jsonglobal settings:GitHubOrganizationGitHubApiBaseUriGitHubApiVersionThe request helper would default to internal/private unless maintainers prefer exposing it for custom test authors.
PR 2 — Initial CIS GitHub controls
Add the first set of organization-level CIS GitHub Enterprise Cloud checks, with one helper
.ps1, one companion.md, and one Pester test file per control, following existing Maester CIS conventions.Initial candidate controls:
GET /orgs/{org}GET /orgs/{org}/actions/permissions/workflowGET /orgs/{org}/actions/permissions/workflowGET /orgs/{org}/actions/permissionsGET /orgs/{org}GET /orgs/{org}/members?role=adminGET /orgs/{org}Candidate after confirming exact CIS wording:
GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-reposProposed implementation principles
Invoke-WebRequest+ConvertFrom-JsonGET /orgs/{org}can return partial org data depending on token visibilityCustomskipped messages for 403, rate limit, missing field, and token visibility issuesAuthentication model
Initial implementation would support PAT-based auth:
admin:orgAdministration: readandMembers: read, but this needs live validationMaintainer questions
Connect-MtGitHuban acceptable new public connection command?Invoke-MtGitHubRequestremain internal, or would you prefer it public for custom test authors?CIS.GH.*an acceptable test/tag namespace for GitHub CIS Benchmark controls?I’m happy to keep the first PR intentionally small and adjust the design before implementing the CIS controls.
All reactions