sensu / sensu-influxdb-handler

Sensu Go InfluxDB Metrics Handler
https://sensu.io
MIT License
14 stars 16 forks source link

Update example config to use ENVVARS for database creds #19

Closed jspaleta closed 5 years ago

jspaleta commented 5 years ago

cmdline arguments are viewable in systemwide process table.

database creds should be held in envvars and references as envvars on the commandline to avoid leaking into the process table.

jspaleta commented 5 years ago

Something like this should work at the linux/osX cmdline \$ is used to prevent bash from trying to replace the variables will creating the command.

sensuctl handler create influx-db \
--type pipe \
--env-vars "INFLUX_USER='user', INFLUX_PASS='pass'"
--command "sensu-influxdb-handler \
--addr 'http://123.4.5.6:8086' \
--db-name 'myDB' \
--username \${INFLUX_USER} \
--password \${INFLUX_PASS}"
jspaleta commented 5 years ago

Actual no.. this is all wrong. What we need is for influxdb handler to optionally parse ENVVARS instead of arguments.

If it inputted as an argument on the cmdline even via envvar substitution it leaks into the process table.

I'll try to do a PR for this teaching the handler to check for special envvar values.

nikkictl commented 5 years ago

Closed by https://github.com/sensu/sensu-influxdb-handler/commit/45d52de8c8f7dd99b8b44231d64a7f459e42e68b