-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
problem
CloudStack doesn't validate the account type and Role during ldapCreateAccount
versions
Acs 4.20.1
The steps to reproduce the bug
Steps to reproduce the issue
- Add a ldap configuration
- Create domain
- Link the domain to LDAP , set the account type to 2 which is domainAdmin
or execute the api
https://cloudstack.apache.org/api/apidocs-4.20/apis/linkDomainToLdap.html
(localcloud) 🐱 > link domaintoldap domainid=394cbde8-efe2-4ef2-bac0-fa5958fa4134 type=GROUP accounttype=2 ldapdomain=cn=dev-team,ou=Telco-Bng,dc=example,dc=in admin=admin
{
"LinkDomainToLdap": {
"accounttype": 2,
"domainid": "394cbde8-efe2-4ef2-bac0-fa5958fa4134",
"ldapdomain": "cn=qa-team,dc=example,dc=in",
"name": "cn=qa-team,dc=example,dc=in",
"type": "GROUP"
}
}
- Check the database table
mysql> select * from ldap_trust_map;
+----+-----------+-------+-------------------------------------------+--------------+------------+
| id | domain_id | type | name | account_type | account_id |
+----+-----------+-------+-------------------------------------------+--------------+------------+
| 22 | 25 | GROUP | cn=dev-team,ou=Telco-Bng,dc=example,dc=in | 2 | 0 |
- Create Ldap account
https://cloudstack.apache.org/api/apidocs-4.20/apis/ldapCreateAccount.html
select the roletype to user
- Account is created with user role type
What to do about it?
CloudStack should validate the role and account type