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

scm_anti_spyware_profile, rules.threat_name can not be null or any #16

Open
UmarA opened this issue Apr 5, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@UmarA
Copy link

UmarA commented Apr 5, 2024

Describe the bug

When creating the rules for scm_anti_spyware_profile the attribute threat_name can not be set to "any" or "null".
There is a validation in place for string length > 4 charachters.

Expected behavior

Should allow following rule:

 rules = [ 
    { name = "simple-critical"
      action = { reset_both = true } 
      category = "any"
      packet_capture = "single-packet"
      severities = ["critical"]
      threat_name    = "any"
    },
 ]

Current behavior

Terraform error:
Error: Provider produced inconsistent result after apply │ │ When applying changes to scm_anti_spyware_profile.bt_default_spyware, provider "provider[\"registry.terraform.io/paloaltonetworks/scm\"]" produced an unexpected new value: .rules[0].threat_name: was │ null, but now cty.StringVal("any"). │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker. ╵

Possible solution

Allow threat_name to be set to "any"

Steps to reproduce

  1. Create a resource:
resource "scm_anti_spyware_profile" "example" {
 name = "test_scm_spyware"
 folder = "Prisma Access"
 rules = [ 
    { name = "simple-critical"
      action = { reset_both = true } 
      category = "any"
      packet_capture = "single-packet"
      severities = ["critical"]
      threat_name    = "any"
    },
 ]
}

Context

I am creating scm_anti_spyware_profile by looking up "best-practice" and replicating the rules.

Your Environment

Terraform v1.7.4
on linux_amd64

  • provider registry.terraform.io/paloaltonetworks/scm v0.6.0
@UmarA UmarA added the bug Something isn't working label Apr 5, 2024
@javierjeronimo
Copy link

Happens also to me:

  • If I set to "any": same validation error.
  • If do not set at all (null):
Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to scm_anti_spyware_profile.xxxx, provider "provider[\"registry.terraform.io/paloaltonetworks/scm\"]" produced an unexpected new value: .rules[1].threat_name:
│ was null, but now cty.StringVal("any").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Environment

Terraform v1.9.8
on darwin_arm64

- Using previously-installed paloaltonetworks/scm v0.9.2

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