Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions main/rule_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ def process_yara_rules(yara_rule_repo_sets, YARA_FORGE_CONFIG):
# Add license URL
modify_meta_data_value(rule['metadata'], 'license_url', repo['license_url'])

# Make sure that the score, the quality and the importance are positive integers
for meta_data in rule['metadata']:
for key, value in meta_data.items():
if key in ['score', 'quality', 'importance']:
# If the value is not an integer, we set it to 0
if not isinstance(value, int):
value = 0
# If the value is negative, we set it to 0
if value < 0:
value = 0
# Set the value back to the meta data
meta_data[key] = value

# Sort the meta data values
rule['metadata'] = sort_meta_data_values(rule['metadata'], YARA_FORGE_CONFIG)

Expand Down
6 changes: 3 additions & 3 deletions yara-forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# YARA Forge
# A YARA Rule Concentrator
# Florian Roth
# August 2024
# June 2025

__version__ = '0.9.0'
__version__ = '0.9.1'

import argparse
#import pprint
Expand Down Expand Up @@ -41,7 +41,7 @@ def write_section_header(title, divider_with=72):
print(r' Bringing Order to Chaos ')
print(r' ')
print(r' Version %s ' % __version__)
print(r' Florian Roth, January 2024 ')
print(r' Florian Roth, June 2025 ')

parser = argparse.ArgumentParser()
parser.add_argument("--debug", help="enable debug output", action="store_true")
Expand Down