Use custom DB roles in EventGate Lambdas
@tmikula-dev đang làm issue này rồi.
Từ ngày 15/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
Currently, all EventGate Lambdas connect to the database using the postgres superuser. This is a significant security anti-pattern — the application should use least-privilege, role-specific database credentials instead of a superuser account.
Problem
- Every Lambda function uses the
postgresuser for DB access, regardless of what operations it actually performs. - A compromised or buggy Lambda currently has full superuser access to the database (schema changes, other roles' data, etc.), far beyond what it needs.
- This is effectively the worst-case DB security posture for the application.
Proposed Change
- Update Lambdas to authenticate using the appropriate custom DB role(s) instead of
postgres. - Custom role credentials are (or will be) stored in AWS Secrets Manager (see companion infrastructure issue in
cps-eventbus-gatewayfor provisioning these secrets). - Pass the relevant Secrets Manager secret ARN into each Lambda so it can retrieve its DB credentials at runtime — likely via an environment variable (e.g.
DB_SECRET_ARN), then resolved through the AWS SDK/Secrets Manager client during cold start or connection setup. - Ensure Lambda IAM roles are granted
secretsmanager:GetSecretValuescoped to only the specific secret(s) they need. - Update DB connection/init code to fetch the username/password from the resolved secret instead of using hardcoded/
postgrescredentials.
Acceptance Criteria
- Lambdas no longer connect to the database as
postgres. - Each Lambda uses the custom role appropriate to its function/permissions needs.
- Secret ARN(s) are passed into Lambdas via environment variable(s).
- Lambda IAM permissions are scoped to only the secret(s) they require (least privilege).
- DB connection logic updated to fetch credentials from Secrets Manager at runtime.
Dependencies
- Ngôn ngữ chính
- Python
- Star
- 4
- Fork
- 0
- Merge trung bình
- 20 giờ 22 phút
- Pull request đã merge (30 ngày)
- 8
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 AbsaOSS/EventGate
-
refactoring type:tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
infrastructure type:tech-debt
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
-
refactoring type:tech-debt
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 71/100
Tất cả issue của AbsaOSS/EventGate
Issue tương tự
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100