-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support enabled status for kmp keys/certs #1874
feat: support enabled status for kmp keys/certs #1874
Conversation
Codecov ReportAttention: Patch coverage is
|
fmt.Printf("debug: certificate %s version %s is disabled.", keyVaultCert.Name, keyVaultCert.Version) | ||
|
||
isEnabled := "false" | ||
startTime := time.Now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reported metric is for the duration of the keyvault fetch operation. We should move the metric reporting to be isolated to that operation above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see that now. Now that there are two calls to AKV I can define the startTime sooner to capture the first call then reset the value for the second call.
// GetSecret is required so we can fetch the entire cert chain. See issue https://github.com/ratify-project/ratify/issues/695 for details | ||
isEnabled := "true" | ||
startTime := time.Now() | ||
secretBundle, err := s.kvClient.GetSecret(ctx, s.vaultURI, keyVaultCert.Name, keyVaultCert.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we making two calls now to Keyvault? One for an initial GetCertificates
and then another for a GetSecret
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. Instead of attempting to trap a specific error from GetSecrets
I opted to use GetCertificates
to get the enabled
status of the certificate to determine how to add the entry to the KMP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. I see. I'm concerned with the network overhead and how that will affect upstream throttling quotas for AKV. What is the value of doing the existence check first and then calling GetSecret. Is it primarily so the disabled certificate content is not returned as part of the response from KeyVault?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, with GetCertificate
I can check the status of enabled without returning any of the secret data. It also avoids having to trap a particular error from AKV when the cert is disabled when GetSecret
is called.
That said, I'm open to suggestions. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can get all required info in single request, I would vote for just calling the GetSecret
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can get away with a single call to GetSecret
if we trap the 403 response and continue on instead of erroring out. The only draw back is that means we have to assume that 403 means the certificate is disabled, which is fairly safe imo.
secretResp, err := secretClient.GetSecret(context.TODO(), certName, version, nil)
if err != nil {
// Check if the error is a ResponseError from Azure SDK
if respErr, ok := err.(*azcore.ResponseError); ok {
// Handle specific status codes
if respErr.StatusCode == 403 {
fmt.Printf("Certificate '%s' is disabled or inaccessible; marking as disabled and continuing.\n", certName)
return
}
}
// For other errors, log and exit
log.Fatal(err)
}
My only concern with just using GetSecret
is if the call fails we have no information about the secret beyond what's provided in the configuration. So in the instance that a user defines a cert or key without a version we won't be able to update the status with the version of disabled certificates.
Another option is to only make a GetCertificate
call when a cert is disabled to gather this info. Which switches the logic from always doing 2x calls to only sometimes doing 2x calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got this working in another branch, with GetCertificate
only being called if GetSecret
returns a 403 error indicating that the certificate is disabled. Curious to get your thoughts on the contains("403")
logic and if that's sound enough. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we also need to check if the root cause is disabled secret since 403 also indicates a permission error. Not sure if this post will help: https://stackoverflow.com/questions/71184772/handling-a-disabled-azure-key-vault-secret-using-go-azure-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not pretty, but I got this working and it's a lot more specific. Great SO post btw @binbin-li that was super helpful, thank you!
if err != nil {
// certificate is disabled, remove it from the map
if de, ok := err.(autorest.DetailedError); ok {
if re, ok := de.Original.(*azure.RequestError); ok {
if re.ServiceError.Code == "SecretDisabled" {
certBundle, err := s.kvClient.GetCertificate(ctx, s.vaultURI, keyVaultCert.Name, keyVaultCert.Version)
if err != nil {
return nil, nil, fmt.Errorf("failed to get certificate objectName:%s, objectVersion:%s, error: %w", keyVaultCert.Name, keyVaultCert.Version, err)
}
keyVaultCert.Version = getObjectVersion(*certBundle.Kid)
isEnabled := *certBundle.Attributes.Enabled
lastRefreshed := startTime.Format(time.RFC3339)
certProperty := getStatusProperty(keyVaultCert.Name, keyVaultCert.Version, strconv.FormatBool(isEnabled), lastRefreshed)
certsStatus = append(certsStatus, certProperty)
mapKey := keymanagementprovider.KMPMapKey{Name: keyVaultCert.Name, Version: keyVaultCert.Version, Enabled: isEnabled}
keymanagementprovider.DeleteCertificateFromMap(s.resource, mapKey)
continue
}
}
}
return nil, nil, fmt.Errorf("failed to get secret objectName:%s, objectVersion:%s, error: %w", keyVaultCert.Name, keyVaultCert.Version, err)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@binbin-li how do you feel about GetCertificate
being called when it's disabled to get the version info from azkv? To me, it felt like a poor user experience if the disabled certs versions are absent.
certProperty := getStatusProperty(keyVaultCert.Name, keyVaultCert.Version, isEnabled, lastRefreshed) | ||
certsStatus = append(certsStatus, certProperty) | ||
certMapKey := keymanagementprovider.KMPMapKey{Name: keyVaultCert.Name, Version: keyVaultCert.Version, Enabled: isEnabled} | ||
certsMap[certMapKey] = []*x509.Certificate{} // empty cert chain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the certificate value (without chain) set in certsMap
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the certificate is disabled, the certificate isn't stored at all. My thinking was that this would prevent the FlattenKMPMap
function from including any disabled certificates. Self-signed certs for example could be used to verify if that cert was passed to the verifier because it doesn't have any cert chain beyond itself. That said, now that there is an enabled
field it's possible to update the Flatten function to look for only enabled certs. Your comment does bring up a good question, what value should be used for disabled certs?
QQ: by certificate value, you're meaning the cert in x509 format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize this was for the disabled case. My bad. I should've looked at the if block condition above. Can you remind me if we plan to show if a certificate is disabled at all in status? I'm trying to understand if the operation on L165 is to clear map value but still have the key available to signify it is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem. :) And yes, the status is now shown in the KMP status. Here's an example:
Certificates:
Enabled: true
Last Refreshed: 2024-10-21T20:27:23Z
Name: ratify
Version: 0ff373a9259c4578a247cfd7861a8804
L165 is meant to clear the value so the disabled certificate data so it's not stored in the KMP but the key remains. The key values are then used to populate the status.
Technically, speaking I don't think there is any reason the key need to remain in the map either, other than to match the status that's being reflected to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking into the way we use certsMap, seems we can just remove L165 since the disabled cert will not be used anywhere. Correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akashsinghal what do you think about not storing disabled cert entries in the KMP cache? Then if a cert is found to be disabled it's reported in the status but removed from the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that should work too because the status will always get updated alongside an upstream KV request fetch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akashsinghal @binbin-li I got this working in a separate branch by adding a few functions to the KMP to delete entries from a resource in cache. This takes care of the edge case where there is only one certificate or key stored in the cache that was once enabled and is now disabled. I can either merge it into this branch or submit it as PR once this one makes it through. Lmk which is prefered. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer merging into this PR as we already have context on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes merged into this PR. :)
ee5d257
to
1b8509e
Compare
// GetSecret is required so we can fetch the entire cert chain. See issue https://github.com/ratify-project/ratify/issues/695 for details | ||
isEnabled := "true" | ||
startTime := time.Now() | ||
secretBundle, err := s.kvClient.GetSecret(ctx, s.vaultURI, keyVaultCert.Name, keyVaultCert.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can get all required info in single request, I would vote for just calling the GetSecret
.
@@ -244,7 +282,7 @@ func initializeKvClient(ctx context.Context, keyVaultEndpoint, tenantID, clientI | |||
|
|||
// Parse the secret bundle and return an array of certificates | |||
// In a certificate chain scenario, all certificates from root to leaf will be returned | |||
func getCertsFromSecretBundle(ctx context.Context, secretBundle kv.SecretBundle, certName string) ([]*x509.Certificate, []map[string]string, error) { | |||
func getCertsFromSecretBundle(ctx context.Context, secretBundle kv.SecretBundle, certName, enabled string) ([]*x509.Certificate, []map[string]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would recommend to define a bool var for enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That can certainly be done, I'll get that refactored.
certProperty := getStatusProperty(keyVaultCert.Name, keyVaultCert.Version, isEnabled, lastRefreshed) | ||
certsStatus = append(certsStatus, certProperty) | ||
certMapKey := keymanagementprovider.KMPMapKey{Name: keyVaultCert.Name, Version: keyVaultCert.Version, Enabled: isEnabled} | ||
certsMap[certMapKey] = []*x509.Certificate{} // empty cert chain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking into the way we use certsMap, seems we can just remove L165 since the disabled cert will not be used anywhere. Correct me if I'm wrong.
@akashsinghal @binbin-li @junczhu did you notice the changes I pushed that adds an interface to the azkv provider to improve test coverage? Lmk if you've got any suggestion on those changes. |
I like the refactoring, it definitely makes the unit test easier. |
lgtm once all nitpick comments resolved. |
@binbin-li, I think I got all the nits implemented. Please lmk if I missed any. |
certificates []types.KeyVaultValue | ||
keys []types.KeyVaultValue | ||
cloudEnv *azure.Environment | ||
kvClient *kv.BaseClient | ||
kvClient kvClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both kvClient and kv.BaseClient rely on autorest (see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault#BaseClient) which is what we need to avoid as it's deprecated. I have refactored the code to replace whatever depends on autorest with azidentity (see #1904 ).
In a nutshell, instead of "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault", we can use azidentity with azcertificates, azsecrets, and azkeys. They abstract away the process of getting AAD access token and authenticating with AKV. Currently in my PR I have implemented the workload identity scenario (which is the scenario for AKS), but it can be extended to other auth types like managed identity and CLI using changedIdentityCredential.
@susanshi @duffney We can refactor this PR to use azidentity. Let me know if you need this to be done on this PR and I am happy to help. Otherwise, we can merge this PR first, and then resolve the conflicts in my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @shahramk64 , given this PR has been open for a while, I would recommend complete this first, we want to avoid further expansion more in scope :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Let's merge this PR once it's ready, I'll resolve the conflicts with my PR after that.
@@ -59,6 +62,7 @@ type AKVKeyManagementProviderConfig struct { | |||
TenantID string `json:"tenantID"` | |||
ClientID string `json:"clientID"` | |||
CloudName string `json:"cloudName,omitempty"` | |||
Resource string `json:"resource,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value exposed to the user for configuration? What happens when they set a value to resource
field? I see that this field is set in the controller. But I'm wondering why we need to JSON serialize this field if it's not exposed as a configurable user field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The value doesn't need to be exposed. And there's no reason to JSON serialize it.
If the resource
isn't passed into the create method via the kmProviderConfig
, where would you suggesting passing it in? Perhaps, passing it into factory.CreateKeyManagementProviderFromConfig
would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see the issue. The config struct is currently the only place to pass the resource
to the AKV KMP in the Create
method. And we need to JSON serialize since the whole config is Marshalled and then Unmarshalled into the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, passing it into factory.CreateKeyManagementProviderFromConfig would work.
This would in turn require updating the KMP factory API 'Create' to incorporate another parameter for resource
. IN the future if we need to pass even more non config info to the each KMP, adding parameters to the API is not extensible. I think this is a larger discussion not just specific to this PR. For now, let's just proceed as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm once @akashsinghal 's comment is resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for all the work here!
3dbcebf
to
241b4ef
Compare
Signed-off-by: Joshua Duffney <[email protected]> fix: remove trailing newline Signed-off-by: Joshua Duffney <[email protected]> mod: update empty latest string with latest version from kid Signed-off-by: Joshua Duffney <[email protected]> mod: set KMPMapKey Enabled to bool & fix metrics reporting in akv provider Signed-off-by: Joshua Duffney <[email protected]> mod: impl kvClient interface to increase code coverage by mocking GetCerts,GetKeys,GetSecrets Signed-off-by: Joshua Duffney <[email protected]> mod:Refactor certificate and key retrieval logic to streamline version handling and improve logging for disabled objects. Removed redundant isEnabled declarations. Signed-off-by: Joshua Duffney <[email protected]> mod: include kid in test data Signed-off-by: Joshua Duffney <[email protected]> mod: reuse isEnabled Signed-off-by: Joshua Duffney <[email protected]> fix: remove disabled certs from cache Signed-off-by: Joshua Duffney <[email protected]> mod: reduce calls to ACR with GetCertificates method Signed-off-by: Joshua Duffney <[email protected]> mod: use autorest detailed error to catch SecretDisabled errors Signed-off-by: Joshua Duffney <[email protected]> chore: use bool for enabled Signed-off-by: Joshua Duffney <[email protected]> mod: Use errors.As to check for specific error Signed-off-by: Joshua Duffney <[email protected]> Update pkg/keymanagementprovider/azurekeyvault/provider.go Co-authored-by: Binbin Li <[email protected]> Signed-off-by: Josh Duffney <[email protected]> mod: helper func isSecretDisabledError Signed-off-by: Joshua Duffney <[email protected]> fix: deleteCert & deleleteKey not updating cache maps Signed-off-by: Joshua Duffney <[email protected]> Update pkg/keymanagementprovider/azurekeyvault/provider.go Co-authored-by: Binbin Li <[email protected]> Signed-off-by: Josh Duffney <[email protected]> mod: address nits Signed-off-by: Joshua Duffney <[email protected]>
Head branch was pushed to by a user without write access
241b4ef
to
08b01b9
Compare
@@ -25,6 +25,8 @@ const ( | |||
StatusName = "Name" | |||
// Certificate version string for the certificate status property | |||
StatusVersion = "Version" | |||
// Enabled string for the certificate status property | |||
StatusEnabled = "True" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Enabled
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @shahramk64! Yes, it should be.
Signed-off-by: Joshua Duffney <[email protected]>
…-project#1876) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (ratify-project#1877) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump vscode/devcontainers/go from `bdecb4c` to `46f85d1` in /.devcontainer (ratify-project#1879) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> feat: crl cache Signed-off-by: Juncheng Zhu <[email protected]> feat: crl cache 2 Signed-off-by: Juncheng Zhu <[email protected]> feat: crl provider Signed-off-by: Juncheng Zhu <[email protected]> feat: added interfaces Signed-off-by: Juncheng Zhu <[email protected]> feat: crl refactor Signed-off-by: Juncheng Zhu <[email protected]> feat: crl refactor Signed-off-by: Juncheng Zhu <[email protected]> feat: crl refactor Signed-off-by: Juncheng Zhu <[email protected]> feat: crl refactor Signed-off-by: Juncheng Zhu <[email protected]> feat: integrate crl to verifier Signed-off-by: Juncheng Zhu <[email protected]> feat: kmp revocationfactory refactor Signed-off-by: Juncheng Zhu <[email protected]> chore: bump up go version to 1.22.8 (ratify-project#1880) Signed-off-by: Binbin Li <[email protected]> Signed-off-by: Binbin Li <[email protected]> chore: Bump github.com/sigstore/sigstore from 1.8.9 to 1.8.10 (ratify-project#1878) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> docs: design proposal for tag and digest co-existing [ISSUE 1657] (ratify-project#1793) docs: add CRL Design (ratify-project#1789) Signed-off-by: Juncheng Zhu <[email protected]> docs: Create proposal for verifying 'last-n' artifacts only. (ratify-project#1797) Signed-off-by: Susan Shi <[email protected]> docs: nVersionCount support for KMP design doc (ratify-project#1831) Signed-off-by: Joshua Duffney <[email protected]> ci: retry trivy db update upon failure (ratify-project#1881) Signed-off-by: Binbin Li <[email protected]> chore: Bump anchore/sbom-action from 0.17.4 to 0.17.5 (ratify-project#1882) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ci: fix tagging in publish-ghcr workflow (ratify-project#1884) Signed-off-by: Binbin Li <[email protected]> ci: retry trivy download-db on failure (ratify-project#1883) Signed-off-by: Binbin Li <[email protected]> chore: migrate azure-sdk-for-go/containerregistry to the latest release (ratify-project#1829) Signed-off-by: Shahram Kalantari <[email protected]> chore: Bump github/codeql-action from 3.26.13 to 3.27.0 (ratify-project#1887) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> feat: crl fetcher Signed-off-by: Juncheng Zhu <[email protected]> feat: crl fetcher Signed-off-by: Juncheng Zhu <[email protected]> feat: update bytesFetcher Signed-off-by: Juncheng Zhu <[email protected]> feat: crl provider Signed-off-by: Juncheng Zhu <[email protected]> feat: refactor the interface Signed-off-by: Juncheng Zhu <[email protected]> feat: integrate crl to verifier 2 Signed-off-by: Juncheng Zhu <[email protected]> feat: integrate crl to verifier 2 Signed-off-by: Juncheng Zhu <[email protected]> chore: update charts (ratify-project#1892) Signed-off-by: Juncheng Zhu <[email protected]> chore: Bump actions/checkout from 4.2.1 to 4.2.2 (ratify-project#1893) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump actions/setup-go from 5.0.2 to 5.1.0 (ratify-project#1894) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump k8s.io/apimachinery from 0.28.14 to 0.28.15 (ratify-project#1896) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump distroless/static from `26f9b99` to `3a03fc0` in /httpserver (ratify-project#1899) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump k8s.io/client-go from 0.28.14 to 0.28.15 (ratify-project#1897) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump anchore/sbom-action from 0.17.5 to 0.17.6 (ratify-project#1903) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> feat: allow service account annotations (ratify-project#1907) Signed-off-by: Maneesh Singh <[email protected]> feat: add interface for testing Signed-off-by: Juncheng Zhu <[email protected]> feat: implemented interface Signed-off-by: Juncheng Zhu <[email protected]> feat: implemented interface Signed-off-by: Juncheng Zhu <[email protected]> test: working on test cases Signed-off-by: Juncheng Zhu <[email protected]> test: working on test cases 2 Signed-off-by: Juncheng Zhu <[email protected]> test: working on test cases 3 Signed-off-by: Juncheng Zhu <[email protected]> refactor: add cache constructor into fetcher constructor Signed-off-by: Juncheng Zhu <[email protected]> refactor: add cache constructor into fetcher constructor 2 Signed-off-by: Juncheng Zhu <[email protected]> refactor: add cache constructor into fetcher constructor 3 Signed-off-by: Juncheng Zhu <[email protected]> test: add cache constructor into fetcher constructor Signed-off-by: Juncheng Zhu <[email protected]> test: add cache constructor into fetcher constructor 2 Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl 1 Signed-off-by: Juncheng Zhu <[email protected]> chore: Bump github.com/aws/aws-sdk-go-v2 from 1.32.2 to 1.32.3 (ratify-project#1912) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.41 to 1.17.42 (ratify-project#1911) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/AzureAD/microsoft-authentication-library-for-go from 1.2.2 to 1.2.3 (ratify-project#1910) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump anchore/sbom-action from 0.17.6 to 0.17.7 (ratify-project#1915) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (ratify-project#1916) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> feat: support enabled status for kmp keys/certs (ratify-project#1874) Signed-off-by: Joshua Duffney <[email protected]> ci: add cron job to cache trivy db (ratify-project#1918) Signed-off-by: Binbin Li <[email protected]> fix: fix the conditional check on update-trivy-cache job (ratify-project#1919) Signed-off-by: Binbin Li <[email protected]> feat: add support for crl basic functionality with built-in cache (ratify-project#1890) Signed-off-by: Juncheng Zhu <[email protected]> Co-authored-by: Binbin Li <[email protected]> chore: Bump goreleaser/goreleaser-action from 6.0.0 to 6.1.0 (ratify-project#1920) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github/codeql-action from 3.27.0 to 3.27.1 (ratify-project#1922) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.42 to 1.17.44 (ratify-project#1923) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump golang from `0ca97f4` to `4cfe4a9` in /httpserver (ratify-project#1925) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github/codeql-action from 3.27.1 to 3.27.3 (ratify-project#1926) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> feat: support alibaba cloud rrsa store auth provider (ratify-project#1909) Signed-off-by: dahu.kdh <[email protected]> feat: kmprevocationfactory impl 3 Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl 2 Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl 3 Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl 4 Signed-off-by: Juncheng Zhu <[email protected]> feat: kmprevocationfactory impl 5 Signed-off-by: Juncheng Zhu <[email protected]> chore: kmprevocationfactory reform Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 2 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 3 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 4 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 5 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 6 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 7 Signed-off-by: Juncheng Zhu <[email protected]> feat: update implementations 8 Signed-off-by: Juncheng Zhu <[email protected]> chore: Bump github/codeql-action from 3.27.3 to 3.27.4 (ratify-project#1929) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump alpine from `beefdbd` to `1e42bbe` (ratify-project#1937) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump golang from `4cfe4a9` to `147f428` in /httpserver (ratify-project#1936) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump distroless/static from `3a03fc0` to `d71f4b2` in /httpserver (ratify-project#1935) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/aliyun/credentials-go from 1.3.10 to 1.3.11 (ratify-project#1934) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.44 to 1.17.45 (ratify-project#1933) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump codecov/codecov-action from 4.6.0 to 5.0.2 (ratify-project#1932) Signed-off-by: dependabot[bot] <[email protected]> chore: Replace deprecated autorest SDK with azidentity (ratify-project#1904) Signed-off-by: Shahram Kalantari <[email protected]> chore: Bump step-security/harden-runner from 2.10.1 to 2.10.2 (ratify-project#1938) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump codecov/codecov-action from 5.0.2 to 5.0.4 (ratify-project#1939) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump codecov/codecov-action from 5.0.4 to 5.0.7 (ratify-project#1946) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github/codeql-action from 3.27.4 to 3.27.5 (ratify-project#1945) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump anchore/sbom-action from 0.17.7 to 0.17.8 (ratify-project#1948) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.45 to 1.17.46 (ratify-project#1953) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fix: add missing pod annotations and labels to deployment spec (ratify-project#1949) Signed-off-by: akashsinghal <[email protected]> chore: revert changes in AKV KMP provider Signed-off-by: Juncheng Zhu <[email protected]> chore: add more comments Signed-off-by: Juncheng Zhu <[email protected]> chore: add more comments and fix Signed-off-by: Juncheng Zhu <[email protected]> chore: update logging Signed-off-by: Juncheng Zhu <[email protected]> chore: update test Signed-off-by: Juncheng Zhu <[email protected]> chore: update test 2 Signed-off-by: Juncheng Zhu <[email protected]> chore: limited changes 3 Signed-off-by: Juncheng Zhu <[email protected]> chore: more changes applied Signed-off-by: Juncheng Zhu <[email protected]> chore: Bump github.com/sigstore/rekor from 1.3.6 to 1.3.7 (ratify-project#1952) Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Susan Shi <[email protected]> Signed-off-by: Binbin Li <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: bump up golangci-lint version (ratify-project#1961) Signed-off-by: Binbin Li <[email protected]> fix(tls): allowing TLS when crd-manager disabled (ratify-project#1954) Signed-off-by: Jordan Langue <[email protected]> chore: Bump github.com/aws/aws-sdk-go-v2/config from 1.28.3 to 1.28.6 (ratify-project#1957) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: Bump distroless/static from `d71f4b2` to `6cd937e` in /httpserver (ratify-project#1960) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: fix go-lint Signed-off-by: Juncheng Zhu <[email protected]> chore: improve codecov Signed-off-by: Juncheng Zhu <[email protected]> chore: fix golint Signed-off-by: Juncheng Zhu <[email protected]> chore: remove the CRL Cache in truststore Signed-off-by: Juncheng Zhu <[email protected]> chore: renaming func Signed-off-by: Juncheng Zhu <[email protected]> chore: fix 1 Signed-off-by: Juncheng Zhu <[email protected]> chore: fix 2 Signed-off-by: Juncheng Zhu <[email protected]> chore: Bump github/codeql-action from 3.27.5 to 3.27.6 (ratify-project#1963) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> chore: add more test case Signed-off-by: Juncheng Zhu <[email protected]> chore: fix golint Signed-off-by: Juncheng Zhu <[email protected]> chore: fix codecov Signed-off-by: Juncheng Zhu <[email protected]> chore: fix context reference Signed-off-by: Juncheng Zhu <[email protected]> chore: fix golint Signed-off-by: Juncheng Zhu <[email protected]> build: add image signing for all release images (ratify-project#1947) Signed-off-by: Akash Singhal <[email protected]> chore: Bump golang from `73f06be` to `574185e` in /httpserver (ratify-project#1973) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
What this PR does / why we need it:
This PR adds an
Enabled
field to the KMPMapyKey struct which allows the provider to store the status of certificates and keys being pulled from the provider into Ratify's KMP. Which is needed to support multiple versions of certificates and keys being stored in the KMP. See discussions and the design doc, here, for more details.Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Unit test currently do not fully test the
GetCertificate
andGetKeys
methods of KMP providers, but can be added if desired to the PR or a follow up PR. Also waiting to see if theazidentiy
work will be done before adding unit tests because that will likely change the client that will need to be mocked to fully tests the methods.Checklist:
Post Merge Requirements
Helm Chart Change