Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bgelov/prometheus-web-yml

Prometheus web.yml file generator for basic authentication
https://github.com/bgelov/prometheus-web-yml

authentication basic-auth-prometheus basic-authentication prometheus prometheus-authentication prometheus-yml web-yml yml

Last synced: about 1 month ago
JSON representation

Prometheus web.yml file generator for basic authentication

Awesome Lists containing this project

README

        

## What kind of script is this?
The script generates a web.yml file with a password hash using [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), which is necessary to enable basic authentication for Prometheus.

## How does it work?
The script prompts for username and password.
When you enter username and password, you need waiting 10 seconds timeout for bcrypt processing.
- If there is a web.yml file, you will be prompted to either recreate it or add credentials to the end of the file.
- If there is no web.yml file, a new file will be generated.

After, you need add web.yml to Prometheus configuration:
```
--web.config.file=/etc/prometheus/web.yml
```

Prometheus documentations about basic auth: [https://prometheus.io/docs/guides/basic-auth/](https://prometheus.io/docs/guides/basic-auth/)

## Example of a generated file
```
basic_auth_users:
test: $2y$17$Ac2deeUOLKZSP2L81awluuTAiisMp46T4NTJ0MX3tpfPXC3MUVl8G
```

## Why is it necessary?
Read the article by [JFrog](https://github.com/jfrog): [Don’t let Prometheus Steal your Fire](https://jfrog.com/blog/dont-let-prometheus-steal-your-fire/)

## Add rights for executing .sh file
```
chmod u+x generate_web_yml.sh
```