Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to create xray_repository_config with scanners_category for artifactory_remote_nuget_repository #273

Open
3 tasks done
FischlerA opened this issue Nov 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@FischlerA
Copy link

FischlerA commented Nov 15, 2024

Describe the bug
Creating a xray_repository_config for a nuget-remote repository with

resource "artifactory_remote_nuget_repository" "nuget-remote" {
  key                        = "nuget-remote"
  description                = "Enthält alle NuGet-Pakete von NuGet.org"
  url                        = "https://www.nuget.org/"
  download_context_path      = "api/v2/package"
  curated                    = true
  xray_index                 = true
  force_nuget_authentication = true
  v3_feed_url                = "https://api.nuget.org/v3/index.json"
  symbol_server_url          = "https://symbols.nuget.org/download/symbols"
}

resource "xray_repository_config" "xray-repo-config-nuget-remote" {
  repo_name   = artifactory_remote_nuget_repository.nuget-remote.key
  jas_enabled = true
  config {
    vuln_contextual_analysis = false
    retention_in_days        = 180
    exposures {
      scanners_category {
        # nuget remote repos only support secret scanners
        secrets  = true
      }
    }
  }
}

fails with

╷
│ Error: Unable to Create Resource
│ 
│   with xray_repository_config.xray-repo-config-nuget-remote,
│   on nuget-artifact-repos.tf line 17, in resource "xray_repository_config" "xray-repo-config-nuget-remote":
│   17: resource "xray_repository_config" "xray-repo-config-nuget-remote" {
│ 
│ An unexpected error occurred while creating the resource update request.
│ Please report this issue to the provider developers.
│ 
│ Error: {"error":"Request payload is invalid as exposure analysis config is
│ missing"}

Terraform version: 1.2.3
Xray Provider Version: 2.13.2
Artifactory Version: 7.100.2 revision: 80002900
Xray Version: 3.106.7 revision: 3fc2909

Requirements for and issue

  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
  • Your version of Artifactory and Xray (you can curl Artifactory version at $host/artifactory/api/system/version and Xray version at
    $host/xray/api/v1/system/version
  • Your version of terraform

Expected behavior
I expect to be able to create a xray_repository_config for nuget repositories. For npm repositories it works as it is supposed to.

@FischlerA FischlerA added the bug Something isn't working label Nov 15, 2024
@alexhung
Copy link
Member

@FischlerA Thanks for the report. I've added this to our plan to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants