Skip to content

🐛 fix(autodetect): refuse CREDS env names and more vendor token prefixes - #345

Merged
hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-344
Oct 25, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-344

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Tightens the sensitive-env deny-list in autodetect.

  • Names: CREDENTIAL -> CREDENTIALS?, plus word-bounded CREDS (AWS_CREDS, GCP_CREDS, CREDS_FILE); INCREDIBLE, AUTHOR, PATH still pass.
  • Value prefixes: hf_, pypi-AgEI, dop_v1_, lin_api_, shpat_/shpss_/shpca_/shppa_, SG., dapi, glc_, ya29..
  • Tests, README and changelog fragment updated.

dist/*.js was hand-mirrored from the .ts edits; any .js.map drift will be synced from CI output.

Closes #344

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Refuse CREDENTIALS/CREDS env names (AWS_CREDS, CREDS_FILE) and add value prefixes for Hugging Face, PyPI, DigitalOcean, Linear, Shopify, SendGrid, Databricks, Grafana and Google OAuth tokens. Tests, README, changelog and dist mirror updated.

Closes #344

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 25, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 25, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 25, 2026
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: dist/ source maps re-synced from tsc output; CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 0d9a6bf

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic is correct; the PR is blocked only because dist/*.js.map was not regenerated.

Checked out 05b787f, ran npm ci && npm run build and the CI gate step from .github/workflows/ci.yml ("Check committed dist/ is in sync with src/"): git status --porcelain -- dist/ reports

 M dist/autodetect.js.map
 M dist/autodetect.test.js.map

That is exactly what all six build-and-test legs fail on (run 40241357336, same step). The hand-mirrored dist/autodetect.js / dist/autodetect.test.js are byte-identical to tsc output, so only the two source maps need committing. The PR body says ".js.map drift will be synced from CI output" — CI does not sync it, it fails the gate; the fix is npm run build && git add dist/*.js.map on scanner/fix-344.

What I verified on the code itself (src/autodetect.ts:74-78, :109-117):

  • (?:^|_)CREDS(?:_|$) flags AWS_CREDS, CREDS_FILE, bare CREDS; does not flag INCREDIBLE, SACRED, MY_CREDSTORE. CREDENTIAL → CREDENTIALS? is a no-op (the old alternative already matched CREDENTIALS as a substring) but harmless.
  • Value prefixes are anchored with ^ and carry minimum lengths, so hf_home, SG.short pass. Note the whole pattern is i-flagged (pre-existing), so sg.…, DAPI… also match — consistent with the existing AIza/npm_ entries, not a regression.
  • npm test at this head: 475/475 pass.
  • Scope matches #344 exactly: both deny-list additions the issue names, nothing else. README and changelog.d/fixed-344.md updated accordingly.

This looks correct to me once the two map files are committed. Not approving — that is a maintainer's signature.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 25, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness review (head 05b787f)

Blocker (in-scope): committed dist/*.js.map are stale, so CI never runs the tests.
.github/workflows/ci.yml:42-43 runs test -z "$(git status --porcelain -- dist/)" before the Test step (ci.yml:51-52). All six build-and-test jobs fail there with dist/ is stale; the only drift is dist/autodetect.js.map and dist/autodetect.test.js.map (reproduced locally: npm run build at head → M dist/autodetect.js.map, M dist/autodetect.test.js.map). The PR body's plan to "sync .js.map drift from CI output" cannot work because the gate blocks first. Fix: run npm run build and commit the two regenerated .js.map files.

For the record, the regex changes themselves are correct: with the maps regenerated locally, npm test → 475/475 pass, and I probed src/autodetect.ts:74,78 (CREDENTIALS?, (?:^|_)CREDS(?:_|$)) and :109-117 (new value prefixes) — INCREDIBLE, SACRED_SITE, MY_CREDSX not flagged; hf_home, ya29.x, DAPIabc not flagged; AWS_CREDS, creds, credentials_path, SendGrid/Databricks-shaped values flagged.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 0435b20 into main Oct 25, 2026
11 of 12 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-344 branch October 25, 2026 23:26
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#3450d9a6bf` sha256:73b52e1f5398044684bdcf5d8bed2451ee1c7e02f0d8b4a02eee14470fd8d26f — download from the dashboard or `hivectl review evidence #345`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] autodetect: sensitive-env deny-list misses CREDS names and common vendor token prefixes (hf_, pypi-, dop_v1_, lin_api_, SG., ya29.)

0 participants