Skip to content

Adding var_groups spec#1059

Merged
teresaromero merged 9 commits intomainfrom
var_groups
Feb 4, 2026
Merged

Adding var_groups spec#1059
teresaromero merged 9 commits intomainfrom
var_groups

Conversation

@seanrathier
Copy link
Copy Markdown
Contributor

@seanrathier seanrathier commented Jan 14, 2026

What does this PR do?

Add a new var_groups field to the package manifest schema that:

  • Defines mutually exclusive groups of variables
  • Controls variable visibility based on the selected option
  • Stores the selection in the policy for backend processing
  • Uses additionalProperties: true on options to allow feature-specific extensions

Why is it important?

Current Limitation

Fleet's generic UI renders all integration variables in a flat list, regardless of authentication method or configuration context. Users see fields that don't apply to their chosen setup (e.g., showing access_key_id when using Assume Role authentication), creating confusion and a poor user experience.

Specific Use Cases

  1. Cloud Connector Integration: The Cloud Connector feature (for agentless AWS/GCP/Azure data collection) is currently only available in CSPM and Cloud Asset Inventory, which use custom UIs. Scaling this to other integrations (AWS GuardDuty, Security Hub, etc.) requires a manifest-driven approach.
  2. Authentication Method Selection: AWS integrations support 5+ authentication methods (Direct Keys, Temporary Keys, Assume Role, Shared Credentials, Cloud Connector), each with different required variables.
  3. Generic Conditional Groups: Other use cases exist beyond authentication, such as selecting compression methods where each method has different configuration options.

Checklist

Related issues

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new var_groups schema to the package manifest specification, enabling conditional variable groups that control which authentication variables are visible based on user selection. This addresses the limitation where Fleet's generic UI currently displays all integration variables in a flat list regardless of their context.

Changes:

  • Introduces var_groups field with mutually exclusive options for organizing related variables
  • Adds validation rules to ensure var_groups reference valid variables and maintain naming uniqueness
  • Supports deployment mode filtering and input-level option hiding for advanced use cases

Reviewed changes

Copilot reviewed 30 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/integration/manifest.spec.yml Adds var_groups schema definition with options, deployment mode filtering, and hide_in_var_group_options for inputs
spec/integration/data_stream/manifest.spec.yml Adds var_groups support at stream level with version patch to remove from pre-3.6.0
spec/changelog.yml Documents the var_groups enhancement for Cloud Connector integration
code/go/internal/validator/spec.go Registers ValidateVarGroups semantic validation rule for format_version >= 3.6.0
code/go/internal/validator/semantic/validate_var_groups.go Implements validation logic for var_groups including duplicate detection and required field checking
code/go/internal/validator/semantic/validate_var_groups_test.go Adds comprehensive test coverage for var_groups validation scenarios
code/go/pkg/validator/validator_test.go Registers test packages for good and bad var_groups validation cases
test/packages/good_var_groups/* Complete test package demonstrating valid var_groups usage with Cloud Connector extensions
test/packages/bad_var_groups_/ Test packages for invalid scenarios (missing vars, duplicate names, required conflicts)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/packages/good_var_groups/manifest.yml Outdated
Comment thread test/packages/good_var_groups/data_stream/findings/manifest.yml Outdated
Comment thread code/go/internal/validator/semantic/validate_var_groups.go Outdated
Comment thread code/go/internal/validator/semantic/validate_var_groups.go
teresaromero
teresaromero previously approved these changes Jan 22, 2026
Copy link
Copy Markdown
Contributor

@teresaromero teresaromero left a comment

Choose a reason for hiding this comment

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

LGTM, please update branch with conflicts

seanrathier and others added 6 commits January 22, 2026 09:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seanrathier
Copy link
Copy Markdown
Contributor Author

/test

teresaromero
teresaromero previously approved these changes Jan 23, 2026
Comment thread spec/changelog.yml

// ValidateVarGroups validates var_groups definitions in manifests.
// It checks that:
// - vars referenced in options[].vars exist in the manifest vars array
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.

👍

mrodm
mrodm previously approved these changes Jan 26, 2026
teresaromero
teresaromero previously approved these changes Jan 26, 2026
@zmoog
Copy link
Copy Markdown
Contributor

zmoog commented Feb 2, 2026

The Azure Logs integration is adding new authentication options (connection string, client credentials, workload identity, and managed identity, etc) so this will be really handy!

@seanrathier
Copy link
Copy Markdown
Contributor Author

@zmoog
This is the merged PR that add the VarGroup rendering

@zmoog
Copy link
Copy Markdown
Contributor

zmoog commented Feb 2, 2026

This is the merged PR that add the VarGroup rendering

Looking forward to the 9.4 release! 🚀

@teresaromero
Copy link
Copy Markdown
Contributor

@seanrathier could you resolve changelog conflicts? thanks!

@seanrathier seanrathier dismissed stale reviews from teresaromero and mrodm via c57ae74 February 4, 2026 15:40
@seanrathier
Copy link
Copy Markdown
Contributor Author

@teresaromero merged conflicts. Thanks for the heads up.

Are we merging the package spec 3.6.0 soon?

@teresaromero teresaromero enabled auto-merge (squash) February 4, 2026 15:49
@teresaromero teresaromero merged commit 175284a into main Feb 4, 2026
3 checks passed
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @seanrathier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Change Proposal] Add var_groups to support Cloud Connector integration with Fleet

6 participants