Skip to content

Feature/intercom token detection#2

Merged
StephenJarso merged 25 commits into
mainfrom
feature/intercom-token-detection
Jun 15, 2026
Merged

Feature/intercom token detection#2
StephenJarso merged 25 commits into
mainfrom
feature/intercom-token-detection

Conversation

@StephenJarso

@StephenJarso StephenJarso commented Jun 15, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Describe the changes in this PR.

Which detectors does it affect?

  • Secrets
  • Environment
  • Auth
  • Config
  • New detector: _______

Testing done

  • Unit tests added
  • Manually tested with a real codebase
  • All existing tests pass

Checklist

  • Code follows the style guide
  • Self-review completed
  • Documentation updated (if applicable)
  • CHANGELOG.md updated under [Unreleased]

Screenshots (if applicable)

Add screenshots to help explain your changes.

- Add Slack token pattern (xoxb, xoxa, xoxp, xoxr, xoxs)
- Add Discord webhook URL pattern
- Add Telegram bot token pattern
- Add Azure Key Vault pattern
- Add personal access token pattern
- Add corresponding test cases for all new patterns
- Add hardcoded password pattern detection
- Add connection string pattern detection
- Add API key header pattern detection
- Add authorization header pattern detection
- Add webhook URL pattern detection
- Add corresponding test cases for all new patterns
- Add SARIFReporter struct implementing Reporter interface
- Add SARIF format structures (Report, Run, Tool, Rule, Result, Location)
- Update main.go to support sarif output format option
- Add test for SARIF reporter
- Add support for .env, .env.local, .env.production, .env.development, .env.test
- Add .envrc file detection
- Add secure-push config file detection
- Add test cases for new config file patterns
- Add .envrc file detection
- Add .env.sample file detection
- Add test cases for new env file patterns
- Add Redis, MSSQL, Oracle database URL tests
- Add password with double quotes and without quotes tests
- Add pwd and passwd pattern tests
- Add multiple slack tokens test
- Add more edge case tests for auth patterns
- Add .env.sample, .envrc uppercase, and mixed case tests
- Add more config file pattern tests
- Add .envrc mixed case and uppercase tests
- Add .envrc.production test
- Add .env.example and .env.sample tests
- Add .envrc.development and .envrc.test tests
- Add secure-push config uppercase tests
- Add config yaml in nested path test
- Add BenchmarkAuthDetector
- Add BenchmarkSecretsDetector
- Add BenchmarkEnvDetector
- Add BenchmarkConfigDetector
- Update integration test for multiple detectors
- Add Formula/secure-push.rb for Homebrew installation
- Support for darwin amd64, darwin arm64, linux amd64, linux arm64
- Add package.json with extension configuration
- Add extension.ts with scan workspace command
- Add tsconfig.json for TypeScript compilation
- Add Slack, Discord, Telegram, Azure, PAT token detectors
- Add hardcoded password and connection string patterns
- Add SARIF reporter, Homebrew formula, VS Code extension
- Add Slack, Discord, Telegram, Azure, PAT token patterns
- Add hardcoded password and connection string patterns
- Add database URL patterns (Redis, MSSQL, Oracle)
- Add SARIF output example
- Add list of supported tools (GitHub, Azure DevOps, GitLab, VS Code)
- Add scanner.yml workflow for CI/CD integration
- Support SARIF output for GitHub Code Scanning
- Add release.yml for automated releases
- Support for linux, darwin, and windows platforms
- Support for amd64 and arm64 architectures
- Document console, json, csv, and sarif output formats
- Add examples for each format type
- Add release workflow to Changed section
- Add Fixed section for bug fixes
- Add Security section for test coverage
- Add wsl linter for whitespace rules
- Add wrapcheck linter for error wrapping
- Add zerologlint for logging best practices
- Prevent resource exhaustion with max 100 concurrent file scans
- Improve memory usage for large codebases
- Reduce memory allocations for binary file checks
- Improve performance for large codebases with many files
- Add GetFileInfo function to reduce code duplication
- Enable better file info caching in future optimizations
- Add test cases for existing and nonexistent files
- Ensure proper error handling for file info retrieval
Comment on lines +10 to +55
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
goarch: [amd64, arm64]
goos: [linux, darwin, windows]
exclude:
- goos: windows
goarch: arm64
- goos: darwin
goarch: arm64
os: ubuntu-latest
- goos: linux
goarch: arm64
os: macos-latest
- goos: darwin
goarch: amd64
os: ubuntu-latest
- goos: linux
goarch: amd64
os: macos-latest

steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
with-cache: true

- name: Build
run: |
EXT=''
if [ "${{ matrix.goos }}" = "windows" ]; then
EXT='.exe'
fi
go build -o secure-push${EXT} ./cmd/secure-push

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: secure-push-${{ matrix.goos }}-${{ matrix.goarch }}
path: secure-push${{ matrix.goos === 'windows' && '.exe' || '' }}

release:
Comment on lines +11 to +28
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Secure Push Scanner
uses: secure-push/secure-push-action@v1
with:
path: '.'
output: 'sarif'
sarif_file: 'results.sarif'

- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'results.sarif'
category: 'secure-push' No newline at end of file
stripeApiKeyPattern = regexp.MustCompile(`(sk|pk)_(live|test)_[0-9a-zA-Z]{24,}`)
sendgridApiKeyPattern = regexp.MustCompile(`SG\.[0-9A-Za-z\-_]{22}\.[0-9A-Za-z\-_]{43}`)
slackTokenPattern = regexp.MustCompile(`xox[baprs]-[A-Za-z0-9\-_]{10,}`)
discordWebhookPattern = regexp.MustCompile(`https://discord\.com/api/webhooks/[0-9]+/[A-Za-z0-9\-_]+`)
@StephenJarso StephenJarso merged commit d541acc into main Jun 15, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants