Skip to content

Commit e20c19b

Browse files
Mikaayensongithub-actions[bot]
authored andcommitted
Resolve backport checks on 2470 by checking Version min_stack (#2519)
(cherry picked from commit e6ba005)
1 parent 4baa8d4 commit e20c19b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

detection_rules/integrations.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from . import ecs
2222
from .beats import flatten_ecs_schema
23+
from .misc import load_current_package_version
2324
from .semver import Version
2425
from .utils import cached, get_etc_path, read_gzip, unzip
2526

@@ -251,9 +252,16 @@ def get_integration_schema_data(data, meta, package_integrations: dict) -> Gener
251252
package = pk_int["package"]
252253
integration = pk_int["integration"]
253254

255+
# Use the minimum stack version from the package not the rule
256+
min_stack = meta.min_stack_version or load_current_package_version()
257+
258+
# Prior to 8.3, some rules had a min_stack_version with only major.minor
259+
if Version(min_stack) != 3:
260+
min_stack = Version(Version(load_current_package_version()) + (0,))
261+
254262
package_version, notice = find_latest_compatible_version(package=package,
255263
integration=integration,
256-
rule_stack_version=meta.min_stack_version,
264+
rule_stack_version=min_stack,
257265
packages_manifest=packages_manifest)
258266

259267
if notify_update_available and notice and data.get("notify", False):

0 commit comments

Comments
 (0)