Repository Security & Quality Assurance
This document describes the comprehensive security controls, quality assurance processes, and synchronization strategies protecting the 1-Click GitHub Security repository itself. These controls go beyond what the installer provides to end users, serving as both protection and validation for the installer project.
π― Overview
This repository implements a "dogfooding plus philosophy" approach: - Uses everything the installer provides (35+ security controls) - Adds development-specific security controls (5+ additional controls) - Implements 6 specialized CI/CD workflows - Maintains documentation and distribution security - Provides reference implementation for security best practices - Ensures multi-dimensional synchronization across all project components
Total Security Controls in This Repository: 40+ comprehensive security checks
π Security Controls Comparison Tables
Table 1: Controls Available in Both Installer and This Repo
Control Type | Category | Description | Installer Provides | This Repo Has |
---|---|---|---|---|
PRE-PUSH HOOK CONTROLS | ||||
Secret Detection | Critical | Blocks AWS keys, GitHub tokens, API keys | β | β |
Vulnerability Scan | Critical | Blocks known CVEs (cargo-deny) | β | β |
Test Validation | Critical | Ensures tests pass | β | β |
Format Check | Critical | Enforces code style (cargo fmt) | β | β |
Linting | Critical | Catches bugs (clippy) | β | β |
Large Files | Critical | Blocks files >10MB | β | β |
SHA Pinning Check | Warning | Verifies GitHub Actions pins | β | β |
Commit Signing | Warning | Verifies signatures | β | β |
License Check | Warning | License compliance | β | β |
Dependency Pinning | Warning | Ensures deps are pinned | β | β |
Unsafe Code | Warning | Monitors unsafe blocks | β | β |
Unused Dependencies | Warning | Detects unused deps | β | β |
Build Scripts | Warning | Security analysis | β | β |
Doc Secrets | Warning | Scans documentation | β | β |
Env Variables | Warning | Hardcoding detection | β | β |
Rust Edition | Warning | Edition specification | β | β |
Import Security | Warning | Validates imports | β | β |
File Permissions | Warning | Permission audit | β | β |
Dependency Count | Warning | Monitors dep count | β | β |
Network Addresses | Warning | IP/URL validation | β | β |
Commit Messages | Warning | Message security | β | β |
Tech Debt | Warning | TODO/FIXME tracking | β | β |
Empty Files | Warning | Incomplete detection | β | β |
Cargo.lock | Warning | Lock file validation | β | β |
HELPER TOOLS | ||||
pinactlite | Tool | SHA pinning verifier | β | β |
gitleakslite | Tool | Secret scanner | β | β |
CI/CD WORKFLOWS | ||||
Basic Security | CI | Optional workflows | β (optional) | β |
CodeQL Scanning | CI | Security code analysis | β (with --github-security) | β |
CONFIGURATION | ||||
.security-controls/ | Config | Security configs | β | β |
deny.toml | Config | Cargo deny config | β | β |
.cargo/config.toml | Config | Cargo security | β | β |
Table 2: Additional Controls ONLY in This Repository
Control Type | Category | Description | Installer Has | This Repo Has | Why Not in Installer |
---|---|---|---|---|---|
PRE-COMMIT HOOKS | |||||
Trailing Whitespace | Formatting | Removes trailing spaces | β | β | Too opinionated for general use |
End-of-File Fixer | Formatting | Ensures newline at EOF | β | β | Minor formatting preference |
YAML Check | Validation | Validates YAML syntax | β | β | Not all projects use YAML |
Large File Check | Validation | Pre-commit large file check | β | β | Redundant with pre-push |
ShellCheck | Linting | Shell script validation | β | β | Development-specific |
shfmt | Formatting | Shell script formatting | β | β | Development-specific |
Markdown Lint | Linting | Markdown validation | β | β | Documentation-heavy repo |
pinactlite Sync | Validation | Tool version sync | β | β | Installer development only |
CI/CD WORKFLOWS (SPECIALIZED) | |||||
Pinning Validation | Security | Validates SHA pinning with pinact v3.4.2 | β | β | Development validation |
Shell Lint | Quality | shellcheck + shfmt CI | β | β | Script-heavy development |
Docs Build | Documentation | MkDocs site generation | β | β | Documentation repo |
Docs Deploy | Documentation | GitHub Pages deployment | β | β | Documentation hosting |
Helpers E2E | Testing | End-to-end tool testing | β | β | Tool development testing |
Installer Self-Test | Testing | Installation validation | β | β | Installer development |
Sync Validation | Testing | Tool consistency check | β | β | Development validation |
DEVELOPMENT TOOLS | |||||
Pre-commit Framework | Tool | Pre-commit hook manager | β | β | Additional complexity |
MkDocs | Tool | Documentation generator | β | β | Not needed by users |
DEPENDENCY MANAGEMENT | |||||
MANUAL GITHUB FEATURES | |||||
Security Advisories | Security | Private vulnerability reporting | β | β | Requires manual web setup |
Advanced Security | Security | Enterprise code scanning | β | β | GitHub Enterprise only |
π Summary Statistics
Metric | Installer Provides | This Repository Has |
---|---|---|
Pre-push Checks | 25+ | 25+ |
Pre-commit Checks | 0 | 8 |
CI/CD Workflows | 1-2 (optional), +1 with --github-security | 4 |
Helper Tools | 2 | 2 + scripts |
Configuration Files | 5 | 7 |
GitHub Security Features | 6 with --github-security | 6 |
Total Security Controls | ~35 with --github-security | ~40 |
π§ Multi-Dimensional Synchronization Strategy
π― Problem Statement
The 1-Click GitHub Security project requires synchronization across multiple dimensions:
Documentation Synchronization
- Repository documentation (README.md, design-principles.md, etc.)
- Installer help messages (
--help
) - Documentation installed by installer (
docs/security/
) - Web documentation site (MkDocs)
Security Controls Synchronization (Dogfooding Plus)
- Repository workflows vs installer templates
- Enhanced repository controls vs user-installed controls
- Functional equivalence validation
Tool Synchronization
- pinactlite updates from upstream
- gitleakslite updates from upstream
- Version alignment across tools
Challenge: How to ensure consistency across all dimensions without violating our Single-Script Architecture principle?
π Current Synchronization Inventory
1. Documentation Synchronization
Repository Documentation (Source of Truth)
- README.md
- User-facing overview and quick start
- CLAUDE.md
- Design principles and ADRs (authoritative)
- docs/architecture.md
- Technical architecture
- docs/installation.md
- Detailed installation guide
- docs/signing-guide.md
- Complete signing guide
- docs/cryptographic-verification.md
- Verification procedures
- CHANGELOG.md
- Version history and changes
- docs/repo-security-and-quality-assurance.md
- This repository's security setup
Installer-Generated Documentation
- docs/security/README.md
- Embedded security overview (static)
- docs/security/ARCHITECTURE.md
- Minimal architecture reference
- docs/security/signing-guide.md
- Complete signing guide (embedded)
MkDocs Site (docs/
)
- docs/index.md
- Site landing page
- Direct files and cross-references
- Generated GitHub Pages site
Installer Help System
- install-security-controls.sh --help
- Command usage
- install-security-controls.sh --version
- Version info with update check
2. Security Controls Synchronization (Dogfooding Plus Philosophy)
Repository Controls (Enhanced)
- .github/workflows/
- 6 specialized CI workflows
- .security-controls/
- Enhanced binary tools and configurations
- Pre-push hooks with repository-specific enhancements
- Custom security policies and branch protection
Installer Templates (Standard) - CI workflow templates embedded in installer - Standard security tool configurations - Basic pre-push hook implementation - GitHub security feature enablement
Sync Challenge: Repository uses "dogfooding plus" - enhanced security beyond what installer provides to users.
3. Tool Synchronization
pinactlite Sync
- Upstream: github.com/h4x0r/pinact-lite
- Local: .security-controls/bin/pinactlite
- Installer embedding: Embedded as base64 in installer script
- Sync frequency: Manual, triggered by upstream releases
gitleakslite Sync
- Upstream: github.com/h4x0r/gitleaks-lite
- Local: .security-controls/bin/gitleakslite
- Installer embedding: Embedded as base64 in installer script
- Sync frequency: Manual, triggered by upstream releases
Synchronization Principles
Principle: Single Source of Truth (SSOT)
Repository is authoritative. All documentation and configurations derive from repository sources.
Dogfooding Plus Principle
Repository demonstrates enhanced security. We use advanced controls beyond what we install for users, proving scalability and effectiveness.
Tier 1: Critical Synchronization (Automated)
- Version Numbers: VERSION file β README badges β Installer script β CHANGELOG
- Security Control Counts: Automated counting from implementation β All documentation
- Release Information: CHANGELOG β Installer version check β GitHub releases
- Tool Versions: Upstream releases β Local binaries β Installer embedding β Release artifacts
Tier 2: Content Synchronization (Semi-Automated)
- Core Features: Repository README β Installer help messages
- Installation Instructions: installation.md β Installer embedded docs
- Architecture Decisions: CLAUDE.md β All documentation references
- Security Controls: Repository workflows β Installer templates (functional equivalence)
- Tool Configurations: Repository configs β Installer embedded configs
Tier 3: Reference Synchronization (Manual with Validation)
- Design Philosophy: Cross-reference consistency validation
- External Links: Broken link checking across all docs
- Examples and Code Samples: Consistency verification
- Enhanced vs Standard Controls: Document differences between repository and installer
- Tool Feature Parity: Validate lite tools maintain core functionality
π Synchronization Rules
Version Management
# Single source of truth
VERSION="0.6.5" (in VERSION file)
# Automated propagation to:
- README.md: []
- install-security-controls.sh: readonly SCRIPT_VERSION="0.6.5"
- CHANGELOG.md: ## [0.6.5] - YYYY-MM-DD
Security Control Counts
# Automated counting from implementation
ACTUAL_CONTROLS=$(count_security_checks_in_installer)
# Propagated to:
- README badges
- Installer help messages
- Architecture documentation
Content Consistency
# Repository docs are authoritative
- CLAUDE.md design principles β All references
- README.md feature descriptions β Installer help
- architecture.md technical details β Embedded docs
Controls Synchronization (Dogfooding Plus)
# Functional equivalence validation
REPO_CONTROLS=$(.github/workflows/*.yml | extract_security_controls)
INSTALLER_CONTROLS=$(install-security-controls.sh | extract_template_controls)
# Core controls must match:
- Secret detection capabilities
- Vulnerability scanning coverage
- Code quality standards
- Supply chain security measures
# Enhanced controls (repository only):
- Advanced CI workflows (6 specialized)
- Custom security policies
- Enhanced monitoring and reporting
- Tool synchronization automation
Tool Synchronization
# Tool version alignment
PINACTLITE_VERSION=$(get_latest_release "h4x0r/pinact-lite")
GITLEAKSLITE_VERSION=$(get_latest_release "h4x0r/gitleaks-lite")
# Synchronization targets:
- .security-controls/bin/pinactlite (repository)
- Base64 embedding in installer script
- Release artifact versions
- Documentation version references
# Update process:
1. Download verified binary from upstream
2. Test compatibility with current architecture
3. Update base64 embedding in installer
4. Update version references in docs
5. Test end-to-end functionality
π‘οΈ Security Layers
Layer 1: Pre-Push Controls (Local)
Same 25+ controls that users get, running via .git/hooks/pre-push
:
Enhanced with --github-security: Users can now also get GitHub repository security features automatically configured.
Blocking Controls: - Secret detection (gitleakslite) - Vulnerability scanning (cargo-deny) - Test validation - Format enforcement - Linting (clippy) - Large file prevention
Warning Controls: - GitHub Actions SHA pinning - Commit signatures - License compliance - Dependency pinning - Unsafe code monitoring - Plus 14 additional checks
Layer 2: Pre-Commit Controls (Local)
Additional controls via .pre-commit-config.yaml
:
repos:
- pre-commit-hooks:
- trailing-whitespace
- end-of-file-fixer
- check-yaml
- check-added-large-files
- shellcheck-py:
- shellcheck for bash/sh scripts
- pre-commit-shfmt:
- Shell formatting (2-space indent)
- markdownlint-cli:
- Markdown linting
- local:
- pinactlite sync verification
Layer 3: CI/CD Workflows (GitHub Actions)
Four specialized workflows for continuous validation:
1. quality-assurance.yml
- Purpose: Comprehensive quality and functional validation with dogfooding plus compliance
- Tools: pinactlite, documentation validation scripts, functional synchronization
- Jobs:
- Critical validation (dogfooding plus compliance)
- Helper tools E2E testing
- Installer self-testing
- SHA pinning validation
- Documentation validation
- Security: Validates repository implements ALL security controls from installer templates
- Dogfooding Plus: Ensures we use everything we provide to users
2. security-scan.yml
- Purpose: Unified security scanning and threat detection
- Tools: CodeQL, Trivy, gitleaks, cargo-deny
- Jobs:
- SAST Analysis: CodeQL static code analysis for JavaScript/TypeScript (blocking)
- Vulnerability Scanning: Trivy filesystem vulnerability detection (blocking)
- Secret Detection: Comprehensive gitleaks scanning with full repository history (blocking)
- Dependency Security: cargo-deny security audit with license compliance (blocking)
- Supply Chain Security: GitHub Actions pinning analysis and dependency integrity (blocking)
- Security: SARIF uploads to GitHub Security tab, comprehensive threat coverage, ALL BLOCKING
- Architecture: Parallel execution with zero-compromise security posture
3. docs.yml
- Purpose: Documentation site generation and deployment
- Tools: MkDocs with Material theme, lychee link validation
- Output: GitHub Pages site deployment
- Triggers: Push to main, PR validation
- Validation: Cross-reference consistency, link checking
4. release.yml
- Purpose: Automated release process with security validation
- Dependencies: Waits for Quality Assurance + Security Scanning workflows
- Checks: Version consistency, changelog updates, artifact generation
- Security: Cryptographic signing, checksum generation, supply chain protection
- Artifacts: Installer scripts, checksums, release notes with security focus
Layer 4: Repository Configuration
Secret Detection (Two-Layer Defense)
- gitleakslite (local): β Pre-push hook blocks secrets before they leave your machine
- GitHub Secret Scanning: β Server-side detection and partner notification
- GitHub Push Protection: β Additional blocking at GitHub level
GitHub Security Features (Enabled)
- Branch protection: β Enabled (PR reviews required, status checks, admin enforcement)
- Issues tracking: β Enabled
- Dependabot vulnerability alerts: β Enabled via API
- Dependabot automated security fixes: β Enabled via API
- Dependabot config: β Present (GitHub Actions + Cargo)
- Code scanning: β CodeQL workflow added
GitHub Features (Require Manual Web Interface)
- Security advisories: β Not enabled (requires manual web setup)
- Advanced security: β Not available (public repo)
Dependency Management
.github/dependabot.yml
- Config for GitHub Actions + Cargo updatesrenovate.json
- Additional dependency managementdeny.toml
- Cargo dependency policiesCargo.lock
- Lock files for reproducible builds- Workflow: Dependabot updates β pinactlite auto-pins β Secure updates
π§ Quality Assurance & Automation
Documentation Synchronization Automation
The repository includes comprehensive automation to maintain documentation consistency:
Automation Scripts:
- scripts/version-sync.sh
- Synchronizes version numbers across all files
- scripts/count-controls.sh
- Audits actual security control counts vs marketing claims
- scripts/validate-docs.sh
- Cross-reference and consistency validation
- scripts/sync-security-controls.sh
- NEW: Functional synchronization of security controls
CI Integration: - Documentation validation runs automatically in quality-assurance.yml workflow - Prevents documentation drift through automated checks - Validates version consistency, control counts, cross-references, and embedded documentation
Maintenance Commands:
# Check all documentation consistency
./scripts/validate-docs.sh
# Verify security control counts
./scripts/count-controls.sh
# Sync version across all files
./scripts/version-sync.sh --check
# Check functional synchronization (dogfooding plus validation)
./scripts/sync-security-controls.sh --check
# Apply missing security controls to repository
./scripts/sync-security-controls.sh --sync
Functional Synchronization (Dogfooding Plus Implementation)
Critical Issue Identified: We had Trivy vulnerability scanning in installer templates but missing from our actual repository workflows. This violates our dogfooding plus philosophy.
Functional Sync Tool: scripts/sync-security-controls.sh
- Purpose: Ensures our repository implements ALL security controls that the installer provides to users
- Philosophy: "If it's not good enough for us, it's not good enough for users"
- Process: Extracts security controls from installer templates, compares with repo implementation, identifies gaps
Sync Categories: 1. Installer β Repo: Controls that should exist in both (vulnerability scanning, secret detection, etc.) 2. Repo Only: Development-specific controls (tool sync, docs, releases) 3. Missing: Controls in installer templates but missing from repo workflows
Why This Matters: - Quality Assurance: We become alpha testers of our own security controls - Bug Discovery: Issues surface in our development before user deployment - Trust Building: Users can inspect our repository to see controls in action - Consistency: Prevents functional drift between what we build and what we use
π οΈ Synchronization Tools and Automation
Documentation Synchronization Tools
- version-sync.sh - Version number propagation
- count-controls.sh - Security control counting
- validate-docs.sh - Documentation consistency checking
Controls Synchronization Tools
- sync-security-controls.sh - Repository/installer controls comparison
- validate-dogfooding-plus.sh - Enhanced vs standard controls validation
- extract-security-controls.sh - Parse controls from workflows and installer
Tool Synchronization Tools
- sync-pinactlite.sh - Update pinactlite from upstream
- sync-gitleakslite.sh - Update gitleakslite from upstream
- validate-tool-compatibility.sh - Test tool functionality after updates
Release Process Tools
- release-validation.sh - Multi-dimensional release checking
- generate-release-notes.sh - Comprehensive release documentation
CI Integration
- Pre-commit hooks for multi-dimensional validation
- PR checks for documentation, controls, and tool consistency
- Automated controls functional equivalence testing
- Tool compatibility validation in CI
- Release pipeline multi-dimensional automation
- Deployment verification across all sync dimensions
π Validation Strategy
CI Pipeline Validation
- Documentation consistency checking
- Version synchronization verification
- Control count accuracy validation
- Cross-reference link checking
- Controls functional equivalence validation
- Tool version alignment verification
- Enhanced vs standard controls documentation
Release Process Integration
- Automated version propagation
- Documentation review requirements
- Controls synchronization validation
- Tool version alignment verification
- Consistency validation gates
- Deployment verification
Contributor Guidelines
- Documentation impact assessment
- Security controls functional equivalence review
- Tool compatibility verification
- Cross-file update requirements
- Validation tool usage
- Multi-dimensional review checklist completion
π Metrics & Monitoring
Workflow Status Badges
All workflows display real-time status in README: - Quality Assurance - Documentation - CodeQL Security Scanning - Pinactlite Sync
Performance Tracking
- Pre-push: ~60 seconds target
- Pre-commit: < 5 seconds
- CI workflows: < 5 minutes each
Security Metrics
- 100% GitHub Actions pinned β
- 0 known vulnerabilities β
- Secret detection coverage β (GitHub + gitleakslite)
- Push protection enabled β
- SLSA Level 2 compliance π (in progress)
π― Success Metrics
Documentation Consistency Metrics
- Zero version discrepancies across files
- Accurate security control counts
- Up-to-date installation instructions
- Working cross-references
Controls Synchronization Metrics
- Functional equivalence between repository and installer controls
- Zero security gaps in base vs enhanced configurations
- Clear documentation of enhanced features
- Successful dogfooding plus validation
Tool Synchronization Metrics
- Tool versions aligned across all deployments
- Zero compatibility issues with tool updates
- Successful tool functionality validation
- Up-to-date tool capability documentation
Maintenance Metrics
- Documentation update time (target: < 30 minutes)
- Controls sync validation time (target: < 15 minutes)
- Tool update integration time (target: < 2 hours)
- Consistency violation detection rate (target: 100%)
- Release accuracy across all dimensions (target: 100%)
- Contributor multi-dimensional compliance (target: > 90%)
π§ Maintenance Workflows
Adding New Security Controls
- For installer (affects users):
- Update installer script
- Test in multiple environments
- Update documentation
-
Version bump
-
For this repository only:
- Add to appropriate workflow
- Update this document
- No version bump needed
Testing Changes
# Local testing
./install-security-controls.sh --dry-run
# Pre-commit testing
pre-commit run --all-files
# Workflow testing
act -j <job-name> # Using act for local workflow testing
Release Process
-
Security verification:
bash # Update checksums sha256sum install-security-controls.sh > install-security-controls.sh.sha256 sha256sum yubikey-gitsign-toggle.sh > yubikey-gitsign-toggle.sh.sha256
-
Version update:
bash ./scripts/version-sync.sh X.Y.Z
-
Testing:
- All workflows must pass
- E2E tests must pass
-
Documentation must build
-
Release:
- Tag with version
- Sign tag (Sigstore/gitsign)
- Create GitHub release
- Update checksums in release
π Cryptographic Chain of Trust
Repository Security Chain:
βββββββββββββββββββ
β Signed Commits β (Sigstore/gitsign)
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β SHA256 Checksumsβ (Installer verification)
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Pinned Actions β (SHA references)
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Tool Signatures β (Cosign verification)
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β SLSA Provenance β (Build attestation)
βββββββββββββββββββ
π¨ Incident Response
Security Issue Detected
- Immediate Actions:
- Disable affected workflows
- Revoke compromised credentials
-
Alert maintainers
-
Investigation:
- Review audit logs
- Check commit signatures
-
Verify checksums
-
Remediation:
- Fix vulnerability
- Update security controls
- Document incident
Compromised Dependency
- Detection via:
- Dependabot alerts
- cargo-deny failures
-
Manual audit
-
Response:
- Pin to last known good version
- Find alternative if critical
- Update deny.toml rules
π Security Checklist for Maintainers
Daily
- [ ] Check workflow status badges
- [ ] Review Dependabot alerts
- [ ] Monitor issue reports
Weekly
- [ ] Review PR security impact
- [ ] Update dependencies
- [ ] Check security advisories
Monthly
- [ ] Full security audit
- [ ] Performance review
- [ ] Documentation updates
Release
- [ ] Update all checksums
- [ ] Sign release artifacts
- [ ] Test on clean environment
- [ ] Update security documentation
π Continuous Improvement
Feedback Loops
- User issue reports β Security improvements
- CI failures β Control refinements
- Performance metrics β Optimization
- Security research β New controls
Innovation Areas
- WebAssembly sandbox for untrusted code
- Machine learning for anomaly detection
- Formal verification of critical paths
- Zero-trust architecture patterns
ποΈ Architecture Principles
Single-Script Architecture Preservation
All synchronization must not violate our Single-Script Architecture. Automation tools are optional enhancements that don't break the core 1-click installation process.
Dogfooding Plus Philosophy
Repository demonstrates enhanced security beyond what installer provides. This proves scalability and effectiveness while maintaining functional equivalence for core security controls.
Tool Independence
Embedded tools must remain functional even when upstream changes. Version synchronization improves capability but never breaks core functionality.
Transparency in Enhancement
Clearly document differences between repository and installer implementations. Users understand what they get vs. what's possible with enhanced configuration.
π― Why the Difference?
The additional controls in this repository serve specific purposes:
- Development Validation: Test the installer itself works correctly
- Documentation: Build and deploy comprehensive docs
- Quality Assurance: Ensure shell scripts are properly formatted
- Tool Synchronization: Keep helper tools in sync
- Enhanced CI/CD: Validate everything works end-to-end
- Multi-Dimensional Consistency: Maintain synchronization across all project dimensions
Most projects don't need these development-specific controls, which is why the installer focuses on universal security controls that benefit all projects.
NEW: The installer now provides comprehensive GitHub security features with --github-security
, bringing user repositories much closer to this repository's security level!
π Additional Resources
Internal Documentation
- Security Controls Architecture - Technical design
- Installation Guide - Setup instructions
- Complete Signing Guide - Cryptographic signing configuration
- Cryptographic Verification - Verification procedures
- Workflow Sources - GitHub Actions workflows
External References
Primary Goal: Achieve 100% synchronization across documentation, security controls, and tools without compromising our design principles.
Secondary Goal: Demonstrate that dogfooding plus approach provides superior security while maintaining user accessibility.
Validation Goal: Ensure all synchronization dimensions work together cohesively in both repository and user deployments.
Last Updated: January 2025 Maintained By: Repository maintainers Security Contact: security@[domain]