12 Commits

Author SHA1 Message Date
Hector
5be7095e87 refactor config basic auth to handle hashing data
Add unit tests for the basicAuth to ensure it behaves as expected.
Update the basic auth provider struct in the cfg package to handle all the
hashing automatically.
2022-01-13 22:21:39 +00:00
Hector
e78d4e7298 add new basic auth provider class
Fix the circular dependency by adding a new BasicAuthProvider interface to
wrap the basic auth values.
Add unit tests for the hash functions.
Refactor functions to use the new basic auth provider interface.
2022-01-13 21:25:37 +00:00
Hector
26f0b0d0ce store basic auth credentials as hash instead of raw value
Update how the basic auth credentials are stored in the application to use
a hashed value instead of the raw value. This prevents the raw value from
being accidentally leaked.
Add new `auth` package for functions related to authentication.
2022-01-13 20:34:42 +00:00
Hector
e176a3ea22 check basic auth username and password set
Add check to ensure basic auth username and password are both set or both
unset. It isn't valid to set one without the other.
Update README file to include the new CLI parameters.
2022-01-12 22:05:27 +00:00
Hector
e3d8c1e0e5 feat: add support for basic auth (#16)
Add new CLI parameters to enable protecting the API endpoints with basic
auth authentication.
Wrap the server endpoints in a new authMiddleware that protects it using
the provided basic auth credentials (if set).
2022-01-11 21:53:43 +00:00
Hector
497e2ff692 remove: references to db collector
Remove final references to the deprecated database metric collector.
Remove counter for db connection errors.

BREAKING CHANGE: Remove `-db` CLI flag.
2021-12-21 17:42:42 +00:00
Private Creator
c208c8e97d feat: add listen address parameter
Add new -web.listen-address command line parameter, so that the
listening interface can be limited. This follows a similar style as
the official prometheus-node-exporter project.
Update project README with the new parameter.
2021-12-18 06:45:37 +00:00
Hector
b268f8654c remove: database-based metrics
Remove all database-based metrics from the metrics endpoint.
Remove all code related to pulling metrics from the fail2ban database.
Remove all configuration variables related to the fail2ban database.
The CLI parameter for the database path was not removed to avoid breaking
compatibility.
Update docker entrypoint to remove references to the fail2ban database.
Remove all references to the old database metrics from the README.
2021-10-15 18:02:26 +00:00
Hector
5a107cc547 feat: support for textfile metrics (#13)
Add support for collecting arbitrary metrics from a textfile as well as
metrics collected from fail2ban. This allows other data to be exported
along with the fail2ban metrics (e.g. instance metadata).
Update the docker image to allow mounting a folder with a collection of
metric files to be exported. Only files ending in `.prom` with be read.
Update project README with the new functionality.
2021-10-12 20:38:26 +00:00
Hector
5b62670e9d refactor: deprecate database metrics
Update all old database-based metrics to include the `deprecated` text.
Add a warning on startup if connecting to the fail2ban database to state
that this functionality will be removed in a future release.
Rename deprecated methods and variables.
2021-08-30 16:38:33 +00:00
Hector
39133d0a76 feat: collect new up metric from fail2ban socket
Add support for connecting the exporter directly to the fail2ban server's
socket to send requests and receive data. The path to the socket file is
optional and specified on startup.
Export a new metric based on the response of the `ping` command sent to the
fail2ban server. The metric is set to 1 if the server responds with `pong`
and 0 in any other case. This metric is only shown if the path to the
socket file was provided on startup.
2021-08-29 11:50:53 +00:00
Hector
9bf3195743 chore: move all source files to new folder
Update the project structure to move all golang files to a new `src/`
folder. This keeps all the code located in the same place and easier to
work with.
Update the Makefile and goreleaser config to continue to work with the new
folder structure.
2021-02-08 18:49:48 +00:00