You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Add section on secrets & token interactions (#1157)
* Add section on secrets & token interactionsAdded section on interaction between argo cd secrets, runtime secrets, and user-specific PATs* Update git tokensAdded section on secrets and tokens* Update git-tokens.mdEdits with feedback* Update git-tokens.md
Copy file name to clipboardExpand all lines: _docs/administration/account-user-management/oauth-setup.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
title:"Setting up OAuth2 for GitOps"
3
-
description:""
3
+
description:"Set up Git authentication with OAuth2"
4
4
group:administration
5
5
sub_group:account-user-management
6
6
toc:true
7
7
---
8
8
9
-
Codefresh integrates with the Git provider defined for yourGitOps runtime accountto sync repositories to your clusters, implementing Git-based operations when creating resources such as Delivery Pipelines, applications, and enriching images with valuable information.
9
+
Codefresh integrates with the Git provider defined for youraccount with the GitOps Runtimeto sync repositories to your clusters, implementing Git-based operations when creating resources such as applications, and enriching images with valuable information.
10
10
11
-
As the account administrator, you can select the authentication method fora runtimeaccount. Users in Codefresh will then authorize access to the Git providers through the defined mechanism.
11
+
As the account administrator, you can select the authentication method fortheaccount with Runtime. Users in Codefresh will then authorize access to the Git providers through the defined mechanism.
12
12
13
13
{% include
14
14
image.html
@@ -22,21 +22,23 @@ As the account administrator, you can select the authentication method for a run
22
22
23
23
Codefresh supports OAuth2 or personal access tokens (PATs) for authentication:
24
24
25
-
* OAuth2 with Codefresh OAuth Application or custom OAuth2 Application
25
+
***OAuth2 with Codefresh OAuth Application or custom OAuth2 Application**
26
26
OAuth2 is the preferred authentication mechanism, supported for popular Git providers such as GitHub, GitHub Enterprise, GitLab Cloud and Server, and Bitbucket Cloud and Server.
27
27
You have the option to use the default predefined Codefresh OAuth Application, or a custom Oauth2 Application for Codefresh in your Git provider account.
28
-
Hosted runtime accounts automatically use Codefresh's predefined OAuth Application.
29
-
To use a custom Oauth2 Application for Codefresh, first create the application in your Git provider account, then create a secret on your K8s cluster, and finally configure OAuth2 access for the custom application in Authentication > Settings. See[Create a custom OAuth2 Application for Git provider](#create-a-custom-oauth2-application-for-git-provider) in this article.
28
+
<!--- Hosted runtime accounts automatically use Codefresh's predefined OAuth Application.-->
29
+
To use a custom Oauth2 Application for Codefresh, first create the application in your Git provider account, then create a secret on your K8s cluster, and finally configure OAuth2 access for the custom application in Authentication > Settings. <br>
30
+
See[Create a custom OAuth2 Application for Git provider](#create-a-custom-oauth2-application-for-git-provider) in this article.
30
31
31
-
* Token-based authentication using PAT
32
-
With token-based authentication, users must generate personal access tokens from their Git providers with the required scopes and enter their personal access tokens when prompted to authorize access. See[Authorize Git access in Codefresh]({{site.baseurl}}/docs/administration/user-self-management/user-settings/#git-provider-private-access).
32
+
***Token-based authentication using PAT**
33
+
With token-based authentication, users must generate personal access tokens from their Git providers with the required scopes and enter their personal access tokens when prompted to authorize access.<br>
34
+
See[Authorize Git access in Codefresh]({{site.baseurl}}/docs/administration/user-self-management/user-settings/#git-provider-private-access).
33
35
34
36
35
37
36
-
##Authentication for Git providers andruntime accounts
38
+
##Authentication for Git providers andRuntime accounts
37
39
The[Git Authentication](https://g.codefresh.io/2.0/account-settings/authentication?providerName=github){:target="\_blank"} page displays the accounts by Git provider and the authentication method selected for the same.
38
40
39
-
Authentication accounts are organized by Runtimes. Aruntime can have a single authentication account.
41
+
Authentication accounts are organized by Runtimes. ARuntime can have a single authentication account.
40
42
The Type column identifies the authentication for the provider account as either Codefresh, Custom, or PAT (personal access token).
41
43
42
44
{% include
@@ -49,7 +51,8 @@ The Type column identifies the authentication for the provider account as either
49
51
max-width="80%"
50
52
%}
51
53
52
-
As the account administrator, you can change the authentication method for a Hybrid GitOps runtime at any time to either Codefresh, Custom, or manual token entry. See[Select authentication mechanism for runtime](#select-authentication-mechanism-for-runtime).
54
+
As the account administrator, you can change the authentication method for a GitOps runtime at any time to either Codefresh, Custom, or manual token entry. See[Select authentication mechanism for runtime](#select-authentication-mechanism-for-runtime).
55
+
53
56
54
57
##Create a custom OAuth2 Application for Git provider
55
58
Create a custom OAuth2 Application for Codefresh in your Git provider accounts with the correct scopes, and set up authentication for the same within Codefresh. Users in Codefresh can then authorize access to the Git provider using OAuth2, instead of a personal access token.
@@ -79,7 +82,8 @@ Create and register an OAuth App under your organization to authorize Codefresh.
79
82
* For**Authorization callback URL**, enter this value:
`<ingressHost>` is the IP address or URL of the ingress host in the runtime cluster.
85
+
`<ingressHost>` is the IP address or URL of the ingress host in the Runtime cluster as defined in your`values.yaml`. <br>For
86
+
tunnel-based access modes, run the command`codefresh runtime list` to retrieve the correct host.
83
87
* Make sure**Enable Device Flow** is_not_ selected.
84
88
* Select**Register application**.
85
89
The client ID is automatically generated, and you are prompted to generate the client secret.
@@ -217,11 +221,11 @@ The values for all the settings in the ConfigMap are the `keys` in the secret fi
217
221
218
222
You have completed the setup to authorize Codefresh as an OAuth App for your Git provider.
219
223
220
-
## Select authentication mechanism forruntime
221
-
For a Git provider and aruntime account, select the authentication mechanism:Codefresh account, Custom provider account if one exists, or token-based authentication.
224
+
## Select authentication mechanism forRuntime
225
+
For a Git provider and aRuntime account, select the authentication mechanism:Codefresh account, Custom provider account if one exists, or token-based authentication.
222
226
223
-
>**NOTE**
224
-
Hosted GitOps runtimes support either Codefresh or token-based authentication.
227
+
<!--- >>**NOTE**
228
+
Hosted GitOps runtimes support either Codefresh or token-based authentication. -->
225
229
226
230
1. In the Codefresh UI, go to [Authentication](https://g.codefresh.io/2.0/account-settings/authentication?providerName=github){:target="\_blank"}.
227
231
1. Select the runtime, and click **Edit**.
@@ -230,6 +234,7 @@ Hosted GitOps runtimes support either Codefresh or token-based authentication.
230
234
231
235
## Related articles
232
236
[Adding users and teams]({{site.baseurl}}/docs/administration/account-user-management/add-users/)
Copy file name to clipboardExpand all lines: _docs/security/git-tokens.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title:"Git tokens for GitOps"
3
-
description:"Understand Git tokens and scopes required forGitOps"
3
+
description:"Understand Git tokens and scopes required forGit authentication"
4
4
group:security
5
5
redirect_from:
6
6
-/docs/administration/git-tokens/
@@ -10,7 +10,8 @@ toc: true
10
10
11
11
12
12
13
-
Codefresh requires two types of Git tokens for authentication in GitOps, a Git Runtime token, and a Git user token. The Runtime and user tokens are both Git access tokens which Codefresh uses for different purposes. See[Git Runtime tokens versus Git user tokens in Codefresh](#git-runtime-tokens-versus-git-user-tokens-in-codefresh).
13
+
14
+
Codefresh requires two types of Git tokens for authentication in GitOps, a Git Runtime token, and a Git user token. The Runtime and user tokens are both Git access tokens used for different purposes. See[Git Runtime tokens versus Git user tokens in Codefresh](#git-runtime-tokens-versus-git-user-tokens-in-codefresh) and[Interaction between Argo CD secrets and Git tokens](#interaction-between-argo-cd-secrets-and-git-tokens).
14
15
* The[Git Runtime token](#git-runtime-token-scopes) is mandatory for every GitOps Runtime. It must be provided during the Runtime installation, and is typically associated with a service/robot account.
15
16
* The[Git user token](#git-user-access-token-scopes) is an access token that is unique to every user in the Codefresh platform. It is required after installation for every Runtime which the user has access to.
16
17
@@ -30,6 +31,31 @@ The table below summarizes the main differences between the Git Runtime token an
30
31
| Managed by| Admin at account-level| User|
31
32
| Associated Account Type| (Recommended)[Service account or robot account](#use-a-servicerobot-account-for-gitops-runtimes)| User account|
32
33
34
+
##Interaction between Git tokens and secrets
35
+
Codefresh needs access to Git repositories for reading and writing to configuration and resource manifests. This section elaborates on how Git providers and repositories with Git tokens for authentication to .
36
+
37
+
38
+
###GitOps Runtime token and secret
39
+
The Git Runtime token is the personal access token provided during Runtime installation and is automatically converted to a secret. The secret for the Runtime repository is stored in the`runtime-repo-creds-secret` secret, labeled with`argocd.argoproj.io/secret-type: repo-creds`.
40
+
41
+
This label
42
+
The Runtime uses the same credentials
43
+
44
+
The secret:
45
+
* Allows Argo CD to use the credentials to clone and pull data from the repositories it syncs from for read-only operations.
46
+
* Allows the Runtime to both read and write to the same repositories, for all actions on behalf of the Runtime such as commits during promotions.
47
+
48
+
###GitOps user token and secret
49
+
50
+
The Git user token, also a personal access token, is used for operations initiated by the user via the UI, and is therefore unique to each user.
51
+
The Git user token is also converted to an encrypted secret, and stored in the`git-default-<account-id>` secret.
52
+
53
+
The token is used to:
54
+
* Perform Git commits and pushes on behalf of the user.
55
+
* Validate the user’s access permissions to specific Git repositories and determine application visibility.
56
+
57
+
58
+
33
59
34
60
##Git Runtime token scopes
35
61
The table below lists the scopes required for Git Runtime tokens for the different Git providers. You can also create a Git Runtime token with custom scopes and[add it directly to the`values.yaml` file](#git-runtime-token-in-valuesyaml).
@@ -43,7 +69,7 @@ The table below lists the scopes required for Git Runtime tokens for the differe
43
69
44
70
###Git Runtime token in values.yaml
45
71
46
-
You also have the option to directly add your Git Runtime token, or a reference toa secret that contains theGitRuntimetoken, to`values.yaml` (typically the latter).
72
+
You also have the option to directly add your Git Runtime token, or a reference tothe secret that contains the Runtimesecret, to`values.yaml` (typically the latter).
47
73
48
74
To skip token validation both during installation and upgrade in this scenario, add the`skipValidation` flag to`values.yaml`.