1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00
Commit Graph

1292 Commits

Author SHA1 Message Date
Hidde Beydals
f2a1d4c782 Rename Go module to github.com/getsops/sops/v3
This commit renames the Go module from `go.mozilla.org/sops/v3` to
`github.com/getsops/sops/v3` without a major version bump, to align
with new stewardship.

For more information around this change, refer to
https://github.com/getsops/sops/issues/1246.

For a one-liner to change the `go.mod` and any import paths in your
Go project making use of this module, run:

```
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i '' 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
```

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-31 22:51:36 +02:00
Devin Buhl
1ea4a74f65 Merge pull request #1146 from hiddeco/revert-log-unify 2023-07-11 18:07:26 -04:00
Hidde Beydals
d54c1286e1 Revert intro of WithError for most key sources
Most of the rewritten key sources introduced `WithError` calls, which
does not appear to go well with the UX of the CLI. This reverts it to
be the semi equal to current `master`.

During the diff, I noticed the current age implementation in master
does make use of `WithError`. Which makes me wonder if errors are not
returned twice at present in the CLI.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-11 23:13:11 +02:00
Hidde Beydals
f495885976 Merge pull request #1249 from getsops/fix-gcp-app-defaults
gcpkms: allow use of Google default credentials
2023-07-11 23:10:16 +02:00
Hidde Beydals
b700beff05 gcpkms: allow use of Google default credentials
By addressing the bug in the introduced logic around
the `GOOGLE_CREDENTIALS` environment variable.

The variable is now only taken into account when set, and actually
containing a value.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-11 23:05:04 +02:00
Devin Buhl
1475933dd2 Merge pull request #1248 from getsops/remove-validation
Delete obsolete `validation/` artifact
2023-07-11 16:57:46 -04:00
Hidde Beydals
06d205c1a9 Delete obsolete validation/ artifact
This appears to be a 7 year old, unmaintained, unused, artifact from
around the time things were still written in Python. As observed
earlier in #1234.

As this now actively triggers a security warning due to an outdated
dependency, remove it.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-11 21:38:58 +02:00
Hidde Beydals
7051ccd90d Merge pull request #1242 from getsops/dependabot/go_modules/github.com/docker/docker-20.10.24incompatible
build(deps): bump github.com/docker/docker from 20.10.7+incompatible to 20.10.24+incompatible
2023-07-06 23:09:53 +02:00
dependabot[bot]
b30df9eeb8 build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.7+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v20.10.7...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 21:03:04 +00:00
Hidde Beydals
728da0c6b0 Merge pull request #1243 from getsops/ci-run-on-main
build: run CLI workflow on `main`
2023-07-06 22:49:23 +02:00
Hidde Beydals
79b301f60b build: run CLI workflow on main
As `master` and `develop` are being laid to rest.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-06 22:42:04 +02:00
Devin Buhl
77c37e2e82 Merge pull request #1237 from getsops/remove-circleci 2023-07-04 17:08:02 -04:00
Hidde Beydals
bc36b2c68f Remove remaining CircleCI workflow
This appears to be only used for pushing Docker images to a registry we
no longer have access to.

