Skip to content

Commit 8012ece

Browse files
authored
Merge fa1e5aa into cb1cca3
2 parents cb1cca3 + fa1e5aa commit 8012ece

File tree

32 files changed

+3459
-75
lines changed

32 files changed

+3459
-75
lines changed

.checkov.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Checkov Security Scanning Configuration
2+
# https://www.checkov.io/2.Basics/Configuration%20File.html
3+
4+
# Framework scanning
5+
framework:
6+
- terraform
7+
- github_actions
8+
- secrets
9+
10+
# Output settings
11+
output:
12+
- cli
13+
- sarif
14+
15+
# Severity settings
16+
soft-fail: true
17+
quiet: false
18+
compact: true
19+
20+
# Skip specific checks that are not applicable or too noisy
21+
skip-check:
22+
# Skip checks that are not relevant for Scaleway
23+
- CKV_AWS_*
24+
- CKV_AZURE_*
25+
- CKV_GCP_*
26+
27+
# Skip specific Terraform checks that might be too restrictive
28+
- CKV_TF_1 # Ensure Terraform module sources use a commit hash
29+
- CKV_TF_2 # Ensure Terraform module sources use a tag with a version number
30+
31+
# Skip GitHub Actions checks that are too restrictive for our use case
32+
- CKV_GHA_1 # Ensure no secrets in GitHub Actions
33+
- CKV_GHA_2 # Ensure GitHub Actions secrets are not hardcoded
34+
35+
# Skip Docker checks if not using containers in templates
36+
- CKV_DOCKER_*
37+
38+
# Enable specific checks for enhanced security
39+
check:
40+
- CKV_TF_* # All Terraform checks
41+
- CKV_GHA_* # All GitHub Actions checks
42+
- CKV_SECRET_* # All secret detection checks
43+
44+
# External modules and plugins
45+
download-external-modules: true
46+
external-modules-download-path: .external_modules
47+
48+
# File inclusion/exclusion patterns
49+
skip-path:
50+
- .terraform/
51+
- .git/
52+
- node_modules/
53+
- __pycache__/
54+
- .pytest_cache/
55+
- .coverage/
56+
- venv/
57+
- .venv/
58+
- .external_modules/
59+
60+
# Integration settings
61+
create-baseline: false
62+
use-enforcement-rules: false
63+
64+
enable-secret-scan-all-files: true
65+
66+
# Repository settings
67+
repo-root-for-plan-enrichment: .

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ updates:
1212
interval: "weekly"
1313
day: "wednesday"
1414
time: "09:00"
15+
reviewers:
16+
- "security-team"
17+
assignees:
18+
- "devops-team"
1519
labels:
1620
- "dependencies"
1721
- "github-actions"
1822
- "ci/cd"
23+
- "security"
1924
commit-message:
2025
prefix: "chore(deps)"
2126
prefix-development: "chore(deps-dev)"
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: CI/CD Performance Optimization Actions
2+
3+
# This workflow contains reusable actions for performance optimization
4+
# Can be included in other workflows for consistent caching and parallel execution
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
cache_key_prefix:
10+
description: 'Prefix for cache keys'
11+
required: true
12+
type: string
13+
terraform_version:
14+
description: 'Terraform version to use'
15+
required: false
16+
type: string
17+
default: '~1.12.0'
18+
kubectl_version:
19+
description: 'kubectl version to use'
20+
required: false
21+
type: string
22+
default: 'v1.32.0'
23+
helm_version:
24+
description: 'Helm version to use'
25+
required: false
26+
type: string
27+
default: 'v3.12.0'
28+
29+
jobs:
30+
setup-tools-cache:
31+
name: Setup Tools with Caching
32+
runs-on: ubuntu-latest
33+
outputs:
34+
terraform_cache_hit: ${{ steps.terraform-cache.outputs.cache-hit }}
35+
kubectl_cache_hit: ${{ steps.kubectl-cache.outputs.cache-hit }}
36+
helm_cache_hit: ${{ steps.helm-cache.outputs.cache-hit }}
37+
38+
steps:
39+
- name: Checkout Code
40+
uses: actions/checkout@v5
41+
42+
- name: Cache Terraform Providers and Modules
43+
id: terraform-cache
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
~/.terraform.d/plugin-cache
48+
**/.terraform
49+
**/.terraform.lock.hcl
50+
key: ${{ inputs.cache_key_prefix }}-terraform-${{ runner.os }}-${{ hashFiles('**/.terraform.lock.hcl', '**/versions.tf') }}
51+
restore-keys: |
52+
${{ inputs.cache_key_prefix }}-terraform-${{ runner.os }}-
53+
terraform-${{ runner.os }}-
54+
55+
- name: Cache kubectl Binary
56+
id: kubectl-cache
57+
uses: actions/cache@v4
58+
with:
59+
path: /usr/local/bin/kubectl
60+
key: kubectl-${{ runner.os }}-${{ inputs.kubectl_version }}
61+
62+
- name: Cache Helm Binary
63+
id: helm-cache
64+
uses: actions/cache@v4
65+
with:
66+
path: /usr/local/bin/helm
67+
key: helm-${{ runner.os }}-${{ inputs.helm_version }}
68+
69+
- name: Cache Helm Chart Repository
70+
uses: actions/cache@v4
71+
with:
72+
path: ~/.cache/helm/repository
73+
key: helm-repo-${{ runner.os }}-${{ hashFiles('**/Chart.yaml', '**/Chart.lock') }}
74+
restore-keys: |
75+
helm-repo-${{ runner.os }}-
76+
77+
- name: Setup Terraform
78+
uses: hashicorp/setup-terraform@v3
79+
with:
80+
terraform_version: ${{ inputs.terraform_version }}
81+
env:
82+
TF_PLUGIN_CACHE_DIR: ~/.terraform.d/plugin-cache
83+
84+
- name: Create Terraform Plugin Cache Directory
85+
run: mkdir -p ~/.terraform.d/plugin-cache
86+
87+
- name: Setup kubectl
88+
uses: azure/setup-kubectl@v4
89+
with:
90+
version: ${{ inputs.kubectl_version }}
91+
92+
- name: Setup Helm
93+
uses: azure/setup-helm@v4
94+
with:
95+
version: ${{ inputs.helm_version }}
96+
97+
- name: Verify Tool Versions
98+
run: |
99+
echo "🔧 Tool versions installed:"
100+
echo "Terraform: $(terraform version -json | jq -r '.terraform_version')"
101+
echo "kubectl: $(kubectl version --client --output=json | jq -r '.clientVersion.gitVersion')"
102+
echo "Helm: $(helm version --template='{{.Version}}')"
103+
echo ""
104+
echo "📊 Cache status:"
105+
echo "Terraform cache hit: ${{ steps.terraform-cache.outputs.cache-hit }}"
106+
echo "kubectl cache hit: ${{ steps.kubectl-cache.outputs.cache-hit }}"
107+
echo "Helm cache hit: ${{ steps.helm-cache.outputs.cache-hit }}"
108+
109+
validate-performance:
110+
name: Validate Performance Configuration
111+
runs-on: ubuntu-latest
112+
needs: setup-tools-cache
113+
114+
steps:
115+
- name: Performance Summary
116+
run: |
117+
echo "🚀 CI/CD Performance Optimization Summary"
118+
echo "========================================"
119+
echo ""
120+
echo "📊 Caching Strategy:"
121+
echo " • Terraform providers cached globally"
122+
echo " • kubectl binary cached per version"
123+
echo " • Helm binary and chart repositories cached"
124+
echo " • Cross-workflow cache sharing enabled"
125+
echo ""
126+
echo "⚡ Performance Benefits:"
127+
echo " • Reduced Terraform provider download time (60-120s → 5-10s)"
128+
echo " • Faster tool setup with binary caching"
129+
echo " • Helm chart caching reduces deployment time"
130+
echo " • Parallel job execution where possible"
131+
echo ""
132+
echo "🔄 Cache Hit Rates:"
133+
echo " • Terraform: ${{ needs.setup-tools-cache.outputs.terraform_cache_hit == 'true' && '✅ Hit' || '❌ Miss' }}"
134+
echo " • kubectl: ${{ needs.setup-tools-cache.outputs.kubectl_cache_hit == 'true' && '✅ Hit' || '❌ Miss' }}"
135+
echo " • Helm: ${{ needs.setup-tools-cache.outputs.helm_cache_hit == 'true' && '✅ Hit' || '❌ Miss' }}"

.github/workflows/deploy-coder.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ jobs:
150150
- name: Checkout Code
151151
uses: actions/checkout@v5
152152

153+
- name: Cache Terraform Providers and Modules
154+
uses: actions/cache@v4
155+
with:
156+
path: |
157+
~/.terraform.d/plugin-cache
158+
**/.terraform
159+
**/.terraform.lock.hcl
160+
key: terraform-coder-validate-${{ runner.os }}-${{ hashFiles('**/.terraform.lock.hcl', '**/versions.tf') }}
161+
restore-keys: |
162+
terraform-coder-validate-${{ runner.os }}-
163+
terraform-validate-${{ runner.os }}-
164+
153165
- name: Determine Deployment Environment
154166
id: determine-env
155167
run: |
@@ -160,6 +172,17 @@ jobs:
160172
uses: hashicorp/setup-terraform@v3
161173
with:
162174
terraform_version: "~1.12.0"
175+
env:
176+
TF_PLUGIN_CACHE_DIR: ~/.terraform.d/plugin-cache
177+
178+
- name: Create Terraform Plugin Cache Directory
179+
run: mkdir -p ~/.terraform.d/plugin-cache
180+
181+
- name: Cache kubectl Binary
182+
uses: actions/cache@v4
183+
with:
184+
path: /usr/local/bin/kubectl
185+
key: kubectl-${{ runner.os }}-v1.32.0
163186

164187
- name: Setup kubectl
165188
uses: azure/setup-kubectl@v4
@@ -315,9 +338,19 @@ jobs:
315338
316339
echo "✅ Template validation successful: $template_name"
317340
341+
security-scan:
342+
name: Security Scan Coder Config
343+
needs: validate
344+
uses: ./.github/workflows/security-scan.yml
345+
with:
346+
scan_scope: infrastructure
347+
environment: ${{ needs.validate.outputs.deploy_env }}
348+
severity_threshold: MEDIUM
349+
fail_on_findings: false
350+
318351
setup-backend:
319352
name: Setup Coder Backend
320-
needs: validate
353+
needs: [validate, security-scan]
321354
if: needs.validate.outputs.deploy_env != ''
322355
uses: ./.github/workflows/manage-backend-bucket.yml
323356
with:

0 commit comments

Comments
 (0)