8000 Playbook: Email Address Enrichment - Generic by JonathanMeler · Pull Request #1173 · demisto/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Playbook: Email Address Enrichment - Generic #1173

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

Merged
merged 23 commits into from
Jan 23, 2018

Conversation

JonathanMeler
Copy link
Contributor
@JonathanMeler JonathanMeler commented Jan 18, 2018
  • GetStringDistance
  • EmailDomainSquattingReputation

email_address_enrichment_-_generic_thu_jan_18_2018

fixes https://github.com/demisto/etc/issues/10313

- GetStringDistance
- EmailDomainSquattingReputation
@JonathanMeler JonathanMeler requested a review from liorkol January 18, 2018 13:04
@asafshen
Copy link
Contributor

@JonathanMeler
we have made some changes in playbook structure - please download the playbook again from an updated demisto env (demo2 for example)

@JonathanMeler
Copy link
Contributor Author

Test demo run: https://demo2.demisto.com/#/WorkPlan/37812

var domains = argToList(args.domain);
var threshold = parseInt(args.threshold);

var emailParts = email.split('@',2);
Copy link
Contributor

Choose a reason for hiding this comment

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

We use python convention. emailParts => email_parts

Copy link
Contributor

Choose a reason for hiding this comment

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

change in all scripts

if (emailParts.length < 2){
return { ContentsFormat: formats.text, Type: entryTypes.error, Contents: email.toString() + " - is not a valid email address" };
}
var emailObj = {Username: emailParts[0],
Copy link
Contributor

Choose a reason for hiding this comment

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

indent and format json objects properly

var emailParts = email.split('@',2);

if (emailParts.length < 2){
return { ContentsFormat: formats.text, Type: entryTypes.error, Contents: email.toString() + " - is not a valid email address" };
Copy link
Contributor

Choose a reason for hiding this comment

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

indent and format json objects properly


if(suspicious && suspicious.length > 0){
//add dbot score, suspicious
ec.DBotScore = {Indicator: email, Type: 'email', Vendor: 'DomainSquatting', Score: 2};
Copy link
Contributor

Choose a reason for hiding this comment

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

format json

};

domains.forEach(function(domain){
var resp = executeCommand("GetStringsDistance", {inputString: emailObj.Domain, compareString: domain});
Copy link
Contributor

Choose a reason for hiding this comment

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

format and indent object

'ReadableContentsFormat' : formats['markdown']})

else:
res.append({'Type': entryTypes['error'], 'ContentsFormat': formats['text'], 'Contents': 'Unable to extract inputString - ' + inputString})
Copy link
Contributor

Choose a reason for hiding this comment

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

format

'LevenshteinDistance' : levenshteinDistance,
'TooClose' : levenshteinDistance > 0 and levenshteinDistance < closeDistanceInt
})
res.append({'Type' : entryTypes['note'],
Copy link
Contributor

Choose a reason for hiding this comment

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

format

distances = []
for curString in compareString:
levenshteinDistance = levenshtein(curString, inputString)
distances.append({'StringA' : inputString,
Copy link
Contributor

Choose a reason for hiding this comment

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

format

}
}
demisto.results({ "Type" : entryTypes["note"],
"ContentsFormat" : formats["json"],
Copy link
Contributor

Choose a reason for hiding this comment

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

format

@@ -0,0 +1,214 @@
id: test_-_email_address_enrichment_-_generic
name: Test - Email Address Enrichment - Generic
Copy link
Contributor

Choose a reason for hiding this comment

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

change the name to be Email Address Enrichment - Generic - Test

@JonathanMeler JonathanMeler merged commit d91b8a3 into master Jan 23, 2018
@dorsha dorsha deleted the playbook-email-address-enrichment branch January 26, 2018 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0