@@ -34,7 +34,7 @@ This module integrates JFrog Xray vulnerability scanning results into Coder work
3434module "jfrog_xray" {
3535 source = "registry.coder.com/modules/jfrog-xray/coder"
3636 version = "1.0.0"
37-
37+
3838 resource_id = docker_container.workspace.id
3939 xray_url = "https://example.jfrog.io/xray"
4040 xray_token = var.jfrog_access_token
@@ -48,15 +48,15 @@ module "jfrog_xray" {
4848module "jfrog_xray" {
4949 source = "registry.coder.com/modules/jfrog-xray/coder"
5050 version = "1.0.0"
51-
51+
5252 resource_id = docker_container.workspace.id
5353 xray_url = "https://example.jfrog.io/xray"
5454 xray_token = var.jfrog_access_token
55-
55+
5656 # Specify repo and path separately for more control
5757 repo = "docker-local"
5858 repo_path = "/codercom/enterprise-base:v2.1.0"
59-
59+
6060 display_name = "Container Security Scan"
6161 icon = "/icon/shield.svg"
6262}
@@ -88,15 +88,15 @@ resource "docker_container" "workspace" {
8888 count = data.coder_workspace.me.start_count
8989 image = "example.jfrog.io/docker-local/codercom/enterprise-base:latest"
9090 name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}"
91-
91+
9292 # Container configuration...
9393}
9494
9595# Add Xray vulnerability scanning
9696module "jfrog_xray" {
9797 source = "registry.coder.com/modules/jfrog-xray/coder"
9898 version = "1.0.0"
99-
99+
100100 resource_id = docker_container.workspace[0].id
101101 xray_url = "https://example.jfrog.io/xray"
102102 xray_token = var.jfrog_access_token
@@ -106,16 +106,16 @@ module "jfrog_xray" {
106106
107107## Variables
108108
109- | Name | Description | Type | Default | Required |
110- | ------| -------------| ------| ---------| ----------|
111- | ` resource_id ` | The resource ID to attach the vulnerability metadata to | ` string ` | n/a | yes |
112- | ` xray_url ` | The URL of the JFrog Xray instance | ` string ` | n/a | yes |
113- | ` xray_token ` | The access token for JFrog Xray authentication | ` string ` | n/a | yes |
114- | ` image ` | The container image to scan in format 'repo/path: tag ' | ` string ` | n/a | yes |
115- | ` repo ` | The JFrog Artifactory repository name (auto-extracted if not provided) | ` string ` | ` "" ` | no |
116- | ` repo_path ` | The repository path with image name and tag (auto-extracted if not provided) | ` string ` | ` "" ` | no |
117- | ` display_name ` | The display name for the vulnerability metadata section | ` string ` | ` "Security Vulnerabilities" ` | no |
118- | ` icon ` | The icon to display for the vulnerability metadata | ` string ` | ` "/icon/security.svg" ` | no |
109+ | Name | Description | Type | Default | Required |
110+ | -------------- | ---------------------------------------------------------------------------- | -------- | ---------------------------- | -------- |
111+ | ` resource_id ` | The resource ID to attach the vulnerability metadata to | ` string ` | n/a | yes |
112+ | ` xray_url ` | The URL of the JFrog Xray instance | ` string ` | n/a | yes |
113+ | ` xray_token ` | The access token for JFrog Xray authentication | ` string ` | n/a | yes |
114+ | ` image ` | The container image to scan in format 'repo/path: tag ' | ` string ` | n/a | yes |
115+ | ` repo ` | The JFrog Artifactory repository name (auto-extracted if not provided) | ` string ` | ` "" ` | no |
116+ | ` repo_path ` | The repository path with image name and tag (auto-extracted if not provided) | ` string ` | ` "" ` | no |
117+ | ` display_name ` | The display name for the vulnerability metadata section | ` string ` | ` "Security Vulnerabilities" ` | no |
118+ | ` icon ` | The icon to display for the vulnerability metadata | ` string ` | ` "/icon/security.svg" ` | no |
119119
120120## Outputs
121121
@@ -124,7 +124,7 @@ This module creates workspace metadata that displays:
124124- ** Image** : The scanned container image
125125- ** Total Vulnerabilities** : Total count of all vulnerabilities
126126- ** Critical** : Count of critical severity vulnerabilities
127- - ** High** : Count of high severity vulnerabilities
127+ - ** High** : Count of high severity vulnerabilities
128128- ** Medium** : Count of medium severity vulnerabilities
129129- ** Low** : Count of low severity vulnerabilities
130130
@@ -155,16 +155,19 @@ image = "docker-local/team/project/service:main-abc123"
155155### Common Issues
156156
157157** "No scan results found"**
158+
158159- Verify the image exists in Artifactory
159160- Check that Xray has scanned the image
160161- Confirm the image path format is correct
161162
162163** "Authentication failed"**
164+
163165- Verify the access token is valid
164166- Check token permissions include Xray read access
165167- Ensure the Xray URL is correct
166168
167169** "Module fails to apply"**
170+
168171- Verify network connectivity to JFrog instance
169172- Check Terraform provider versions
170173- Review Coder logs for detailed error messages
0 commit comments