iDefense Deprecated

Deprecated. Use the iDefense v2 integration instead.

Data Enrichment & Threat Intelligence · Accenture CTI (Deprecated)

Details

IDiDefense
ProviderAccenture
CategoryData Enrichment & Threat Intelligence
From Version5.0.0
Supported ModulesAgentix

README

Use the iDefense integration to manage cyber threats and security issues in the iDefense security platform.

Configure iDefense on Cortex XSOAR

  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for iDefense.
  3. Click Add instance to create and configure a new integration instance.
    • Name: a textual name for the integration instance.
    • URL
    • API Token
    • Trust any certificate (not secure)
    • Use system proxy settings
  4. Click Test to validate the URLs, token, and connection.

Commands

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

  1. Check IP address: ip
  2. Check a domain: domain
  3. Check a URL: url
  4. Get threats from the iDefense database: idefence-general
  5. Get the reputation of an indicator: uuid

1. Check an IP address


Checks the reputation of an IP address.

Base Command

ip

Input
Argument Name Description Required
ip The IP address to check. Required

 

Context Output
Path Type Description
IP.Address unknown The address of the bad IP.
IP.Malicious.Vendor unknown For malicious IPs, the name of the vendor that made the decision.
IP.Malicious.Description unknown For malicious IPs, the reason that the vendor to made the decision.
DBotScore.Indicator unknown The indicator that was tested.
DBotScore.Type unknown The type of indicator.
DBotScore.Vendor unknown The vendor used to calculate the score.
DBotScore.Score unknown The actual score.

 

Command Example
  !ip ip=256.256.256.256 using=iDefense_instance_1
Context Example
{
    "IP": [
        {
            "Malicious": {
                "Vendor": "iDefense",
                "Description": "last seen as MALWARE_C2"
            },
            "Address": "256.256.256.256"
        }
    ],
    "DBotScore": [
        {
            "Vendor": "iDefense",
            "Indicator": "256.256.256.256",
            "Score": 2,
            "Type": "ip"
        }
    ]
}
Human Readable Output

iDefense IP Reputation

Dbot Reputation Name Threat Types confidence
Suspicious 256.256.256.256 Cyber Espionage 50

 

2. Check a domain


Checks the reputation of a domain.

Base Command

domain

Input
Argument Name Description Required
domain The name of the domain to check. Required

 

Context Output
Path Type Description
Domain.Name unknown The name of the bad domain.
Domain.Malicious.Vendor unknown For malicious domains, the name of the vendor that made the decision.
Domain.Malicious.Description unknown For malicious domains, the reason that the vendor made the decision.
DBotScore.Indicator unknown The indicator that was tested.
DBotScore.Type unknown The type of the indicator.
DBotScore.Vendor unknown The vendor used to calculate the score.
DBotScore.Score unknown The actual score.

 

Command Example
!domain domain=example.com using=iDefense_instance_1
Context Example
{
    "Domain": [
        {
            "Malicious": {
                "Vendor": "iDefense",
                "Description": "last seen as MALWARE_DOWNLOAD"
            },
            "Name": "example.com"
        }
    ],
    "DBotScore": [
        {
            "Vendor": "iDefense",
            "Indicator": "example.com",
            "Score": 2,
            "Type": "domain"
        }
    ]
}
Human Readable Output

iDefense Domain Reputation

Dbot Reputation Name Threat Types confidence
Suspicious example.com Cyber Espionage  

 

3. Check a URL 


Checks the reputation of a URL.

Base Command

url

Input
Argument Name Description Required
url The name of the URL to check (must start with http://). Required

 

Context Output
Path Type Description
URL.Data unknown The name of the bad URL.
URL.Malicious.Vendor unknown For malicious URLs, the vendor that made the decision.
URL.Malicious.Description unknown For malicious URLs, the reason that the vendor made the decision.
DBotScore.Indicator unknown The indicator that was tested.
DBotScore.Type unknown The type of indicator.
DBotScore.Vendor unknown The vendor used to calculate the score.
DBotScore.Score unknown The actual score.

 

Command Example
  !url url=http://example.com using=iDefense_instance_1
Context Example
{
    "URL": [
        {
            "Malicious": {
                "Vendor": "iDefense",
                "Description": "last seen as MALWARE_C2"
            },
            "Data": "http://example.com"
        }
    ],
    "DBotScore": [
        {
            "Vendor": "iDefense",
            "Indicator": "http://example.com",
            "Score": 2,
            "Type": "url"
        }
    ]
}
Human Readable Output

iDefense URL Reputation

Dbot Reputation Name Threat Types confidence
Suspicious http://example.com Cyber Crime 50

 

4. Get threats from the iDefense database


Returns threat information, such as IP address, URL and domain from the iDefense database. 

Base Command

idefense-general

Input
Argument Name Description Required
max_result The maximum amount of results to return. Optional

 

Context Output
Path Type Description
IP.Address unknown The name of the bad IP Address.
IP.Malicious.Vendor unknown For malicious IPs, the vendor that made the decision.
IP.Malicious.Description unknown For malicious IPs, the reason that the vendor made the decision.
Domain.Name unknown The name of the bad domain.
Domain.Malicious.Vendor unknown For malicious domains, the vendor that made the decision.
Domain.Malicious.Description unknown For malicious domains, the reason that the vendor made the decision.
URL.Data unknown The bad URL found.
URL.Malicious.Vendor unknown For malicious URLs, the vendor that made the decision.
URL.Malicious.Description unknown For malicious URLs, the reason that the vendor made the decision.
DBotScore.Indicator unknown The indicator that was tested.
DBotScore.Type unknown The type of indicator.
DBotScore.Vendor unknown The vendor used to calculate the score.
DBotScore.Score unknown The actual score.

 

Command Example
!idefense-general max_result=1
Context Example
{
    "URL": [
        {
            "Malicious": {
                "Vendor": "iDefense",
                "Description": "last seen as MALWARE_DOWNLOAD"
            },
            "Data": "http://example.com/malicious_file.exe"
        },
        {
            "Vendor": "iDefense",
            "Indicator": "http://example.com/suspicious_file.exe",
            "Score": 2,
            "Type": "url"
        }
    ]
}
Human Readable Output

iDefense Reputations

Dbot Reputation Name Threat Types confidence
Malicious http://example.com/malicious_file.exe Cyber Crime 100
Suspicious http://example.com/suspicious_file.exe Cyber Crime 50

 

5. Get the reputation of an indicator


Returns the reputation of a specific indicator.

Base Command

uuid

Input
Argument Name Description Required
uuid The unique ID of the user. Required

 

Context Output
Path Type Description
IP.Address unknown The name of the bad IP Address.
IP.Malicious.Vendor unknown For malicious IPs, the vendor that made the decision.
IP.Malicious.Description unknown For malicious IPs, the reason that the vendor made the decision.
Domain.Name unknown The name of the bad domain.
Domain.Malicious.Vendor unknown For malicious domains, the vendor that made the decision.
Domain.Malicious.Description unknown For malicious domains, the reason that the vendor made the decision.
URL.Data unknown The name of the bad URL.
URL.Malicious.Vendor unknown For malicious URLs, the vendor that made the decision.
URL.Malicious.Description unknown For malicious URLs, the reason that the vendor made the decision.
DBotScore.Indicator unknown The indicator that was tested.
DBotScore.Type unknown The type of indicator.
DBotScore.Vendor unknown The vendor used to calculate the score.
DBotScore.Score unknown The actual score.

 

Command Example
!uuid uuid=44a7d565-a260-9oc6-b7f4-2368dc3a4a67 using=iDefense_instance_1
Context Example
{
    "Domain": [
        {
            "Malicious": {
                "Vendor": "iDefense",
                "Description": "last seen as MALWARE_C2"
            },
            "Name": "example.com"
        }
    ],
    "DBotScore": [
        {
            "Vendor": "iDefense",
            "Indicator": "example.com",
            "Score": 2,
            "Type": "domain"
        }
    ]
}
Human Readable Output

iDefense Reputations

Dbot Reputation Name Threat Types confidence
Suspicious example.com Cyber Espionage  

 

Configuration parameters

  • url — URL (required)
  • api_token — API Token (required)
  • insecure — Trust any certificate (not secure)
  • useproxy — Use system proxy settings

Commands (5)

  • domain

    Check domain reputation

  • idefense-general

    Get threats from iDefense database. Returns all records of ip/url/domain

  • ip

    Check IP reputation

  • url

    Check URL reputation

  • uuid

    Get specific indicator reputation

// handle '/' at the end of the url
var base_url = params.url.slice(0, params.url.length - params.url.match('/*$')[0].length) + '/rest/';

function sendRequest(method, url_suffix, headers, body) {
    headers = headers || {};
    body = body || {};

    // add default headers
    if (!("Accept" in headers)) {
        headers["Accept"] = ['application/json'];
    }
    if (!("Content-Type" in headers)) {
        headers['Content-Type'] = ['application/json'];
    }
    headers['Auth-Token'] = [params.api_token];

    var res = http(
        base_url + url_suffix,
        {
            Method: method,
            Headers: headers,
            Body: JSON.stringify(body),
        },
        params.insecure,
        params.useproxy
    );

    if (res.StatusCode < 200 || res.StatusCode >= 300) {
        throw 'Request Failed.\nStatus code: ' + res.StatusCode + '.\nBody: ' + JSON.stringify(res) + '.';
    }

    return res.Body.length !== 0 ? JSON.parse(res.Body) : {};
}

function calculate_dbot_score(severity) {
    // Calculate score based on severity
    // Dbot Score   | severity
    //  0           | 0
    //  1           | 1,2
    //  2           | 3,4
    //  3           | 5,6,7
    var dbot_score = 0;
    if (severity > 4) {
        dbot_score = 3;
    } else if (severity > 2) {
        dbot_score = 2;
    } else if (severity > 0) {
        dbot_score = 1;
    } else {
        dbot_score = 0;
    }

    return dbot_score;
}

function get_full_data(cmd_url, query, result_threshold) {
    result_threshold = result_threshold || 300;
    query = query || {};

    var results = [];
    var res;

    query.page = 1;
    do {
        res = sendRequest('GET', cmd_url + encodeToURLQuery(query));
        if (res.total_size === 0) {
            break;
        }
        results = results.concat(res.results);
        ++query.page;
    } while ((res.more) && (results.length < result_threshold));

    return results;
}

function check_threats(type, value, uniq_field, results) {
    if (!results) {
        var cmd_url = 'threatindicator/v0/' + type.toLowerCase();
        var query = {'key.values' : value};
        results = get_full_data(cmd_url, query);

        if (results.length === 0) {
            return {results:[], md : [], context: {}};
        }
    }

    var dbot_context = [];
    var result_context = [];
    var md = [];
    for (var i in results) {
        var r = results[i];
        dbot_score = calculate_dbot_score(r.severity);

        md.push({
            Name : r.key,
            'Dbot Reputation' : scoreToReputation(dbot_score),
            confidence : r.confidence,
            'Threat Types' : r.threat_types
        });

        dbot_context.push({
            Indicator : r.key,
            Type : type.toLowerCase(),
            Vendor : 'iDefense',
            Score : dbot_score
        });

        if (dbot_score >= 2) {
            var r_context = {
                Malicious : {
                    Vendor : 'iDefense',
                    Description : 'last seen as ' + r.last_seen_as
                }
            };
            r_context[uniq_field] = r.key;
            result_context.push(r_context);
        }
    }

    var context_type = type + '(val.' + uniq_field + ' && val.' + uniq_field + ' == obj.' + uniq_field + ')';
    var context = {};
    if (result_context.length > 0) {
        context[context_type] = result_context;
    }

    return {
        results : results,
        md : md,
        context : context,
        scores : dbot_context

    };
}
function sort_threats(results) {
    var domains = [], urls = [], ips = [], others = [];

    for (var i in results) {
        switch (results[i].type) {
        case 'domain':
            domains.push(results[i]);
            break;
        case 'ip':
            ips.push(results[i]);
            break;
        case 'url':
            urls.push(results[i]);
            break;
        default:
            others.push(results[i]);
        }
    }

    var domain_threats = check_threats('Domain', undefined, 'Name', domains),
        ip_threats = check_threats('IP', undefined, 'Address', ips),
        url_threats = check_threats('URL', undefined, 'Data', urls);

    var merged_md = domain_threats.md.concat(ip_threats.md).concat(url_threats.md);
    var merged_scores = domain_threats.scores.concat(ip_threats.scores).concat(url_threats.scores);

    return {
        Type : entryTypes.note,
        Contents : results,
        ContentsFormat : formats.json,
        HumanReadable : tableToMarkdown('iDefense Reputations', merged_md),
        EntryContext : mergeForeignObjects([domain_threats.context, ip_threats.context, url_threats.context, {DBotScore : merged_scores}])
    };

}

function get_threats(max_results) {
    var cmd_url = 'threatindicator/v0/';
    var results = get_full_data(cmd_url, {}, max_results);

    return sort_threats(results);
}

function get_domain(domain) {
    var threats_info = check_threats('Domain', domain, 'Name');
    if (threats_info.results.length === 0) {
        return 'No result was found.';
    }

    return {
        Type : entryTypes.note,
        Contents : threats_info.results,
        ContentsFormat : formats.json,
        HumanReadable : tableToMarkdown('iDefense Domain Reputation', threats_info.md),
        EntryContext : mergeForeignObjects([threats_info.context, {DBotScore : threats_info.scores}])
    };
}

function get_ip(ip) {
    if (!isValidIP(ip)) {
        return {Type: entryTypes.error, Contents: 'IP - ' + ip + ' is not valid IP', ContentsFormat: formats.text};
    }

    var threats_info = check_threats('IP', ip, 'Address');
    if (threats_info.results.length === 0) {
        return 'No result was found.';
    }

    return {
        Type : entryTypes.note,
        Contents : threats_info.results,
        ContentsFormat : formats.json,
        HumanReadable : tableToMarkdown('iDefense IP Reputation', threats_info.md),
        EntryContext : mergeForeignObjects([threats_info.context, {DBotScore : threats_info.scores}])

    };
}

function get_url(url) {
    var threats_info = check_threats('URL', url, 'Data');
    if (threats_info.results.length === 0) {
        return 'No result was found.';
    }

    return {
        Type : entryTypes.note,
        Contents : threats_info.results,
        ContentsFormat : formats.json,
        HumanReadable : tableToMarkdown('iDefense URL Reputation', threats_info.md),
        EntryContext : mergeForeignObjects([threats_info.context, {DBotScore : threats_info.scores}])

    };
}

function get_uuid(uuid) {
    var cmd_url = 'threatindicator/v0/' + uuid;
    var res = sendRequest('GET', cmd_url);

    return sort_threats([res]);
}

// The command input arg holds the command sent from the user.
logDebug('entering with command: ' + command);
switch (command) {
    case 'idefense-general':
        // still having issues with this command.
        return get_threats(args.max_result);
    case 'domain':
        return get_domain(args.domain);
    case 'ip':
        return get_ip(args.ip);
    case 'url':
        return get_url(args.url);
    case 'uuid':
        // still having issues with this command.
        return get_uuid(args.uuid);
    // This is the call made when pressing the integration test button.
    case 'test-module':
        //check api_token is valid
        get_threats(1);
        return 'ok';
    default:
        break;
}