Skip to content

Cloudstack doesn't validate the account type and Role during ldapCreateAccount #11472

Description

@kiranchavala

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

  1. Add a ldap configuration
Image
  1. Create domain
Image
  1. Link the domain to LDAP , set the account type to 2 which is domainAdmin
Image

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"
}
}

  1. 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 |

  1. Create Ldap account

https://cloudstack.apache.org/api/apidocs-4.20/apis/ldapCreateAccount.html

select the roletype to user

  1. Account is created with user role type
Image

What to do about it?

CloudStack should validate the role and account type

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions