Skip to content

Commit

Permalink
Map inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcnally-r7 committed Nov 6, 2023
1 parent 79e606a commit a83e3f8
Showing 1 changed file with 36 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def run(self, params={}):
# END INPUT BINDING - DO NOT REMOVE
# Input retrieval
asset_group = params.get(Input.ASSET_GROUP)
cve = params.get(Input.CVE)
hostname = params.get(Input.HOSTNAME)
cve = params.get(Input.CVE, None)
hostname = params.get(Input.HOSTNAME, None)
source = params.get(Input.SOURCE)
ip_address = params.get(Input.IP_ADDRESS)
risk_score = params.get(Input.RISK_SCORE)
Expand All @@ -38,14 +38,41 @@ def run(self, params={}):
# Output.SOLUTION_SUMMARY: "solution_summary",
# Output.VULNERABILITY_ID: "vulnerability_id",
# }
x = []
if cve:
x.append({
"field": "cve",
"operator": "is",
"value": cve,
})
if hostname:
x.append({
"field": "host-name",
"operator": "is",
"value": hostname,
}, )

# {
# "field": "<field-name>",
# "operator": "<operator>",
# ["value": < value >,],
# ["lower": < value >,],
# ["upper": < value >],
# }
if ip_address:
x.append(
{
"field": "ip-address",
"operator": "is",
"value": ip_address,
})
if risk_score:
x.append(
{
"field": "risk-score",
"operator": "is",
"value": risk_score,
})
if site_id:
x.append(
{
"field": "site-id",
"operator": "is",
"value": site_id,
})

# Build API call
resource_helper = ResourceRequests(self.connection.session, self.logger)
Expand Down

0 comments on commit a83e3f8

Please sign in to comment.