Skip to content

Commit 107ab62

Browse files
todaywasawesomecrenshaw-devfarcallerpasha-codefreshyann-soubeyrand
authored
Verify aud claim cf (#202)
* fix: verify audience claim Co-Authored-By: Vladimir Pouzanov <[email protected]> Signed-off-by: CI <[email protected]> * fix unit tests Signed-off-by: Michael Crenshaw <[email protected]> * handle single aud claim marshaled as a string Signed-off-by: Michael Crenshaw <[email protected]> * fix dependencies * fix: add CLI client IDs to default OIDC allowed audiences (argoproj#12170) (argoproj#12179) * fix(settings): add CLI client ID in default OAuth2 allowed audiences Signed-off-by: Yann Soubeyrand <[email protected]> * fix: add CLI client IDs to default OIDC allowed audiences (argoproj#12170) Signed-off-by: Michael Crenshaw <[email protected]> * docs Signed-off-by: Michael Crenshaw <[email protected]> * test Signed-off-by: Michael Crenshaw <[email protected]> * handle expired token properly Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Yann Soubeyrand <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Yann Soubeyrand <[email protected]> * fix dependencies * update version * update version * update version * fix linter * fix linter --------- Signed-off-by: CI <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: Yann Soubeyrand <[email protected]> Co-authored-by: CI <[email protected]> Co-authored-by: Vladimir Pouzanov <[email protected]> Co-authored-by: pashakostohrys <[email protected]> Co-authored-by: Yann Soubeyrand <[email protected]>
1 parent 545b94b commit 107ab62

File tree

25 files changed

+1582
-109
lines changed

25 files changed

+1582
-109
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.5-cap-CR-fix-rollouts-rollback
1+
2.5.5-cap-CR-verify-aud-claim

cmd/argocd/commands/admin/settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ var validatorsByGroup = map[string]settingValidator{
206206
}
207207
ssoProvider = "Dex"
208208
} else if general.OIDCConfigRAW != "" {
209-
if _, err := settings.UnmarshalOIDCConfig(general.OIDCConfigRAW); err != nil {
209+
if err := settings.ValidateOIDCConfig(general.OIDCConfigRAW); err != nil {
210210
return "", fmt.Errorf("invalid oidc.config: %v", err)
211211
}
212212
ssoProvider = "OIDC"

common/common.go

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package common
22

33
import (
4+
"errors"
45
"os"
56
"path/filepath"
67
"strconv"
@@ -78,10 +79,10 @@ const (
7879

7980
// ArgoCDAdminUsername is the username of the 'admin' user
8081
ArgoCDAdminUsername = "admin"
81-
// ArgoCDUserAgentName is the default user-agent name used by the gRPC API client library and grpc-gateway
82-
ArgoCDUserAgentName = "argocd-client"
8382
// ArgoCDSSAManager is the default argocd manager name used by server-side apply syncs
8483
ArgoCDSSAManager = "argocd-controller"
84+
// ArgoCDUserAgentName is the default user-agent name used by the gRPC API client library and grpc-gateway
85+
ArgoCDUserAgentName = "argocd-client"
8586
// AuthCookieName is the HTTP cookie name where we store our auth token
8687
AuthCookieName = "argocd.token"
8788
// StateCookieName is the HTTP cookie name that holds temporary nonce tokens for CSRF protection
@@ -227,12 +228,6 @@ const (
227228
DefaultCMPWorkDirName = "_cmp_server"
228229

229230
ConfigMapPluginDeprecationWarning = "argocd-cm plugins are deprecated, and support will be removed in v2.6. Upgrade your plugin to be installed via sidecar. https://argo-cd.readthedocs.io/en/stable/user-guide/config-management-plugins/"
230-
231-
ConfigMapPluginCLIDeprecationWarning = "spec.plugin.name is set, which means this Application uses a plugin installed in the " +
232-
"argocd-cm ConfigMap. Installing plugins via that ConfigMap is deprecated in Argo CD v2.5. " +
233-
"Starting in Argo CD v2.6, this Application will fail to sync. Contact your Argo CD admin " +
234-
"to make sure an upgrade plan is in place. More info: " +
235-
"https://argo-cd.readthedocs.io/en/latest/operator-manual/upgrading/2.4-2.5/"
236231
)
237232

238233
const (
@@ -299,7 +294,7 @@ func GetCMPWorkDir() string {
299294
}
300295

301296
const (
302-
// AnnotationApplicationRefresh is an annotation that is added when an ApplicationSet is requested to be refreshed by a webhook. The ApplicationSet controller will remove this annotation at the end of reconciliation.
297+
// AnnotationApplicationRefresh is an annotation that is added when an ApplicationSet is requested to be refreshed by a webhook. The ApplicationSet controller will remove this annotation at the end of reconcilation.
303298
AnnotationApplicationSetRefresh = "argocd.argoproj.io/application-set-refresh"
304299
)
305300

@@ -312,11 +307,14 @@ const (
312307

313308
// Security severity logging
314309
const (
315-
SecurityField = "security"
316-
SecurityCWEField = "CWE"
317-
SecurityEmergency = 5 // Indicates unmistakably malicious events that should NEVER occur accidentally and indicates an active attack (i.e. brute forcing, DoS)
318-
SecurityCritical = 4 // Indicates any malicious or exploitable event that had a side effect (i.e. secrets being left behind on the filesystem)
319-
SecurityHigh = 3 // Indicates likely malicious events but one that had no side effects or was blocked (i.e. out of bounds symlinks in repos)
320-
SecurityMedium = 2 // Could indicate malicious events, but has a high likelihood of being user/system error (i.e. access denied)
321-
SecurityLow = 1 // Unexceptional entries (i.e. successful access logs)
310+
SecurityField = "security"
311+
SecurityCWEField = "CWE"
312+
SecurityHigh = 3 // Indicates likely malicious events but one that had no side effects or was blocked (i.e. out of bounds symlinks in repos)
313+
SecurityMedium = 2 // Could indicate malicious events, but has a high likelihood of being user/system error (i.e. access denied)
314+
SecurityLow = 1 // Unexceptional entries (i.e. successful access logs)
322315
)
316+
317+
// Common error messages
318+
const TokenVerificationError = "failed to verify the token"
319+
320+
var TokenVerificationErr = errors.New(TokenVerificationError)

0 commit comments

Comments
 (0)