fix(#7): allow POST git-upload-pack in default GitHub provider#8
Conversation
The default GitHub provider profile used `access: read-only` on the `github.com:443` endpoint, which expands to GET/HEAD/OPTIONS only. Git's smart HTTP protocol requires POST to `**/git-upload-pack` for clone/fetch and POST to `**/info/refs` for ref discovery, so those operations were denied by the L7 proxy. Replace the `access: read-only` preset on the `github.com` endpoint with explicit L7 rules that permit the standard read-only methods plus POST on `**/git-upload-pack` and `**/info/refs`. Push operations (`git-receive-pack`) remain blocked. Updated the `github_profile_materializes_policy_metadata` test to reflect that `github.com` now uses explicit rules instead of the `read-only` access preset. Note: Rust toolchain unavailable in sandbox — unit tests could not be compiled. Manual verification of openshell-providers tests is required. Closes #7 Signed-off-by: fullsend-code <289857995+devtest-coder[bot]@users.noreply.github.com>
|
🤖 Finished Review · ✅ Success · Started 9:07 PM UTC · Completed 9:17 PM UTC |
ReviewFindingsHigh
Low
Info
|
ghost
left a comment
There was a problem hiding this comment.
See the review comment for full details.
| - allow: | ||
| method: OPTIONS | ||
| path: "**" | ||
| - allow: |
There was a problem hiding this comment.
[low] edge-case
The rule { method: POST, path: **/info/refs } allows POST requests to /info/refs. In Git smart HTTP protocol, /info/refs is only accessed via GET. POST is used only for /git-upload-pack and /git-receive-pack. Since the GET ** rule already covers GET /info/refs, this POST rule is unnecessary.
Suggested fix: Change the method from POST to GET, or remove this rule entirely since GET ** already covers it.
| git_endpoint.access.is_empty(), | ||
| "github.com should use explicit rules, not an access preset" | ||
| ); | ||
| assert!( |
There was a problem hiding this comment.
[low] test-inadequate
The new test assertions check .access.is_empty() and !.rules.is_empty(), but do not validate the actual content of the rules array (specific methods, paths).
Suggested fix: Add assertions that validate at least one critical rule (e.g., the POST git-upload-pack rule) to ensure the rules contain expected values.
| protocol: rest | ||
| access: read-only | ||
| enforcement: enforce | ||
| rules: |
There was a problem hiding this comment.
[low] yaml_structure
The rules array is the first use of explicit L7 rules in any provider YAML file in the providers/ directory. This introduces a new pattern without similar examples for consistency.
| enforcement: enforce | ||
| # github.com is the git transport (clone / fetch by default). | ||
| # Explicit rules instead of `access: read-only` so that POST to | ||
| # git-upload-pack (clone/fetch) is allowed while git-receive-pack |
There was a problem hiding this comment.
[low] design-smell
The github.com endpoint uses explicit L7 rules while api.github.com endpoints use the read-only access preset, creating inconsistent policy expression patterns within a single provider profile. The inconsistency is inherent and documented by the inline comment.
| rules: | ||
| - allow: | ||
| method: GET | ||
| path: "**" |
There was a problem hiding this comment.
[info] permission-expansion
The github.com:443 endpoint is upgraded from access: read-only to explicit rules that additionally allow POST on **/git-upload-pack and **/info/refs. The expansion is justified by issue #7 and follows least-privilege for the stated use case.
| method: OPTIONS | ||
| path: "**" | ||
| - allow: | ||
| method: POST |
There was a problem hiding this comment.
[info] authorization
POST to **/info/refs is not part of the standard Git smart HTTP protocol (which uses GET for ref discovery). The practical security impact is negligible given the default-deny policy.
The default GitHub provider profile used
access: read-onlyon thegithub.com:443endpoint, which expands to GET/HEAD/OPTIONS only. Git's smart HTTP protocol requires POST to**/git-upload-packfor clone/fetch and POST to**/info/refsfor ref discovery, so those operations were denied by the L7 proxy.Replace the
access: read-onlypreset on thegithub.comendpoint with explicit L7 rules that permit the standard read-only methods plus POST on**/git-upload-packand**/info/refs. Push operations (git-receive-pack) remain blocked.Updated the
github_profile_materializes_policy_metadatatest to reflect thatgithub.comnow uses explicit rules instead of theread-onlyaccess preset.Note: Rust toolchain unavailable in sandbox — unit tests could not be compiled. Manual verification of openshell-providers tests is required.
Closes #7
Post-script verification
agent/7-github-provider-git-upload-pack)09bd32f35a3b539e6aec895d4dec87d4ec030369..HEAD)