Skip to content

Commit

Permalink
Merge pull request #80 from JupiterOne/22-support-config-filepath
Browse files Browse the repository at this point in the history
Support config filepath
  • Loading branch information
Erich Smith authored Nov 7, 2022
2 parents adf58c5 + 65a0685 commit 6b798e7
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

#### 🚀 Enhancement

- Add 'jupiterone' storage engine [#79](https://github.com/JupiterOne/starbase/pull/79) ([@erichs](https://github.com/erichs))
- Add 'jupiterone' storage engine
[#79](https://github.com/JupiterOne/starbase/pull/79)
([@erichs](https://github.com/erichs))

#### Authors: 1

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Starbase offers three key advantages:
## Available Integrations / Connectors

Starbase supports
[70+](https://github.com/jupiterone?q=graph-&type=all&language=&sort=) open
source graph integrations!
[115+](https://github.com/orgs/JupiterOne/repositories?q=graph-++in%3Aname&type=public&language=&sort=)
open source graph integrations!

Here are some highlights:

Expand Down Expand Up @@ -193,7 +193,8 @@ Usage: yarn starbase [options] [command]
Starbase graph ingestion orchestrator

Options:
-h, --help display help for command
-c, --config <path> optional path to config file (default: "config.yaml")
-h, --help display help for command

Commands:
run collect and upload entities and relationships
Expand All @@ -206,8 +207,8 @@ Commands:
2. Run `yarn starbase run` to collect data for each listed integration and then
push collected data to the storage endpoint listed in `config.yaml`.
For additional information on using Neo4j as a storage endpoint, please see the
[README.md](docker/README.md) provided.
For additional information on using Neo4j or JupiterOne as a storage endpoint,
please see the [README.md](docker/README.md) provided.
### Running Starbase - Docker
Expand Down
33 changes: 33 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,36 @@ for Windows and Mac includes Docker Composer. Linux users will need to install
[Docker Engine](https://docs.docker.com/engine/install/) and
[Docker Composer](https://docs.docker.com/compose/install/) manually until
Docker Desktop for Linux is available.

# JupiterOne as a Storage Endpoint

In addition to a local Neo4J storage endpoint, Starbase supports a remote
JupiterOne storage endpoint, allowing you to run your integrations locally (or
on-premise) and persist your integration data directly to a configured
JupiterOne account.

You may specify multiple storage endpoints in the `storage` list, for example if
you also wanted to persist data to a local Neo4J storage endpoint.

## Configuring the JupiterOne Storage Endpoint

Add a configuration stanza like the following to your `config.yaml`:

```
storage:
-
engine: jupiterone
config:
apiKey: your-unique-api-key (may be either user or account key, needs graph write permission)
accountId: your-j1-account-id
```

NOTE: if the canonical API URL for your account/region is not
`https://api.us.jupiterone.io`, you will need to specify an additional storage
configuration parameter, `apiBaseUrl`, with the HTTPS URL appropriate for the
token and account you've provided.

See [JupiterOne API](https://community.askj1.com/kb/articles/794-jupiterone-api)
and
[Creating User and Account API Keys](https://community.askj1.com/kb/articles/785-creating-user-and-account-api-keys)
docs for additional details.
5 changes: 5 additions & 0 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export function createStarbaseCli() {
return createCommand()
.name('yarn starbase')
.description('Starbase graph ingestion orchestrator')
.option(
'-c, --config <path>',
'optional path to config file',
'config.yaml',
)
.addCommand(run())
.addCommand(setup())
.addCommand(wipe())
Expand Down
5 changes: 3 additions & 2 deletions src/cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ function onSkipIntegrationExecution({
export function run() {
return createCommand('run')
.description('collect and upload entities and relationships')
.action(async () => {
await executeStarbase(await parseConfigYaml('config.yaml'), {
.action(async (cmd) => {
const config = cmd.parent.config;
await executeStarbase(await parseConfigYaml(config), {
onSkipIntegrationExecution,
});
});
Expand Down

0 comments on commit 6b798e7

Please sign in to comment.