Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix: harden setup.sh credential handling (security + robustness)#33

Merged
marcusquinn merged 1 commit intomainfrom
fix/quality-debt-setup-sh-32
Mar 7, 2026
Merged

fix: harden setup.sh credential handling (security + robustness)#33
marcusquinn merged 1 commit intomainfrom
fix/quality-debt-setup-sh-32

Conversation

@marcusquinn
Copy link
Owner

Summary

Addresses all 3 medium-severity findings from Gemini code review on PR #25 (setup.sh).

  • Mask sensitive input: API Key and Application ID now use read -rs (silent mode) to prevent shoulder-surfing and terminal scrollback exposure. Existing values show only last 4 chars as masked hints (****XXXX) instead of the full credential.
  • Eliminate file permission race condition: Credentials file is now written inside a umask 077 subshell, so it's created with 600 permissions atomically — no window where the file exists with default (644) permissions.
  • Prefer jq for JSON parsing: Uses jq when available for robust credential file reading, with grep/sed fallback and a warning when jq is not installed. Consistent with jq usage elsewhere in the script.

Verification

  • ShellCheck: clean
  • 201 unit tests: all pass
  • TypeScript build: clean
  • ESLint: clean

Closes #32

Address all 3 medium-severity findings from Gemini review on PR #25:

1. Mask sensitive input: use read -rs for API Key and Application ID
   to prevent shoulder-surfing and terminal log exposure. Show only
   last 4 chars of existing values as hints (****XXXX).

2. Eliminate file permission race condition: use umask 077 in a
   subshell when writing credentials.json so the file is created
   with 600 permissions atomically, instead of creating with default
   perms then chmod after.

3. Prefer jq for JSON parsing: use jq when available for robust
   credential file reading, with grep/sed fallback and a warning
   when jq is not installed.

Closes #32
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d8f99433-b533-441d-bb7d-f6d162bdbdf8

📥 Commits

Reviewing files that changed from the base of the PR and between 1c5f74a and 85cda6d.

📒 Files selected for processing (1)
  • setup.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/quality-debt-setup-sh-32

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

@marcusquinn
Copy link
Owner Author

This PR appears orphaned — no active worker process found and no activity for 6+ hours. The linked issue is already closed. Flagging for review. If work is still in progress, remove the status:orphaned label.

@marcusquinn
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@marcusquinn marcusquinn merged commit 242c6f3 into main Mar 7, 2026
8 checks passed
@marcusquinn marcusquinn deleted the fix/quality-debt-setup-sh-32 branch March 7, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: setup.sh — PR #25 review feedback (medium)

1 participant