这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ringerc
Copy link
Collaborator

@ringerc ringerc commented Jun 17, 2024

When doing database auto-discovery, exclude all databases marked as templates and any databases that do not allow connections.

It's conceivable, but not very likely, that someone could want to scrape metrics from a template DB, but pg_exporter currently defaults to excluding template1 anyway. postgres_exporter also has the same behaviour of excluding template DBs from discovery. So I did not add a CLI option to override this behaviour.

Additionally, schema-qualify references to pg_database and the pg_is_in_recovery function call in the database discovery query to guarantee protection against any possible search_path based attacks. I can't immediately see how it'd be possible in this case, so it's not a vulnerability, but it's best practice to always schema-qualify everything in any query that could possibly be run as a privileged role.

ringerc added 2 commits June 18, 2024 11:20
Schema-qualify all object references in queries to `pg_database`.
When doing database auto-discovery, exclude all databases marked as
templates and any databases that do not allow connections.

It's conceivable, but not very likely, that someone could want to scrape
metrics from a template DB, but pg_exporter currently defaults to
excluding template1 anyway. postgres_exporter also has the same
behaviour of excluding template DBs from discovery. So I did not add a
CLI option to override this behavour.
@Vonng Vonng merged commit c8d4c39 into pgsty:master Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants