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

EC2 Auth Fails on Some Instances #12520

Closed
maths22 opened this issue Sep 8, 2021 · 0 comments · Fixed by #12519
Closed

EC2 Auth Fails on Some Instances #12520

maths22 opened this issue Sep 8, 2021 · 0 comments · Fixed by #12519
Labels
auth/aws bug Used to indicate a potential bug ecosystem

Comments

@maths22
Copy link
Contributor

maths22 commented Sep 8, 2021

Describe the bug
EC2 Vault login fails with failed to parse the BER encoded PKCS#7 signature: ber2der: Invalid BER format for some instances

To Reproduce
Steps to reproduce the behavior:

  1. Run vault write -format=json "auth/aws/login" role="$role" pkcs7="$pkcs7" nonce="$nonce"
  2. Get the error from above

This only happens on a subset of ec2 instances (those that include a certificate in the response from http://169.254.169.254/latest/dynamic/instance-identity/pkcs7) We could not find a pattern as to which instances did and didn't include the certificate, but the bug reliably happens if the certificate is included.

Expected behavior
It should not break

Environment:

  • Vault Server Version (retrieve with vault status): 1.8.2
  • Vault CLI Version (retrieve with vault version): 1.6.2
  • Server Operating System/Architecture: linux/amd64

Additional context
When #12340 / #12361 were pulled in, they happened before this upstream PR: mozilla-services/pkcs7#61

Without the upstream pr, certain valid BER files are rejected as invalid and are mis-parsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth/aws bug Used to indicate a potential bug ecosystem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants