Security: ACS user access to all databases
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 6 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 32
Mô tả
##### ISSUE TYPE
* Bug Report
* Improvement Request
* Enhancement Request
##### COMPONENT NAME
~~~
Core, MySQL
~~~
##### CLOUDSTACK VERSION
~~~
4.19.0.0-snapshot.20231113
~~~
##### CONFIGURATION
##### OS / ENVIRONMENT
Ubuntu 22.04
##### SUMMARY
ACS requires access to all MySQL databases, which creates a huge security hole for a shared MySQL instance.
Trying to limit the scope of ACS access yields in the access denied error (see below).
##### STEPS TO REPRODUCE
~~~
> `sudo cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root`
/usr/share/cloudstack-management/setup/create-database.sql
lines: 64-65
GRANT process ON *.* TO cloud@`localhost`;
GRANT process ON *.* TO cloud@`%`;
// This works with the full access
GRANT ALL ON *.* TO 'root'@'hyp0' WITH GRANT OPTION
// This yields in an error:
- GRANT ALL ON mysql.* TO 'root'@'hyp0' WITH GRANT OPTION
- GRANT ALL ON billing.* TO 'root'@'hyp0' WITH GRANT OPTION
- GRANT ALL ON cloud.* TO 'root'@'hyp0' WITH GRANT OPTION
- GRANT ALL ON cloud_usage.* TO 'root'@'hyp0' WITH GRANT OPTION
~~~
##### EXPECTED RESULTS
~~~
ACS configs own databases only without an error
~~~
##### ACTUAL RESULTS
~~~
ACS wants a full access and gives an error when a limited db access is provided
We apologize for below error:
table:
/usr/share/cloudstack-management/setup/create-database.sql
Error:
b"ERROR 1045 (28000) at line 64: Access denied for user 'root'@'hyp0' (using password: NO)\n"
~~~
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với /usr/share/cloudstack-management/setup/create-database.sql, đặc biệt là các dòng 64-65, và tái hiện lệnh setup với các quyền MySQL bị giới hạn được hiển thị. Theo dõi những cơ sở dữ liệu và quyền nào ACS cần; hoàn tất khi setup CloudStack thành công chỉ với phạm vi cơ sở dữ liệu cần thiết và không có quyền truy cập vào các cơ sở dữ liệu không liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- mysql, sql
- Lĩnh vực
- databases, security
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100