IBM QRadar SOAR

IBM QRadar

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Custom Threat Sources security

    Posted Mon December 09, 2019 04:30 PM
    Edited by Carlos Ortigoza Mon December 09, 2019 04:32 PM
    Hello,

    We were wondering how we can deploy a Custom Threat Source over HTTPS. We were going through the documentation and didn't find any reference about how to do it.

    Besides this, we were also wondering how can we make it listen on all interfaces or something different to localhost. We considered already implementing a forwarding rule using iptables but something native is preferable.

    Regards,

    ------------------------------
    Carlos Ortigoza
    ------------------------------


  • 2.  RE: Custom Threat Sources security

    Posted Wed December 11, 2019 07:27 AM
    Hello Carlos,

    Thanks for contacting us.

    Could you please explain in more details what you meant by "deploy a Custom Threat Source over HTTPS"?

    Thanks,

    Yongjian

    ------------------------------
    Yongjian Feng
    ------------------------------



  • 3.  RE: Custom Threat Sources security

    Posted Wed December 11, 2019 08:07 AM
    Hello,

    I mean how can we have the Custom Threat Source listening on an URL like:
    • https://mydomain.com:8888
    Instead of:
    • http://mydomain.com:8888

    I didn't find any reference about how to configure this but I might be looking at the wrong documentation.

    Regards,

    ------------------------------
    Carlos Ortigoza
    ------------------------------



  • 4.  RE: Custom Threat Sources security

    Posted Wed December 11, 2019 10:28 AM
    I see. Did you guys develop this CTS or downloaded it from the App Exchange please?

    ------------------------------
    Yongjian Feng
    ------------------------------



  • 5.  RE: Custom Threat Sources security

    Posted Wed December 11, 2019 12:19 PM
    Hi,

    It was developed by us following Resilient's documentation.

    Regards,

    ------------------------------
    Carlos Ortigoza
    ------------------------------



  • 6.  RE: Custom Threat Sources security

    Posted Thu December 12, 2019 01:35 PM
    I know we have a simpler sample application too, so this answer depends upon which sample you started with...

    If based on the Django sample, the README.md points to uwsgi documentation and provides an example way to host using nginx: https://github.com/ibmresilient/resilient-python-examples/tree/master/django-custom-threat-service#sample-configuration-with-nginx

    If you are using nginx simply uncomment the section in the nginx.conf file which is labelled as "# Enable these settings for SSL". Personally I'm a big fan of nginx, because it is very flexible.

    There are some other production-ready web servers to host Django applications - https://gunicorn.org/ is one that I have seen used for a large application in the past.

    More information / discussions can be found at the following links:
    https://vsupalov.com/django-runserver-in-production/
    https://www.quora.com/Which-web-server-suits-Django-best-Apache-Nginx-or-something-else
    https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Deployment



    ------------------------------
    Marty James
    ------------------------------



  • 7.  RE: Custom Threat Sources security

    Posted Tue December 17, 2019 03:03 AM
    Hi Marty,

    Thanks for the clarification and the links you provided. They are really useful.

    ------------------------------
    Carlos Ortigoza
    ------------------------------



  • 8.  RE: Custom Threat Sources security

    Posted Tue December 24, 2019 10:27 AM
    Hi Marty,

    We were having a look at this example and found something that we don't completely understand. In the controller.py module, the class "SearchContext" is defined like this:
    class SearchContext(object):
    
        """ Class to hold context of searches, so that asynchronous searches can be co-ordinated """
    
        def __init__(self, context):
            self._context = copy.copy(context)
            self._active_searches = []
            self._id = uuid.uuid4().__str__()

    This differs to the equivalent ID creation present in the CustomThreatService class available in the rc_cts Python package:
    # Generate a request ID, derived from the artifact being requested.
    request_id = str(uuid5(self.namespace, json.dumps(body)))
    The body variable is what is received in the POST requests made by Resilient.

    After studying the previous implementation, we understood that the purpose of this ID is:
    1. Have a way of tracking asynchronous requests to the actual Threat Source, so Resilient can poll for the results later making GET requests.
    2. Cache the results from the Threat Source during a given TTL, so the two consecutive requests for the same artifact value and type just returns the cached value.
    However, in the Django implementation the ID seems to be generated without making use of the input data or any seed whatsoever and it looks like if Resilient makes the exact same request many times in a short period of time, none of these requests will have the same UUID.

    As we came to this conclusion by inspecting the code and not running it yet, could you please check and let us know if this is an error? If so, how can be request a fix? This would potentially have a big performance impact for our Threat Sources.

    ------------------------------
    Regards,
    Carlos Ortigoza
    ------------------------------



  • 9.  RE: Custom Threat Sources security

    Posted Thu January 02, 2020 10:21 AM
    Hi Carlos,

    Thanks for contacting us.

    First of all, both packages/scripts are provided as sample code, or say for general demonstration purpose, not for solving a particular problem. My understanding is that caching has pros and cons, and customers might need to make their decisions based on their own use cases. Those two sample packages demonstrated two different levels of caching, each might be more suitable for certain/particular use case. 

    My point here is that you can make decision on which level of caching you need for your use case.

    Thanks,

    Yongjian Feng

    ------------------------------
    Yongjian Feng
    ------------------------------