Skip to content

Commit

Permalink
feat: add GCP KMS key suppport
Browse files Browse the repository at this point in the history
Signed-off-by: Eriks Zelenka <[email protected]>
  • Loading branch information
isindir committed Jun 21, 2019
1 parent 902c19e commit c2b6216
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@ sops --encrypt \
> jenkins-secrets.enc.yaml
```

* Encrypt file using `sops` and GCP KMS key:

```bash
sops --encrypt \
--gcp-kms 'projects/<project-name>/locations/<location>/keyRings/<keyring-name>/cryptoKeys/<key-name>' \
--encrypted-suffix='_templates' jenkins-secrets.yaml \
> jenkins-secrets.enc.yaml
```

* Encrypt file using `sops` and Azure Keyvault key:

```bash
sops --encrypt \
--azure-kv "https://<vault-url>/keys/<key-name>/<key-version>" \
--azure-kv 'https://<vault-url>/keys/<key-name>/<key-version>' \
--encrypted-suffix='_templates' jenkins-secrets.yaml \
> jenkins-secrets.enc.yaml
```
Expand All @@ -75,7 +84,7 @@ sops --encrypt \

```bash
sops --encrypt \
--pgp "<pgp-finger-print>" \
--pgp '<pgp-finger-print>' \
--encrypted-suffix='_templates' jenkins-secrets.yaml \
> jenkins-secrets.enc.yaml
```
Expand Down
17 changes: 12 additions & 5 deletions pkg/apis/isindir/v1alpha1/sopssecret_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ type AzureKmsItem struct {
CreationDate string `json:"created_at,omitempty"`
}

// GcpKmsDataItem defines GCP KMS Key specific encryption details
// +k8s:openapi-gen=true
type GcpKmsDataItem struct {
VaultURL string `json:"resource_id,omitempty"`
EncryptedKey string `json:"enc,omitempty"`
CreationDate string `json:"created_at,omitempty"`
}

// SopsMetadata defines the encryption details
// +k8s:openapi-gen=true
type SopsMetadata struct {
AwsKms []KmsDataItem `json:"kms,omitempty"`
Pgp []PgpDataItem `json:"pgp,omitempty"`
AzureKms []AzureKmsItem `json:"azure_kv,omitempty"`
//TODO: add following
//GcpKms []GcpKmsDataItem `json:"gcp_kms,omitempty"`
AwsKms []KmsDataItem `json:"kms,omitempty"`
Pgp []PgpDataItem `json:"pgp,omitempty"`
AzureKms []AzureKmsItem `json:"azure_kv,omitempty"`
GcpKms []GcpKmsDataItem `json:"gcp_kms,omitempty"`

Mac string `json:"mac,omitempty"`
LastModified string `json:"lastmodified,omitempty"`
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/isindir/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package version

var (
// Version of the operator
Version = "0.0.5"
Version = "0.0.6"
)

0 comments on commit c2b6216

Please sign in to comment.