As we need to rework the release process as a whole (using GitHub
Actions), remove it for now. As the only thing it yields at present
are failure notifications in my inbox.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 22:50:31 +02:00
Hidde Beydals
94f29cfe45 Merge pull request #1147 from hiddeco/update-deps
chore: update Go dependencies
2023-07-04 13:26:06 +02:00
Hidde Beydals
70d2d85ee9 chore: update Go dependencies
- cloud.google.com/go/kms v1.4.0 -> v1.12.1
- cloud.google.com/go/storage v1.23.0 -> v1.31.0
- filippo.io/age v1.0.0 -> v1.1.1
- github.com/ProtonMail/go-crypto v0.0.0-20220711121315-1fde58898e96 -> v0.0.0-20230626094100-7e9e0395ebec
- github.com/aws/aws-sdk-go-v2 v1.16.7 -> v1.18.1
- github.com/aws/aws-sdk-go-v2/config v1.15.14 -> v1.18.27
- github.com/aws/aws-sdk-go-v2/credentials v1.12.9 -> v1.13.26
- github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.14 -> v1.11.71
- github.com/aws/aws-sdk-go-v2/service/kms v1.17.5 -> v1.22.2
- github.com/aws/aws-sdk-go-v2/service/s3 v1.26.10 -> v1.36.0
- github.com/aws/aws-sdk-go-v2/service/sts v1.16.9 -> v1.19.2
- github.com/fatih/color v1.13.0 -> v1.15.0
- github.com/golang/protobuf v1.5.2 -> v1.5.3
- github.com/google/go-cmp v0.5.8 -> v0.5.9
- github.com/hashicorp/vault/api v1.7.2 -> v1.9.2
- github.com/lib/pq v1.10.6 -> v1.10.9
- github.com/ory/dockertest/v3 v3.9.1 -> v3.10.0
- github.com/sirupsen/logrus v1.8.1 -> v1.9.3
- github.com/stretchr/testify v1.8.1 -> v1.8.4
- github.com/urfave/cli v1.22.7 -> v1.22.14
- golang.org/x/crypto v0.7.0 -> v0.10.0
- golang.org/x/net v0.8.0 -> v0.11.0
- golang.org/x/sys v0.6.0 -> v0.9.0
- golang.org/x/term v0.6.0 -> v0.9.0
- google.golang.org/api v0.87.0 -> v0.129.0
- google.golang.org/genproto v0.0.0-20220712132514-bdd2acd4974d -> v0.0.0-20230629202037-9506855d4529
- google.golang.org/grpc v1.48.0 -> v1.56.1
- google.golang.org/protobuf v1.28.0 -> v1.31.0
- gopkg.in/ini.v1 v1.66.4 -> v1.67.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-04 13:20:00 +02:00
Hidde Beydals
75b5b54524 chore: update dockertest to Go Mod compatible v3
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-04 13:15:46 +02:00
Hidde Beydals
4eaecaddaf Merge pull request #1092 from hiddeco/azkv-update-sdk
azkv: update Azure SDK to v0.10.0
2023-07-04 13:05:33 +02:00
Hidde Beydals
2625e56918 azkv: update Azure SDKs
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1 -> v1.6.1
- github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 -> v1.3.0
- github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.9.0 -> v0.10.0

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 21:39:00 +02:00
Hidde Beydals
b1c899ae48 azkv: update azcore and azidentity
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-03 21:35:06 +02:00
Hidde Beydals
4f858e5ed2 azkv: update Azure SDK to v0.9.0
Besides some signature changes, really nothing special.

```
$ go test --tags integration ./... -v
=== RUN   TestMasterKey_Encrypt
--- PASS: TestMasterKey_Encrypt (1.34s)
=== RUN   TestMasterKey_Decrypt
--- PASS: TestMasterKey_Decrypt (0.68s)
=== RUN   TestMasterKey_EncryptDecrypt_RoundTrip
--- PASS: TestMasterKey_EncryptDecrypt_RoundTrip (0.40s)
=== RUN   TestNewMasterKeyFromURL
=== RUN   TestNewMasterKeyFromURL/URL
=== RUN   TestNewMasterKeyFromURL/malformed_URL
--- PASS: TestNewMasterKeyFromURL (0.00s)
    --- PASS: TestNewMasterKeyFromURL/URL (0.00s)
    --- PASS: TestNewMasterKeyFromURL/malformed_URL (0.00s)
=== RUN   TestMasterKeysFromURLs
=== RUN   TestMasterKeysFromURLs/single_URL
=== RUN   TestMasterKeysFromURLs/multiple_URLs
=== RUN   TestMasterKeysFromURLs/multiple_URLs,_one_malformed
=== RUN   TestMasterKeysFromURLs/empty
--- PASS: TestMasterKeysFromURLs (0.00s)
    --- PASS: TestMasterKeysFromURLs/single_URL (0.00s)
    --- PASS: TestMasterKeysFromURLs/multiple_URLs (0.00s)
    --- PASS: TestMasterKeysFromURLs/multiple_URLs,_one_malformed (0.00s)
    --- PASS: TestMasterKeysFromURLs/empty (0.00s)
=== RUN   TestTokenCredential_ApplyToMasterKey
--- PASS: TestTokenCredential_ApplyToMasterKey (0.00s)
=== RUN   TestMasterKey_EncryptedDataKey
--- PASS: TestMasterKey_EncryptedDataKey (0.00s)
=== RUN   TestMasterKey_SetEncryptedDataKey
--- PASS: TestMasterKey_SetEncryptedDataKey (0.00s)
=== RUN   TestMasterKey_EncryptIfNeeded
=== RUN   TestMasterKey_EncryptIfNeeded/not_encrypted
[AZKV]   time="2022-11-21T20:41:58Z" level=error msg="Encryption failed" key=test-key version=a2a690a4fcc04166b739da342a912c90
=== RUN   TestMasterKey_EncryptIfNeeded/already_encrypted
--- PASS: TestMasterKey_EncryptIfNeeded (2.12s)
    --- PASS: TestMasterKey_EncryptIfNeeded/not_encrypted (2.12s)
    --- PASS: TestMasterKey_EncryptIfNeeded/already_encrypted (0.00s)
=== RUN   TestMasterKey_NeedsRotation
--- PASS: TestMasterKey_NeedsRotation (0.00s)
=== RUN   TestMasterKey_ToString
--- PASS: TestMasterKey_ToString (0.00s)
=== RUN   TestMasterKey_ToMap
--- PASS: TestMasterKey_ToMap (0.00s)
=== RUN   TestMasterKey_getTokenCredential
=== RUN   TestMasterKey_getTokenCredential/with_TokenCredential
=== RUN   TestMasterKey_getTokenCredential/default
--- PASS: TestMasterKey_getTokenCredential (0.00s)
    --- PASS: TestMasterKey_getTokenCredential/with_TokenCredential (0.00s)
    --- PASS: TestMasterKey_getTokenCredential/default (0.00s)
PASS
ok      go.mozilla.org/sops/v3/azkv     4.551s
```

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-03 21:34:58 +02:00
Hidde Beydals
50064ee947 docs: update Azure Key Vault entry
The generated password from `az` does no longer appear to be a UUID,
but returns a random generated string instead.

Given there is also a UUID attached to Secret object that holds this
value, it is better to be explict to guide users.

In addition, the tenant is always a UUID (and not _any_ ID).

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-03 21:34:58 +02:00
Hidde Beydals
ce5177651b azkv: update Azure SDK to v0.6.0
This should be the last major change in their SDK with regard to
changing method signatures and/or the way the client is constructed.

I manually ran the integration test suite which passes without any
issues.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-03 21:34:58 +02:00
Hidde Beydals
8960e72156 Merge pull request #1148 from hiddeco/go-1.19 2023-07-02 20:10:12 +02:00
Hidde Beydals
67bd286a04 build: bump Go version in go.mod to 1.19
Which is the lowest supported version of Go at the moment.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-02 19:55:13 +02:00
Hidde Beydals
ec06248b8e build: bump Alpine Dockerfile to 3.18
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-02 18:19:03 +02:00
Hidde Beydals
9196a11b63 build: update GitHub workflow actions
To their respective latest versions.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-02 18:19:02 +02:00
Hidde Beydals
83f459b1ad build: update Go to 1.20
This updates Go used for builds to 1.20, including an update of Alpine
to 3.17.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-02 18:19:02 +02:00
Hidde Beydals
4bef0297cb build: update Go to 1.19
This updates Go used for builds to 1.19, and updates a forgotten
Alpine 3.15 version in a `Dockerfile` to 3.16.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-07-02 18:19:02 +02:00
Hidde Beydals
575e76d235 Merge pull request #1234 from getsops/update-rustc
Update rustc functional tests to v1.70.0
2023-07-02 13:57:51 +02:00
Hidde Beydals
1d7fc78a75 Update rustc functional tests to v1.70.0
Bear minimum to get this going again, including an update of
dependencies.

It's worth noting that there is a detachment between the GitHub Action
workflow and running this locally. As there are assumptions around:

1. Having the `pgp/sops_functional_tests_key.asc` imported.
2. Having a Vault server running for two functional tests.

The `functional-tests` Make target does not facilitate this, and
putting something in place using a temporary `GNUPGHOME` and a
container image would likely be a welcome future improvement.

In addition, there is Rust code in `validation/` which appears to be an
artifact from an ancient Python library[1][2]. This should probably be
removed in the future.

[1]: https://github.com/getsops/sops/tree/python-sops
[2]: https://pypi.org/project/sops/

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-02 13:37:49 +02:00
Hidde Beydals
482a262894 Merge pull request #1233 from getsops/add-dco-coc
Add DCO and CoC
2023-07-01 01:17:04 +02:00
Hidde Beydals
5d2b29821f Adopt the CNCF Code of Conduct
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-01 00:55:31 +02:00
Hidde Beydals
ec38de6f91 Add Developer Certificate of Origin
The application which enforces this (https://github.com/apps/dco)
has been added to the GitHub organization, and is enabled for all
repositories of the organization going forward.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-01 00:53:18 +02:00
AJ Bahnken
9124783930 Merge pull request #1116 from felixfontein/update-keys-input-type
Support --input-type for updatekeys
2022-09-01 11:16:16 -07:00
AJ Bahnken
f35e9833b0 Merge pull request #1113 from flx5/feature/replace-gopass
Replace deprecated gopass package with term
2022-09-01 11:15:24 -07:00
AJ Bahnken
1cd49d6eda Merge pull request #1115 from felixfontein/version-without-network
--version without network request
2022-09-01 11:07:55 -07:00
Felix Fontein
566d51a25b Add --input-type option to updatekeys. 2022-08-27 15:52:29 +02:00
Felix Fontein
8f186bcb37 input-type and output-type description do not mention ini format. 2022-08-27 15:52:02 +02:00
Felix Fontein
148d46108b Do not check whether current version is latest when --disable-version-check is passed. 2022-08-27 15:33:41 +02:00
flx5
0e7174c7f9 Replace deprecated gopass package with term 2022-08-20 16:55:19 +02:00
AJ Bahnken
7e981e4e5e Merge pull request #1091 from mozilla/upgrade-deps
Upgrade dependencies
2022-07-19 09:53:40 -07:00
AJ Bahnken
2c835975ea Upgrade dependencies 2022-07-12 15:20:30 -07:00
AJ Bahnken
09378ffb34 Merge pull request #1085 from hiddeco/hcvault-keysource-imprv
hcvault: update API, add tests, tidy
2022-07-12 15:10:26 -07:00
AJ Bahnken
5448b42f47 Merge pull request #1072 from hiddeco/gcpkms-keysource-imprv
gcpkms: update SDK to latest, add tests, tidy
2022-07-12 14:48:20 -07:00
Hidde Beydals
c7ae3eee59 hcvault: update API, add tests, tidy
This updates the Vault API and client to latest, adds more extensive
test coverage, and general tidying of bits of code.
The improvements are based on a fork of the key source in the Flux
project's kustomize-controller, built due to SOPS' limitation around
credential management without relying on runtime environment variables.

- Vault API and client have been updated to latest.
- It introduces a `Token` type which holds a Vault token, and can be
  applied to the `MasterKey`. When applied, the token is used in the
  Vault client configuration, instead of relying on the `VAULT_TOKEN`
  environment variables, or the `.vault-token` file in the user's home
  directory. This is most useful when working with SOPS as an SDK, in
  combination with e.g. a local key service server implementation.
- Extensive test coverage.

The forked version of this has compatability tests to ensure it works
with current SOPS:

- 62fb2d96a2/internal/sops/hcvault/keysource_test.go (L130)
- 62fb2d96a2/internal/sops/hcvault/keysource_test.go (L202)

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-07-05 16:09:35 +02:00
Hidde Beydals
d9a5644df1 gcpkms: update SDK to latest, add tests, tidy
This updates the GCP KMS client to latest, adds more extensive test
coverage, and general tidying of bits of code.
The improvements are based on a fork of the key source in the Flux
project's kustomize-controller, built due to SOPS' limitation around
credential management without relying on runtime environment variables.

- Updates the deprecated `google.golang.org/api/cloudkms/v1` to
  `cloud.google.com/go/kms/apiv1`.
- It introduces a `CredentialJSON` type which holds a Service Account
  credential file, and can be applied to the `MasterKey`.
  When applied, the provided credentials are used in the GCP KMS
  service client configuration, instead of relying on
  `GOOGLE_CREDENTIALS`, or the default client environment variables.
  This is most useful when working with SOPS as an SDK, in combination
  with e.g. a local key service server implementation.
- Test coverage.

The forked version of this has compatability (and integration) tests to
ensure it works with current SOPS:

- cbb0fc9df5/internal/sops/gcpkms/keysource_integration_test.go (L39)
- cbb0fc9df5/internal/sops/gcpkms/keysource_integration_test.go (L59)

Co-authored-by: Somtochi Onyekwere <somtochi@weave.works>
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-07-04 22:23:24 +02:00
AJ Bahnken
8c5c397c46 Merge pull request #1065 from hiddeco/kms-keysource-imprv
kms: AWS SDK V2, allow creds config, add tests
2022-06-27 11:21:17 -07:00
Hidde Beydals
0eef7ce86c Delete obsolete mockery make target and doc ref
This was only required for the test mocks for the V1 AWS SDK tests,
which have been removed with the rewrite to V2.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-06 23:18:19 +02:00
Hidde Beydals
d2ce37d366 publish: update S3 destination to AWS SDK V2
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-06 23:14:34 +02:00
Hidde Beydals
b6f6fa1748 kms: AWS SDK V2, allow creds config, add tests
This updates the AWS SDK for Go to V2, adds extensive test coverage
based on a mocking server, and a general tidying of bits of code.
The improvements are based on a fork of the key source in the Flux
project's kustomize-controller, built due to SOPS' limitation around
credential management without relying on runtime environment variables.

- AWS SDK has been updated to V2. There are still bits in `publish/`
  which would need updating to drop the dependency on V1.
- It introduces a `CredentialsProvider` type which holds an
  `aws.CredentialsProvider`, and can be applied to the `MasterKey`.
  When applied, the provider is used in the AWS client configuration
  instead of relying on the SDK default (environmental) values.
  This is most useful when working with SOPS as an SDK, in combination
  with e.g. a local key service server implementation.
- Extensive test coverage. STS session implementation details are not
  tested due to mocking complexities, but the wiring is.

The forked version of this has compatibility tests to ensure it works
with current SOPS:

- 8b7e7ecb1a/internal/sops/awskms/keysource_test.go (L134)
- 8b7e7ecb1a/internal/sops/awskms/keysource_test.go (L200)

Co-authored-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-06 23:14:27 +02:00