Skip to content

Commit

Permalink
feat(auditor): use loop for continous interactive auditing
Browse files Browse the repository at this point in the history
  • Loading branch information
arminveres committed Nov 15, 2023
1 parent f146561 commit a9380dc
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions impl/src/auditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from aiohttp import ClientSession
from support.agent import DEFAULT_INTERNAL_HOST
from support.database import OrionDB
from support.utils import log_json, log_msg, log_status, prompt
from support.utils import log_json, log_msg, log_status, prompt, prompt_loop


class Auditor:
Expand Down Expand Up @@ -56,17 +56,16 @@ async def main():
# response = await auditor.db_client.query_all("db1")

# value = await auditor.db_client.query_key(db_to_check, "controller_node_0.agent")
node_input = await prompt("Node to be checked: ")
value = await auditor.db_client.query_key(db_to_check, node_input.strip())

log_json(value)

# do some magic, analysis and return with the marked vulnerable component send revoke request
# to issuer
marked_vulnerabilities = auditor.check_vulnerability(db_to_check, value["components"])

if marked_vulnerabilities is not None:
await auditor.notify_maintainer(db_to_check, marked_vulnerabilities)
async for option in prompt_loop("Node to be checked: "):
value = await auditor.db_client.query_key(db_to_check, option.strip())
# log_json(value)
marked_vulnerabilities = auditor.check_vulnerability(db_to_check, value["components"])
# do some magic, analysis and return with the marked vulnerable component send revoke request
# to issuer
marked_vulnerabilities = auditor.check_vulnerability(db_to_check, value["components"])

if marked_vulnerabilities is not None:
await auditor.notify_maintainer(db_to_check, marked_vulnerabilities)

# except Exception:
await auditor.client_session.close()
Expand Down

0 comments on commit a9380dc

Please sign in to comment.