Skip to content

Improve mlflow detection#1455

Open
AlyaGomaa wants to merge 461 commits intodevelopfrom
improve-mlflow-detection
Open

Improve mlflow detection#1455
AlyaGomaa wants to merge 461 commits intodevelopfrom
improve-mlflow-detection

Conversation

@AlyaGomaa
Copy link
Copy Markdown
Collaborator

No description provided.

@jsvobo jsvobo added Machine Learning Needs knowledge of Machine Learning Better Detection Tasks for making better detections of threats labels Sep 2, 2025
Copy link
Copy Markdown

@JiwaniZakir JiwaniZakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In init_log_file(), the file handle self.log_file is opened with open(self.log_path, "w") but there's no visible close() call — this is a resource leak. Since FlowMLDetection is a long-running module, this should use a context manager or at minimum close the handle in the module's shutdown() or __del__ method.

There's also a latent AttributeError bug: if self.mode is neither "train" nor "test" (e.g., a misconfiguration), init_log_file falls through without setting self.log_file, yet write_to_log only guards on self.enable_logs — so any call to write_to_log in that scenario will raise AttributeError: 'FlowMLDetection' object has no attribute 'log_file'. Adding an else branch or initializing self.log_file = None with a corresponding guard in write_to_log would make this robust.

The default mode in config/slips.yaml was silently flipped from test to train — this is a potentially disruptive change for existing deployments where users expect detection behavior out of the box, not model training. This warrants a prominent note in the changelog or at minimum a comment in the config explaining why train is now the default.

The added flowmlanalysis.ipynb notebook contains two completely empty code cells after the imports, suggesting it was committed prematurely; it adds repository noise without contributing anything functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Better Detection Tasks for making better detections of threats Machine Learning Needs knowledge of Machine Learning

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants