Autofocus Deprecated
Deprecated. Use the Palo Alto Networks AutoFocus v2 integration instead. Palo Alto Networks AutoFocus enables you to distinguish the most important threats from everyday commodity attacks.
Data Enrichment & Threat Intelligence · AutoFocus by Palo Alto Networks
Details
| ID | Autofocus |
|---|---|
| Provider | Palo Alto Networks |
| Category | Data Enrichment & Threat Intelligence |
| From Version | 5.0.0 |
| Supported Modules | Agentix Cortex Cloud Cloud Runtime Security Cloud Posture Security XSIAM EDR |
README
AutoFocus contextual threat intelligence brings speed, consistency and precision to threat investigation.
Configure Autofocus on Cortex XSOAR
- Navigate to Settings > Integrations > Servers & Services.
- Search for Autofocus.
- Click Add instance to create and configure a new integration instance.
- Name: a textual name for the integration instance.
- Server URL
- Version
- API Key
- Use system proxy settings
- Trust any certificate (not secure)
- 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. Search for samples
Search for samples in Palo Alto Networks AutoFocus.
Base Command
autofocus-search-samples
Input
| Argument Name | Description | Required |
|---|---|---|
| scope | The scope for the search | Optional |
| size | Number of results | Optional |
| from | Sample number to start from | Optional |
| sort | Sort field | Optional |
| order | Order of sort | Optional |
| query | The query to retrieve samples | Required |
| sleep | Time to sleep between checking for results | Optional |
| checks | Number of checks before giving up on the query | Optional |
| cookie | The af_cookie for retrieving previous search results | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Autofocus.Cookie | string | The cookie for the results |
| Autofocus.Samples.id | string | The ID of the sample. |
| Autofocus.Samples.md5 | string | The MD5 hash of the sample. |
| Autofocus.Samples.sha1 | string | The SHA-1 of the sample. |
| Autofocus.Samples.sha256 | string | The SHA-256 of the sample. |
| Autofocus.Samples.app_name | string | The application name (if exists). |
| Autofocus.Samples.size | number | The size of the sample. |
| Autofocus.Samples.ssdeep | string | The SSDeep of the sample. |
| Autofocus.Samples.create_date | string | The create date for the sample. |
| Autofocus.Samples.finish_date | string | The finish date for the sample. |
| Autofocus.Samples.malware | string | Is this malware (0 or 1). |
| Autofocus.Samples.app_packagename | string | The sample package name (if exists). |
| Autofocus.Samples.filetype | string | The sample type. |
| Autofocus.Samples.region | number | Where this sample was seen. |
| Autofocus.Samples.tag | string | The tags of the sample. |
Command Example
!autofocus-search-samples scope="public" size="10" sort="create_date" order="desc" query="{\"operator\": \"all\", \"children\": [{\"field\": \"sample.malware\", \"operator\": \"is\", \"value\": 1}]}"
Human Readable Output

2. Search for sessions
Search for sessions in Palo Alto Networks AutoFocus.
Base Command
autofocus-search-sessions
Input
| Argument Name | Description | Required |
|---|---|---|
| size | The number of results to return. | Optional |
| from | The sample number to start from. | Optional |
| sort | The sort field. | Optional |
| order | The sort order. | Optional |
| query | The query to retrieve samples. | Required |
| sleep | The time to sleep between checking for results. | Optional |
| checks | The number of checks before stopping the query. | Optional |
| cookie | The af_cookie for retrieving previous search results. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Autofocus.Cookie | string | The cookie for the results. |
| Autofocus.Sessions.id | string | The ID of the session. |
| Autofocus.Sessions.device_industry | string | The device industry. |
| Autofocus.Sessions.filename | string | The name of the file. |
| Autofocus.Sessions.region | string | The region for the session. |
| Autofocus.Sessions.sha256 | string | The SHA-256 of the file. |
| Autofocus.Sessions.tstamp | string | The timestamp for the session. |
| Autofocus.Sessions.upload_src | string | Where did we get the file |
Command Example
!autofocus-search-sessions size="10" sort="tstamp" order="desc" query="{\"operator\": \"all\", \"children\": [{\"field\": \"session.region\", \"operator\": \"is\", \"value\": \"us\"}]}"
Human Readable Output

3. Get details of a session
Returns details of a specific session.
Base Command
autofocus-session
Input
| Argument Name | Description | Required |
|---|---|---|
| id | The session ID to retrieve details for. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| Autofocus.Sessions.id | string | The ID of the session. |
| Autofocus.Sessions.device_industry | string | The device industry. |
| Autofocus.Sessions.filename | string | The name of the file. |
| Autofocus.Sessions.region | string | The region for the session. |
| Autofocus.Sessions.sha256 | string | The SHA-256 of the file. |
| Autofocus.Sessions.tstamp | string | The timestamp for session. |
| Autofocus.Sessions.upload_src | string | The origin of the file. |
4. Get a sample analysis
Retrieves the sample analysis.
Base Command
autofocus-sample-analysis
Input
| Argument Name | Description | Required |
|---|---|---|
| id | The ID of the sample. | Required |
| coverage | Whether coverage should be displayed. | Optional |
| sections | A CSV list of sections to display: apk_app_icon, apk_app_name, apk_cert_file, apk_certificate_id, apk_defined_activity, apk_defined_intent_filter, apk_defined_receiver, apk_defined_sensor, apk_defined_service, apk_digital_signer, apk_embedded_library, apk_embeded_url, apk_internal_file, apk_isrepackaged, apk_packagename, apk_requested_permission, apk_sensitive_api_call, apk_suspicious_behavior, apk_suspicious_file, apk_suspicious_pattern, apk_suspicious_action_monitored, apk_suspicious_file, apk_suspicious_string, apk_version_num, behavior_type, connection, coverage, dns, file, http, japi, mac_embedded_url, misc, mutex, process, registry, service, user_agent | Optional |
| platforms | A CSV list of platforms: win7, winxp, android, staticAnalyzer, mac | Optional |
Context Output
There is no context output for this command.
Command Example
!autofocus-sample-analysis id="7ebf30b8f908ce574fda70af1f94ebcb071c2e5f0e22f2ec349a2290f243a036" coverage=true sections=file
Human Readable Output

5. Get the reputation of a file
Checks the file reputation of the given hash.
Base Command
file
Input
| Argument Name | Description | Required |
|---|---|---|
| file | The hash of the file to query. Supports MD5, SHA-1, and SHA-256. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| File.MD5 | string | The MD5 hash of the file. |
| File.SHA1 | string | The SHA-1 hash of the file. |
| File.SHA256 | string | The SHA-256 hash of the file. |
| File.Malicious.Vendor | string | For malicious files, the vendor that made the decision. |
| File.Malicious.Description | string | For malicious files, the reason that the vendor made the decision. |
| DBotScore.Indicator | string | The indicator that was tested. |
| DBotScore.Type | string | The indicator type. |
| DBotScore.Vendor | string | The vendor used to calculate the score. |
| DBotScore.Score | number | The actual score. |
| DBotScore.Description | string | The reason for the score (if any). |
Command Example
!file file="75779e62f9790bd4c2ed449bd20be741f78811fb5ce848a2c5a516af17cdeccf" using-brand="Autofocus"
Human Readable Output

