Add pluggable package policy checks - #3
Open
shrikant-pplx wants to merge 3 commits into
Open
Conversation
shrikant-pplx
marked this pull request as ready for review
August 31, 2026 23:01
shrikant-pplx
force-pushed
the
codex/socket-policy-direct
branch
from
August 31, 2026 23:32
60a14f5 to
298dcd7
Compare
shrikant-pplx
force-pushed
the
codex/socket-policy-direct
branch
from
August 31, 2026 23:38
298dcd7 to
23e03f4
Compare
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.
Motivation
Cachew knows when an immutable package body is a cold miss, so it can enforce package-admission policy before fetching from an origin. The admission contract should not couple the CodeArtifact and Go module strategies to one vendor.
What changed
package-policyblock to the CodeArtifact and Go module strategies.socketprovider with configurableapi-url, organization, token, and timeout. The provider owns Socket-specific bearer authentication, request/query shape, NDJSON decoding, and policy-action mapping..infoqueries pass through for canonical-version resolution; the resulting module artifacts are evaluated before download.403for deny decisions. Pending analysis and evaluator availability failures return a retryable, non-cacheable503; neither path contacts the package origin. Provider failure causes are retained for strategy-level logs while client responses remain sanitized.private-pathsfrom package-policy evaluation.not_applicable; metadata GETs and body-admitting requests should be separated when interpreting coverage.AcceptandAccept-Encodingvariant from every deployment; Cachew does not currently list or purge objects by package path or PURL.Security and operator impact
With the Socket provider, Socket receives the ecosystem, public package name, and version. Cachew does not send package contents, CodeArtifact tokens, repository names, AWS identity, or private Go module identities.
The Socket token requires only
packages:list. Configuration uses${SOCKET_SECURITY_API_TOKEN}so deployments can inject a Kubernetes Secret-backed environment variable into the Cachew container; no token is stored in this repository or exposed to package-manager clients. The configurable Socket API must be an HTTPS origin, and redirects are not followed with credentials.This source change does not create or modify deployment secrets. Enabling a provider remains an explicit deployment configuration change.