feat(specs): Add new security and device profile specs#719
feat(specs): Add new security and device profile specs#719repl-dheeraj-v wants to merge 3 commits into
Conversation
|
@migara can you please review. The terraform provider was generated from this and was tested against our configuration |
- Add data_filtering_security_profile spec with vsys and template locations - Add decryption_profile spec (ssl-inbound-proxy element, correct field names) - Add snmp_trap_profile spec with v2c/v3 variant support - Add email_server_profile spec matching syslog profile structure - Add administrator spec with correct permissions/role-based XML structure - Fix pango error parser to surface raw Panorama response when msg is empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ltering resource - Rename panos_data_filtering_profile → panos_data_filtering_security_profile in example - Add example for panos_decryption_profile - Add example for panos_snmp_trap_profile - Add example for panos_email_server_profile - Add example for panos_administrator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51ef603 to
002f802
Compare
|
@migara verified the workflow is passing on my fork repl-dheeraj-v#1 |
kklimonda-cl
left a comment
There was a problem hiding this comment.
Thanks for the PR,
I've started review, but there are quite a few differences between your YAML specs and what I get internally for those XPaths, so I'll have to spend some time to understand where are the differences coming from, and what can be pulled in (definitely all descriptions, as those are something we are always in a short supply of!).
See my inline comments for some questions I have.
I'll be back on 4th of May and work on adding tests to all those resources and verifying those differences, and get back to you.
| name: password | ||
| sensitive: true | ||
| hashing: | ||
| type: solo |
There was a problem hiding this comment.
Is the password actually hashed by the device? I believe we need to have a separate hasher that does hashing first and then sends a hashed password to the device.
When you open your terraform tfstate file, and look for the resource it should have a private key with base64 encoded value, and that value has another base64 encoded value under "encrypted_values" key. If value for the password there is plaintext, then device is not hashing the password and is expecting it to be hashed beforehand.
I have some code intenally to get it working, but it's a part of a bigger change to our hashing codegen.
There was a problem hiding this comment.
Yes, upon decoding twice I see the password is being passed in this format {"hashing_type":"solo","plaintext":""}. The password is blank because we use LDAP with Active Directory. Do you think this limitation is going to affect us till the bigger change get's released @kklimonda-cl ?
|
@repl-dheeraj-v I've pushed a separate branch with your changes and tests for enum values - there is a large difference between what enum values I get from our schema and what is in this PR, and on my test devices some of your values are failing If you have access to Panorama device, can you checkout branch and report back what is passing/failing with error messages? You can create Makefile.local next to Makefile with environment variables that describe your device: If you can't test it I'll just go with the values I'm getting from the schema, and adding what I have: Removed: Added: |
Ran the tests SHA-224 got rejected |
|
@kklimonda-cl any new comments or concerns? |
Description
Adds five new codegen specs for Terraform provider resources that were missing from the v2 provider, plus a bug fix in the pango error handler.
New Resources
panos_data_filtering_security_profilepanos_decryption_profilepanos_snmp_trap_profilepanos_email_server_profilepanos_administratorBug Fix — pango error parser (
assets/pango/errors/panos.go)When Panorama returns an error response with an empty or unparseable
<msg>element,errors.Parse()previously returned an empty string, causing Terraform to display"failed to create entry on the server: "with no detail. The fix falls back to embedding the raw XML response body in the error so the actual rejection reason is always visible without needingPANOS_LOG_LEVEL=DEBUG.Motivation and Context
These resources exist in the v1 provider but were not yet available in v2. They are required to manage common PAN-OS security and device configurations via Terraform, including SSL/TLS decryption profiles, DLP data filtering, log forwarding via SNMP/email, and administrator account lifecycle.
Key implementation notes:
ssl-inbound-proxy(notssl-inbound-inspectionas in older PAN-OS docs). Verified against PAN-OS 11.2.8 XML API.permissions/role-based/<role>yes</role>XML structure, not a flatroleelement. Thedisabledfield is not valid in this context and was excluded.vsys,template,template-vsys,template-stack, andtemplate-stack-vsyslocations for full NGFW and Panorama template support.How Has This Been Tested?
go run cmd/codegen/main.go)panos_decryption_profile— forward proxy and inbound proxy profiles created at device-group scopepanos_administrator— superuser and superreader accounts created via templateshow config running xpath ...Types of Changes
Checklist