From 4a9876c349155211d4e8c73160dc3b3ab2f3a8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Wed, 19 Feb 2025 12:13:06 +0100 Subject: [PATCH] Complete README.md --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5ac647..695cc34 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,32 @@ token. The following env variables will need to be set: -- **NB_API_URL**: The URL to your NetBox instance. (Example: https://netbox.example.org) -- **NB_API_TOKEN**: The token created previously. (Example: f74cb99cf552b7005fd1a616b53efba2ce0c9656) +- **NB_API_URL**: The URL to your NetBox instance. (ex: https://netbox.example.org) +- **NB_API_TOKEN**: The token created previously. (ex: f74cb99cf552b7005fd1a616b53efba2ce0c9656) ### On pfSense pfSense does not provide any REST API out of the box. Therefore, you'll first need to install the [pfrest package](https://pfrest.org/INSTALL_AND_CONFIG/#). +Once it's done you can create a user dedicated for this application (ex: pfsense-netbox-sync). +You'll then need to grant the account all permissions for ``/api/v2/services/dns_resolver/*`` (Effective Privileges in +the user page). + +Note: You **should** restrict API access to the IP who are using it. + +The following env variables will need to be set: + +- **PF_API_URL**: The URL to your pfSense instance. (ex: https://fw.example.org) +- **PF_API_USER**: The username of the account created previously. (ex: pfsense-netbox-sync) +- **PF_API_PASS**: The password of the account created previously. (ex: MQILv21OJIJ_x4dO0hZgJtwl) + ## Executing the script +You can then execute the script using the following command: + ``` PF_API_URL=xx PF_API_USER=xx PF_API_PASS=xx NB_API_URL=xx NB_API_TOKEN=xx python3 -m app -``` \ No newline at end of file +``` + +The script will indicate any change made. \ No newline at end of file