Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cme/modules/bh_owned.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ def on_admin_login(self, context, connection):
with session.begin_transaction() as tx:
result = tx.run(
"MATCH (c:Computer {{name:\"{}\"}}) SET c.owned=True RETURN c.name AS name".format(host_fqdn))
if len(result.value()) > 0:
record = result.single()
value = record.value()
if len(value) > 0:
context.log.success("Node {} successfully set as owned in BloodHound".format(host_fqdn))
else:
context.log.error(
"Node {} does not appear to be in Neo4J database. Have you imported correct data?".format(host_fqdn))
driver.close()
driver.close()