rubrikinc / rubrik-powershell-sdk

The Rubrik Security Cloud SDK
https://www.powershellgallery.com/packages/RubrikSecurityCloud
MIT License
7 stars 8 forks source link

Connect-RSC Throws Error if not Admin #37

Closed smasterson closed 6 months ago

smasterson commented 7 months ago

Due to the version check Connect-RSC does upon connection, this will throw an error for any non-admin user, although the connection succeeds. This becomes problematic for any automation. Note - 'non-admin' is a bit vague...I haven't been able to find a permission set that will allow this action specifically.

PS C:\Users\MyUser> Connect-RSC
Connect-Rsc: One or more errors occurred. (The request generated an error.

Query: query GetRscVersion{
deploymentVersion

__typename }
Variables: null
Operation Name: GetRscVersion

GraphQLResponse<JObject>:
Data: null
Errors:

403 Objects are not authorized
  Locations:
    Line: 2, Column: 1
  Path: deploymentVersion
  Extensions:
{
  "code": 403,
  "trace": {
    "operation": "/api/graphql",
    "traceId": "emCSjcC4/UC3PE53cWkU1A==",
    "spanId": "3COwVjAQPss="
  }
}

HTTP Status Code: 200 OK

)
guirava commented 6 months ago

Can you verify it's an error and not a warning? Connect-Rsc writes a warning when there is a version mismatch

if (_schemaVersion != _serverVersion)
{
    _logger.Warning($"The installed RSC SDK version does not " +
    $"match the server version.");
}
smasterson commented 6 months ago

The error was posted above. It no longer seems to be the case, I suspect a change on the RSC side as I haven't update the module yet. Now with a 'non-admin' account the connection works as expected (no errors).