lyft / cartography

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.

Home Page:https://lyft.github.io/cartography/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help message link for NEO4J_URI links to a 404, and the documentation should include user and password for neo4j

pcn opened this issue · comments

Title: Minor improvements to the help message and getting started doc

Description:

The help message for cartography points to this link which is a 404 currently and should probably point to this link which doesn't have the driver.html at the end, but which exists. Also, the quickstart should document the need for cartography to have the neo4j user and password provided by default

To Reproduce:
Following the steps to run cartography against a self-hosted neo4j docker image, the default neo4j/neo4j auth doesn't work, and requires a user and password to be provided. What worked for me was following the docker run instructions here

$ docker run \
    --name testneo4j \
    -p7474:7474 -p7687:7687 \
    -d \
    -v $HOME/neo4j/data:/data \
    -v $HOME/neo4j/logs:/logs \
    -v $HOME/neo4j/import:/var/lib/neo4j/import \
    -v $HOME/neo4j/plugins:/plugins \
    --env NEO4J_AUTH=neo4j/password \
    neo4j:latest

then running cartography like this:

env NEO_PASSWORD=password GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/application_default_credentials.json cartography --neo4j-uri bolt://localhost:7687 --neo4j-password-env-var=NEO_PASSWORD --neo4j-user=neo4j

otherwise startup fails.

Logs:
n/a, I think?

Screenshots:
n/a, I think?

Please complete the following information::

  • cartography versoin: 0.83.0 installed from pypi with pipenv
  • Python version: 3.10.6
  • OS (feel free to omit this if you don't think it's relevant to your issue): Pop_OS current as the container host, cartography running in a ubuntu 22.04 container

Additional context:
Nope

the default neo4j/neo4j auth doesn't work

As far as I remember, this only doesn't work because Neo4j forces you to change the default password before you can connect. You can either change it in the Neo4j Browser as shown in my article "Getting Started with Cartography for AWS", or set new defaults as you're doing with the NEO4J_AUTH environment variable.

You're right that these details should be added to the docs though - I do remember the original setup was rather tricky, which is why I wrote that article last year.

If the door is open to PRs, I could take a shot at updating them.

I don't speak for the guys at Lyft but I believe they're usually quite receptive to and grateful for PRs.

Thanks for filing - definitely happy to accept a PR to update the docs. I think older versions of Neo4j didn't behave this way.