Skip to content

Commit

Permalink
Merge pull request #715 from DocArmoryTech/patch-1
Browse files Browse the repository at this point in the history
customise ipasn service
  • Loading branch information
adulau authored Feb 24, 2025
2 parents 8cb79f9 + 2dded40 commit 0e04091
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion misp_modules/modules/expansion/ipasn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
'input': 'An IP address MISP attribute.',
'output': 'Asn object(s) objects related to the IP address used as input.',
}
moduleconfig = [
"custom_api"
]


def parse_result(attribute, values):
Expand Down Expand Up @@ -53,7 +56,9 @@ def handler(q=False):

toquery = request['attribute']['value']

ipasn = IPASNHistory()
ipasn_url = request["config"].get("custom_api") or "https://ipasnhistory.circl.lu/"

ipasn = IPASNHistory(root_url=ipasn_url)
values = ipasn.query(toquery)

if not values:
Expand All @@ -67,4 +72,5 @@ def introspection():


def version():
moduleinfo["config"] = moduleconfig
return moduleinfo

0 comments on commit 0e04091

Please sign in to comment.