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
|`install-dir`| (optional) | Path of directory to install `roxctl` to. |
22
+
|`version`| (optional) |`roxctl` release version to use, e.g. "4.4.0". The latest available version is used by default. Ignored when `central-endpoint` is specified. |
23
+
|`central-endpoint`| (optional) | RHACS Central endpoint to download `roxctl` from. If left unspecified, `roxctl` is downloaded from mirror.openshift.com instead. Requires `central-token` to be set. |
24
+
|`central-token`| (optional) | Token to access RHACS Central endpoint. |
25
+
|`skip-tls-verify`| (optional) | Skip TLS certificate verification for Central's API endpoint. `false` by default. |
26
+
27
+
## Authentication
18
28
19
29
Short-lived access tokens are the recommended authentication method when using `roxctl` in GitHub workflows.
20
30
To generate a suitable token, configure a machine access configuration in Central and run the
21
31
[central-login](https://github.com/stackrox/central-login) Github Action to set up an authenticated environment.
22
32
23
-
The following examples assume `env.CENTRAL_ENDPOINT` to be a valid Central URL.
33
+
For example, to allow access from GitHub workflows in the `stackrox/stackrox` repository:
34
+
35
+
1. Create a machine access configuration of type `GitHub` in Central.
36
+
2. Add a new rule with `Key = sub`, `Value = repo:stackrox/stackrox.*` and `Role = Continuous Integration`.
37
+
38
+

39
+
40
+
The following examples assume `env.CENTRAL_ENDPOINT=https://my-central.com` to be a valid Central URL.
41
+
42
+
### Authenticate with short-lived access tokens
43
+
44
+
See [Scan images in CI pipeline](#scan-images-in-ci-pipelines) and [Check images in CI pipeline](#check-images-in-ci-pipelines) for full length examples.
45
+
46
+
```yaml
47
+
steps:
48
+
- name: Central login
49
+
uses: stackrox/central-login@v1
50
+
with:
51
+
endpoint: ${{ env.CENTRAL_ENDPOINT }}
52
+
- name: Install roxctl
53
+
uses: stackrox/roxctl-installer-action@v1
54
+
with:
55
+
central-endpoint: ${{ env.CENTRAL_ENDPOINT }}
56
+
central-token: ${{ env.ROX_API_TOKEN }}
57
+
```
58
+
59
+
### Authenticate with long-lived API tokens
60
+
61
+
Long-lived API tokens are not recommended because they carry an increased risk of credential exposure.
62
+
They should only be used when short-lived access tokens are not an option.
63
+
64
+
To authenticate with a Central API token, create a GitHub secret `secrets.ROX_API_TOKEN` and assign its value to the API token.
| `install-dir` | (optional) | Path of directory to install `roxctl` to. |
183
-
| `version` | (optional) | `roxctl` release version to use, e.g. "4.4.0". The latest available version is used by default. Ignored when `central-endpoint` is specified. |
184
-
| `central-endpoint` | (optional) | RHACS Central endpoint to download `roxctl` from. If left unspecified, `roxctl` is downloaded from mirror.openshift.com instead. Requires `central-token` to be set. |
185
-
| `central-token` | (optional) | Token to access RHACS Central endpoint. |
186
-
| `skip-tls-verify` | (optional) | Skip TLS certificate verification for Central's API endpoint. `false` by default. |
0 commit comments