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

xray_security_policy error plan fails if malicious_package and min_severity are used together in criteria #251

Closed
3 tasks
tiviuray opened this issue Sep 23, 2024 · 2 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@tiviuray
Copy link

tiviuray commented Sep 23, 2024

Describe the bug
Plan fails if malicious_package and min_severity are used together in version 2.11.1, but it works with 2.11.0

criteria {
      fix_version_dependant = true
      malicious_package     = false
      min_severity          = "Critical"
}

Plan output:

|  Error: Invalid Attribute Combination
│ 
│ Attribute
│ "rule[Value({\"actions\":[{\"block_download\":[{\"active\":false,\"unscanned\":false}],\"block_release_bundle_distribution\":<null>,\"block_release_bundle_promotion\":<null>,\"build_failure_grace_period_in_days\":0,\"create_ticket_enabled\":<null>,\"fail_build\":false,\"mails\":<null>,\"notify_deployer\":<null>,\"notify_watch_recipients\":<null>,\"webhooks\":<null>}],\"criteria\":[{\"applicable_cves_only\":<null>,\"cvss_range\":<null>,\"exposures\":<null>,\"fix_version_dependant\":true,\"malicious_package\":false,\"min_severity\":\"Critical\",\"package_name\":<null>,\"package_type\":<null>,\"package_versions\":<null>,\"vulnerability_ids\":<null>}],\"name\":\"Fail_critical_vulnerability\",\"priority\":2})].criteria[Value({\"applicable_cves_only\":<null>,\"cvss_range\":<null>,\"exposures\":<null>,\"fix_version_dependant\":true,\"malicious_package\":false,\"min_severity\":\"Critical\",\"package_name\":<null>,\"package_type\":<null>,\"package_versions\":<null>,\"vulnerability_ids\":<null>})].min_severity"
│ cannot be specified when
│ "rule[Value({\"actions\":[{\"block_download\":[{\"active\":false,\"unscanned\":false}],\"block_release_bundle_distribution\":<null>,\"block_release_bundle_promotion\":<null>,\"build_failure_grace_period_in_days\":0,\"create_ticket_enabled\":<null>,\"fail_build\":false,\"mails\":<null>,\"notify_deployer\":<null>,\"notify_watch_recipients\":<null>,\"webhooks\":<null>}],\"criteria\":[{\"applicable_cves_only\":<null>,\"cvss_range\":<null>,\"exposures\":<null>,\"fix_version_dependant\":true,\"malicious_package\":false,\"min_severity\":\"Critical\",\"package_name\":<null>,\"package_type\":<null>,\"package_versions\":<null>,\"vulnerability_ids\":<null>}],\"name\":\"Fail_critical_vulnerability\",\"priority\":2})].criteria[Value({\"applicable_cves_only\":<null>,\"cvss_range\":<null>,\"exposures\":<null>,\"fix_version_dependant\":true,\"malicious_package\":false,\"min_severity\":\"Critical\",\"package_name\":<null>,\"package_type\":<null>,\"package_versions\":<null>,\"vulnerability_ids\":<null>})].malicious_package"
│ is specified

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
Artifactory: 7.90.10
Xray: 3.104.11
  • Your version of terraform
Terraform: 1.9.4

Expected behavior
Plan is succeded
Additional context
Add any other context about the problem here.

@tiviuray tiviuray added the bug Something isn't working label Sep 23, 2024
@tiviuray tiviuray changed the title xray_security_policy error plan fails if malicious_package and min_severity are xray_security_policy error plan fails if malicious_package and min_severity are set together in criteria Sep 23, 2024
@tiviuray tiviuray changed the title xray_security_policy error plan fails if malicious_package and min_severity are set together in criteria xray_security_policy error plan fails if malicious_package and min_severity are used together in criteria Sep 23, 2024
@alexhung
Copy link
Member

@tiviuray The error is correct. malicious_package attribute is for "Malicious Packages" rule type, which is separate from "CVEs" (the min_severity and fix_version_dependant attributes are for).

You can verify this in the Xray policy web UI, where you can select "Malicious Packages" or "CVEs" rule type.

@alexhung alexhung added the invalid This doesn't seem right label Sep 23, 2024
@tiviuray
Copy link
Author

I understand, thanks for the answer

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

No branches or pull requests

2 participants