Connecting to LIMO feeds from libtaxii Taxi Client


#1

I trying to connect to the LIMO feeds using url https://limo.anomali.com/api/v1/taxii/taxii-discovery-service and client libtaxii as shown below :

import libtaxii as t
import libtaxii.clients as tc
import libtaxii.messages_11 as tm11
from libtaxii.constants import *

client = tc.HttpClient()
client.set_auth_type(tc.HttpClient.AUTH_BASIC)
client.set_use_https(True)
client.set_auth_credentials({‘username’: ‘guest’, ‘password’: ‘guest’})

discovery_request = tm11.DiscoveryRequest(message_id=tm11.generate_message_id())
discovery_xml = discovery_request.to_xml(pretty_print=True)

http_resp = client.call_taxii_service2(‘limo.anomali.com’, ‘/api/v1/taxii/taxii-discovery-service’, VID_TAXII_XML_11, discovery_xml)
taxii_message = t.get_message_from_http_response(http_resp, discovery_request.message_id)
print taxii_message.to_xml(pretty_print=True)

But I’m getting below error :

<taxii_11:Status_Message xmlns:taxii=“http://taxii.mitre.org/messages/taxii_xml_binding-1” xmlns:taxii_11=“http://taxii.mitre.org/messages/taxii_xml_binding-1.1” xmlns:tdq=“http://taxii.mitre.org/query/taxii_default_query-1” message_id=“0” in_response_to=“7238631488384744973” status_type=“FAILURE”>
<taxii_11:Message>HTTP Error 503: Service Unavailable
Date: Thu, 10 Aug 2017 08:31:54 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Cache-Control: no-cache
X-Kong-Upstream-Latency: 9
X-Kong-Proxy-Latency: 0
Via: kong/0.10.1

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>
</taxii_11:Message>
</taxii_11:Status_Message>

Could anyone direct me right diection?
Thanks in Advance


#2

I get the same error message.

The request XML :

<taxii_11:Discovery_Request
xmlns:taxii="http://taxii.mitre.org/messages/taxii_xml_binding-1"
xmlns:taxii_11="http://taxii.mitre.org/messages/taxii_xml_binding-1.1"
xmlns:tdq="http://taxii.mitre.org/query/taxii_default_query-1"
message_id=“3139893654721473576”/>


#3

Found the issue, Looks like the LIMO server does not accept a port number in the HTTP HOST header limo.anomali.com:443

libtaxii always includes the port number in the url, and so this will also be in the HTTP HOST header.

Edited and tested the libtaxii call_taxii_service2 function, changed url = scheme + host + ‘:’ + str(port) + path to
url = scheme + host + ‘:’ + path (for testing only) and this worked with LIMO

Hopefully this helps :slight_smile: