diff --git a/HISTORY.rst b/HISTORY.rst index 6b40dc19..160327a4 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,13 +3,22 @@ History ======= -0.9.2 +0.11.0 ----- Released: Pending Status: Alpha +0.10.0 +------ + +Released: 2019-05-07 + +Status: Alpha + +- Added `device.Telemetry` + 0.9.1 ----- diff --git a/pandevice/__init__.py b/pandevice/__init__.py index ff0c73f0..81d5186a 100755 --- a/pandevice/__init__.py +++ b/pandevice/__init__.py @@ -23,7 +23,7 @@ __author__ = 'Palo Alto Networks' __email__ = 'techpartners@paloaltonetworks.com' -__version__ = '0.9.1' +__version__ = '0.10.0' import logging diff --git a/pandevice/device.py b/pandevice/device.py index 81014ecf..092efbaf 100644 --- a/pandevice/device.py +++ b/pandevice/device.py @@ -262,6 +262,7 @@ class SystemSettings(VersionedPanObject): CHILDTYPES = ( "device.NTPServerPrimary", "device.NTPServerSecondary", + "device.Telemetry", ) def _setup(self): @@ -452,3 +453,54 @@ def change_password(self, new_password): dev = self.nearest_pandevice() self.password_hash = dev.request_password_hash(new_password) self.update('password_hash') + + +class Telemetry(VersionedPanObject): + """Share telemetry data with Palo Alto Networks. + + Join other Palo Alto Networks customers in a global sharing community, + helping to raise the bar against the latest attack techniques. Your + participation allows us to deliver new threat prevention controls across + the attack lifecycle. Choose the type of data you share across + applications, threat intelligence, and device health information to improve + the fidelity of the protections we deliver. This is an opt-in feature + controlled with granular policy, and we encourage you to join the + community. + + Add only one of these to a firewall. + + Args: + app_reports (bool): Application reports + threat_reports (bool): Threat preventioin reports + url_reports (bool): URL reports + file_type_reports (bool): File type identification reports + threat_data (bool): Threat prevention data + threat_pcaps (bool): Enable sending packet captures with threat + prevention information. This requires that "threat_data" also be + enabled. + product_usage_stats (bool): Health and performance reports + passive_dns_monitoring (bool): Passive DNS monitoring + + """ + NAME = None + ROOT = Root.DEVICE + + def _setup(self): + # xpaths + self._xpaths.add_profile(value='/update-schedule/statistics-service') + + bool_params = ( + ('app_reports', 'application-reports'), + ('threat_reports', 'threat-prevention-reports'), + ('url_reports', 'url-reports'), + ('file_type_reports', 'file-identification-reports'), + ('threat_data', 'threat-prevention-information'), + ('threat_pcaps', 'threat-prevention-pcap'), + ('product_usage_stats', 'health-performance-reports'), + ('passive_dns_monitoring', 'passive-dns-monitoring'), + ) + + self._params = tuple( + VersionedParamPath(param, vartype='yesno', path=path) + for param, path in bool_params + ) diff --git a/setup.py b/setup.py index 02a12dac..2f781420 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name='pandevice', - version='0.9.1', + version='0.10.0', description='Framework for interacting with Palo Alto Networks devices via API', long_description='The Palo Alto Networks Device Framework is a way to interact with Palo Alto Networks devices (including Next-generation Firewalls and Panorama) using the device API that is object oriented and conceptually similar to interaction with the device via the GUI or CLI.', author='Palo Alto Networks',