Configuration parameters
server— Server URL (required)version— Version (required)apiKey— API Key (required)useproxy— Use system proxy settingsinsecure— Trust any certificate (not secure)
Commands (5)
-
autofocus-sample-analysisRetrieve the sample analysis
-
autofocus-search-samplesSearch for samples on Autofocus
-
autofocus-search-sessionsSearch for sessions on Autofocus
-
autofocus-sessionGet details of a specific session
-
fileCheck file reputation of the given hash
var SERVER = params.server.replace(/[\/]+$/, '') + '/api/' + params.version + '/'; function doReq(path, data) { data.apiKey = params.apiKey; var result = http( SERVER + path, { Headers: {'Content-Type': ['application/json'], 'Accept': ['application/json']}, Method: 'POST', Body: JSON.stringify(data) }, params.insecure, params.useproxy ); if (result.StatusCode < 200 || result.StatusCode > 299) { if (result.StatusCode == 503) { throw '503 - Rate limit exceeded. Contact your Autofocus representative.'; } if (result.StatusCode == 409) { throw '409 - Invalid message or missing parameters.'; } else { throw 'Failed to perform request ' + path + ', request status code: ' + result.StatusCode + '\n' + result.Body; } } if (result.Body === '') { throw 'No content received.'; } var obj; try { obj = JSON.parse(result.Body); } catch (ex) { throw 'Error parsing reply - ' + result.Body + ' - ' + ex; } return { body: result.Body, obj: obj, statusCode: result.StatusCode }; } function doSearch(prefix) { var cookie = args.cookie; if (!cookie) { var q = {}; q.query = JSON.parse(args.query); q.from = parseInt(args.from); q.size = parseInt(args.size); if (args.sort) { q.sort = {}; q.sort[args.sort] = {order: (args.order ? args.order : 'asc')}; } if (args.scope) { q.scope = args.scope; } var res = doReq(prefix + '/search/', q); if (!res.obj.af_cookie) { throw 'Unable to retrieve cookie of search results'; } cookie = res.obj.af_cookie; } var checks = (args.checks) ? parseInt(args.checks) : 10; var sleep = (args.sleep) ? parseInt(args.sleep) : 3; var res1; var ec = {'Autofocus.Cookie': cookie}; while (checks > 0) { checks--; wait(sleep); res1 = doReq(prefix + '/results/' + cookie, {}); if (res1.obj.af_message === 'complete' || res1.obj.af_in_progress === false || (res1.obj.hits && res1.obj.hits.length >= parseInt(args.size))) { var md = '## PAN Autofocus ' + prefix + ' result\n'; md += 'Total: ' + res1.obj.total + '\nTook: ' + res1.obj.took + '\n'; var hits = []; for (var i=0; i<res1.obj.hits.length; i++) { var data = res1.obj.hits[i]._source; data.id = res1.obj.hits[i]._id; hits.push(data); } ec['Autofocus.S' + prefix.substr(1)] = hits; md += tableToMarkdown('S' + prefix.substr(1), hits); return { Type: entryTypes.note, Contents: res1.body, ContentsFormat: formats.json, HumanReadable: md, EntryContext: ec }; } } return { Type: entryTypes.note, Contents: ec, ContentsFormat: formats.json, HumanReadable: 'PAN Autofocus timeout occured waiting for results, cookie is: ' + cookie, EntryContext: ec }; } function doSession(id) { var res = doReq('session/' + id, {}); if (res.obj.af_message === 'complete' || res.obj.af_in_progress === false || res.obj.hits.length >= 1) { var hits = []; for (var i=0; i<res.obj.hits.length; i++) { var data = res.obj.hits[i]._source; data.id = res.obj.hits[i]._id; hits.push(data); } md = tableToMarkdown('PAN Autofocus session details', hits); md += 'Took: ' + res.obj.took + '\n'; return { Type: entryTypes.note, Contents: res.body, ContentsFormat: formats.json, HumanReadable: md, EntryContext: {'Autofocus.Sessions': hits} }; } return { Type: entryTypes.note, ContentsFormat: formats.markdown, Contents: 'PAN Autofocus no session for: ' + id }; } function doSample() { var p = {}; if (args.sections) { p.sections = argToList(args.sections); } if (args.platforms) { p.platforms = argToList(args.platforms); } if (args.coverage === 'true') { p.coverage = true; if (p.sections && p.sections.indexOf('coverage') < 0) { p.sections.push('coverage'); } } var res = doReq('sample/' + args.id + '/analysis', p); md = '## PAN Autofocus Sample Analysis\n'; md += '### Sections: ' + res.obj.sections.join(', ') + '\n'; md += '### Platforms: ' + res.obj.platforms.join(', ') + '\n'; if (res.obj.coverage) { Object.keys(res.obj.coverage).forEach(function(s) { if (Object.keys(res.obj.coverage[s]).length) { md += tableToMarkdown('Coverage ' + s, res.obj.coverage[s]) + '\n'; } }); } res.obj.sections.forEach(function(s) { if (s === 'coverage') { return; } res.obj.platforms.forEach(function(p) { if (res.obj[s][p]) { md += tableToMarkdown(s + ' - ' + p, res.obj[s][p]) + '\n'; } }); }); return { Type: entryTypes.note, Contents: res.body, ContentsFormat: formats.json, HumanReadable: md }; } switch (command) { case 'test-module': doReq('samples/search/', {query: {operator: 'all', children: [{field: 'sample.malware', operator: 'is', value: 1}]}, size: 1, from: 0, scope: 'public'}); return 'ok'; case 'autofocus-search-samples': return doSearch('samples'); case 'autofocus-search-sessions': return doSearch('sessions'); case 'autofocus-session': return doSession(args.id); case 'autofocus-sample-analysis': return doSample(args.id); case 'file': args.size = 1; args.from = 0; args.scope = 'public'; var hash = args.file.length === 64 ? 'sha256' : args.file.length === 40 ? 'sha1' : 'md5'; args.query = JSON.stringify({operator: 'all', children: [{field: 'sample.' + hash, operator: 'is', value: args.file}]}); var search = doSearch('samples'); if (search.EntryContext && search.EntryContext['Autofocus.Samples'] && search.EntryContext['Autofocus.Samples'].length > 0) { var c = search.EntryContext['Autofocus.Samples'][0]; var dbotScore = []; ['md5', 'sha1', 'sha256'].forEach(function(h) { if (c[h]) { dbotScore.push({Indicator: c[h], Type: 'hash', Vendor: 'PAN Autofocus', Score: c.malware === 1 ? 3 : 1, Description: c.tag && c.tag.length > 0 ? c.tag.join(', ') : c.malware === 1 ? 'Marked as malware' : ''}); } }); var ec = {DBotScore: dbotScore}; var f = {MD5: c.md5, SHA1: c.sha1, SHA256: c.sha256, Size: c.size, SSDeep: c.ssdeep, Region: c.region ? c.region.join(',') : '', Info: c.filetype, Type: c.filetype}; if (c.malware === 1) { f.properties_to_append = ['Malicious']; f.Malicious = {Vendor: 'PAN Autofocus', Description: dbotScore[0].Description}; } ec[outputPaths.file] = f; // Now, let's add any interesting sessions we've encountered to the display args.size = 50; delete args.scope; args.query = JSON.stringify({operator: 'all', children: [{field: 'session.sha256', operator: 'is', value: c.sha256}]}); var md = search.HumanReadable; var sessions = doSearch('sessions'); if (sessions.EntryContext && sessions.EntryContext['Autofocus.Sessions'] && sessions.EntryContext['Autofocus.Sessions'].length > 0) { md += '\n' + sessions.HumanReadable; } return { Type: entryTypes.note, Contents: search.Contents, ContentsFormat: formats.json, HumanReadable: md, EntryContext: ec }; } return { Type: entryTypes.note, ContentsFormat: formats.markdown, Contents: 'PAN Autofocus no data for: ' + args.file }; default: throw 'Unknown command "' + command + '"'; }