Abstract
In the evolving landscape of cybersecurity, a significant gap persists between manual malware analysis and automated machine learning (ML) detection systems. While malware analysts produce high-quality YARA rules to identify specific threats, these rules are often too narrow for direct integration into broad-scale ML models. This paper presents HaYaMa (Harvesting Yara rule for Malware), a framework designed to "live off the analyst" by decomposing manual signatures into granular sub-signatures. By applying Lasso-based feature selection and non-linear modeling, we demonstrate that these human-derived features provide a 1.8% relative improvement in detection at a 0.01% false-positive rate, effectively automating the scaling of expert intuition.
Introduction
Production-grade anti-virus (AV) systems rely heavily on static features—characteristics of a file accessible without execution—due to their computational efficiency. However, the rapid evolution of malware necessitates a constant influx of new features. Currently, this burden falls on malware analysts who write YARA rules: manual descriptors used to identify specific families or malicious behaviors.
The challenge lies in the specificity of these rules. A single YARA rule might only trigger on a handful of files within a million-sample dataset, making it a poor feature for a generalized machine learning model. HaYaMa addresses this by breaking these complex signatures into smaller, more frequent "sub-signatures," turning manual labor into automated model enhancements.
The HaYaMa Framework
The HaYaMa approach involves a multi-stage pipeline to transform expert knowledge into machine-readable signals:
- Sub-signature Extraction: Rather than treating a YARA rule as a monolithic boolean, the framework extracts individual components, such as specific file paths, registry keys, or function names. The researchers harvested nearly 20,000 such sub-signatures from 22 public repositories, including sources like FireEye and AlienVault.
- Feature Selection via Lasso: To manage the high dimensionality of the resulting feature space, the authors utilized Lasso (L1-regularized) logistic regression. This process mathematically prunes non-predictive features, identifying the most potent sub-signatures for classification.
- Model Integration: The framework explores three integration strategies:
- Independent: Selecting YARA features in isolation.
- Conditional: Selecting features based on the existing model's predictions.
- Stacked: Combining YARA features with standard features (e.g., the EMBER dataset) into a single vector for holistic selection.
- Non-linear Classification: Final classification is performed using XGBoost, a gradient-boosted decision tree ensemble capable of capturing the complex, conditional logic inherent in human-written rules.
Experimental Results
The framework was evaluated using the EMBER 2018 benchmark dataset, consisting of 800,000 Windows Portable Executable (PE) files.
Detection Performance
Integrating YARA-derived features into the baseline EMBER model yielded a 1.8% relative improvement at a 0.01% False Positive Rate (FPR). In production environments, where false positives can disrupt critical business software, improvements at this ultra-low FPR threshold are highly significant. Notably, a model using only YARA sub-signatures achieved approximately 95% accuracy, highlighting the high information density of analyst-written strings.
Feature Efficiency
The study found that the model's accuracy plateaus at approximately 300 YARA features. This suggests that defenders do not need to maintain thousands of active signatures to see a benefit; a small, curated subset of sub-signatures captures the majority of the predictive value.
Discussion and Insights
Reconstructing Analyst Logic
The superiority of tree-based models (XGBoost) over linear models suggests that the ML system is effectively "re-learning" the conditional logic originally intended by the analyst. However, by breaking the rules into sub-signatures, the model can apply fragments of that logic to new, unseen malware variants that might not trigger the original, full YARA rule.
Complementary Information
Statistical analysis revealed that 30% of the information captured by YARA sub-signatures was entirely novel and could not be reconstructed from existing EMBER features. This confirms that human analysts identify patterns—often behavioral or intent-based—that standard automated feature extraction methods overlook.
Power-Law Distribution
Sub-signatures follow a power-law distribution. Some act as "Kilo-Grams" (highly specific identifiers for a single family), while others are "dual-purpose" strings (such as VM detection routines). While dual-purpose strings appear in both benign and malicious contexts, they provide critical context that helps the model differentiate between sophisticated legitimate software and malware.
Conclusion
HaYaMa demonstrates a viable path for "living off the analyst," bridging the gap between manual signature writing and automated detection. By decomposing YARA rules, defenders can extract significant latent value from existing workflows, improving detection rates at the low false-positive thresholds required for modern AV systems. Future work will explore the framework's applicability to non-PE file types and its robustness against adversarial attempts to poison sub-signature features.
Summary updated