Skip to content

fix(terrascript): upgrade time and random Terraform provider versions#5496

Merged
RH-tj merged 3 commits intoapp-sre:masterfrom
RH-tj:fix/cve-upgrade-terraform-time-random-providers
Apr 22, 2026
Merged

fix(terrascript): upgrade time and random Terraform provider versions#5496
RH-tj merged 3 commits intoapp-sre:masterfrom
RH-tj:fix/cve-upgrade-terraform-time-random-providers

Conversation

@RH-tj
Copy link
Copy Markdown
Contributor

@RH-tj RH-tj commented Apr 17, 2026

Summary

  • Upgrade hashicorp/time provider version from 0.9.1 to 0.13.1 in terrascript required_providers
  • Upgrade hashicorp/random provider version from 3.4.3 to 3.8.1 in terrascript required_providers

Context

ACS flagged critical fixable CVEs in the qontract-reconcile-master image running in gabi-pipelines on appsrep09ue1. The root cause is old Terraform providers compiled with vulnerable Go versions (< 1.19.9). The old time (0.9.1) and random (3.4.3) providers were built with Go 1.18.5, which is affected by CVE-2023-24538, CVE-2023-24540, CVE-2024-24790, and others.

Dependency

This PR requires the updated qontract-reconcile-base container image (with the new provider versions available in the plugin directory) to be published first. See companion PR: app-sre/container-images#TBD

The qontract-reconcile Dockerfile base image digest will also need to be updated to reference the new base image once it is published.

Test plan

  • Verify terraform init succeeds with new provider versions
  • Verify terrascript generates correct required_providers blocks
  • Verify ACS CVE alerts clear after deployment

Made with Cursor

Summary by CodeRabbit

  • Chores
    • Updated Terraform provider version constraints for temporary providers to ensure compatibility and receive recent fixes.
    • Bumped base images used for development and pre-test builds to a newer revision for improved stability and build consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2851ad71-0069-476a-940e-4ced64e85968

📥 Commits

Reviewing files that changed from the base of the PR and between 6953a28 and 43e39e1.

📒 Files selected for processing (2)
  • dockerfiles/Dockerfile
  • reconcile/utils/terrascript_aws_client.py
✅ Files skipped from review due to trivial changes (2)
  • dockerfiles/Dockerfile
  • reconcile/utils/terrascript_aws_client.py

Walkthrough

Updated Terraform temporary provider version constraints for hashicorp/time and hashicorp/random, and bumped the base image tag and digest used in two Docker build stages.

Changes

Cohort / File(s) Summary
Terraform Provider Version Updates
reconcile/utils/terrascript_aws_client.py
Updated temporary provider version constraints in TerrascriptClient.__init__: hashicorp/time 0.9.10.13.1, hashicorp/random 3.4.33.8.1.
Docker base image bump
dockerfiles/Dockerfile
Updated base image tag and pinned digest for dev-image and prod-image-pre-test stages to qontract-reconcile-base-master:1.5.2-1 (from 1.5.1-1).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

RH-tj added 2 commits April 21, 2026 08:24
Update hardcoded Terraform provider versions in terrascript to match
the upgraded providers in the qontract-reconcile-base container image:
- time: 0.9.1 -> 0.13.1 (fixes CVE-2023-24538, CVE-2023-24540)
- random: 3.4.3 -> 3.8.1 (fixes CVE-2023-24538, CVE-2023-24540)

The old versions were compiled with Go < 1.19.9 which contains critical
vulnerabilities. The new versions are built with safe Go versions.

NOTE: This change requires the updated qontract-reconcile-base image
with the new provider versions to be available before deployment.

JIRA: APPSRE-xxxx
Made-with: Cursor
…oviders

Updates the qontract-reconcile-base-master digest to pick up the
new image built from container-images#294, which removed vulnerable
AWS provider versions and upgraded time (0.13.1) and random (3.8.1).

Made-with: Cursor
@RH-tj RH-tj force-pushed the fix/cve-upgrade-terraform-time-random-providers branch from 6953a28 to 43e39e1 Compare April 21, 2026 12:34
@lisa
Copy link
Copy Markdown
Contributor

lisa commented Apr 21, 2026

/lgtm

@RH-tj RH-tj requested a review from lisa April 21, 2026 12:57
Copy link
Copy Markdown
Contributor

@lisa lisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Copy Markdown
Contributor

@hemslo hemslo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@RH-tj RH-tj merged commit f452426 into app-sre:master Apr 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants