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

SignatureDoesNotMatch error in RamRoleArn mode #454

Open
QiXingchuan opened this issue Sep 18, 2024 · 6 comments
Open

SignatureDoesNotMatch error in RamRoleArn mode #454

QiXingchuan opened this issue Sep 18, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@QiXingchuan
Copy link

Describe the bug

The query will have errors like this after the steampipe service runs for some time.

Error: alicloud_sandbox: SDK.ServerError
ErrorCode: SignatureDoesNotMatch
Recommend: InvalidAccessKeySecret: Please check you AccessKeySecret
Message: Specified signature is not matched with our calculation.

Steampipe version (steampipe -v)

Steampipe v0.23.2

Plugin version (steampipe plugin list)

hub.steampipe.io/plugins/turbot/alicloud@latest | 0.23.0

To reproduce

  • config
connection "alicloud_sandbox" {
  plugin = "alicloud"
  regions = ["cn-shanghai"]
  profile = "syncer-test"
}

# .aliyun/config.json
{
	"current": "default",
	"profiles": [
		{
			"name": "syncer-test",
			"mode": "RamRoleArn",
			"access_key_id": "xxx",
			"access_key_secret": "xxx",
			"sts_token": "",
			"sts_region": "",
			"ram_role_name": "syncer-test",
			"ram_role_arn": "acs:ram::xxx:role/syncer-test",
			"ram_session_name": "syncer-test",
			"source_profile": "",
			"private_key": "",
			"key_pair_name": "",
			"expired_seconds": 0,
			"verified": "",
			"region_id": "cn-shanghai",
			"output_format": "json",
			"language": "en",
			"site": "",
			"retry_timeout": 0,
			"connect_timeout": 0,
			"retry_count": 0,
			"process_command": "",
			"credentials_uri": "",
			"oidc_provider_arn": "",
			"oidc_token_file": ""
		}
	],
	"meta_path": ""
}
  • steampipe service start
  • steampipe query
  • Execute query like select * from alicloud_sandbox.alicloud_ecs_instance
  • Execute query like select * from alicloud_sandbox.alicloud_ecs_instance after one hour

Expected behavior

The error should not happen.

Additional context

It seems that the credential is expired when this issue happens. This should be renewed internally, rather than throwing an error.

@QiXingchuan QiXingchuan added the bug Something isn't working label Sep 18, 2024
@ParthaI ParthaI self-assigned this Sep 19, 2024
@ParthaI
Copy link
Contributor

ParthaI commented Sep 23, 2024

Hello @QiXingchuan,

Sorry to hear that you're encountering this issue.

After reviewing it, I’d like to share a few key points for your consideration:

The ALI Cloud SDK previously did not support CLI authentication. We added profile authentication in Steampipe by manually parsing the file located at ~/.aliyun/config.json. However, it seems we may have missed handling session expiration properly. A support request was also raised with the SDK team. For reference, see: aliyun/alibaba-cloud-sdk-go#629.

Recently, they added support for profile authentication in the SDK. I’ve submitted a PR (#456) to address this issue. The updated profile authentication will now use the SDK's built-in mechanism.

The changes in the PR are still in progress, but it would be helpful if you could test it with the PR branch (update-alicloud-sdk) and let us know if the issue is resolved, or if there are any remaining edge cases we need to consider.

Thanks!

@QiXingchuan
Copy link
Author

Hi @ParthaI. Thank you for getting back to me so quickly! I tested it with PR #456, and the issue has been resolved.

@QiXingchuan
Copy link
Author

Hi @ParthaI. Is there any plan to merge the PR and release it?

@snigdhasambitak
Copy link

@ParthaI This is blcoking us from using the alicloud plugin. If you can give us a tentative day when the fixed PR will be merged, it would be great.

@ParthaI
Copy link
Contributor

ParthaI commented Nov 18, 2024

Apologies for the delay in the review process, @snigdhasambitak. @misraved, could you please review this PR when you get a chance and proceed accordingly? Thank you!

@snigdhasambitak
Copy link

snigdhasambitak commented Nov 19, 2024

@ParthaI we did verify your change and it works. Can you please merge the fixed PR now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants