|
| 1 | +version: 2 |
| 2 | + |
| 3 | +# ═════════════════════════════════════════════════════════════════════════════ |
| 4 | +# DEPENDABOT CONFIGURATION - Production-Ready |
| 5 | +# |
| 6 | +# Purpose: Automate dependency updates across Python, Docker, Terraform, and CI |
| 7 | +# Strategy: Weekly updates with PR limits to prevent spam |
| 8 | +# Security: Immediate alerts for security vulnerabilities |
| 9 | +# |
| 10 | +# Ecosystem Coverage: |
| 11 | +# ✓ Python (Poetry) - /backend |
| 12 | +# ✓ Docker (Base images) - /backend, /frontend |
| 13 | +# ✓ Terraform (Providers/Modules) - /infra |
| 14 | +# ✓ GitHub Actions (Workflow versions) - / |
| 15 | +# |
| 16 | +# CI Integration: |
| 17 | +# • PR triggers CI automatically (configured in ci.yml) |
| 18 | +# • Dependabot PRs run security scans |
| 19 | +# • Auto-merge available for patch/minor updates |
| 20 | +# |
| 21 | +# ═════════════════════════════════════════════════════════════════════════════ |
| 22 | + |
| 23 | +updates: |
| 24 | + # ============================================================================ |
| 25 | + # PYTHON BACKEND: Poetry Package Manager |
| 26 | + # ============================================================================ |
| 27 | + # Manages FastAPI, database drivers, and all Python dependencies |
| 28 | + # |
| 29 | + # Strategy: |
| 30 | + # - Weekly updates (Monday 02:00 UTC) |
| 31 | + # - Max 5 open PRs to prevent overwhelming review queue |
| 32 | + # - Immediate security updates (bypass schedule) |
| 33 | + # - pycrypto explicitly ignored (deprecated, requires manual migration) |
| 34 | + # |
| 35 | + # Why Poetry? |
| 36 | + # - Deterministic: poetry.lock ensures reproducible builds |
| 37 | + # - Security: Lockfile changes trigger Docker layer cache invalidation |
| 38 | + # - Integration: Works seamlessly with CI cache strategy |
| 39 | + # ============================================================================ |
| 40 | + - package-ecosystem: "pip" |
| 41 | + directory: "/backend" |
| 42 | + schedule: |
| 43 | + interval: "weekly" |
| 44 | + day: "monday" |
| 45 | + time: "02:00" |
| 46 | + open-pull-requests-limit: 5 |
| 47 | + labels: |
| 48 | + - "backend" |
| 49 | + - "dependencies" |
| 50 | + pull-request-branch-name: |
| 51 | + separator: "/" |
| 52 | + allow: |
| 53 | + - dependency-type: "all" |
| 54 | + commit-message: |
| 55 | + prefix: "build(backend):" |
| 56 | + prefix-development: "build(backend-dev):" |
| 57 | + include: "scope" |
| 58 | + rebase-strategy: "disabled" |
| 59 | + versioning-strategy: "lockfile-only" |
| 60 | + # Security updates bypass the schedule and are created immediately |
| 61 | + # Reason: Production security patches should not wait for weekly schedule |
| 62 | + |
| 63 | + # ============================================================================ |
| 64 | + # FRONTEND: Docker Base Images |
| 65 | + # ============================================================================ |
| 66 | + # Keeps Node.js base images patched for security vulnerabilities |
| 67 | + # |
| 68 | + # Strategy: |
| 69 | + # - Weekly updates (Monday 03:00 UTC) |
| 70 | + # - Max 2 open PRs (conservative: Docker updates are critical) |
| 71 | + # - Semver opt-out: Only patch/minor versions |
| 72 | + # - CI tests build and deployment |
| 73 | + # |
| 74 | + # Why Docker Updates? |
| 75 | + # - Base images contain OS packages (curl, openssl, etc.) |
| 76 | + # - Security vulnerabilities in base images are high-risk |
| 77 | + # - Docker layer caching invalidates automatically |
| 78 | + # - Cache busting ensures fresh layers on dependency change |
| 79 | + # ============================================================================ |
| 80 | + - package-ecosystem: "npm" |
| 81 | + directory: "/frontend" |
| 82 | + schedule: |
| 83 | + interval: "weekly" |
| 84 | + day: "monday" |
| 85 | + time: "03:00" |
| 86 | + open-pull-requests-limit: 2 |
| 87 | + labels: |
| 88 | + - "docker" |
| 89 | + - "dependencies" |
| 90 | + pull-request-branch-name: |
| 91 | + separator: "/" |
| 92 | + commit-message: |
| 93 | + prefix: "build(docker):" |
| 94 | + include: "scope" |
| 95 | + # Only patch and minor versions to avoid breaking changes |
| 96 | + # Major versions may require code changes (e.g., node:18 → node:20) |
| 97 | + allow: |
| 98 | + - dependency-type: "all" |
| 99 | + |
| 100 | + # ============================================================================ |
| 101 | + # BACKEND: Docker Base Images |
| 102 | + # ============================================================================ |
| 103 | + # Keeps Python base images patched for security vulnerabilities |
| 104 | + # |
| 105 | + # Strategy: |
| 106 | + # - Weekly updates (Monday 03:30 UTC) |
| 107 | + # - Max 2 open PRs (conservative: Docker updates are critical) |
| 108 | + # - Semver opt-out: Only patch/minor versions |
| 109 | + # - Cache invalidation: poetry.lock changes trigger Docker rebuild |
| 110 | + # |
| 111 | + # Why Docker Updates? |
| 112 | + # - Base images contain OS packages and Python runtime |
| 113 | + # - Python package installations depend on base image security |
| 114 | + # - Multi-stage builds ensure optimized production images |
| 115 | + # - Updates tested automatically via CI before deployment |
| 116 | + # ============================================================================ |
| 117 | + - package-ecosystem: "docker" |
| 118 | + directory: "/backend" |
| 119 | + schedule: |
| 120 | + interval: "weekly" |
| 121 | + day: "monday" |
| 122 | + time: "03:30" |
| 123 | + open-pull-requests-limit: 2 |
| 124 | + labels: |
| 125 | + - "docker" |
| 126 | + - "dependencies" |
| 127 | + pull-request-branch-name: |
| 128 | + separator: "/" |
| 129 | + commit-message: |
| 130 | + prefix: "build(docker):" |
| 131 | + include: "scope" |
| 132 | + |
| 133 | + # ============================================================================ |
| 134 | + # TERRAFORM: Infrastructure as Code |
| 135 | + # ============================================================================ |
| 136 | + # Manages AWS provider versions and Terraform modules |
| 137 | + # |
| 138 | + # Strategy: |
| 139 | + # - Weekly updates (Tuesday 04:00 UTC) |
| 140 | + # - Max 3 open PRs (moderate: requires infrastructure review) |
| 141 | + # - All versions allowed (Terraform handles most upgrades) |
| 142 | + # - Security-focused: Always on latest provider versions |
| 143 | + # |
| 144 | + # Why Terraform Updates? |
| 145 | + # - AWS provider includes new resources and bug fixes |
| 146 | + # - Terraform maintains compatibility across major versions |
| 147 | + # - Infrastructure tests validate changes via CI |
| 148 | + # - ECS Fargate deployment orchestrated through Terraform |
| 149 | + # |
| 150 | + # NOTE: Do NOT modify Terraform code directly |
| 151 | + # - Dependabot only updates provider/module versions |
| 152 | + # - Resource configurations remain unchanged |
| 153 | + # - CI validates all infrastructure changes |
| 154 | + # ============================================================================ |
| 155 | + - package-ecosystem: "terraform" |
| 156 | + directory: "/infra" |
| 157 | + schedule: |
| 158 | + interval: "weekly" |
| 159 | + day: "tuesday" |
| 160 | + time: "04:00" |
| 161 | + open-pull-requests-limit: 3 |
| 162 | + labels: |
| 163 | + - "infra" |
| 164 | + - "dependencies" |
| 165 | + - "terraform" |
| 166 | + pull-request-branch-name: |
| 167 | + separator: "/" |
| 168 | + commit-message: |
| 169 | + prefix: "build(terraform):" |
| 170 | + include: "scope" |
| 171 | + # Allow major version updates for terraform to ensure latest provider support |
| 172 | + allow: |
| 173 | + - dependency-type: "all" |
| 174 | + |
| 175 | + # ============================================================================ |
| 176 | + # GITHUB ACTIONS: Workflow Versions |
| 177 | + # ============================================================================ |
| 178 | + # Manages GitHub Actions action versions used in CI/CD pipelines |
| 179 | + # |
| 180 | + # Strategy: |
| 181 | + # - Weekly updates (Wednesday 02:00 UTC) |
| 182 | + # - Max 4 open PRs (accommodates multiple action updates) |
| 183 | + # - All versions allowed (GitHub Actions maintains compatibility) |
| 184 | + # - Critical: Actions run in privileged CI context |
| 185 | + # |
| 186 | + # Why GitHub Actions Updates? |
| 187 | + # - Actions contain security patches and bug fixes |
| 188 | + # - Setup actions (python, node, terraform) need latest features |
| 189 | + # - Docker build action depends on latest buildx improvements |
| 190 | + # - Cache strategy relies on recent action versions |
| 191 | + # |
| 192 | + # CI Pipeline Actions Updated: |
| 193 | + # - actions/checkout@v4 |
| 194 | + # - actions/setup-python@v6 |
| 195 | + # - actions/setup-node@v4 |
| 196 | + # - docker/setup-buildx-action@v2 |
| 197 | + # - docker/build-push-action@v4 |
| 198 | + # - hashicorp/setup-terraform@v2 |
| 199 | + # - actions/cache@v4 |
| 200 | + # - And all security scanning actions |
| 201 | + # ============================================================================ |
| 202 | + - package-ecosystem: "github-actions" |
| 203 | + directory: "/" |
| 204 | + schedule: |
| 205 | + interval: "weekly" |
| 206 | + day: "wednesday" |
| 207 | + time: "02:00" |
| 208 | + open-pull-requests-limit: 4 |
| 209 | + labels: |
| 210 | + - "ci" |
| 211 | + - "dependencies" |
| 212 | + pull-request-branch-name: |
| 213 | + separator: "/" |
| 214 | + commit-message: |
| 215 | + prefix: "ci:" |
| 216 | + include: "scope" |
| 217 | + rebase-strategy: "disabled" |
| 218 | +# ═════════════════════════════════════════════════════════════════════════════ |
| 219 | +# SECURITY & CI INTEGRATION |
| 220 | +# ═════════════════════════════════════════════════════════════════════════════ |
| 221 | +# |
| 222 | +# ✅ Security Model: |
| 223 | +# - Dependabot PRs run full CI/CD pipeline |
| 224 | +# - All security scans execute before merge |
| 225 | +# - No AWS credentials used in Dependabot context |
| 226 | +# - Runtime secrets stay in AWS Secrets Manager |
| 227 | +# - ECR push only happens on main/staging/develop |
| 228 | +# |
| 229 | +# ✅ CI Triggers: |
| 230 | +# - PR to main → Full CI + security scans |
| 231 | +# - PR to staging → Full CI + security scans |
| 232 | +# - PR to develop → Full CI + security scans |
| 233 | +# - Configured in: .github/workflows/ci.yml |
| 234 | +# |
| 235 | +# ✅ Auto-Merge Strategy: |
| 236 | +# - Workflow: .github/workflows/dependabot-auto-merge.yml |
| 237 | +# - Trigger: PR from dependabot[bot] |
| 238 | +# - Condition: Only after all CI checks pass |
| 239 | +# - Strategy: Squash merge (clean git history) |
| 240 | +# - Types: patch/minor versions only |
| 241 | +# |
| 242 | +# ═════════════════════════════════════════════════════════════════════════════ |
0 commit comments