FeedURLhaus

Fetch url indicators for URLHaus.

Data Enrichment & Threat Intelligence · URLhaus Feed · Feed

Details

IDFeedURLhaus
ProviderOpen Source
CategoryData Enrichment & Threat Intelligence
From Version5.5.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

URLhaus is a platform from abuse.ch and Spamhaus dedicated to sharing malicious URLs that are being used for malware distribution.
For more information, visit: https://urlhaus.abuse.ch/

Fetch indicators from URLhaus api

Fetch indicators from the URLhaus API.

Parameter Description Required
Auth Key Auth Key for authentication with abuse.ch True
Fetches indicators Check tofetch indicators True
Indicator Reputation The type of reputation for the indicator True
Feed Source The type of data we want to get from the api True
Traffic Light Protocol Color The Traffic Light Protocol (TLP) designation to apply to indicators fetched from the feed. True
Indicator Expiration Method The indicator expiration method True
Source Reliability The reliability of the feed True
Feed Fetch Interval The time interval to fetch indicators from the api True
Trust any certificate Weather or not to trust any certificate True
Use system proxy settings If you want to use proxy for the integration True

Create an Auth Key for abuse.ch

Note: If you already have a profile, you can skip steps 1 and 2.

  1. Sign up for an abuse.ch account. You can do this easily by using an existing account that you may already have on X, LinkedIn, Google or Github. Just log in with the authentication provider of your choice here: https://auth.abuse.ch/

  2. Once you are authenticated on abuse.ch, ensure that you connect at least one additional authentication provider. This will ensure that you have access to abuse.ch platforms, even if one of the authentication providers you use shuts down (yes, it happened with Twitter!)

  3. Ensure that you hit the “Save profile” button. In the “Optional” section, you can now generate an “Auth-Key”. This is your personal Auth-Key that you can now use in the integration.

Commands

You can execute these commands in a playbook.

urlhaus-get-indicators


Manual command to fetch events and display them.

Configuration parameters

  • credentials
  • feedTags — Tags
  • feedExpirationPolicy
  • feedReputation — Indicator Reputation
  • tlp_color — Traffic Light Protocol Color
  • feed — Fetch indicators
  • feedReliability — Source Reliability (required)
  • feedExpirationInterval
  • feedFetchInterval — Feed Fetch Interval
  • feedBypassExclusionList — Bypass exclusion list
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings

Commands (1)

  • urlhaus-get-indicators

    Retrieves a limited number of indicators.

from CommonServerPython import *
from CSVFeedApiModule import *


def main():  # pragma: no cover
    try:
        auth_key = demisto.params().get("credentials", {}).get("password")
        if not auth_key:
            raise ValueError("Missing required parameter Auth Key. Please set this parameter in the instance configuration.")

        params = {k: v for k, v in demisto.params().items() if v is not None}
        args = demisto.args()
        params = params | args
        base_url = "https://urlhaus.abuse.ch/downloads/"
        chosen_urls = []
        params["feed_url_to_config"] = {}
        url = urljoin(base_url + "csv_online")
        params["feed_url_to_config"][url] = {
            "indicator_type": FeedIndicatorType.URL,
            "ignore_regex": "#*",
            "fieldnames": ["id", "dateadded", "url", "url_status", "last_online", "threat", "tags", "urlhaus_link", "reporter"],
            "mapping": {
                "Creation Date": "dateadded",
                "Value": "url",
                "State": "url_status",
                "Tags": "tags",
                "Download URL": "urlhaus_link",
                "Reported By": "reporter",
            },
        }
        chosen_urls.append(url)
        params["indicator_type"] = FeedIndicatorType.URL
        params["ignore_regex"] = "#"
        params["url"] = chosen_urls
        params["credentials"] = {"password": auth_key, "identifier": "_header:Auth-Key"}

        feed_main("URLhaus Feed", params, "urlhaus-")
    except Exception as e:
        return_error(f"Failed to execute {demisto.command()} command. Error: {e!s}")


if __name__ in ("__builtin__", "builtins", "__main__"):
    main()