PhotoSync uses multiple automated security scanning tools to ensure code quality and security:
- What: Static code analysis to find security vulnerabilities
- Detects: SQL injection, XSS, command injection, path traversal, etc.
- Runs: Automatically by GitHub Advanced Security
- Results: Available in the Security tab
- Note: Managed by GitHub, not in workflow files
2. Dependency Review (security.yml)
- What: Reviews dependencies for vulnerabilities and incompatible licenses
- Detects: Vulnerable or incompatible licenses (GPL, AGPL, LGPL, MPL, etc.)
- Runs: On every pull request (requires base/head comparison)
- Action: PR blocked if moderate+ severity vulnerabilities or copyleft licenses found
3. NuGet Vulnerability Scan (security.yml)
- What: Scans NuGet packages for known vulnerabilities
- Detects: CVEs in dependencies (direct and transitive)
- Runs: Every push, PR, weekly schedule, and manual dispatch
- Action: Build fails if vulnerabilities found, uploads report artifact
4. Infrastructure as Code Scanning (security.yml)
- What: Microsoft Security DevOps scans Terraform code
- Detects: Security misconfigurations, best practice violations
- Runs: Every push, PR, weekly schedule, and manual dispatch
- Tools: Checkov, Terrascan, Template Analyzer
- Results: Available in the Security tab
- What: Detects leaked secrets in code
- Detects: API keys, passwords, tokens
- Runs: Automatically by GitHub Advanced Security
- Action: Alerts sent to repository maintainers
- Note: Managed by GitHub, not in workflow files
6. Dependabot (dependabot.yml)
- What: Automated dependency updates
- Runs: Weekly
- Action: Creates PRs for security updates automatically
- Scope: NuGet packages, GitHub Actions, npm packages
- Log Analytics Workspace: Centralized logging for all resources
- Diagnostic Settings: Automatic logging for Function Apps and Key Vault
- Security Alerts: Automated alerts for failures and anomalies
- Managed Identity: Function Apps access Key Vault without passwords
- Key Vault: Stores all secrets (refresh tokens, client secrets)
All security monitoring is configured automatically when you run terraform apply:
- β Log Analytics workspace creation
- β Diagnostic settings for Function Apps
- β Diagnostic settings for Key Vault (audit logs)
- β Alert rules for HTTP 5xx errors
- β Alert rules for Key Vault access failures
- β Alert rules for unusual file processing activity
No manual setup required!
If you discover a security vulnerability, please:
- Do NOT open a public GitHub issue
- Email the details to the repository owner
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We will respond within 48 hours and work on a fix.
- Automated: Dependabot creates PRs for security updates
- Review: Security team reviews and approves
- Deploy: Changes deployed via CI/CD pipeline
- Verify: Post-deployment security verification
- β Never commit secrets (API keys, passwords, tokens)
- β Use Key Vault references for sensitive configuration
- β Keep dependencies up to date
- β Follow principle of least privilege
- β Enable 2FA on GitHub account
- β Review security alerts promptly
- β Rotate secrets every 90 days
- β Review Azure Security Center recommendations
- β Monitor Application Insights for anomalies
- β Keep Function App runtime updated
- β Review Key Vault access logs monthly
| Tool | Purpose | Where Configured |
|---|---|---|
| CodeQL | Code security analysis | GitHub Advanced Security (automatic) |
| Dependabot | Automated dependency updates | dependabot.yml |
| Dependency Review | License and vulnerability check for PRs | security.yml |
| NuGet Scanner | .NET-specific vulnerability detection | security.yml |
| Microsoft Security DevOps | IaC scanning (Terraform) | security.yml |
| Secret Scanning | Leaked credential detection | GitHub Advanced Security (automatic) |
| Microsoft Defender | Cloud security posture | Azure Portal |
- OWASP Top 10: Covered by CodeQL analysis
- CWE Top 25: Scanned by CodeQL
- CVE Database: Checked by Dependabot and NuGet scanner
- Least Privilege: Enforced via Managed Identity and Key Vault
View security metrics in:
- GitHub Security tab: Code scanning, Dependabot, Secret scanning alerts
- Azure Security Center: Runtime security posture
- Application Insights: Security-related telemetry
For security-related questions, see: