-
Notifications
You must be signed in to change notification settings - Fork 0
Security Setup
This guide walks you through setting up and configuring TrueHour's comprehensive security infrastructure.
File: renovate.json
Features:
- Automated dependency updates for Python, Docker, GitHub Actions
- Weekly schedule (Mondays before 6 AM EST)
- Auto-merge for patch updates
- Security updates with high priority
- Grouped updates by ecosystem
- 3-day stability period before updates
File: .github/workflows/security-scan.yml
Scans Implemented:
- Semgrep - SAST for OWASP Top 10, Python security issues
- CodeQL - Deep semantic code analysis
- Safety - Python dependency vulnerability checking
- Bandit - Python code security analysis
- pip-audit - Python package auditing
- Trivy - Container image vulnerability scanning
- Hadolint - Dockerfile security linting
- Gitleaks - Secret detection in code and git history
- OWASP Dependency-Check - Comprehensive dependency CVE scanning
Schedule: Daily at 2 AM EST, on push/PR, manual
Reports: Available in GitHub Security tab (SARIF format)
File: .github/workflows/sbom-generation.yml
Generates:
- Python backend SBOM (CycloneDX, SPDX)
- API container SBOM (CycloneDX, SPDX)
- Frontend container SBOM (CycloneDX, SPDX)
- License reports (JSON, Markdown)
- Cryptographic attestations (on release)
Schedule: Weekly on Sundays at 3 AM EST, on dependency changes, on releases
Standards: CycloneDX 1.5, SPDX 2.3 (ISO/IEC 5962:2021)
Retention: 90 days (artifacts), permanent (releases)
File: .github/workflows/lint.yml
Linters:
- Python: Black, isort, Flake8, Pylint, mypy
- Frontend: HTMLHint, HTML5 Validator
- Dockerfile: hadolint, Checkov
- Docker Compose: validation, Checkov
- YAML: yamllint
- Markdown: markdownlint-cli2
- Shell: ShellCheck
Schedule: On push/PR to main and develop
| File | Purpose |
|---|---|
.flake8 |
Python style guide (Flake8) |
pyproject.toml |
Black, isort, Pylint, mypy config |
.htmlhintrc |
HTML linting rules |
.markdownlint.json |
Markdown linting rules |
renovate.json |
Dependency update automation |
| Document | Purpose |
|---|---|
| Security CI/CD Pipeline | Comprehensive security documentation |
| Security Tools Reference | Quick reference for all tools |
| Security Policy | Vulnerability reporting and security policy |
- Go to: https://github.com/apps/renovate
- Click "Install" or "Configure"
- Select "FliteAxis" organization
- Grant access to "TrueHour" repository
- Renovate will detect
renovate.jsonand start automatically
Already configured! Results appear in:
- Security > Code scanning alerts
- Security > Dependabot alerts (if Dependabot also enabled)
For advanced features, add these secrets:
| Secret | Purpose | Required? |
|---|---|---|
GITLEAKS_LICENSE |
Gitleaks Pro features | Optional |
Navigate to: Settings > Secrets and variables > Actions
- Go to: Settings > Branches
- Add rule for
mainbranch:- β Require status checks to pass before merging
- β Require branches to be up to date before merging
- Select required checks:
Python LintingFrontend LintingDockerfile LintingDocker Compose LintingSemgrep SASTCodeQL Analysis
- Repeat for
developbranch
Push the security implementation to develop branch:
git add .
git commit -m "feat: Add comprehensive security CI/CD pipeline
Implements:
- Renovate for dependency management
- Multi-tool security scanning (Semgrep, CodeQL, Trivy, etc.)
- SBOM generation (CycloneDX, SPDX)
- Comprehensive linting (Python, Docker, YAML, Markdown)
- Security documentation"
git push origin developThen create a PR to main to see all checks in action.
- Renovate PRs: Within 24 hours, Renovate will create initial dependency update PRs
- Security Scans: First scan runs on next push, then daily at 2 AM EST
- Linting: Runs on every push and PR
- SBOM: Generated weekly on Sundays at 3 AM EST
- Weekly: Review Renovate PRs (Mondays)
- Daily: Monitor security alerts in Security tab
- Per PR: Review linting and security scan results
- Monthly: Review SBOM for compliance/audit needs
β Automated vulnerability detection in code and dependencies β Container image security scanning β Secret detection preventing credential leaks β OWASP Top 10 coverage β Daily security monitoring
β SBOM generation (NTIA minimum elements) β Cryptographic attestations β CycloneDX and SPDX standards β License tracking β Audit trail via GitHub Security tab
β Consistent code formatting (Black, isort) β Style guide enforcement (Flake8, Pylint) β Type safety (mypy) β Dockerfile best practices (hadolint) β Infrastructure security (Checkov)
β Automated dependency updates β Auto-merge for safe updates β Clear PR descriptions from Renovate β Pre-commit guidance via linting β Comprehensive documentation
- First scan may produce many findings - this is expected
- Prioritize: CRITICAL > HIGH > MEDIUM > LOW
- Many findings may be false positives - review carefully
- Use inline comments to suppress false positives with justification
- DO NOT blindly merge all PRs
- Review changelogs for breaking changes
- Major version updates require testing
- Auto-merge only applies to passing patch updates
- Fix formatting issues first (Black, isort)
- Then address style issues (Flake8)
- Finally address code quality (Pylint)
- Type hints are encouraged but not required (mypy)
- SBOMs are for transparency and compliance
- Use for supply chain security verification
- Share with customers/auditors as needed
- Attestations prove SBOM authenticity
- Code scanning alerts: Should trend downward
- Dependabot alerts: Address within SLA
- Secret scanning alerts: Address immediately
- Target: >95% success rate for linting
- Target: >90% success rate for security scans
- Target: 100% success rate for SBOM generation
- Target: <30 days behind latest stable versions
- Target: Zero known vulnerabilities in dependencies
- Target: All dependencies with active maintenance
-
Before committing:
black backend/ && isort backend/ flake8 backend/ -
Create PR: Automated checks run
-
Address findings: Fix linting and security issues
-
Merge when green: All checks pass
-
Review changelog: Check for breaking changes
-
Review test results: CI must pass
-
For patch updates: Auto-merge is safe
-
For minor updates: Review changes, test locally if needed
-
For major updates:
- Read migration guide
- Test thoroughly locally
- Update code as needed
- Merge after validation
-
Triage: Determine if real or false positive
-
If real:
- Assess severity and exploitability
- Plan remediation
- Apply fix or upgrade dependency
- Verify fix resolves issue
-
If false positive:
- Add suppression comment with justification
- Document in code review
Edit .github/workflows/security-scan.yml:
schedule:
- cron: '0 7 * * *' # Daily at 2 AM EST (7 AM UTC)Change to weekly: '0 7 * * 1' (Mondays only)
Edit renovate.json:
"schedule": ["before 6am on monday"]Change to: "at any time" for continuous updates
-
Python: Edit
pyproject.tomland.flake8 -
HTML: Edit
.htmlhintrc -
Markdown: Edit
.markdownlint.json
See Security CI/CD Pipeline for ideas.
- Security CI/CD Pipeline - Detailed technical documentation
- Security Tools Reference - Quick reference
- Security Policy - Vulnerability reporting
- Renovate Docs
- Semgrep Rules
- Trivy Documentation
- β Enable Renovate: Install GitHub App
- β Push to develop: Commit this implementation
- β Create PR to main: Test all workflows
- β Review first scan results: Triage findings
- β Enable branch protection: Require checks to pass
- β Document team process: Update Contributing guide
- β Set up notifications: Configure GitHub notifications for security alerts
For questions or improvements to the security pipeline:
- Open an issue: https://github.com/FliteAxis/TrueHour/issues
- See: Contributing Guide
Last Updated: December 7, 2025 Version: 1.0.0
π View on GitHub | π³ Docker Hub
π Report Issue | π¬ Discussions
License: MIT License | Copyright (c) 2024-2025 FliteAxis
π Getting Started
π¦ Deployment
π§ Development
π Security
- Security Setup Guide
- Security CI/CD Pipeline
- Code Quality & Linting
- SBOM Management
- Vulnerability Scanning
π Dependencies
π³ Docker
π Reference
π Links