Security isn't just for security engineers — it's every developer's responsibility. Secrets in code, vulnerable dependencies, and misconfigurations are common attack vectors. The right tools automate security checks and catch issues before they reach production.
This guide covers essential security tools for developers: secrets management, dependency scanning, static analysis, and security best practices.
Secrets Management
Never Commit Secrets
The first rule of secrets management: never commit API keys, passwords, or tokens to version control.
.gitignore Best Practices
# Environment files
.env
.env.local
.env.*.local
# Secrets
secrets/
credentials/
*.pem
*.key
# IDE files
.vscode/
.idea/
Tools
1. 1Password (Paid)
1Password Developer Tools provides secure secrets injection into CI/CD pipelines:
- ✅ Encrypted vault
- ✅ CLI for secrets access
- ✅ GitHub Actions integration
- ✅ Auto-rotation of credentials
2. HashiCorp Vault (Free/Paid)
Industry-standard secrets management for teams:
- ✅ Centralized secret storage
- ✅ Dynamic secrets (leases, rotation)
- ✅ Audit logging
- ✅ Kubernetes integration
3. Doppler (Free/Paid)
Developer-first secrets management:
- ✅ Simple CLI and API
- ✅ Environment sync
- ✅ GitHub/GitLab integration
- ✅ Secrets versioning
Dependency Scanning
Why Scan Dependencies?
Dependencies can have vulnerabilities that affect your application. Automated scanning catches known CVEs before they reach production.
Tools
1. Snyk (Free/Paid)
Popular dependency scanner with excellent integration:
- ✅ GitHub/GitLab/Bitbucket integration
- ✅ Continuous monitoring
- ✅ License compliance
- ✅ Docker image scanning
Setup with GitHub:
# Enable Snyk in GitHub marketplace
# Snyk automatically scans on every push
# Blocks PRs with high-severity vulnerabilities
2. Dependabot (Free with GitHub Pro)
GitHub's built-in dependency scanner:
- ✅ Automatic security updates
- ✅ Pull request automation
- ✅ Version compatibility checking
3. Trivy (Free)
Open-source vulnerability scanner:
- ✅ Scans file systems, Git repositories, container images
- ✅ CI/CD integration
- ✅ Fast scanning
CLI Usage:
# Scan current directory
trivy fs .
# Scan container image
trivy image my-app:latest
# Scan Git repository
trivy repo https://github.com/user/repo
Static Application Security Testing (SAST)
What is SAST?
Static analysis scans source code for security vulnerabilities without executing the code. It catches SQL injection, XSS, authentication issues, and more.
Tools
1. SonarQube (Free/Paid)
Comprehensive code quality and security platform:
- ✅ Code smells, bugs, vulnerabilities
- ✅ Code coverage
- ✅ Duplicate detection
- ✅ CI/CD integration
2. Semgrep (Free/Paid)
Fast, open-source static analysis:
- ✅ Custom rules
- ✅ 2000+ built-in rules
- ✅ Multiple language support
- ✅ GitHub Actions integration
Example Rule:
rules:
- id: eval-in-require
pattern: $code.require($EVAL(...)$
message: Avoid using eval with user input
languages: [javascript, python]
3. CodeQL (Free with GitHub)
GitHub's code analysis engine:
- ✅ Query-based analysis
- ✅ Find security and quality issues
- ✅ Automated in GitHub Actions
Secret Scanning
Detecting Accidental Commits
Even with best practices, secrets sometimes slip into code. Secret scanning tools detect and alert on committed secrets.
Tools
1. Gitleaks (Free)
Scans Git history for secrets:
# Scan current repository
gitleaks detect --source .
# Scan specific commit
gitleaks detect --commit abc123
# Scan from CI/CD
gitleaks detect --no-git
2. TruffleHog (Free/Paid)
Enterprise-grade secret scanning:
- ✅ Real-time scanning
- ✅ 350+ secret patterns
- ✅ Custom regex patterns
- ✅ Slack, Jira, PagerDuty alerts
Container Security
Scanning Docker Images
Container images can contain vulnerabilities from base images or installed packages. Scan images before deploying to production.
Tools
1. Trivy (Free)
# Scan Docker image
trivy image my-app:latest
# Scan with severity threshold
trivy image --severity HIGH,CRITICAL my-app:latest
# Generate SARIF report for CI/CD
trivy image --format sarif my-app:latest
2. Grype (Free)
Anchore's vulnerability scanner for containers:
- ✅ Fast scanning
- ✅ CVE database (NVD, GitHub Advisory Database)
- ✅ CI/CD integration
Infrastructure Security
Infrastructure as Code Security
IaC scanning checks Terraform, CloudFormation, and Kubernetes configurations for security issues.
Tools
1. tfsec (Free)
Security scanner for Terraform:
# Scan Terraform directory
tfsec .
# Scan with severity threshold
tfsec --minimum-severity HIGH .
# Generate SARIF
tfsec --format sarif .
2. Checkov (Free/Paid)
Comprehensive IaC scanner:
- ✅ Terraform, CloudFormation, Kubernetes, AWS SAM
- ✅ 1000+ security checks
- ✅ Context-aware analysis
- ✅ Fix suggestions
CI/CD Security
Securing Pipelines
CI/CD pipelines have access to production infrastructure and secrets. Secure them properly.
Best Practices
- ✅ Use secrets managers: Never hardcode secrets in pipeline YAML
- ✅ Minimum permissions: CI/CD tokens should only access what's needed
- ✅ Branch protection: Require reviews for main branch
- ✅ Require status checks: Block merges until security scans pass
- ✅ Dependency pinning: Lock dependency versions
- ✅ Review logs: Don't print secrets in logs
GitHub Actions Security
Hardcoded secrets example:
# ❌ BAD - Hardcoded secret
- name: Deploy
env:
API_KEY: sk_live_12345
# ✅ GOOD - Use secret
- name: Deploy
env:
API_KEY: ${{ secrets.API_KEY }}
Security Best Practices
1. Principle of Least Privilege
Access only what's necessary:
- API tokens with minimal scopes
- Database credentials with read-only when possible
- CI/CD tokens with repository-level access only
2. Defense in Depth
Multiple security layers:
- Input validation
- Authentication and authorization
- Rate limiting
- Monitoring and alerting
3. Keep Dependencies Updated
- Enable Dependabot or Renovate
- Review security updates promptly
- Pin critical dependencies
- Monitor CVE databases
4. Validate Input
- Sanitize all user input
- Use parameterized queries (no concatenation)
- Validate data types and ranges
- Escape output (prevent XSS)
5. Enable HTTPS Everywhere
- SSL/TLS for all services
- HSTS headers
- Secure cookies (HttpOnly, Secure)
- Redirect HTTP to HTTPS
2026 Security Trends
AI-Powered Security
- 🆕 AI-generated rules for custom detection
- 🆕 Automated vulnerability explanations
- 🆕 Predictive threat detection
DevSecOps Integration
- 🆕 Security shifting left in development
- 🆕 Automated security gates in CI/CD
- 🆕 Security as code
Security Checklist
Pre-Commit
- ☐ No secrets in code changes
- ☐ Dependencies scanned (no high-severity CVEs)
- ☐ Code passes static analysis
Pre-Merge
- ☐ Code reviewed
- ☐ All security status checks pass
- ☐ Tests pass
- ☐ Documentation updated
Pre-Deploy
- ☐ Secrets in secure storage
- ☐ CI/CD pipelines secured
- ☐ Infrastructure scanned
- ☐ Monitoring configured
Conclusion
Security is a mindset, not just tools. Start with automated scanning (dependencies, SAST, secrets) and build security practices into your development workflow.
The tools covered here automate security checks, but they're not a substitute for secure coding practices. Combine automated tooling with manual reviews and security training for comprehensive protection.
This article contains affiliate links to security tools (Snyk, 1Password, etc.). If you click through and sign up, I may earn a commission at no additional cost to you. I use these tools daily and recommend them to all developers.