PaloAltoNetworks / PaloAltoNetworks/pan-os-python
The Class definition for ntp-servers is missing the "authentication-type" parameter.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 400
- Forks
- 199
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
The Class definition for ntp-servers is missing the "authentication-type" parameter.
Expected behavior
When I modify or instantiate an NTPServerPrimary of NTPServerSecondary object, and apply it to the firewall, it should be reflected in the configuration as such:
ntp-servers {
primary-ntp-server {
ntp-server-address <address>;
authentication-type {
none;
}
}
}
Current behavior
If I modify an existing object, the "authentication-type" block disappears.
If I instantiate a new object, adds it to the systemSettings object as a child, the "authentication-type" block is never made.
Possible solution
Steps to reproduce
Firewall:
firewall# show deviceconfig system ntp-servers
ntp-servers {
primary-ntp-server {
ntp-server-address ntp1.example.com;
authentication-type {
none;
}
}
}
Python:
firewall = panos.firewall.Firewall(<parameters>)
sysset = panos.device.SystemSettings.refreshall(firewall)
ntpobj = sysset.children[0]
print (ntpobj.address)
>> 'ntp1.example.com'
ntpobj.address="ntp2.example.com"
ntpobj.apply()
Firewall:
firewall# show deviceconfig system ntp-servers
ntp-servers {
primary-ntp-server {
ntp-server-address ntp2.example.com;
}
}
Screenshots
Context
I have about 20 firewalls with a wrong ntp configuration. I would love to edit it via Python code instead of logging into each one to fix them by CLI.
Your Environment
Python 3.11.2
pan-os-python 1.8.1
Tested on two firewalls:
model: PA-5220
sw-version: 10.2.3-h4
model: PA-220
sw-version: 9.1.12-h3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the NTPServerPrimary and NTPServerSecondary class definitions used by panos.device.SystemSettings and the SystemSettings.refreshall entry point. Reproduce the reported update and creation flows, then verify that the authentication-type block is preserved or created with the expected configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100