Skip to content

feat(core): Improve policy matching for hostnames#2640

Merged
AryanBakliwal merged 1 commit into
kubearmor:mainfrom
AryanBakliwal:improve-policy-matching
Jun 9, 2026
Merged

feat(core): Improve policy matching for hostnames#2640
AryanBakliwal merged 1 commit into
kubearmor:mainfrom
AryanBakliwal:improve-policy-matching

Conversation

@AryanBakliwal

Copy link
Copy Markdown
Member

Purpose of PR?:

  1. Add regex based policy matching for hostname label. For example, kubearmor.io/hostnamereg=node-* matches for nodes with label kubearmor.io/hostname=node-1 and kubearmor.io/hostname=node-2. Similarly for kubernetes.io/hostnamereg= for k8s env.
  2. Adds matching comma-separated list of hostnames. For example, kubernetes.io/hostname=node-1,node-2 matches nodes with label kubernetes.io/hostname=node-1 and kubernetes.io/hostname=node-2, and kubernetes.io/hostname= "*" matches for all nodes. Similarly, kubearmor.io/hostname= for unorchestrated env.

Fixes #

Does this PR introduce a breaking change?
No

If the changes in this PR are manually verified, list down the scenarios covered:

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Bug fix. Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

Comment thread KubeArmor/common/common.go Fixed
Comment thread KubeArmor/common/common.go Fixed
@AryanBakliwal AryanBakliwal force-pushed the improve-policy-matching branch from fac942d to c56862f Compare June 1, 2026 09:49
@Aryan-sharma11

Copy link
Copy Markdown
Member

LGTM.

@achrefbensaad achrefbensaad force-pushed the improve-policy-matching branch from c56862f to ce0a543 Compare June 8, 2026 13:05

@achrefbensaad achrefbensaad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, tested on multinode setup as well

@Aryan-sharma11 Aryan-sharma11 force-pushed the improve-policy-matching branch from ce0a543 to 70f3439 Compare June 9, 2026 03:38
@AryanBakliwal AryanBakliwal merged commit a59d541 into kubearmor:main Jun 9, 2026
20 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.

5 participants