Administrator
An administrator has access to everything a user has, and a few other functionalities:
They can:
- Manage the channels
- Manage the users
- Manage the schedulers
Settings
The settings page allows the administrator to manage the existing channels and create new ones. The channels used are using Redis, and require a name, a database number, a host (default redis) and a port (default 6379).
Users
The users page allows the administrator to:
- Remove existing users,
- Create or edit a scheduler,
- Create a new user
Create a new administrator using CLI
If there is a need for multiple administrators, a new administrator can be created using the shell inside the API container (see the production installation for more details) using the following command:
../docker-entrypoint.sh create-user [USERNAME] [PASSWORD] --admin
Replacing [USERNAME]
and [PASSWORD]
with the corresponding data.
Removing the --admin
option will create a simple user, and adding --scheduler
will create a new scheduler.
There are also two other commands that can be used in the CLI:
../docker-entrypoint.sh delete-user [USERNAME]
Will remove a user, no matter their role (admin, scheduler or user).
../docker-entrypoint.sh reset-password [USERNAME] [NEW_PASSWORD]
Will change the password of a user.
Add a new extern API
If you need to add other externs APIs, it can be done this way:
Add API data in the database
First, you need to gather the data of the api you want to add, and insert it in the /passiveDNS/db/extern_apis.yml
document as follows:
...
---
_key: "API_NAME"
base_url: "BASE_URL"
header: "NAME_OF_APIKEY_HEADER"
ip:
method: "GET/POST"
uri: "URI_FOR_IP_REQUEST"
domain:
method: "GET/POST"
uri: "URI_FOR_DOMAIN_REQUEST"
Replacing each line with the appropriate data. This data will automatically be added to the database the next time you run the application.
Add data formatting
Next, you need to update the /passiveDNS/analytics/extern_api.py
file, to add the data formatting for your new API. To do so, you can get inspiration from the Virustotal or AlienVault formatting already existing.
There are 3 things to modify in this file :
First, add a global variable with the name you specified as _key
in the .yml
file.
|
|
Then, you need to add the formatting function for you new API, at the end of the file:
|
|
Note : The data returned should be a list with this format after passing through the function :
[
{
"domain_name": ,
"ip_address": ,
"first_updated_at": ,
"last_updated_at": ,
},
"..."
]
Finally, in get_api
function:
|
|