-
Notifications
You must be signed in to change notification settings - Fork 237
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
Is there a programmatic way to bootstrap a superuser? #316
Comments
I appears that the |
Oh, but when I try to create the API key it fails:
So I'm not sure how I'm supposed to get the key. |
Is there a way to make API calls without having to use the API key? The key cannot be controlled by setting it, it can only be generated, and it's necessary to check if the Super Admin user already exists to not fail creating it. How could I authenticate with the user and their password? |
Using basic auth doesn't seem to work:
|
Oh, I see, it has to be enabled:
|
Yep, there we go:
Now it works. |
Work Environment
20.04.1
3.1.0
Problem Description
I'm installing Cortex with Ansible and I'd like to be able to programmatically create both the superuser and then the user and token that will be used by The Hive.
I looked ad the API docs:
https://github.com/TheHive-Project/CortexDocs/blob/master/api/api-guide.md
And as far as I can tell there is no method dedicated to this. And no environment variables that would facilitate this.
Possible Solutions
Exposing an API call to create a superuser when service is first started might be a bit dangerous, so most services provide environment variables that can be set and used at startup to create the admin user. Something like:
And this would allow a tool like Ansible to start creating other users necessary to bootstrap other services like The Hive.
The text was updated successfully, but these errors were encountered: