Exemplo n.º 1
0
        'Contents': enclave_ids,
        'ContentsFormat': formats['json'],
        'ReadableContentsFormat': formats['markdown'],
        'HumanReadable': tableToMarkdown(title, enclave_ids),
    }
    return entry


''' EXECUTION CODE '''
config = {
    'user_api_key': API_KEY,
    'user_api_secret': API_SECRET,
    'api_endpoint': BASE_URL,
    'verify': INSECURE
}
ts = trustar.TruStar(config=config)

LOG('command is %s' % (demisto.command(), ))

try:
    if demisto.command() == 'test-module':
        demisto.results('ok')

    elif demisto.command() == 'trustar-related-indicators':
        enclave_ids = demisto.args().get('enclave-ids', None)
        demisto.results(get_related_indicators(demisto.args()['indicators'], enclave_ids, demisto.args()[
                        'page-size'], demisto.args()['page-number']))

    elif demisto.command() == 'trustar-trending-indicators':
        demisto.results(get_trending_indicators(demisto.args()['type'], demisto.args()['days-back']))
Exemplo n.º 2
0
 def __init__(self, config, station=''):
     self.client = trustar.TruStar(config=config)
     self.command_dict = self._build_command_dict()
     self.context_manager = ContextManager()
     self.station = station