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

Commit192ab44

Browse files
authored
Add skip validation info for fine-grained git tokens (#1161)
* Add skip validation info for fine-grained git tokens* Update manage-pats.mdAdded note on skipping validation for fine-grained tokens
1 parent9567142 commit192ab44

File tree

3 files changed

+46
-27
lines changed

3 files changed

+46
-27
lines changed

‎_docs/administration/user-self-management/manage-pats.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ sub_group: user-self-management
66
toc:true
77
---
88

9-
As a user in Codefresh, you must authorize access to your Git provider accounts, and authenticate Git-based actions from Codefresh clients, per provisioned GitOps Runtime. This is done through the Git user token, which is an access token unique to each user. For more details, including required scopes and how the Git user token differs from the Git Runtime token, see[Git tokens in Codefresh]({{site.baseurl}}/docs/security/git-tokens/).
9+
As a user in Codefresh, you must authorize access to your Git provider accounts and authenticate Git-based actions from Codefresh clients, per provisioned GitOps Runtime. This is done through the Git user token, which is an access token unique to each user. For more details, including required scopes and how the Git user token differs from the Git Runtime token, see[Git tokens in Codefresh]({{site.baseurl}}/docs/security/git-tokens/).
1010

1111
The authorization mode depends on the authorization method set up by your account admin:
1212
* OAuth2
1313
If your admin has set up authentication with OAuth2, you can authorize access using OAuth2.
1414
* Git user access token
1515
You can always generate a Git user token from your Git provider and then add the same to the GitOps Runtime in Codefresh to authorize access.
1616

17+
>**NOTE**
18+
Codefresh GitOps does not officially support fine-grained tokens, or tokens with custom scopes. If you are using such tokens, make sure you turn off validation for Git tokens in the`values.yaml` file, as described in[Skipping token values.yaml]({{site.baseurl}}/docs/security/git-tokens#skipping-token-validation-in-valuesyaml).
1719

18-
19-
##Authorize Git access to GitOps Runtimes
20+
##Authorize Git access to GitOps Runtimes with OAuth2å
2021
Authorize Git access to GitOps Runtimes with OAuth2 if your account admin has set up Codefresh as an OAuth application, or alternatively through Git user access tokens from your Git provider.
2122

2223
If you have access to more than one GitOps Runtime in the same or in different accounts, you can use the same Git user token for all the Runtimes you have access to._You must however authorize access for each GitOps Runtime individually_.

‎_docs/installation/gitops/hybrid-gitops-helm-installation.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The table below lists the settings validated in the `values` file.
158158
{: .table .table-bordered .table-hover}
159159
|**Setting**|**Validation**|
160160
| --------------| --------------|
161-
|**userToken**|If explicitly defined, or defined as a`secretKeyRef` which exists in the currentk8s context and the defined namespace.|
161+
|**userToken**|If explicitly defined, or defined as a`secretKeyRef` which exists in the currentK8s context and the defined namespace.|
162162
|**Account permissions**|If the user has admin permissions for the account in which they are installing the runtime.|
163163
|**Runtime name**|If defined, and is unique to the account.|
164164
|**Access mode**|{::nomarkdown}<ul><li>For tunnel-based (the default), if <codeclass="highlighter-rouge">accountId</code> is defined, and matches the account of the <codeclass="highlighter-rouge">userToken</code> defined in the file.</li><li>For ingress-based, if the hosts array contains at least one entry that is a valid URL (successful HTTP GET).</li><li>If both tunnel-based and ingress-based access modes are disabled, if <codeclass="highlighter-rouge">runtime.ingressUrl</code> is defined.</li></ul>{:/}|
@@ -175,7 +175,7 @@ where:
175175

176176
###Disable global installation validation
177177
You may want to disable automated validation for specific scenarios, such as to address false-negatives.
178-
Do so by either adding the flag to the Helm install command or adding the relevant section to the values file.
178+
Do so by either adding the flag to the Helm install command or adding the relevant section to the`values` file.
179179

180180

181181
#####In install command
@@ -213,6 +213,24 @@ global:
213213
{% endraw %}
214214
{% endhighlight %}
215215

216+
###Disabling validation for custom/fine-grained Git tokens
217+
If you use tokens with custom scopes, or GitHub's fine-grained tokens (currently not officially supported by Codefresh),_skip token validation_ to avoid validation failures when installing GitOps Runtimes.
218+
219+
Add the`skipGitPermissionValidation` flag to your`values.yaml` file:
220+
221+
```yaml
222+
app-proxy:
223+
config:
224+
skipGitPermissionValidation:"true"
225+
```
226+
227+
If you set this flag, make sure that:
228+
1. The Git user token defined for the GitOps Runtime (the token defined for`runtime-repo-creds-secret`), has read and write access to the Shared Configuration Repository.
229+
1. The Git user tokens for the different Git repositories associated with the Runtimes have read and write permissions to those Git repositories they expect to write to and read from.
230+
Read more on configuring the repositories with multiple `repo-creds` secrets in [Argo CD Repositories](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#repositories).
231+
232+
For details on Git token usage, see [Git tokens]({{site.baseurl}}/docs/security/git-tokens/).
233+
216234
### Manually validate values.yaml
217235
To manually validate the values file, run:
218236
`cf helm validate --values <values_file> --namespace <namespace> --version <version>`

‎_docs/security/git-tokens.md‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ toc: true
1111

1212

1313

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 Git tokens and secrets](#interaction-between-git-tokens-and-secrets).
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).
1515
* 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.
1616
* 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.
1717

1818
>**IMPORTANT**
19-
At all times,_bothtokens are always securely stored on your cluster_ and never stored locally on our platform.
19+
_Bothtokens are always securely stored on your cluster_ and never locally on our platform.
2020

2121
Users can also create and use Git tokens with custom scopes for both GitOps Runtimes and for Git repositories associated with the Runtimes that they need to access. See[Git user tokens with custom scopes](#git-user-tokens-with-custom-scopes).
2222

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

34-
##Interaction betweenGittokens and secrets
34+
##Gittoken conversion to secret
3535
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 .
3636

3737

@@ -69,7 +69,8 @@ The table below lists the scopes required for Git Runtime tokens for the differe
6969

7070
###Git Runtime token in values.yaml
7171

72-
You also have the option to directly add your Git Runtime token, or a reference to the secret that contains the Runtime secret, to`values.yaml` (typically the latter).
72+
You can directly add the Git Runtime token, or a reference to the Runtime secret, to your`values.yaml`.
73+
7374

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

@@ -87,7 +88,7 @@ If you set the flag to skip validation, _the onus is on you to provide a valid a
8788
8889
## Git user access token scopes
8990
The table below lists the scopes required for Git user access tokens for the different Git providers.
90-
As with the Git Runtime token, you can create and use Git user tokens with custom scopes per GitOps Runtime, and per Git repository to which the Runtime has access.
91+
As with the Git Runtime token, you can create and use Git user tokens with custom scopes per GitOps Runtime and per Git repository to which the Runtime has access.
9192
9293
9394
| Git provider | Required scopes for Git user token |
@@ -97,14 +98,11 @@ As with the Git Runtime token, you can create and use Git user tokens with custo
9798
| Bitbucket Cloud and Bitbucket Server | {::nomarkdown} <ul><li>Account: <code class="highlighter-rouge">Read</code></li><li>Workspace membership: <code class="highlighter-rouge">Read</code></li><li>Webhooks: <code class="highlighter-rouge">Read and write</code></li><li>Repositories: <code class="highlighter-rouge">Write, Admin </code></li></ul>{:/}|
9899
99100
100-
### Git user tokens with custom scopes
101-
Codefresh validates Git user tokens and their associated scopes when authorizing Git actions for the Runtime.
102-
103-
104-
If you require custom scopes in Git user tokens that don't meet the default Codefresh requirements, you can create Git user tokens with custom scopes. You may want to have Git user tokens without`admin` scopes, or use the new fine-grained tokens for GitHub (currently not officially supported by Codefresh).
105-
106-
Codefresh provides the `skipGitPermissionValidation` flag which you can add to your `values.yaml` file to bypass token validation for such cases.
101+
## Skipping token validation in values.yaml
102+
If you use tokens with custom scopes, or GitHub's fine-grained tokens (currently not officially supported by Codefresh), _you must skip token validation in the`values.yaml` file_ to avoid validation failures when installing GitOps Runtimes.
103+
Codefresh validates the `values.yaml` before initiating Runtime installation.
107104

105+
Add the `skipGitPermissionValidation` flag to your `values.yaml` file to bypass token validation:
108106

109107
```yaml
110108
app-proxy:
@@ -113,6 +111,7 @@ app-proxy:
113111
```
114112

115113
If you set this flag, make sure that:
114+
1. You configure the Git user token for each GitOps Runtime separately.
116115
1. The Git user token defined for the GitOps Runtime (the token defined for `runtime-repo-creds-secret`), has read and write access to the Shared Configuration Repository.
117116
1. The Git user tokens for the different Git repositories associated with the Runtimes have read and write permissions to those Git repositories they expect to write to and read from.
118117
Read more on configuring the repositories with multiple `repo-creds` secrets in [Argo CD Repositories](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#repositories).
@@ -122,21 +121,22 @@ If you set this flag, make sure that:
122121
If you set the flag to skip validation, _the onus is on you to provide valid and secure tokens_. Codefresh does not validate the tokens whenever Git Runtime and Git user tokens are updated.
123122
{{site.data.callout.end}}
124123

125-
### Use same Git user tokens for multiple GitOps Runtimes
126-
If a user has access to multiple GitOps Runtimes in the same or in different accounts in Codefresh, they can use either the same Git user token to authenticate and authorize all the Runtimes to which they have access.
124+
## Best practices for Git token usage
127125

128-
>**NOTE**
129-
The user must configure the Gitusertokenforeach GitOps Runtime separately.
126+
### Use a service/robot account for GitOps Runtimes
127+
For GitOps Runtime installation, we recommend using an account not related to any specificuserin your organization. Service/robot accounts are idealforthis purpose, as they provide secure authentication, restricted permissions, and centralized management.
130128

131-
### Manage Git user tokens
132-
User can manage their Git user tokens for Runtimes, as described in [Managing Git PATS]({{site.baseurl}}/docs/administration/user-self-management/manage-pats/).
129+
You need to create a service or robot account with your Git provider, generate the Git Runtime token, and use this account exclusively to install GitOps Runtimes.
133130

131+
### Use the same Git user tokens for multiple GitOps Runtimes
132+
If a user has access to multiple GitOps Runtimes, either within the same or across different Codefresh accounts, they can use the same Git user token to authenticate and authorize all the Runtimes to which they have access. This approach simplifies token management and ensures consistency in authentication.
134133

135-
## Use a service/robot account for GitOps Runtimes
136-
For GitOps Runtime installation, we recommend using an account not related to any specific user in your organization.
137-
Service/robot accounts are ideal for this purpose, as they provide secure authentication, restricted permissions, and centralized management.
134+
>****NOTE**
135+
The user must configure the Git user token for each GitOps Runtime separately.
136+
137+
### Manage Git user tokens
138+
Users can manage their Git user tokens for Runtimes, as described in [Managing Git PATS]({{site.baseurl}}/docs/administration/user-self-management/manage-pats/).
138139

139-
You need to create a service or robot account with your Git provider, generate the Git Runtime token, and use this account exclusively to install GitOps Runtimes.
140140

141141
## Related articles
142142
[Managing Git PATs]({{site.baseurl}}/docs/administration/user-self-management/manage-pats/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp