-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use cosign build from head Signed-off-by: cpanato <ctadeu@gmail.com> * add script to sign the digests and not the tags Signed-off-by: cpanato <ctadeu@gmail.com> * update test script and update the flags Signed-off-by: cpanato <ctadeu@gmail.com> * regenerate the certificate becasue the previous expired, now it is valid for 10 years Signed-off-by: cpanato <ctadeu@gmail.com> * add doc in how to regenerate a certificate in case we need it again :) Signed-off-by: cpanato <ctadeu@gmail.com> * enable cache Signed-off-by: cpanato <ctadeu@gmail.com> * uncomment Signed-off-by: cpanato <ctadeu@gmail.com>
- Loading branch information
Showing
6 changed files
with
82 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2022 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
: "${GIT_HASH:?Environment variable empty or not defined.}" | ||
: "${GITHUB_RUN_ID:?Environment variable empty or not defined.}" | ||
: "${GITHUB_RUN_ATTEMPT:?Environment variable empty or not defined.}" | ||
|
||
export COSIGN_EXPERIMENTAL=1 | ||
COSIGN_CLI=./cosign | ||
|
||
if [[ ! -f cosignImagerefs ]]; then | ||
echo "cosignImagerefs not found" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f sgetImagerefs ]]; then | ||
echo "sgetImagerefs not found" | ||
exit 1 | ||
fi | ||
|
||
echo "Signing cosign images using Keyless..." | ||
|
||
$COSIGN_CLI sign -a sha="$GIT_HASH" -a run_id="$GITHUB_RUN_ID" -a run_attempt="$GITHUB_RUN_ATTEMPT" "$(cat cosignImagerefs)" | ||
$COSIGN_CLI sign -a sha="$GIT_HASH" -a run_id="$GITHUB_RUN_ID" -a run_attempt="$GITHUB_RUN_ATTEMPT" "$(cat sgetImagerefs)" |
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,26 @@ | ||
# Generate Certificate | ||
|
||
If the `test/testdata/test_blob_cert.pem` expire you can generate a new certificate to use in the tests running the | ||
following command: | ||
|
||
```shell | ||
$ openssl req -key test/testdata/test_blob_private_key -x509 -days 3650 -out cert.pem -new -nodes | ||
|
||
You are about to be asked to enter information that will be incorporated | ||
into your certificate request. | ||
What you are about to enter is what is called a Distinguished Name or a DN. | ||
There are quite a few fields but you can leave some blank | ||
For some fields there will be a default value, | ||
If you enter '.', the field will be left blank. | ||
----- | ||
Country Name (2 letter code) []:US | ||
State or Province Name (full name) []:CA | ||
Locality Name (eg, city) []:SF | ||
Organization Name (eg, company) []:Company | ||
Organizational Unit Name (eg, section) []:Unit | ||
Common Name (eg, fully qualified host name) []:www.example.org | ||
Email Address []:email@email.com | ||
``` | ||
|
||
and then you replace the old `test/testdata/test_blob_cert.pem` with the new certificate. | ||
|
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIB9jCCAZwCCQDmJAPXiurv9jAKBggqhkjOPQQDAjCBgjELMAkGA1UEBhMCVVMx | ||
MIIB9zCCAZwCCQCtaU3hib3CkTAKBggqhkjOPQQDAjCBgjELMAkGA1UEBhMCVVMx | ||
CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEQMA4GA1UECgwHQ29tcGFueTENMAsG | ||
A1UECwwEVW5pdDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUub3JnMR4wHAYJKoZIhvcN | ||
AQkBFg9lbWFpbEBlbWFpbC5jb20wHhcNMjIwMzI4MTgwNDIwWhcNMjIwNDI3MTgw | ||
NDIwWjCBgjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEQ | ||
AQkBFg9lbWFpbEBlbWFpbC5jb20wHhcNMjIwNzA2MTQyMzU5WhcNMzIwNzAzMTQy | ||
MzU5WjCBgjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEQ | ||
MA4GA1UECgwHQ29tcGFueTENMAsGA1UECwwEVW5pdDEYMBYGA1UEAwwPd3d3LmV4 | ||
YW1wbGUub3JnMR4wHAYJKoZIhvcNAQkBFg9lbWFpbEBlbWFpbC5jb20wWTATBgcq | ||
hkjOPQIBBggqhkjOPQMBBwNCAAR1Q4hB1jtagrdsVxygtDa/rli00U7n/1I/NSw8 | ||
yoMRQ+MOAjRhg3gtcV0tha34L6150qJirQHbfocsao8X6wFmMAoGCCqGSM49BAMC | ||
A0gAMEUCIQDkZ4ZmFOK2Ze+znScge1JidTRzxNxCLbrdfc5yEJia2QIgCEjIY6Zo | ||
QUwiyuC3ll5a9GDc4swfguZq9kOFX9bD0XQ= | ||
A0kAMEYCIQDperCsZxqQRZXSMk4DiJCxSQfT+gaX+aLbhOS1AoTbGQIhAO22bQ87 | ||
9ngud/Klrih6bm4rde6oLtfVB+12wSetEqpd | ||
-----END CERTIFICATE----- |