Skip to content

passing wrong secrets to AWS break the plan forever until you clear the cache #589

Closed

Description

@samalba

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.

To fix the issue, I had to:

  1. docker rm -f dagger-buildkitd
  2. docker volume rm dagger-buildkitd
  3. dagger up

cc @aluzzardi

Activity

  1. added
    kind/bug
    on Jun 8, 2021
  2. grouville commented on Jun 8, 2021

    @grouville
    Member

    @samalba @aluzzardi, it is the source of the issue I have been encountering since yesterday (when running tests locally 🤯)

  3. aluzzardi commented on Jun 8, 2021

    @aluzzardi
    Contributor

    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.

  4. added this to the v0.1.0 milestone on Jun 8, 2021
  5. samalba commented on Sep 3, 2021

    @samalba
    ContributorAuthor

    @benja-M-1 was impacted by this bug with GCP auth. The bug is not AWS specific.

  6. grouville commented on Sep 7, 2021

    @grouville
    Member

    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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions