Agent pool Postgres DSN is logged in cleartext, including the password, while the auth DSN is redacted
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Tìm đường dẫn log collection của PostgreSQL cho agent pool và so sánh với đường dẫn logging của cơ sở dữ liệu xác thực, nơi đã redacts DSN của nó. Tái hiện vấn đề bằng DSN của PostgreSQL agent pool, áp dụng cách redaction hiện có cho giá trị được ghi log và xác minh rằng password không còn xuất hiện trong collection log.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
LocalAI version
v4.9.0 (localai/localai:latest-gpu-nvidia-cuda-12, revision f7ad3f70eb5d8a0ddf80e08557f0d7df28cf032e)
Describe the bug
When the agent pool uses the Postgres vector engine, LocalAI logs the full
LOCALAI_AGENT_POOL_DATABASE_URL at INFO level, including the database
password in cleartext, every time it opens a collection.
The auth database URL is redacted correctly in the same log stream, so the
redaction helper already exists. It just is not applied on this path.
Redacted (correct), from LOCALAI_AUTH_DATABASE_URL:
INFO Auth enabled database="postgresql://%2A%2A%2A:%2A%2A%2A@postgres:5432/localai_auth?sslmode=disable"
Not redacted, from LOCALAI_AGENT_POOL_DATABASE_URL (password replaced by hand
before pasting here):
INFO PostgreSQL collection collectionName="AML" databaseURL="postgresql://localai_user:REDACTED-PASSWORD@postgres:5432/localai?sslmode=disable"
One line is emitted per collection on every start, so the credential is
repeated and persists in whatever collects container logs. In a Docker
deployment these sit on disk under the json-file driver and are readable by
anyone who can read container logs, for example through a management UI,
without any access to the environment or the compose file.
To Reproduce
- Set
LOCALAI_AGENT_POOL_VECTOR_ENGINE=postgresand
LOCALAI_AGENT_POOL_DATABASE_URL=postgresql://user:password@host:5432/db?sslmode=disable - Have at least one agent collection defined.
- Start LocalAI and read the log.
The PostgreSQL collection line contains the password verbatim.
Expected behavior
The agent pool DSN should be redacted in logs the same way the auth DSN
already is, or the log line should print only the host, port and database
name rather than the whole URL.
Additional context
Not configurable from the outside: the value has to be a DSN, so there is no
way for an operator to avoid this short of not using the Postgres vector
engine. Rotating the password does not help, because the new one is logged
too.
Suggested fix: apply the same redaction used for the auth DSN to the agent
pool DSN before logging.
- Ngôn ngữ chính
- Go
- Star
- 49.2k
- Fork
- 4.5k
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 362
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mudler/LocalAI
-
bug unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mudler/LocalAI#12337 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mudler/LocalAI#11995 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fish-speech: make compile:true usable on Blackwell sm_121 by honouring the CUDA toolkit's ptxasĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mudler/LocalAI#11348 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
barholeurĐang mởbug unconfirmed
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug unconfirmed
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mudler/LocalAI
Issue tương tự
-
area: global bug dx priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
grafana/mcp-grafana#1267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automation models
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
coverage-gap good-first-pattern help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/k8s-aibom#114 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
txn2/mcp-data-platform#1984 ·
Maintainer thường phản hồi trong vòng 1 ngày