Skip to content

Neo4j credential rotation during application runtime #1371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vboerner opened this issue Jan 31, 2023 · 3 comments · Fixed by #1380
Closed

Neo4j credential rotation during application runtime #1371

vboerner opened this issue Jan 31, 2023 · 3 comments · Fixed by #1380

Comments

@vboerner
Copy link

Hi!

I've started to integrate HashiCorp Vault into my Spring-based application with spring-data-neo4j 6. I am using a Neo4j in version 4.4.11 and the neo4j-java-driver runs in version 4.4.11, too.

When starting the application, it's being able to authenticate successfully with HashiCorp Vault and retrieve the neo4j credentials.

My problem begins when trying to rotate the database credentials because I did not find a way to update the neo4j credentials during application runtime.

After digging around, I found that Spring creates a bean of type org.neo4j.driver.Driver via GraphDatabase.driver(serverUri,authToken,config);

And org.neo4j.driver.internal.async.pool.ConnectionPoolImpl is used as ConnectionPool.

As far as I can see I have found no way to set username and password for the neo4j in driver class or connection pool during application runtime.

For example, if a database uses the HikariCP, it is possible to update the credentials at runtime because HikariCP provides a way to do it via the HikariConfigMXBean. See: HikariConfig.java, Line 61-72

Is this type of update also possible in the Neo4j driver or connection pool? Or is it planned for the future?

Many thanks in advance for your help.

@injectives
Copy link
Contributor

Hello. Thanks for your question.

At present, it is not possible. Credentials are set for the lifetime of the driver.

However, we are currently working on an ability to re-authenticate. The current plan is to let driver pull new credentials with TTL when needed. This feature should be released in 5.x driver series in near future.

@sathishkumar294
Copy link

sathishkumar294 commented Mar 2, 2023

Hi @injectives, thanks for the explanation. Is there a roadmap on when this improvement will be released?

@injectives
Copy link
Contributor

Hi @injectives, thanks for the explanation. Is there a roadmap on when this improvement will be released?

Hello!

Probably end of March or end of April. This is assuming no other thing affects our hopes on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants