fix(bloodhound): fail out right away if Bloodhound is enabled and authentication fails to the API

main
Marshall Hallenbeck 2024-03-22 14:51:09 -04:00 committed by Marshall Hallenbeck
parent 58d2039553
commit a9bd576392
1 changed files with 4 additions and 4 deletions

View File

@ -52,14 +52,14 @@ def add_user_bh(user, domain, logger, config):
_add_with_domain(user_info, domain, tx, logger)
except AuthError:
logger.fail(f"Provided Neo4J credentials ({config.get('BloodHound', 'bh_user')}:{config.get('BloodHound', 'bh_pass')}) are not valid.")
return
exit()
except ServiceUnavailable:
logger.fail(f"Neo4J does not seem to be available on {uri}.")
return
exit()
except Exception as e:
logger.fail(f"Unexpected error with Neo4J: {e}")
return
driver.close()
finally:
driver.close()
def _add_with_domain(user_info, domain, tx, logger):