fix(cyberstrike): 58 Correcting error preventing using of EC2 instance role via co… - #59
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
badchars
left a comment
There was a problem hiding this comment.
Thanks for the PR and for testing this on a real EC2 instance — the guard fix on line 248 (!providerConfig) is exactly right and matches what upstream is doing in anomalyco/opencode#40522.
One concern with the credential provider change: replacing fromNodeProviderChain() with fromInstanceMetadata() fixes the EC2 Instance Role case, but breaks other credential sources that the chain previously covered — SSO profiles, ~/.aws/credentials, credential_process, Web Identity tokens, etc. These are all valid ways to authenticate to Bedrock.
I understand the Bun parseKnownFiles Symbol crash motivated this change. We'll merge the PR as-is (guard fix is the critical part and it works for EC2), then follow up with a commit that restores fromNodeProviderChain with a fallback to fromInstanceMetadata so all credential sources work.
Thanks again for the contribution!
What does this PR do?
Fixes: Issue 58
Updated line 248 in
packages/cyberstrike/src/provider/provider.tsto include a check if aproviderConfigwas supplied. This previously caused an early exit if all items in the if statement were blank.The second change started at line 258 resolved an issue where Bun would crash when parsing local file structures, with error
'parseKnownFiles' is a Symbol.Type of change
Security impact
How did you verify it works?
Tested on EC2 that the config file is read and Cyberstrike can send prompts to Amazon Bedrock without API error using the attached EC2 Instance role.
Checklist
bun turbo typecheckpasses