-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Azure KMS support Signed-off-by: Carlos Panato <ctadeu@gmail.com> * refactor to the new way Signed-off-by: Carlos Panato <ctadeu@gmail.com> * fix for e2e test, little improvement in bash script Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com> * fix issues Signed-off-by: Carlos Panato <ctadeu@gmail.com> * add some docs for azure key vault Signed-off-by: Carlos Panato <ctadeu@gmail.com> Co-authored-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
- Loading branch information
1 parent
a9aeb21
commit 1c1454f
Showing
10 changed files
with
600 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Azure KMS | ||
|
||
In order to use Azure KMS with sigstore project you should setup the azure first, the key creation | ||
will be handled in sigstore, however the vault and any needed permission will not and those things need to be configured. | ||
|
||
### What I need? | ||
|
||
- Create a Resource Group | ||
- In this Resource Group create the Azure KMS | ||
- Configure any custom permission | ||
|
||
After that you can use the created vault to generate the key, sign and verify. | ||
|
||
For more information check the official Azure Docs: https://azure.microsoft.com/en-us/services/key-vault/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// Copyright 2021 The Sigstore Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package azure | ||
|
||
import "testing" | ||
|
||
func TestParseReference(t *testing.T) { | ||
tests := []struct { | ||
in string | ||
wantVaultURL string | ||
wantVaultName string | ||
wantKeyName string | ||
wantErr bool | ||
}{ | ||
{ | ||
in: "azurekms://honk-vault.vault.azure.net/honk-key", | ||
wantVaultURL: "https://honk-vault.vault.azure.net/", | ||
wantVaultName: "honk-vault", | ||
wantKeyName: "honk-key", | ||
wantErr: false, | ||
}, | ||
{ | ||
in: "foo://bar", | ||
wantErr: true, | ||
}, | ||
{ | ||
in: "", | ||
wantErr: true, | ||
}, | ||
{ | ||
in: "azurekms://wrong-test/test/1/3", | ||
wantErr: true, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.in, func(t *testing.T) { | ||
gotVaultURL, gotVaultName, gotKeyName, err := parseReference(tt.in) | ||
if (err != nil) != tt.wantErr { | ||
t.Errorf("parseReference() error = %v, wantErr %v", err, tt.wantErr) | ||
return | ||
} | ||
if gotVaultURL != tt.wantVaultURL { | ||
t.Errorf("parseReference() gotVaultURL = %v, want %v", gotVaultURL, tt.wantVaultURL) | ||
} | ||
if gotVaultName != tt.wantVaultName { | ||
t.Errorf("parseReference() gotVaultName = %v, want %v", gotVaultName, tt.wantVaultName) | ||
} | ||
if gotKeyName != tt.wantKeyName { | ||
t.Errorf("parseReference() gotKeyName = %v, want %v", gotKeyName, tt.wantKeyName) | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.