Secure the installation#

Close ports#

InfluxDB#

/etc/influxdb/influxdb.conf:

# Bind address to use for the RPC service for backup and restore.
bind-address = "localhost:8088"

[http]
# The bind address used by the HTTP service.
bind-address = "localhost:8086"
systemctl restart influxdb

Grafana#

/etc/grafana/grafana.ini:

http_addr = localhost
systemctl restart grafana-server

Enable authentication#

InfluxDB#

Purpose: Enable auth-only access to InfluxDB.

  1. Create admin user:

    $ curl --silent --get 'http://kotori.example.org:8086/query?pretty=true' --user root:root --data-urlencode 'q=CREATE USER admin WITH PASSWORD 'admin' WITH ALL PRIVILEGES'
    
  1. Enable authentication by setting the auth-enabled option to true in the [http] section of the configuration file:

    [http]
    # ...
    auth-enabled = true
    # ...