Skip to content

Commit

Permalink
Finish 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sarus committed Jun 1, 2022
2 parents ed21b77 + 6f68138 commit 58caa8d
Show file tree
Hide file tree
Showing 8 changed files with 3,079 additions and 35 deletions.
5 changes: 4 additions & 1 deletion components/us-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ polarity.export = PolarityComponent.extend({
typeof err.meta.errorMessage === 'string' &&
typeof err.meta.description === 'string'
) {
this.set('block._state.errorMessage', `${err.meta.errorMessage}\n\n${err.meta.description}`);
this.set(
'block._state.errorMessage',
`${err.meta.errorMessage}\n\n${err.meta.description}`
);
} else if (
typeof err.meta === 'object' &&
typeof err.meta.detail === 'string'
Expand Down
10 changes: 10 additions & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ module.exports = {
userCanEdit: true,
adminOnly: false
},
{
key: 'includeTaskedIndicators',
name: 'Search Tasked URLs and Domains',
description:
'If checked, the integration will search tasked URLs and Domains in addition to the primary domain (defaults to true).',
default: true,
type: 'boolean',
userCanEdit: false,
adminOnly: true
},
{
key: 'blocklist',
name: 'Ignored Entities',
Expand Down
18 changes: 13 additions & 5 deletions integration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Bottleneck = require('bottleneck');
const request = require('request');
const request = require('postman-request');
const _ = require('lodash');
const fp = require('lodash/fp');
const config = require('./config/config');
Expand Down Expand Up @@ -95,15 +95,23 @@ function _setupRegexBlocklists(options) {
}
}

function getQuery(entity) {
function getQuery(entity, options) {
if (entity.isIP) {
return `page.ip:"${entity.value}"`;
} else if (entity.isDomain) {
return `page.domain:"${entity.value}"`;
if (options.includeTaskedIndicators) {
return `page.domain:"${entity.value}" OR task.domain:"${entity.value}"`;
} else {
return `page.domain:"${entity.value}"`;
}
} else if (entity.isHash) {
return `hash:"${entity.value}"`;
} else if (entity.isURL) {
return `page.url:"${entity.value}"`;
if (options.includeTaskedIndicators) {
return `page.url:"${entity.value}" OR task.url:"${entity.value}"`;
} else {
return `page.url:"${entity.value}"`;
}
}
}

Expand Down Expand Up @@ -266,7 +274,7 @@ function doLookup(entities, options, cb) {
if (errors.length > 0) {
cb(errors);
} else {
Logger.trace({lookupResults}, 'Lookup Results');
Logger.trace({ lookupResults }, 'Lookup Results');
cb(null, lookupResults);
}
}
Expand Down
Loading

0 comments on commit 58caa8d

Please sign in to comment.