Merge pull request #690 from shariqmalik/fixes

Fixed bh_owned error on non-existing  values
main
mpgn 2022-11-25 13:05:22 +01:00 committed by GitHub
commit f69fdcf503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,10 @@ class CMEModule:
result = tx.run( result = tx.run(
"MATCH (c:Computer {{name:\"{}\"}}) SET c.owned=True RETURN c.name AS name".format(host_fqdn)) "MATCH (c:Computer {{name:\"{}\"}}) SET c.owned=True RETURN c.name AS name".format(host_fqdn))
record = result.single() record = result.single()
try:
value = record.value() value = record.value()
except AttributeError:
value = []
if len(value) > 0: if len(value) > 0:
context.log.success("Node {} successfully set as owned in BloodHound".format(host_fqdn)) context.log.success("Node {} successfully set as owned in BloodHound".format(host_fqdn))
else: else: