-
Notifications
You must be signed in to change notification settings - Fork 20
Add Samsung CredSweeper shared workflow for credential scanning with source file masking #2888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: pelikhan <[email protected]>
| echo "📁 Created /tmp/gh-aw/credsweeper for scan results" | ||
| --- | ||
|
|
||
| # Samsung CredSweeper Usage Guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot wrap in xml comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8a92115. The usage guide section is now wrapped in XML comments <!-- ... -->.
|
|
||
| # Create temporary directory for scans | ||
| mkdir -p /tmp/gh-aw/credsweeper | ||
| echo "📁 Created /tmp/gh-aw/credsweeper for scan results" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot add JavaScript to parse results and mask away secrets with ***
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8a92115. Added /tmp/gh-aw/credsweeper/mask-secrets.js JavaScript utility that:
- Parses CredSweeper JSON results
- Masks secrets with
***(shows first 2 and last 2 characters for longer secrets) - Can be used standalone or piped with jq
Example usage:
node /tmp/gh-aw/credsweeper/mask-secrets.js /tmp/gh-aw/credsweeper/scan-results.jsonCo-authored-by: pelikhan <[email protected]>
|
@copilot the JavaScript must mask the files in place |
Co-authored-by: pelikhan <[email protected]>
Done in f31edb0. The Updated behavior: # Modifies /tmp/gh-aw/credsweeper/scan-results.json in place
node /tmp/gh-aw/credsweeper/mask-secrets.js /tmp/gh-aw/credsweeper/scan-results.json
# Output: ✅ Masked N findings in /tmp/gh-aw/credsweeper/scan-results.json
# Then read the masked file
cat /tmp/gh-aw/credsweeper/scan-results.json | jq '.' |
|
…tensive logging Co-authored-by: pelikhan <[email protected]>
Done in 5b0efb3. The
Example output: |
|
@copilot do not log secret value to core.info |
Co-authored-by: pelikhan <[email protected]>
Done in 1dbaad3. Removed all secret value logging from Changes:
The script now only logs:
No actual secret values are ever logged to |
|
@copilot review failure https://github.com/githubnext/gh-aw/actions/runs/18984795622/job/54225882260#step:5:1 you probably need to provide the GH_TOKEN |
The Could you clarify what operation is failing? The script:
If there's a specific error message from the workflow run, that would help identify the issue. The script should work without GH_TOKEN since it only performs local file operations. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/q investigate https://github.com/githubnext/gh-aw/actions/runs/18984795622/job/54225882260#step:5:1 and generate a fix for the share workflow in this pull request |
|
Agentic Q triggered by this issue comment. |
🔍 Q Investigation CompleteI've investigated the failed workflow run #18984795622 and identified the issue. Problem FoundThe EvidenceLooking at your lock file changes, I can see that the Node.js setup step was generated during compilation: - name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
with:
node-version: '24'This indicates the compiler tried to add it, but it wasn't in the source markdown file, which is why the workflow failed when executed. Fix CreatedI've created a pull request that adds the missing Node.js setup step to the source file PR: [q] Fix Samsung CredSweeper shared workflow - add Node.js setup step The fix ensures:
Next StepsOnce the fix is merged, you can recompile your workflow and the daily-news workflow should execute successfully with CredSweeper support. Investigation performed by Q workflow optimizer based on live workflow logs and PR analysis. |
Adds a shared workflow configuration for Samsung CredSweeper credential scanner and imports it in the daily-news workflow.
Changes
Created
.github/workflows/shared/credsweeper.mdghcr.io/samsung/credsweeper:latestrun,pull,ps,images) and Node.js script execution/tmp/gh-aw/credsweeperdirectory for scan resultsmask-secrets.js) that parses CredSweeper JSON results and masks secrets directly in the actual source files where they were detected, not just in the JSON resultscore.infothroughout the masking process with detailed progress and summary statistics - never logs actual secret valuesUpdated
.github/workflows/daily-news.mdshared/credsweeper.mdto enable credential scanning in daily repository reportsUsage Example
Key Features
The
mask-secrets.jsutility:***)core.infofor detailed progress tracking including file processing, masked value previews, and comprehensive summary statistics - never logs actual secret values@actions/corewhen running in GitHub Actions, falls back to console logging when running standaloneSecurity
The logging system is designed to provide full visibility into the masking process while maintaining security:
"my***rd")The shared workflow follows the established pattern used by other tool integrations (ffmpeg, ollama-threat-scan) and scans the
/tmp/gh-aw/directory as specified. The mask-secrets.js utility ensures that detected credentials are safely masked by directly modifying source files before being committed or displayed in logs or reports.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.