glances icon indicating copy to clipboard operation
glances copied to clipboard

Improve the IP module with a link to Censys

Open nicolargo opened this issue 3 years ago • 2 comments

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)

nicolargo avatar Aug 07 '22 07:08 nicolargo

First version implemented in the develop branch.

TODO:

  • [x] - Implement the WebUI
  • [ ] - Tests

nicolargo avatar Aug 08 '22 09:08 nicolargo

To be tested.

nicolargo avatar Aug 13 '22 11:08 nicolargo