- Notifications
You must be signed in to change notification settings - Fork928
docs: add guide for Xray integration#12629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletionsdocs/guides/xray-integration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Integrating JFrog Xray with Coder Kubernetes Workspaces | ||
<div> | ||
<a href="https://github.com/matifali" style="text-decoration: none; color: inherit;"> | ||
<span style="vertical-align:middle;">Muhammad Atif Ali</span> | ||
<img src="https://github.com/matifali.png" width="24px" height="24px" style="vertical-align:middle; margin: 0px;"/> | ||
</a> | ||
</div> | ||
March 17, 2024 | ||
--- | ||
This guide will walk you through the process of adding | ||
[JFrog Xray](https://jfrog.com/xray/) integration to Coder Kubernetes workspaces | ||
using Coder's [JFrog Xray Integration](github.com/coder/coder-xray). | ||
## Prerequisites | ||
- A self-hosted JFrog Platform instance. | ||
- Kubernetes workspaces running on Coder. | ||
## Deploying the Coder Xray Integration | ||
1. Create a JFrog Platform | ||
[Access Token](https://jfrog.com/help/r/jfrog-platform-administration-documentation/access-tokens) | ||
with a user that has the read | ||
[permission](https://jfrog.com/help/r/jfrog-platform-administration-documentation/permissions) | ||
for the repositories you want to scan. | ||
2. Create a Coder | ||
[token](https://coder.com/docs/v2/latest/cli/tokens_create#tokens-create) | ||
with a user that has the | ||
[`owner`](https://coder.com/docs/v2/latest/admin/users#roles) role. | ||
3. Create kubernetes secrets for the JFrog Xray and Coder tokens. | ||
```bash | ||
kubectl create secret generic coder-token --from-literal=coder-token='<token>' | ||
kubectl create secret generic jfrog-token --from-literal=user='<user>' --from-literal=token='<token>' | ||
``` | ||
4. Deploy the Coder Xray integration. | ||
```bash | ||
helm repo add coder-xray https://helm.coder.com/coder-xray | ||
helm upgrade --install coder-xray coder-xray/coder-xray \ | ||
--namespace coder-xray \ | ||
--create-namespace \ | ||
--set namespace="<CODER_WORKSPACES_NAMESPACE>" \ # Replace with your Coder workspaces namespace | ||
--set coder.url="https://<your-coder-url>" \ | ||
--set coder.secretName="coder-token" \ | ||
--set artifactory.url="https://<your-artifactory-url>" \ | ||
--set artifactory.secretName="jfrog-token" | ||
``` | ||
### Updating the Coder template | ||
[`coder-xray`](https://github.com/coder/coder-xray) will scan all kubernetes | ||
workspaces in the specified namespace. It depends on the `image` available in | ||
Artifactory and indexed by Xray. To ensure that the images are available in | ||
Artifactory, update the Coder template to use the Artifactory registry. | ||
```tf | ||
image = "<ARTIFACTORY_URL>/<REPO>/<IMAGE>:<TAG>" | ||
``` | ||
> **Note**: To authenticate with the Artifactory registry, you may need to | ||
> create a | ||
> [Docker config](https://jfrog.com/artifactory/docs/docker/#docker-login) and | ||
> use it in the `imagePullSecrets` field of the kubernetes pod. See this | ||
> [guide](./image-pull-secret.md) for more information. | ||
 |
Binary file addeddocs/images/guides/xray-integration/example.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletionsdocs/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.