You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
passing wrong secrets to AWS break the plan forever until you clear the cache #589
I don't think this is related to AWS, pretty sure this is global to usage of secrets.
I gave wrong secrets to awsConfig and I got the following error:
5:35PM INF s3bucket.url | computing
5:35PM ERR s3bucket.url | #13 3.188 fatal error: An error occurred (AuthorizationHeaderMalformed) when calling the ListObjectsV2 operation: The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".
I then tried to fix the keys and ran a dagger up again. Nothing fixed the issue, the wrong keys were persisted.
Since plaintext secrets are not part of LLB, buildkit doesn't see any changes (only the "secret ID" is in LLB and that doesn't change).
This usually doesn't affect packages that take both secrets and content: For instance, Netlify takes a secret and the source code to be deployed. If the source changes, then the cache is busted and buildkit will fetch a fresh new secret. If the source didn't change, there's nothing to deploy and no need to fetch secrets.
For aws.#CLI (and gcp.#GCloud): those only take secrets, nothing else. The cache is never busted.
Short term: Like any other caching stuff: run dagger up --no-cache will do the trick. We can add a always: true to aws and gcp.
Proper fix: Use the encrypted secret as the secret ID. That way cache will be busted properly. It's a bit tricky to implement.
Instead of having the encrypted secret as a secret ID, can't we just hash (sha512) the secret and use it as an ID.
Every time the up is processed, we compute it again. This way, if it doesn't change between two up, it will remain the same. And if it changes, it'll be different. May be easier to implement ?
Activity
grouville commentedon Jun 8, 2021
@samalba @aluzzardi, it is the source of the issue I have been encountering since yesterday (when running tests locally 🤯)
aluzzardi commentedon Jun 8, 2021
Since plaintext secrets are not part of LLB, buildkit doesn't see any changes (only the "secret ID" is in LLB and that doesn't change).
This usually doesn't affect packages that take both secrets and content: For instance, Netlify takes a secret and the source code to be deployed. If the source changes, then the cache is busted and buildkit will fetch a fresh new secret. If the source didn't change, there's nothing to deploy and no need to fetch secrets.
For
aws.#CLI(andgcp.#GCloud): those only take secrets, nothing else. The cache is never busted.Short term: Like any other caching stuff: run
dagger up --no-cachewill do the trick. We can add aalways: trueto aws and gcp.Proper fix: Use the encrypted secret as the secret ID. That way cache will be busted properly. It's a bit tricky to implement.
samalba commentedon Sep 3, 2021
@benja-M-1 was impacted by this bug with GCP auth. The bug is not AWS specific.
grouville commentedon Sep 7, 2021
Instead of having the encrypted secret as a secret ID, can't we just hash (sha512) the secret and use it as an ID.
Every time the
upis processed, we compute it again. This way, if it doesn't change between twoup, it will remain the same. And if it changes, it'll be different. May be easier to implement ?