Skip to content

Commit

Permalink
Add explicit caps
Browse files Browse the repository at this point in the history
  • Loading branch information
traut committed Feb 7, 2025
1 parent 82a05d1 commit 919dd33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions detection_rules/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
# The base package version that we will start to include all versions of historical rules
BASE_PKG_VERSION = Version(major=8, minor=17, patch=0)

MAX_VERSIONS_NEW_STACK = 3
MAX_VERSIONS_OLD_STACK = 1


def get_github_token() -> Optional[str]:
"""Get the current user's GitHub token."""
Expand Down Expand Up @@ -131,14 +134,14 @@ def build_release(ctx: click.Context, config_file, update_version_lock: bool, ge
# Version 8.17.0-beta.1 is considered lower than 8.17.0
current_pkg_version_no_prerelease = Version(major=current_pkg_version.major,
minor=current_pkg_version.minor, patch=current_pkg_version.patch)


click.echo(f'[+] Limit historical rule versions in our release package for version {current_pkg_version_no_prerelease}')
if current_pkg_version_no_prerelease >= BASE_PKG_VERSION:
click.echo(f'[+] Adding all historical rule versions in our release package for version \
{current_pkg_version_no_prerelease}')
limited_historical_rules = historical_rules
limited_historical_rules = sde.keep_latest_versions(historical_rules, num_versions=MAX_VERSIONS_NEW_STACK)
else:
click.echo(f'[+] Limit historical rule versions in our release package for version \
{current_pkg_version_no_prerelease}')
limited_historical_rules = sde.keep_latest_versions(historical_rules)
limited_historical_rules = sde.keep_latest_versions(historical_rules, num_versions=MAX_VERSIONS_OLD_STACK)

package.add_historical_rules(limited_historical_rules, registry_data['version'])
click.echo(f'[+] Adding historical rules from {previous_pkg_version} package')

Expand Down
2 changes: 1 addition & 1 deletion detection_rules/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from .schemas import definitions

MANIFEST_FILE_PATH = get_etc_path('integration-manifests.json.gz')
NUM_LATEST_RULE_VERSIONS = 3
NUM_LATEST_RULE_VERSIONS = 1
SCHEMA_FILE_PATH = get_etc_path('integration-schemas.json.gz')
_notified_integrations = set()

Expand Down

0 comments on commit 919dd33

Please sign in to comment.