Skip to content
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

Adjusted logging around signature database pre-compilation #249

Merged
merged 1 commit into from
May 15, 2024
Merged
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
8 changes: 7 additions & 1 deletion wordfence/cli/malwarescan/malwarescan.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ def _get_pre_compiled_signatures(
def fetch_pre_compiled() -> Optional[PrecompiledSignatureSet]:
client = self.context.get_noc1_client()
try:
return client.get_precompiled_malware_signatures(
pre_compiled = client.get_precompiled_malware_signatures(
Platform.detect(),
vectorscan.API_VERSION
)
if pre_compiled is None:
log.warning(
'No compatible pre-compiled signature set was '
'found. Signatures will be compiled locally.'
)
return pre_compiled
except UnknownPlatform:
log.warning(
'Unable to determine current platform, pre-compiled '
Expand Down
7 changes: 4 additions & 3 deletions wordfence/scanning/matching/vectorscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def compile(self, signature_set: SignatureSet) -> bytes:
for signature in signature_set.signatures.values()
}
pattern_count = len(patterns)
log.debug(
log.info(
f'Compiling {pattern_count} pattern(s) '
'to vectorscan database...'
'to vectorscan database (this may take a substantial '
'amount of time depending on system performance)...'
)
flags = (
VectorscanFlags.CASELESS |
Expand All @@ -89,7 +90,7 @@ def compile(self, signature_set: SignatureSet) -> bytes:
flags=flags,
platform_info=platform_info
)
log.debug('Successfully compiled vectorscan database')
log.info('Successfully compiled vectorscan database')
return database

def compile_serializable(self, signature_set: SignatureSet) -> bytes:
Expand Down
Loading