Skip to content

feat: add OpenSearch resource type#9

Open
revied wants to merge 3 commits intoblock:mainfrom
revied:feature/opensearch-resource-type
Open

feat: add OpenSearch resource type#9
revied wants to merge 3 commits intoblock:mainfrom
revied:feature/opensearch-resource-type

Conversation

@revied
Copy link
Copy Markdown
Contributor

@revied revied commented Apr 13, 2026

Summary

  • Adds OpenSearch as a supported resource type for version drift detection
  • Implements Wiz inventory source, endoflife.date EOL provider support, and detector
  • Fixes convertCycle to correctly handle two-tier lifecycle (standard support -> extended support -> EOL) for products like OpenSearch and EKS

Changes

EOL Provider (pkg/eol/endoflife/)

  • Add opensearch -> amazon-opensearch ProductMapping
  • Add version normalization: strip OpenSearch_ prefix, truncate to major.minor
  • Fix convertCycle: versions past eol but before extendedSupport are now correctly classified as extended support (YELLOW) instead of EOL (RED)

Wiz Inventory Source (pkg/inventory/wiz/opensearch.go)

  • Parse Wiz CSV for OpenSearch domains
  • Filter by nativeType (domains only, excludes snapshots/policies)
  • Version prefix stripping (OpenSearch_2.11 -> 2.11)
  • Tag-based service attribution with registry fallback

Detector (pkg/detector/opensearch/)

  • Follows Aurora/EKS pattern: fetch inventory, check EOL, apply policy

Server Wiring (cmd/server/main.go)

  • WIZ_OPENSEARCH_REPORT_ID env var
  • Inventory source, EOL provider, and detector registration

Test plan

  • go build ./... passes
  • go test ./... passes (53+ tests including 13 new OpenSearch tests)
  • EOL lifecycle correctly classifies: supported, extended support, and EOL versions
  • Wiz inventory source filters to domain resources only
  • Version normalization handles OpenSearch_2.11, 2.11.0, 2.11 formats

🤖 Generated with Claude Code

Adds full OpenSearch support across the detection pipeline:

- EOL provider: add ProductMapping for amazon-opensearch, version
  normalization (strip OpenSearch_ prefix, truncate to major.minor),
  and fix convertCycle to correctly handle two-tier lifecycle where
  eol = end of standard support and extendedSupport = real EOL
- Wiz inventory source: CSV parsing for OpenSearch domains with
  nativeType filtering (domains only, not snapshots/policies),
  version prefix stripping, and tag-based service attribution
- Detector: follows Aurora/EKS pattern for inventory fetch, EOL
  check, and policy evaluation
- Server wiring: WIZ_OPENSEARCH_REPORT_ID config, inventory source,
  EOL provider, and detector registration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@revied revied requested a review from bakayolo as a code owner April 13, 2026 17:18
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 70.80745% with 47 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/inventory/wiz/opensearch.go 60.00% 29 Missing and 9 partials ⚠️
pkg/detector/opensearch/detector.go 84.00% 5 Missing and 3 partials ⚠️
pkg/eol/mock/provider.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
pkg/eol/endoflife/provider.go 90.00% <100.00%> (ø)
pkg/eol/mock/provider.go 0.00% <0.00%> (ø)
pkg/detector/opensearch/detector.go 84.00% <84.00%> (ø)
pkg/inventory/wiz/opensearch.go 60.00% <60.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Follows the Aurora/EKS pattern with full-flow tests covering all
status classifications (RED, YELLOW, GREEN) and summary statistics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
}

// parseOpenSearchRow parses a single CSV row into a Resource
func (s *OpenSearchInventorySource) parseOpenSearchRow(ctx context.Context, row []string) (*types.Resource, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you turn this into leveraging the parseWizReport( helper ?

@Kiran01bm
Copy link
Copy Markdown
Contributor

also worth updating the Supported Resources section of the README

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.

2 participants