Commit Graph

1098 Commits

Author SHA1 Message Date
Hidde Beydals 36df540a5d decryptor: detect format of Secret data field
This checks the base64 decoded bytes from a Secret field for any of the
marker bytes, thereby allowing data to be encrypted into any format.
Instead of the previous behavior which assumed it to either be YAML or
JSON.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-29 15:26:36 +02:00
Hidde Beydals a7639c68d3 decryptor: detect DockerConfigJsonKey as JSON out
This ensures the Secret field gets formatted back into JSON, instead of
it being detected as binary output.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-29 11:00:44 +02:00
Hidde Beydals e0ba73f4be
Merge pull request #643 from fluxcd/release-v0.24.4 2022-04-28 10:18:13 +02:00
Hidde Beydals 6c523b820a Release v0.24.4
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-28 09:58:22 +02:00
Hidde Beydals bcfd42466c
Merge pull request #637 from fluxcd/fix-build-panics 2022-04-27 12:26:30 +02:00
Hidde Beydals 6854ff519c generator: recover from kustomize build panics
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-27 12:11:40 +02:00
Stefan Prodan d1a686235c
Add test for build panic
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-27 12:58:56 +03:00
Stefan Prodan ac4594d053
Merge pull request #636 from seh/revise-sops-format-detection-for-generated-secrets
Use Secret generator keys for SOPS format hint
2022-04-27 11:37:40 +03:00
Steven E. Harris e6beca11b1
Confirm format detection of file sources via tests
Signed-off-by: Steven E. Harris <seh@panix.com>
2022-04-26 11:07:17 -04:00
Steven E. Harris ee0e4c1674
Remove invalid "EnvSources" entry from test case
Signed-off-by: Steven E. Harris <seh@panix.com>
2022-04-26 11:07:17 -04:00
Steven E. Harris 7162f5e6fa
Use Secret generator keys for SOPS format hint
Rather than inspecting the source file name supplied to kustomize's
Secret generator to determine the format of the SOPS-encrypted file
content, instead inspect the Secret key (when supplied separately from
the source file name) as a more reliable heuristic.

Doing so allows kustomization authors to name their SOPS-encrypted
output files with a ".json" extension accurately reflecting the format
in which SOPS writes its encrypted output, even if the encrypted
content itself is not in JSON format.

Signed-off-by: Steven E. Harris <seh@panix.com>
2022-04-26 11:07:17 -04:00
Hidde Beydals ef77093efd
Merge pull request #633 from fluxcd/release-v0.24.3
Release v0.24.3
2022-04-22 11:59:36 +02:00
Hidde Beydals f2986712d8 Release v0.24.3
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-22 11:35:55 +02:00
Hidde Beydals 4c7b436e4c
Merge pull request #632 from fluxcd/update-sc 2022-04-22 11:31:30 +02:00
Hidde Beydals 0cc81fcc17 Update source-controller to v0.24.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-22 11:14:09 +02:00
Hidde Beydals cda51febc7
Merge pull request #631 from cwyl02/ychen/exp-backoff-retry 2022-04-22 09:45:45 +02:00
Hidde Beydals 5d10770b37
Merge pull request #630 from aryan9600/fix-tmp-dir-macos
Ensure generated temp dir is absolute on all OSes
2022-04-22 09:45:11 +02:00
Sanskar Jaiswal d499ed8063 Ensure generated temp dir is absolute on all OSes
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-04-22 09:01:46 +02:00
York Chen 827f814f2f
feat: flags to configure exponential backoff retry
Signed-off-by: York Chen <ychen@d2iq.com>
2022-04-21 10:09:39 -04:00
Hidde Beydals 7dca61f430
Merge pull request #629 from fluxcd/release-v0.24.2 2022-04-21 11:13:55 +02:00
Hidde Beydals 0976a4fb33 Release v0.24.2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-21 10:55:16 +02:00
Hidde Beydals ee5a411b4c
Merge pull request #628 from fluxcd/update-deps 2022-04-21 09:24:46 +02:00
Hidde Beydals 897fc8d617 Update golang.org/x/crypto
This forces it past a CVE-2022-27191 version.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-20 19:51:51 +02:00
Hidde Beydals 65d0fe9e47
Merge pull request #627 from fluxcd/release-v0.24.1 2022-04-20 17:45:04 +02:00
Hidde Beydals 1cd31e6e4b Release v0.24.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-20 17:29:32 +02:00
Hidde Beydals 6985449947
Merge pull request #626 from fluxcd/kustomize-fs-remote 2022-04-20 17:29:23 +02:00
Hidde Beydals 880587f20d generator: ensure remote build dirs can be reached
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-20 17:12:33 +02:00
Hidde Beydals 69a9e9d6bf
Merge pull request #624 from fluxcd/release-v0.24.0 2022-04-19 14:10:00 +02:00
Hidde Beydals 4340d2f641 Release v0.24.0
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 13:46:28 +02:00
Hidde Beydals 31a8fb4e41
Merge pull request #623 from fluxcd/update-deps 2022-04-19 13:33:07 +02:00
Hidde Beydals 87ea78c24c Update dependencies
- github.com/fluxcd/source-controller/api to v0.24.0
- golang.org/x/net to v0.0.0-20220418201149-a630d4f3e7a2

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-19 13:18:06 +02:00
Hidde Beydals 2f41b20d6b
Merge pull request #621 from fluxcd/update-deps 2022-04-15 16:47:30 +02:00
Hidde Beydals f0bcd0ced0 Update dependencies
Azure SDK dependencies cannot be updated, as this requires us to move to
Go 1.18.

