Skip to content

feat: add OpenSearch resource type#9

Merged
bakayolo merged 4 commits intoblock:mainfrom
revied:feature/opensearch-resource-type
Apr 17, 2026
Merged

feat: add OpenSearch resource type#9
bakayolo merged 4 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

@revied revied requested a review from bakayolo as a code owner April 13, 2026 17:18
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 53.44828% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/inventory/wiz/generic.go 4.54% 19 Missing and 2 partials ⚠️
pkg/inventory/wiz/helpers.go 85.71% 2 Missing and 3 partials ⚠️
pkg/workflow/orchestrator/workflow.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
pkg/eol/endoflife/provider.go 85.46% <ø> (ø)
pkg/workflow/orchestrator/workflow.go 0.00% <0.00%> (ø)
pkg/inventory/wiz/helpers.go 80.71% <85.71%> (ø)
pkg/inventory/wiz/generic.go 72.18% <4.54%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/inventory/wiz/opensearch.go Outdated
@Kiran01bm
Copy link
Copy Markdown
Contributor

also worth updating the Supported Resources section of the README

@revied revied force-pushed the feature/opensearch-resource-type branch from 8f11445 to 60b96bb Compare April 15, 2026 13:51
@revied
Copy link
Copy Markdown
Contributor Author

revied commented Apr 15, 2026

Done — updated the Supported Resources section in README.md (ElastiCache and OpenSearch moved from "Easily extensible to" into "Currently implemented"). Also updated ARCHITECTURE.md to mark both as ✅ and added opensearch.go, helpers.go, and the opensearch detector to the repo structure diagram.

Kiran01bm
Kiran01bm previously approved these changes Apr 15, 2026
@revied revied force-pushed the feature/opensearch-resource-type branch 2 times, most recently from 611d7fc to 6efe234 Compare April 16, 2026 12:32
- Add opensearch entry to config/resources.yaml with pipe-delimited
  native_type_pattern for both flat and DB_SERVER Wiz report schemas
- Add pipe-delimited pattern matching in matchesNativeTypePattern
- Add column alias system in helpers.go for cross-schema compatibility
  (DB_SERVER.externalId → externalId, subscriptionExternalId → cloudAccount.externalId, etc.)
- Add OpenSearch version normalization (strip OpenSearch_/Elasticsearch_ prefixes)
- Add legacy Elasticsearch detection (versions 5.x/6.x/7.x → elasticsearch engine)
- Add opensearch and elasticsearch to EOL ProductMapping
- Add opensearch to orchestrator default resource types
- Add observability logging in parseWizReport (row counts, filter stats)
- Update README.md and ARCHITECTURE.md to reflect production-tested status

Amp-Thread-ID: https://ampcode.com/threads/T-019d98f0-cc82-75bf-b664-e3a63eef6ee9
Co-authored-by: Amp <amp@ampcode.com>
@bakayolo bakayolo force-pushed the feature/opensearch-resource-type branch from 782d6a9 to 144183c Compare April 17, 2026 00:59
bakayolo and others added 2 commits April 16, 2026 18:15
- Map cloudAccount.externalId alias to cloudPlatform (DB_SERVER schema)
- Make accountID non-required (graceful fallback for schemas without it)

Tested: 290 OpenSearch findings processed successfully from DB_SERVER schema report.
Amp-Thread-ID: https://ampcode.com/threads/T-019d98f0-cc82-75bf-b664-e3a63eef6ee9
Co-authored-by: Amp <amp@ampcode.com>
bakayolo
bakayolo previously approved these changes Apr 17, 2026
@bakayolo bakayolo merged commit 57c4f44 into block:main Apr 17, 2026
8 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.

3 participants