Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8bff88c

Browse files
authored
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
1 parent893ccfd commit8bff88c

File tree

3 files changed

+51
-20
lines changed

3 files changed

+51
-20
lines changed

‎_docs/administration/account-user-management/oauth-setup.md‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title:"Setting up OAuth2 for GitOps"
3-
description:""
3+
description:"Set up Git authentication with OAuth2"
44
group:administration
55
sub_group:account-user-management
66
toc:true
77
---
88

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.
1010

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.
1212

1313
{% include
1414
image.html
@@ -22,21 +22,23 @@ As the account administrator, you can select the authentication method for a run
2222

2323
Codefresh supports OAuth2 or personal access tokens (PATs) for authentication:
2424

25-
* OAuth2 with Codefresh OAuth Application or custom OAuth2 Application
25+
***OAuth2 with Codefresh OAuth Application or custom OAuth2 Application**
2626
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.
2727
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.
3031

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).
3335

3436

3537

36-
##Authentication for Git providers andruntime accounts
38+
##Authentication for Git providers andRuntime accounts
3739
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.
3840

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.
4042
The Type column identifies the authentication for the provider account as either Codefresh, Custom, or PAT (personal access token).
4143

4244
{% include
@@ -49,7 +51,8 @@ The Type column identifies the authentication for the provider account as either
4951
max-width="80%"
5052
%}
5153

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+
5356

5457
##Create a custom OAuth2 Application for Git provider
5558
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.
7982
* For**Authorization callback URL**, enter this value:
8083
`<ingressHost>/app-proxy/api/git-auth/github/callback`
8184
where:
82-
`<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.
8387
* Make sure**Enable Device Flow** is_not_ selected.
8488
* Select**Register application**.
8589
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
217221

218222
You have completed the setup to authorize Codefresh as an OAuth App for your Git provider.
219223

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.
222226

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. -->
225229

226230
1. In the Codefresh UI, go to [Authentication](https://g.codefresh.io/2.0/account-settings/authentication?providerName=github){:target="\_blank"}.
227231
1. Select the runtime, and click **Edit**.
@@ -230,6 +234,7 @@ Hosted GitOps runtimes support either Codefresh or token-based authentication.
230234

231235
## Related articles
232236
[Adding users and teams]({{site.baseurl}}/docs/administration/account-user-management/add-users/)
233-
[Configuring access control]({{site.baseurl}}/docs/administration/account-user-management/access-control/)
237+
[Configuring access control for GitOps]({{site.baseurl}}/docs/administration/account-user-management/gitops-abac/)
238+
[Git tokens for GitOps]({{site.baseurl}}/docs/security/git-tokens/)
234239
[Codefresh IP addresses]({{site.baseurl}}/docs/administration/platform-ip-addresses/)
235240

‎_docs/security/git-tokens.md‎

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title:"Git tokens for GitOps"
3-
description:"Understand Git tokens and scopes required forGitOps"
3+
description:"Understand Git tokens and scopes required forGit authentication"
44
group:security
55
redirect_from:
66
-/docs/administration/git-tokens/
@@ -10,7 +10,8 @@ toc: true
1010

1111

1212

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).
1415
* 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.
1516
* 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.
1617

@@ -30,6 +31,31 @@ The table below summarizes the main differences between the Git Runtime token an
3031
| Managed by| Admin at account-level| User|
3132
| Associated Account Type| (Recommended)[Service account or robot account](#use-a-servicerobot-account-for-gitops-runtimes)| User account|
3233

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+
3359

3460
##Git Runtime token scopes
3561
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
4369

4470
###Git Runtime token in values.yaml
4571

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).
4773

4874
To skip token validation both during installation and upgrade in this scenario, add the`skipValidation` flag to`values.yaml`.
4975

-27 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp