Skip to content

Conversation

@kgal-akl
Copy link

@kgal-akl kgal-akl commented Sep 19, 2025

Description

Added a new Secret Store component for Akeyless.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

Issue reference

#4063

Requirements

  • Code compiles correctly, component loaded successfully after compiling local daprd with added Akeyless Secret Store component, secret retrieved:
image

@kgal-akl kgal-akl mentioned this pull request Oct 4, 2025
7 tasks
@kgal-akl kgal-akl marked this pull request as ready for review October 4, 2025 05:09
@kgal-akl kgal-akl requested review from a team as code owners October 4, 2025 05:09
type: string
- name: accessId
required: true
description: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we support accessKey and aws iam, then can you pls bring in the builtinAuthProfile for aws here? Also, please be mindful of the authProfiles field in the metadata.yaml files that are meant for authentication profiles. That would be nice to leverage here if not just through the built-in aws profile :)

Copy link
Contributor

@sicoyle sicoyle Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the integration docs show that this component supports auth with gcp and azure, so you can also bring in and test out those builtin auth profiles if you want/have time (for gcp and azuread I think is what it's called). Otherwise, those can be a follow up effort, just please create a follow up issue for this 🙏 https://www.akeyless.io/integrations/

is a related goal of this PR to add dapr as an integration in the link i pasted for akeyless integrations? We could probably do some promoting on that front if y'all want :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we support accessKey and aws iam, then can you pls bring in the builtinAuthProfile for aws here?

Can you provide a bit more info about builtinAuthProfile? I can't find this symbol in the repo or web search:

grep builtinAuthProfile -rnw ~dapr-components | wc -l
       0

the integration docs show that this component supports auth with gcp and azure

Correct, we're currently only implementing AWS IAM auth to target a specific use case. We will definitely add GCP/Azure auth when the need arises.

is a related goal of this PR to add dapr as an integration in the link i pasted for akeyless integrations? We could probably do some promoting on that front if y'all want :)

We see adding Akeyless as a Dapr Secret Store as more of a 'plugin' than an 'integration'. We have them listed in https://docs.akeyless.io/docs/plugins-overview. I'll get back to you about the promoting part.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we support accessKey and aws iam, then can you pls bring in the builtinAuthProfile for aws here?

I reviewed the resources provided in #4036 (comment) on how to use the BuiltinAuthenticationProfile and AuthenticationProfile.

From what I see, when configuring the builtinAuthenticationProfiles we would be authenticating directly with the cloud provider.
In order to be able to get secrets from Akeyless we need to use the Akeyless cloud provider authentication method access ID to authenticate with the cloud provider and get an Akeyless temporary token:

image

We have a library https://github.com/akeylesslabs/akeyless-go-cloud-id that gets us this temporary token directly from the cloud provider metadata server running in their cluster/VMs infrastructure (e.g. AWS IMDSv2).

Given this auth flow, using the builtinAuthenticationProfiles doesn't make sense since we need to go through Akeyless or the cloud provider metadata server to authenticate and not directly to the cloud provider external APIs.

Regarding using the authenticationProfiles, it could work for us but I'm not sure how to implement it for our case.
As you can see from our metadata.yaml, the only required parameter is accessId and is used in all of the authentication methods. From what I can tell, this would mean that I would need to set accessId in each one of the profile metadata sections, e.g.:

authenticationProfiles:
  - title: "API Key Authentication"
    description: Authenticate using Akeyless API key
    metadata:
     - name: accessId
        type: string
        required: true
        sensitive: true
        description: Akeyless access ID
        example: "ABCD1233...="
      - name: accessKey
        type: string
        required: true
        sensitive: true
        description: Akeyless access key
        example: "ABCD1233...="
  - title: "JWT Authentication"
    description: Authenticate using JWT token
    metadata:
     - name: accessId
        type: string
        required: true
        sensitive: true
        description: Akeyless access ID
        example: "ABCD1233...="
      - name: jwt
        type: string
        required: true
        sensitive: true
        description: JWT token for authentication
        example: "eyJ..."

Is there a way to make a parameter such as accessId mandatory in all profile metadata? If not, I believe there's no real benefit to choosing authenticationProfiles over the current implementation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the links and pic - that's a very helpful visual. I understand what you're saying and agree with you on this will be done outside of the scope of the existing builtin auth profile setup we have. Imo, having defined auth profiles in the metadata makes it easier for end dapr users to know concretely what auth profile they are opting into, esp since there are downstream consumers of the metadata bundle that we generate per release... so even if you do have accessId in both/all, then that is fine. I'm fine either way tbh, but again, do think it is nicer from DX to see explicit auth profiles - thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will refactor to use authentication profiles. I found that the only place where the authenticationProfiles key is used is in the schema here:

type ComponentMetadata struct {
	AuthenticationProfiles []AuthenticationProfile `json:"authenticationProfiles,omitempty" yaml:"authenticationProfiles,omitempty"`
}

Since I want to implement the authentication profile interface, I wanted to change the type passed into the Init function signature from secretstores.Metadata to schema.ComponentMetadata:

func (a *akeylessSecretStore) Init(ctx context.Context, meta secretstores.Metadata) error {
}
func (a *akeylessSecretStore) Init(ctx context.Context, meta schema.ComponentMetadata) error {
}

However, the schema package is inside the .build-utils directory and I can't import it into the secretstore.akeyless module.

I wanted to take get the authentication profiles from the secretstore package metadata module but it only has a Properties map:

# https://github.com/akeylesslabs/DAPR-components/blob/93d56de21248d21bb4f287920e0b97ab7c8fe165/secretstores/metadata.go#L22-L24
type Metadata struct {
	metadata.Base `json:",inline"`
}

# https://github.com/akeylesslabs/DAPR-components/blob/93d56de21248d21bb4f287920e0b97ab7c8fe165/metadata/base.go#L22-L27
type Base struct {
	// Name is the name of the component that's being used.
	Name string
	// Properties is the metadata properties.
	Properties map[string]string `json:"properties,omitempty"`
}

If I can't import and use ComponentMetadata.AuthenticationProfiles to parse the authentication profiles from the secretstore metadata, how do I parse them correctly?

@kgal-akl kgal-akl requested a review from sicoyle October 22, 2025 17:33
kgal-akl and others added 22 commits October 22, 2025 15:17
add aws iam, jwt support

Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Cassandra Coyle <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Javier Aliaga <[email protected]>
Co-authored-by: Sam <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
added support for single static secret value

Signed-off-by: Kobbi Gal <[email protected]>
wip: get bulk secrets
Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
treat initial rotation status as active

Signed-off-by: Kobbi Gal <[email protected]>
Signed-off-by: Kobbi Gal <[email protected]>
@kgal-akl kgal-akl force-pushed the add-akeyless-secretstore branch from a56fc84 to b2a72bf Compare October 22, 2025 19:17
Copy link
Contributor

@sicoyle sicoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for iterating with me on this! Here's another batch of feedback for ya - I still have a bit more to review on this, but this is the main I think so far :) 🙌

| `k8sServiceAccountToken` | No | If using the k8s auth method, specify the service account token. If not specified,
we will try to read it from the default service account token file. | `eyJ...` |

We currently support the following [Authentication Methods](https://docs.akeyless.io/docs/access-and-authentication-methods):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We currently support the following [Authentication Methods](https://docs.akeyless.io/docs/access-and-authentication-methods):
While the Akeyless Dapr Secretstore only supports AWS IAM and Kubernetes JWT authentication, Akeyless in general currently supports the following [authentication methods](https://docs.akeyless.io/docs/access-and-authentication-methods).

or something along these lines pls

Comment on lines +43 to +44
K8SGatewayURL string `json:"k8sGatewayUrl" mapstructure:"k8sGatewayUrl"`
K8SAuthConfigName string `json:"k8sAuthConfigName" mapstructure:"k8sAuthConfigName"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
K8SGatewayURL string `json:"k8sGatewayUrl" mapstructure:"k8sGatewayUrl"`
K8SAuthConfigName string `json:"k8sAuthConfigName" mapstructure:"k8sAuthConfigName"`
K8sGatewayURL string `json:"k8sGatewayUrl" mapstructure:"k8sGatewayUrl"`
K8sAuthConfigName string `json:"k8sAuthConfigName" mapstructure:"k8sAuthConfigName"`

a.logger.Debug("Creating authentication request to Akeyless...")
authRequest := akeyless.NewAuth()
authRequest.SetAccessId(metadata.AccessID)
authRequest.SetAccessType(metadata.AccessType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is missing in metadata.yaml. Pls use the allowed values field too for this one for the consts you set for the select case below


// Get the authentication method
a.logger.Debug("extracting access type from accessId...")
accessTypeChar, err := ExtractAccessTypeChar(m.AccessID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
accessTypeChar, err := ExtractAccessTypeChar(m.AccessID)
accessTypeChar, err := extractAccessTypeChar(m.AccessID)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls check if there are any other funcs that should be un-exported

}
a.logger.Debugf("access type detected: %s", accessTypeDisplayName)

switch accessTypeDisplayName {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the other auth types need validations?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants