feat: map IOC scores to Sigma-aligned log levels#11
Merged
Neo23x0 merged 5 commits intoNextron-Labs:masterfrom Mar 27, 2026
Merged
feat: map IOC scores to Sigma-aligned log levels#11Neo23x0 merged 5 commits intoNextron-Labs:masterfrom
Neo23x0 merged 5 commits intoNextron-Labs:masterfrom
Conversation
added 5 commits
March 25, 2026 20:37
- Parse optional ;SCORE suffix in C2 IOC files (e.g. 176.123.5.126;65)
- Introduce unified scoreToLevel() mapping IOC scores (0-100) onto
Sigma severity levels: info/low/medium/high/critical
- Emit ioc_level and ioc_score fields in all IOC match log entries
(both filename and C2) for consistent downstream filtering
- C2 entries without explicit score default to 80 (high), preserving
previous behaviour where all C2 matches logged at error level
- Score-to-level mapping:
0-39 → info (log.Info)
40-59 → low (log.Info)
60-74 → medium (log.Warn)
75-89 → high (log.Error)
90-100 → critical (log.Error)
- Add comprehensive tests for C2 score parsing, level mapping,
and ioc_level field presence in output
- Reject C2 indicators with invalid FQDN characters (specific hint for ':' typo) - Test colon-vs-semicolon, whitespace, underscores, empty indicators - Test three-field filename IOC format (REGEX;SCORE;FP_REGEX) - Test malformed filename IOCs (missing score, bad regex, invalid FP regex) - Add integration tests validating all production IOCs load correctly - Verified: 1,773 C2 IOCs + 3,732 filename IOCs load with zero rejects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Map IOC scores (0–100) to Sigma-aligned log levels for both filename and C2 IOCs, so downstream consumers (SIEM, dashboards) can filter IOC matches the same way they filter Sigma alerts.
Score-to-Level Mapping
Changes
C2 IOCs (
c2.go);SCOREsuffix (e.g.,evil.com;65)[a-zA-Z0-9.-]):is used instead of;(common typo)ioc_scoreandioc_levelfields in match logsUnified
scoreToLevel()(iocconsumer.go)log.Leveland human-readable level namelogLevelForFilenameScore()(kept as backwards-compat wrapper)Example Log Output
{ "ioc_type": "c2", "ioc_field": "DestinationIp", "ioc_value": "176.123.5.126", "ioc_indicator": "176.123.5.126", "ioc_score": 65, "ioc_level": "medium", "level": "warning", "message": "IOC match" }Tests
TestC2IOCWithScoreParsing— scored + unscored C2 entries, correct level mappingTestLoadC2IOCsWithScores— score parsing at load timeTestLoadC2IOCsRejectsMalformedEntries— colon typo, whitespace, underscores, empty indicator, non-numeric scoreTestLoadFilenameIOCsThreeFieldFormat— REGEX;SCORE;FP_REGEX format with FP exclusion validationTestLoadFilenameIOCsRejectsMalformedEntries— missing score, invalid regex, bad FP regexTestScoreToLevel— boundary tests for all level transitionsTestFilenameIOCLevelField—ioc_levelemitted at all 5 severity tiersTestValidateRealC2IOCs/TestValidateRealFilenameIOCs— integration tests against production IOC filesProduction IOC Validation
Tested against
/opt/aurora-linux/resources/iocs/:Backwards Compatibility
errorlevel (same as before)logLevelForFilenameScore()preserved as wrapper for any external callers