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
1. An OpenShift cluster (Go to [the OpenShift console](https://console.redhat.com/openshift/create)). Cluster must have a dynamic StorageClass to provision PersistentVolumes. See also [sizing your cluster](../../devsecops/cluster-sizing).
12
12
1. A second OpenShift cluster for development using secure CI pipelines.
13
13
1. A third OpenShift cluster for production. (optional but desirable)
14
-
1. A GitHub account (and a token for it with repositories permissions, to read from and write to your forks)
14
+
1. A GitHub account and a personal access token. The Tekton CI/CD pipelines use this token to clone repositories, push commits, and create pull requests. You can use either a classic token or a fine-grained token. For details, see [GitHub token scopes](#github-token-scopes).
15
15
1. Tools Podman and Git. (see below)
16
16
17
17
If you do not have running Red Hat OpenShift clusters you can start one on a
In addition to the openshift cluster, you will need to prepare a number of secrets, or credentials, which will be used
24
24
in the pattern in various ways. To do this, copy the [values-secret.yaml template](https://github.com/validatedpatterns/multicluster-devsecops/blob/main/values-secret.yaml.template) to your home directory as `values-secret.yaml` and replace the explanatory text as follows:
25
25
26
-
* Your git repository username and password. The password must be base64 encoded.
26
+
* Your GitHub username and personal access token. Use the token as the password value. For required token scopes, see [GitHub token scopes](#github-token-scopes). The token must be base64 encoded.
27
27
28
28
```yaml
29
29
---
30
30
secrets:
31
31
# NEVER COMMIT THESE VALUES TO GIT
32
32
git:
33
33
# Go to: https://github.com/settings/tokens
34
-
# Then: echo -n 'your string value' | base64
34
+
# For required scopes, see the "GitHub token scopes" section in the docs
35
+
# Then: echo -n 'your-token' | base64
35
36
username: USERNAME
36
-
password: 'encoded password in single quotes'
37
+
password: 'encoded token in single quotes'
37
38
```
38
39
39
40
* You application secret. TBD This may change when the application is changed.
@@ -47,6 +48,36 @@ secrets:
47
48
secret: PLAINTEXT
48
49
```
49
50
51
+
## GitHub token scopes
52
+
53
+
The Tekton CI/CD pipelines require a GitHub personal access token to clone repositories, push commits, and create pull requests. You can use a classic token or a fine-grained token.
54
+
55
+
### Option 1: Classic token
56
+
57
+
Create a [personal access token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with the following scope:
58
+
59
+
| Scope | Reason |
60
+
|-------|--------|
61
+
| **`repo`** | Grants read and write access to repositories, including the ability to create pull requests |
62
+
63
+
To create the token, go to [GitHub Settings > Tokens](https://github.com/settings/tokens).
64
+
65
+
### Option 2: Fine-grained token
66
+
67
+
If you prefer more restrictive permissions, create a [fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) with the following repository permissions:
68
+
69
+
| Permission | Access | Reason |
70
+
|------------|--------|--------|
71
+
| **Contents** | Read and write | Clone repositories and push commits |
72
+
| **Pull requests** | Read and write | Create pull requests through the GitHub API |
73
+
74
+
When you create a fine-grained token, you must also configure these settings:
75
+
76
+
- **Resource owner**: Select the GitHub account or organization that owns your fork.
77
+
- **Repository access**: Grant access to your fork of the `multicluster-devsecops` repository. If the pipelines interact with additional repositories, include those as well.
78
+
79
+
> **Note:** Fine-grained tokens are scoped to specific repositories and owners. If your organization restricts fine-grained token usage, you must use a classic token instead.
80
+
50
81
# Preparing to deploy
51
82
52
83
1. Install the installation tooling dependencies. See [Patterns quick start](/learn/quickstart/)
0 commit comments