Improve the IP module with a link to Censys
Censys is a IP database available through an API: https://search.censys.io/api
The proposal is to display additional information concerning the IP address in the Glances interface.
The configuration to the Censys services should be added to the glances.conf file:
[ip]
disable=False
censys_url=https://search.censys.io/api
# Get your own credential here: https://search.censys.io/account/api
censys_username=CENSYS_API_ID
censys_password=CENSYS_API_SECRET
# List of fields to be displayed in user interface (comma separated)
censys_fields=location:continent,location:country,autonomous_system:name
Example of curl request:
curl -u "CENSYS_API_ID:CENSYS_API_SECRET" "https://search.censys.io/api/v2/hosts/82.66.169.82"
{"code": 200, "status": "OK", "result": {"ip": "82.66.169.82", "services": [], "location": {"continent": "Europe", "country": "France", "country_code": "FR", "postal_code": "", "timezone": "Europe/Paris", "coordinates": {"latitude": 48.8582, "longitude": 2.3387}, "registered_country": "France", "registered_country_code": "FR"}, "location_updated_at": "2022-08-07T07:27:15.420656Z", "autonomous_system": {"asn": 12322, "description": "PROXAD", "bgp_prefix": "82.64.0.0/14", "name": "PROXAD", "country_code": "FR"}, "autonomous_system_updated_at": "2022-08-07T07:27:15.420656Z"}}
Result:
IP 192.168.0.48/24 Pub 82.66.XX.YY (Europe/France/PROXAD)
First version implemented in the develop branch.
TODO:
- [x] - Implement the WebUI
- [ ] - Tests
To be tested.