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

Splunk: Fix MAC address to display in proper STIX format #1386

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
corrected the spelling
corrected the maclength variable spelling.
thangaraj-ramesh committed Mar 15, 2023

Verified

This commit was signed with the committer’s verified signature.
folke Folke Lemaitre
commit 859ddffee9f44a490fe3742d85a958d417a8cf19
6 changes: 3 additions & 3 deletions stix_shifter_modules/splunk/stix_translation/transformers.py
Original file line number Diff line number Diff line change
@@ -56,9 +56,9 @@ def transform(macvalue):
"""correcting mac address presentation, it should be 6 octate separated
by only colon (:) not by any other special character """
macvalue = re.sub("[^A-Za-z0-9]", "", macvalue)
delliott90 marked this conversation as resolved.
Show resolved Hide resolved
maclenth = len(macvalue)
if (maclenth<12):
for i in range(maclenth, 12):
maclength = len(macvalue)
if (maclength<12):
for i in range(maclength, 12):
macvalue = "0" + macvalue

value = ':'.join([macvalue[i:i + 2] for i in range(0, len(macvalue), 2)])