Skip to content

Change asset type to security_rule #1054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 19, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion detection_rules/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,14 @@ def _generate_registry_package(self, save_dir):

package_dir = Path(save_dir).joinpath(manifest.version)
docs_dir = package_dir / 'docs'
rules_dir = package_dir / 'kibana' / 'security-rule'
rules_dir = package_dir / 'kibana' / 'security_rule'

docs_dir.mkdir(parents=True)
rules_dir.mkdir(parents=True)

manifest_file = package_dir.joinpath('manifest.yml')
readme_file = docs_dir.joinpath('README.md')
notice_file = package_dir.joinpath('NOTICE.txt')

manifest_file.write_text(yaml.safe_dump(manifest.asdict()))
# shutil.copyfile(CHANGELOG_FILE, str(rules_dir.joinpath('CHANGELOG.json')))
Expand All @@ -503,6 +504,7 @@ def _generate_registry_package(self, save_dir):
'for the detection engine within the Elastic Security application.\n\n')

readme_file.write_text(readme_text)
notice_file.write_text(Path(NOTICE_FILE).read_text())

def bump_versions(self, save_changes=False, current_versions=None):
"""Bump the versions of all production rules included in a release and optionally save changes."""
Expand Down