BloodHound-Tools icon indicating copy to clipboard operation
BloodHound-Tools copied to clipboard

Update Neo4j driver and fix schema issues

Open voutilad opened this issue 3 years ago • 2 comments

The Neo4j 1.7 driver will be end-of-life soon as Neo4j 3.5 becomes EOL in November 2021. This PR moves to using a newer driver (4.2.1) that still supports Neo4j 3.5 but also the newer 4.x series by:

  • updating the requirements to just the newer neo4j python module
  • fixes some general Neo4j 4.x combability issues in the cypher statements, specifically migrating all usages of the legacy parameter format ({param}) to the 4.x compatible format ($param)
  • updates the DROP statements to properly be able to drop indexes and constraints in 4.x

Secondly, this PR fixes and refactors issues with the schema. Schema wasn't being set before data creation, so a typo in a guid parameter was causing a collision for nodes representing the "DEFAULT DOMAIN POLICY" and "DEFAULT DOMAIN CONTROLLERS POLICY" :Base nodes.

The refactor forces the schema to be configured during data creation to help catch any issues. Clearing the db now just removes the schema definition but does not recreate it.

This should simplify usage so if users skip "cleardb" on a fresh database they will still get an index and constraints.

voutilad avatar Mar 02 '21 17:03 voutilad

I didn't expect an old PR to have all the fixes I just wrote and more, why is this not merged to master?

LizardBlizzard avatar Nov 03 '21 20:11 LizardBlizzard

It would be really great to get this PR merged 🙏 @andyrobbins @rvazarkar

As Neo4j 3.5 is EOL (soon) and the old drivers don't work against new databases.

jexp avatar Jan 24 '22 14:01 jexp