terraform-provider-xray: XRAY - CVSS range doesn't support decimals

Description Hello Artifactory devs, I am trying to create new policy set for Xray. I found small problem in policy definition. I am using CVSS3 scoring system and it works with decimals.

Example:

resource "artifactory_xray_policy" "my_severity_policy" {
  name        = "my-severity"
  description = "Managed by Terraform"
  type        = "security"
  rules {
    name     = "high-severity-rule"
    priority = 1
    criteria {
      cvss_range {
        from = 7
        to   = 10
      }
    }
    actions {
      fail_build = false
      mails      = []
      webhooks   = []
      block_download {
        active    = false
        unscanned = false
      }
    }
  }
}

Requirements for and issue

  • I need to be able to work with decimals in code block like this:
     cvss_range {
        from = 7.1
        to   = 9.4
      }
    }
  • My version of Artifactory is 7.15.4 rev
  • My version of Terraform (Terraform v1.0.4)

Expected behavior I want to be able to work with more granular ranges then whole numbers. Its possible via console but not via Terraform.

Additional context This issue affects all the companies working with proper CVSS scoring and especially with https://www.first.org/cvss/calculator/3.0 . Working with granular policies allows to setup proper blocking, notification and watcher setup for X-Ray.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

No, they have to be integration tests - Some of the tests passed and others had me scratching my head. It doesn’t help that resetting state can require me to create a whole new stack. I’ll get back to you

The documentation is is mud on this subject. However, I tried it with decimal scores and it was accepted via API. So, I will change the types and do some more testing.