You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, love the work on expanding the functionality and pushing this out to the marketplace. Unfortunately, I have discovered an issue with this that is also present in my action... I am unable to get the values of the AAD dynamic secret.
Let me set you up properly.
Understanding the Azure AD Akeyless Response
This is what you get when using the Akeyless CLI when fetching an Azure AD dynamic secret.
{
"id": "{\"secret_name\":\"tmp.p-m9vvgiii6rip.kj36S\",\"secret_key_id\":\"0c46516c-076e-4e69-bcf3-7c2fcac265a7\"}",
"msg": "User has been added successfully to the following Group(s): [] Role(s): [] Expires on Thu Aug 10 14:38:59 UTC 2023",
"secret": {
"appId": "207ff3fc-f6e3-4467e-babf-66b62e047be7",
"displayName": "tmp.p-m9vvgiii6rip.kj36S",
"keyId": "0c46516c-3456-4e69-bcf3-7c2fcac265a7",
"secretText": "xrk8Q~qvnUbBHfXlCmaTdIakNyLc8xC.50gBqa0K",
"tenantId": "bd47e796-1234-4b8a-9101-1f4c0c7af31a"
},
"ttl_in_minutes": "60"
}
Notice how the important values we need to use are inside the secret value:
Problem
In my Action, this never gets properly parsed by the SDK, and it also seems you might be experiencing the same problem. Here is what happens when I run this action and try to get the value for secret
Repro 1 - Using key: "secret" For Precision
You can reproduce this with the following YAML. Notice I am using key=secret to be able to ignore the rest of the top-level values.:
This will output the rest of the dynamic secret's values.. but not secret.appId, secret.tenantId, etc. In fact, it still breaks when trying to read the value of secret:
Resolution
Either of these two outcomes would be considered a resolution.
An example that doesn't set the key, but is able to iterate over the sub-keys of secret
An update to the action that lets me set key: "secret" and then be able access the values of appId, tenantId and secretText
The text was updated successfully, but these errors were encountered:
After further investigation, I think I've found the reason why this is failing. The JSON data is using stringifies result in some key values but not with the secret's key's values. This is cuasing JSON parsers to fail.
Here is the output from the Action:
Since "[object, object]" cannot be deserialized because it is a string, not an object, thus there isn't a way to get the original values out of it.
If anyone else is reading this and having the same issue, I was able to write up a workaround by using the Akeyless REST API (instead of relying on the JavaScript SDK this action uses).
Hi Team,
First, love the work on expanding the functionality and pushing this out to the marketplace. Unfortunately, I have discovered an issue with this that is also present in my action... I am unable to get the values of the AAD dynamic secret.
Let me set you up properly.
Understanding the Azure AD Akeyless Response
This is what you get when using the Akeyless CLI when fetching an Azure AD dynamic secret.
Notice how the important values we need to use are inside the
secret
value:Problem
In my Action, this never gets properly parsed by the SDK, and it also seems you might be experiencing the same problem. Here is what happens when I run this action and try to get the value for
secret
Repro 1 - Using
key: "secret"
For PrecisionYou can reproduce this with the following YAML. Notice I am using key=secret to be able to ignore the rest of the top-level values.:
Repro 2 - Reading Entire Response
If you want to avoid the error, you can run it like this (with out declaring
key: "secret"
):This will output the rest of the dynamic secret's values.. but not secret.appId, secret.tenantId, etc. In fact, it still breaks when trying to read the value of
secret
:Resolution
Either of these two outcomes would be considered a resolution.
key
, but is able to iterate over the sub-keys ofsecret
key: "secret"
and then be able access the values ofappId
,tenantId
andsecretText
The text was updated successfully, but these errors were encountered: