Skip to content

feat: Add end-to-end Terraform EOL scanning support - #602

Open
hellonico wants to merge 3 commits into
xeol-io:mainfrom
hellonico:feature/terraform-support
Open

feat: Add end-to-end Terraform EOL scanning support#602
hellonico wants to merge 3 commits into
xeol-io:mainfrom
hellonico:feature/terraform-support

Conversation

@hellonico

Copy link
Copy Markdown

Fixes #601

Description

Adds end-to-end End-of-Life (EOL) scanning support for Terraform infrastructure.

Currently, the Xeol scanner does not detect EOL Terraform providers or binaries. As infrastructure-as-code matures, catching deprecated Terraform providers hidden deep in environment sub-folders is critical to preventing breaking changes and maintaining security compliance.

Implementation Details

This PR encompasses three core components to bypass upstream Syft limitations and provide full Terraform support:

  1. Custom HCL Lockfile Cataloger (xeol/pkg/cataloger/terraform)
    • Since the underlying Syft dependency (v1.10.0) lacks native Terraform support, this introduces a lightweight, zero-dependency cataloger.
    • It recursively walks directories searching for .terraform.lock.hcl files, parses provider blocks, and emits them as xeol.Package objects.
  2. Terraform Matcher (xeol/matcher/terraform)
    • Intercepts packages with the pkg:terraform/ PURL prefix and evaluates them against the local SQLite database.
  3. Database Schema Mapping & POC Generator (cmd/db-gen)
    • Updated the CycleModel schema to include product_id for correct SQL JOIN queries.
    • Included a Proof-of-Concept database generator script (cmd/db-gen/main.go) that demonstrates how to map Terraform binary data from endoflife.date and static HashiCorp provider lifecycles into the internal xeol-db schema.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue with SQL schema joins)

Validation

  • Tested locally against a live Terraform repository.
  • Successfully crawls sub-environment directories and flags deprecated pinned versions (e.g., catching an AWS provider pinned to v4.67.0, accurately flagging it as 800+ days past EOL).

hellonico added 3 commits May 21, 2026 17:37
…raform provider EOL detection

- Add xeol/pkg/cataloger/terraform: walks dirs for .terraform.lock.hcl,
  parses provider blocks with a stdlib line scanner (no HCL v2 dep needed)
- Inject cataloger output into xeol/pkg provider.Provide() for dir: inputs,
  converting Provider records to xeol.Package with pkg:terraform/... PURLs
- Add ProductID FK to CycleModel so GetCyclesByPurl JOIN works correctly
- Rewrite cmd/db-gen: seeds both Terraform binary + hashicorp/aws provider
  EOL cycles; cube-plus-infra aws@4.67.0 now flagged as EOL (841 days)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

End-to-End Terraform EOL Scanning Support

1 participant