When running the vecs-cli command to delete an expired CSR using a custom user account assigned with superAdmin role, it fails with an ERROR_ACCESS_DENIED error:
<User name>@<VC hostname> [ ~ ]$ /usr/lib/vmware-vmafd/bin/vecs-cli entry delete --store MACHINE_SSL_CERT --alias __MACHINE_CSR -yvecs-cli failed. Error 5: Possible errors:LDAP error: Compare FalseWin Error: Operation failed with error ERROR_ACCESS_DENIED (5)
VMware vCenter Server
This is because the user account does not have access permissions for that store MACHINE_SSL_CERT.
You can see the current permission settings for the store using vecs-cli store get-permissions command.# /usr/lib/vmware-vmafd/bin/vecs-cli store get-permissions --name MACHINE_SSL_CERTPERMISSIONS FOR STORE: [MACHINE_SSL_CERT]OWNER : rootUSER ACCESSvlcm readupdatemgr readvsphere-ui readvpxd readvpostgres readvsm readvsan-health readlighttpd readrhttpproxy write
To add read/write permission to the user account, use vecs-cli store permission command.
example:# /usr/lib/vmware-vmafd/bin/vecs-cli store permission --name MACHINE_SSL_CERT --user <User name> --grant writePermissions for store [MACHINE_SSL_CERT] set successfully#