- github.com/fluxcd/pkg/apis/kustomize to version 0.3.3
- github.com/fluxcd/pkg/apis/meta to version 0.12.2
- github.com/fluxcd/pkg/runtime to version 0.14.1
- github.com/fluxcd/pkg/ssa to version 0.15.2
- github.com/hashicorp/go-retryablehttp to version 0.7.1
- github.com/hashicorp/vault/api to version 1.5.0
- github.com/onsi/gomega to version 1.19.0
- golang.org/x/net to version 0.0.0-20220412020605-290c469a71a5
- sigs.k8s.io/cli-utils to version 0.29.4

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-15 16:28:46 +02:00
Hidde Beydals 14996311be api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.3.3
- github.com/fluxcd/pkg/apis/meta to v0.12.2
- k8s.io/apiextensions-apiserver to v0.23.5
- k8s.io/apimachinery to v0.23.5
- sigs.k8s.io/controller-runtime to v0.11.2

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-15 16:28:46 +02:00
Hidde Beydals 39872cd02f
Merge pull request #620 from fluxcd/fssecure 2022-04-15 16:04:23 +02:00
Hidde Beydals f4528fb25d controllers: use own Kustomize FS implementation
For details, see: https://github.com/fluxcd/pkg/pull/262

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-15 15:48:23 +02:00
Hidde Beydals ad91006d4e
Merge pull request #619 from fluxcd/kustomize-decryptor-impr 2022-04-14 09:36:51 +02:00
Hidde Beydals 105ebd9f47 controllers: improve decryptor and add tests
- Refactored recursion while iterating over Kustomization files.
  References of files that have been visited are cached, and not
  visited again. In addition, symlinks are confirmed to not traverse
  outside the working directory.
- Optimized various bits around (un)marshalling (encrypted) data, and
  YAML -> JSON -> YAML roundtrips are prevented where not required.
- Added support for decrypting INI Kustomize EnvSource references using
  the dedicated SOPS store for the format.
- Introduced support for decrypting Kustomize FileSources:
  https://pkg.go.dev/sigs.k8s.io/kustomize@v1.0.2/pkg/types#DataSources

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-14 09:17:43 +02:00
Stefan Prodan 4da17e1ffb
Merge pull request #610 from dholbach/update-link
update toolkit.fluxcd.io docs link
2022-04-05 18:06:52 +03:00
Hidde Beydals 6bc847b339
Merge pull request #614 from pjbgf/release-v0.23.0 2022-04-05 16:15:38 +02:00
Paulo Gomes f90dbc9bb5
Release v0.23.0
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-05 12:54:18 +01:00
Hidde Beydals cbd02eaf03
Merge pull request #607 from fluxcd/sops-keyservice-imprv 2022-04-05 13:20:56 +02:00
Hidde Beydals 62dafa1baf decryptor: switch Printf to Errorf
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-05 13:07:01 +02:00
Hidde Beydals bf4cefe011 decryptor: mention Secret name in import errors
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-05 12:44:35 +02:00
Hidde Beydals 9db141d9db sops/keyservice: tidy and add tests
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-05 12:44:35 +02:00
Hidde Beydals ffdda3f3da sops/azkv: add Token utility type
This adds a new Token type which can be used to configure an
azcore.TokenCredential on a master key. Due to this introduction, the
server only has to go through the AADConfig once.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-05 12:44:35 +02:00
Hidde Beydals dfbeae9487 sops/age: add ParsedIdentities utility type
This adds a new ParsedIdentities type which can be used to parse a set
of age identities just once, instead of parsing them for every Decrypt
request.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-05 12:44:35 +02:00
Hidde Beydals ed49f8427f sops/pgp: add GnuPGHome utility type
This adds a new GnuPGHome type which can be used to create a new
contained GnuPG home directory. The type is self-validating, ensuring
it adheres to e.g. permission rules set out by GnuPG, and allows for
importing keys from armored bytes and files.

Because of this introduction, the decryptor service no longer has to
write data from a Secret to a temporary file, but is instead able to
directly import them into the keyring from the Secret entry's bytes.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-04 23:57:46 +02:00
Hidde Beydals eaec2b9164 sops/hcvault: tidy and test keysource impl
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-04 23:57:46 +02:00
Hidde Beydals 6554be2208 sops/pgp: tidy and test keysource implementation
This revises the PGP keysource implementation, removing bits of code
that were not actually in use, or not viable in combination with how we
work with keys. In short:

- crypto/openpgp implementation has been removed. As it is unable to read
  the keystore created by newer versions of GnuPG. Given we import user
  provided keys _with_ GnuPG, this was basically dead code.
- All capabilities around fetching public keys from a server have been
  removed.
- "Jailing" of GnuPG shell-out is now handled in `gpgExec`, in addition,
  arguments for encrypt and decrypt execs have been revised to ensure
  they e.g. do not instruct to use the agent.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-04-04 23:57:46 +02:00