Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve alibaba cloud credential providers in OSS artifacts #11453

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

DahuK
Copy link
Contributor

@DahuK DahuK commented Jul 26, 2023

Motivation

Improve the credential security of OSS artifacts, avoid hardcoding AK in secret
For more details abount alibaba cloud credential provider, please refer to credentails-go

Modifications

add new configuration for OSSBucket in workflow_types.go to support using the default provider chain or the oidc token provider to get alibaba cloud credentials.

	// RoleARN is the Alibaba Cloud Resource Name(ARN) of the role to assume.
	RoleARN string `json:"roleARN,omitempty" protobuf:"bytes,8,opt,name=roleARN"`

	// OidcProviderARN is the Alibaba Cloud Resource Name (ARN) of the OIDC IdP.
	OidcProviderARN string `json:"OidcProviderARN,omitempty" protobuf:"bytes,9,opt,name=OidcProviderARN"`

	// OidcTokenFile is the file path of the OIDC token.
	OidcTokenFile string `json:"OidcTokenFile,omitempty" protobuf:"bytes,10,opt,name=OidcTokenFile"`

	// UseSDKCreds tells the driver to figure out credentials based on sdk defaults.
	UseSDKCreds bool `json:"useSDKCreds,omitempty" protobuf:"varint,11,opt,name=useSDKCreds"`

and refine the artifacts oss.go to init the OSS client with then given provider configuration

Verification

  • Run make pre-commit -B
  • Run draft PR to check changes

@DahuK DahuK marked this pull request as draft July 26, 2023 12:14
@DahuK DahuK marked this pull request as ready for review July 26, 2023 12:18
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Have you tested this change in an actual OSS bucket?

return oss.New(ossDriver.Endpoint, "", "",
oss.SetCredentialsProvider(provider))
}
//using ak sec
Copy link
Member

Choose a reason for hiding this comment

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

Be more descriptive or remove the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@terrytangyuan
Copy link
Member

Please also resolve conflicts

@DahuK DahuK force-pushed the refine-oss-artifacts branch 2 times, most recently from 1ea96a4 to e17a01e Compare July 28, 2023 09:34
@DahuK
Copy link
Contributor Author

DahuK commented Jul 28, 2023

Have you tested this change in an actual OSS bucket?

@terrytangyuan Thanks for your review! I have tested both of RRSA service account mode and the original AK/SK mode in ACK cluster, it works fine when saving and loading OSS artifacts in output/input wf steps.

image

image

Signed-off-by: dahu.kdh <dahu.kdh@alibaba-inc.com>
Signed-off-by: dahu.kdh <dahu.kdh@alibaba-inc.com>
Signed-off-by: dahu.kdh <dahu.kdh@alibaba-inc.com>
@DahuK
Copy link
Contributor Author

DahuK commented Jul 28, 2023

Please also resolve conflicts

Fixed, thanks!and added some instructions on how to cofigure and use Alibaba Cloud OSS RRSA in configure-artifact-repository.md

Copy link
Member

@terrytangyuan terrytangyuan 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!

@terrytangyuan terrytangyuan enabled auto-merge (squash) July 28, 2023 11:30
@terrytangyuan terrytangyuan merged commit e53a265 into argoproj:master Jul 28, 2023
22 checks passed
@agilgur5 agilgur5 added the area/artifacts S3/GCP/OSS/Git/HDFS etc label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/artifacts S3/GCP/OSS/Git/HDFS etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants