Documentation
¶
Overview ¶
Package panos interacts with Palo Alto and Panorama devices using the XML API.
Index ¶
- type ARPEntry
- type ARPTable
- type Address
- type AddressGroup
- type AddressGroups
- type AddressObjects
- type AuthMethod
- type CustomURL
- type DeviceGroup
- type DeviceGroups
- type Devices
- type Job
- type Jobs
- type PaloAlto
- func (p *PaloAlto) ARPTable(option ...string) (*ARPTable, error)
- func (p *PaloAlto) AddDevice(serial string, devicegroup ...string) error
- func (p *PaloAlto) AddInterfaceToVirtualRouter(vr, ifname string) error
- func (p *PaloAlto) AddInterfaceToVlan(vlan, ifname string) error
- func (p *PaloAlto) AddInterfaceToZone(name, zonetype, ifname string) error
- func (p *PaloAlto) AddressGroups(devicegroup ...string) (*AddressGroups, error)
- func (p *PaloAlto) Addresses(devicegroup ...string) (*AddressObjects, error)
- func (p *PaloAlto) ApplyLogForwardingProfile(logprofile, devicegroup string, rule ...string) error
- func (p *PaloAlto) ApplySecurityProfile(secprofiles *SecurityProfiles, devicegroup string, rule ...string) error
- func (p *PaloAlto) AssignTemplate(name, devices string, stack bool) error
- func (p *PaloAlto) Commit() error
- func (p *PaloAlto) CommitAll(devicegroup string, devices ...string) error
- func (p *PaloAlto) CreateAddress(name, addrtype, address, description string, devicegroup ...string) error
- func (p *PaloAlto) CreateAddressFromCsv(file string) error
- func (p *PaloAlto) CreateAddressGroup(name string, members []string, description string, devicegroup ...string) error
- func (p *PaloAlto) CreateDeviceGroup(name, description string, devices []string) error
- func (p *PaloAlto) CreateDynamicAddressGroup(name, criteria, description string, devicegroup ...string) error
- func (p *PaloAlto) CreateExternalDynamicList(listtype string, name string, url string, recurrance *Recurrance, ...) error
- func (p *PaloAlto) CreateInterface(iftype, ifname, comment string, ipaddr ...string) error
- func (p *PaloAlto) CreateLayer3Interface(ifname, ipaddress string, comment ...string) error
- func (p *PaloAlto) CreateService(name, protocol, port, description string, devicegroup ...string) error
- func (p *PaloAlto) CreateServiceGroup(name string, members []string, devicegroup ...string) error
- func (p *PaloAlto) CreateStaticRoute(vr, name, destination, nexthop string, metric ...int) error
- func (p *PaloAlto) CreateTag(name, color, comments string, devicegroup ...string) error
- func (p *PaloAlto) CreateTemplate(name, description string, devices ...string) error
- func (p *PaloAlto) CreateTemplateStack(name, description, templates string, devices ...string) error
- func (p *PaloAlto) CreateURLCategory(name string, urls []string, description string, devicegroup ...string) error
- func (p *PaloAlto) CreateVirtualRouter(name string) error
- func (p *PaloAlto) CreateVlan(name string, vlaninterface ...string) error
- func (p *PaloAlto) CreateVwire(name, interface1, interface2, tagallowed string) error
- func (p *PaloAlto) CreateZone(name, zonetype string, userid bool) error
- func (p *PaloAlto) DeleteAddress(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteAddressGroup(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteDeviceGroup(name string) error
- func (p *PaloAlto) DeleteExternalDynamicList(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteInterface(iftype, ifname string) error
- func (p *PaloAlto) DeleteService(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteServiceGroup(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteStaticRoute(vr, name string) error
- func (p *PaloAlto) DeleteTag(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteTemplate(name string, stack bool) error
- func (p *PaloAlto) DeleteURLCategory(name string, devicegroup ...string) error
- func (p *PaloAlto) DeleteVirtualRouter(vr string) error
- func (p *PaloAlto) DeleteVlan(vlan string) error
- func (p *PaloAlto) DeleteVwire(name string) error
- func (p *PaloAlto) DeleteZone(name string) error
- func (p *PaloAlto) DeviceGroups() (*DeviceGroups, error)
- func (p *PaloAlto) Devices() (*Devices, error)
- func (p *PaloAlto) EditGroup(objecttype, action, object, group string, devicegroup ...string) error
- func (p *PaloAlto) EditURLCategory(action, url, name string, devicegroup ...string) error
- func (p *PaloAlto) Jobs(status interface{}) (*Jobs, error)
- func (p *PaloAlto) Policy(devicegroup string) (*Policy, error)
- func (p *PaloAlto) RemoveDevice(serial string, devicegroup ...string) error
- func (p *PaloAlto) RemoveInterfaceFromVirtualRouter(vr, ifname string) error
- func (p *PaloAlto) RemoveInterfaceFromVlan(vlan, ifname string) error
- func (p *PaloAlto) RemoveInterfaceFromZone(name, zonetype, ifname string) error
- func (p *PaloAlto) RemoveTag(tag, object string, devicegroup ...string) error
- func (p *PaloAlto) RenameObject(oldname, newname string, devicegroup ...string) error
- func (p *PaloAlto) RestartSystem() error
- func (p *PaloAlto) ServiceGroups(devicegroup ...string) (*ServiceGroups, error)
- func (p *PaloAlto) Services(devicegroup ...string) (*ServiceObjects, error)
- func (p *PaloAlto) SetPanoramaServer(primary string, secondary ...string) error
- func (p *PaloAlto) SetShared(shared bool)
- func (p *PaloAlto) TagObject(tag, object string, devicegroup ...string) error
- func (p *PaloAlto) Tags() (*Tags, error)
- func (p *PaloAlto) TemplateStacks() (*TemplateStacks, error)
- func (p *PaloAlto) Templates() (*Templates, error)
- func (p *PaloAlto) TestRouteLookup(vr, destination string) (string, error)
- func (p *PaloAlto) TestURL(url string) ([]string, error)
- func (p *PaloAlto) URLCategory(devicegroup ...string) (*URLCategory, error)
- func (p *PaloAlto) XpathClone(xpath, from, newname string) error
- func (p *PaloAlto) XpathConfig(action, xpath string, element ...string) error
- func (p *PaloAlto) XpathGetConfig(configtype, xpath string) (string, error)
- func (p *PaloAlto) XpathMove(xpath, where string, destination ...string) error
- func (p *PaloAlto) XpathMulti(action, xpath, element string) error
- type Policy
- type Recurrance
- type Rule
- type SecurityProfiles
- type Serial
- type Service
- type ServiceGroup
- type ServiceGroups
- type ServiceObjects
- type Tag
- type Tags
- type Template
- type TemplateStack
- type TemplateStacks
- type Templates
- type URLCategory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARPEntry ¶
type ARPEntry struct {
Status string `xml:"status"`
IPAddress string `xml:"ip"`
MACAddress string `xml:"mac"`
TTL int `xml:"ttl"`
Interface string `xml:"interface"`
Port string `xml:"port"`
}
ARPEntry contains information about each individual ARP entry.
type ARPTable ¶
type ARPTable struct {
XMLName xml.Name `xml:"response"`
MaxEntries int `xml:"result>max"`
TotalEntries int `xml:"result>total"`
DefaultTimeout int `xml:"result>timeout"`
Entries []ARPEntry `xml:"result>entries>entry"`
}
ARPTable contains information about all of the ARP entries on the device.
type Address ¶
type Address struct {
Name string `xml:"name,attr"`
IPAddress string `xml:"ip-netmask,omitempty"`
IPRange string `xml:"ip-range,omitempty"`
FQDN string `xml:"fqdn,omitempty"`
Description string `xml:"description,omitempty"`
}
Address contains information about each individual address object.
type AddressGroup ¶
type AddressGroup struct {
Name string
Type string
Members []string
DynamicFilter string
Description string
}
AddressGroup contains information about each individual address group.
type AddressGroups ¶
type AddressGroups struct {
Groups []AddressGroup
}
AddressGroups contains a slice of all address groups.
type AddressObjects ¶
type AddressObjects struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Addresses []Address `xml:"result>address>entry"`
}
AddressObjects contains a slice of all address objects.
type AuthMethod ¶
AuthMethod defines how we want to authenticate to the device. If using a username and password to authenticate, the Credentials field must contain the username and password , respectively (i.e. []string{"admin", "password"}). If you are using the API key for authentication, provide the entire key for the APIKey field.
type CustomURL ¶
type CustomURL struct {
Name string `xml:"name,attr"`
Description string `xml:"description,omitempty"`
Members []string `xml:"list>member,omitempty"`
}
CustomURL contains information about each individual custom URL category object.
type DeviceGroup ¶
DeviceGroup contains information about each individual device-group.
type DeviceGroups ¶
type DeviceGroups struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Groups []DeviceGroup `xml:"result>device-group>entry"`
}
DeviceGroups lists all of the device-group's in Panorama.
type Devices ¶
type Devices struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Devices []Serial `xml:"result>devices>entry"`
}
Devices lists all of the devices in Panorama.
type Job ¶
type Job struct {
ID int `xml:"id"`
User string `xml:"user"`
Type string `xml:"type"`
Status string `xml:"status"`
Queued string `xml:"queued"`
Stoppable string `xml:"stoppable"`
Result string `xml:"result"`
Description string `xml:"description,omitempty"`
QueuePosition int `xml:"positionInQ"`
Progress string `xml:"progress"`
Details []string `xml:"details>line"`
Warnings string `xml:"warnings,omitempty"`
StartTime string `xml:"tdeq"`
EndTime string `xml:"tfin"`
}
Job holds information about each individual job.
type Jobs ¶
type Jobs struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Jobs []Job `xml:"result>job"`
}
Jobs holds information about all jobs on the device.
type PaloAlto ¶
type PaloAlto struct {
Host string
Key string
URI string
Platform string
Model string
Serial string
SoftwareVersion string
DeviceType string
Panorama bool
}
PaloAlto is a container for our session state.
func NewSession ¶
func NewSession(host string, authmethod *AuthMethod) (*PaloAlto, error)
NewSession sets up our connection to the Palo Alto firewall or Panorama device. The authmethod parameter is used to define two ways of authenticating to the device. One is via username / password, the other is with the API key if you already have generated it. Please see the documentation for the AuthMethod struct for further details.
func (*PaloAlto) ARPTable ¶
ARPTable will gather all of the ARP entires on the device. Without any parameters, it will return all ARP entries. You can specify an interface name for the option parameter if you choose to only view the ARP entries for that specific interface (i.e. "ethernet1/1.200" or "ethernet1/21"). Status codes are as follows: s - static, c - complete, e - expiring, i - incomplete.
func (*PaloAlto) AddDevice ¶
AddDevice will add a new device to a Panorama. If you specify the optional devicegroup parameter, it will also add the device to the given device-group.
func (*PaloAlto) AddInterfaceToVirtualRouter ¶
AddInterfaceToVirtualRouter will add an interface or interfaces to the given virtual-router. Separate multiple interfaces using a comma, i.e.: "ethernet1/2, ethernet1/3"
func (*PaloAlto) AddInterfaceToVlan ¶
AddInterfaceToVlan will add an interface or interfaces to the given vlan. Separate multiple interfaces using a comma, i.e.: "ethernet1/2, ethernet1/3"
func (*PaloAlto) AddInterfaceToZone ¶
AddInterfaceToZone adds an interface or interfaces to the given zone. zonetype must be one of: tap, vwire, layer2, layer3. Separate multiple interfaces using a comma, i.e.: "ethernet1/2, ethernet1/3"
func (*PaloAlto) AddressGroups ¶
func (p *PaloAlto) AddressGroups(devicegroup ...string) (*AddressGroups, error)
AddressGroups returns information about all of the address groups. You can (optionally) specify a device-group when ran against a Panorama device. If no device-group is specified, then all address groups are returned, including shared objects if run against a Panorama device.
func (*PaloAlto) Addresses ¶
func (p *PaloAlto) Addresses(devicegroup ...string) (*AddressObjects, error)
Addresses returns information about all of the address objects. You can (optionally) specify a device-group when ran against a Panorama device. If no device-group is specified, then all objects are returned, including shared objects if run against a Panorama device.
func (*PaloAlto) ApplyLogForwardingProfile ¶
ApplyLogForwardingProfile will apply a Log Forwarding profile to every rule in the policy for the given device-group. If you wish to apply it to a single rule, instead of every rule in the policy, you can optionally specify the rule name as the last parameter. For policies with a large number of rules, this process may take a few minutes to complete.
func (*PaloAlto) ApplySecurityProfile ¶
func (p *PaloAlto) ApplySecurityProfile(secprofiles *SecurityProfiles, devicegroup string, rule ...string) error
ApplySecurityProfile will apply the following security profiles: URL Filtering, File-Blocking, Antivirus, Anti-Spyware, Vulnerability, Wildfire to every rule in the policy for the given device-group. If you wish to apply it to a single rule, instead of every rule in the policy, you can optionally specify the rule name as the last parameter. You can also specify a security group profile instead of individual profiles. This is done by ONLY populating the "Group" field in the SecurityProfiles struct. For policies with a large number of rules, this process may take a few minutes to complete.
func (*PaloAlto) AssignTemplate ¶
AssignTemplate will assign devices to the given template. Devices must be serial numbers, and each serial must be separated by a comma, i.e.: "010101010101, 020202020202." If you are assigning devices to a template stack, then specify "true" for the stack parameter, otherwise specifying "false" will only assign devices to a single template. Template stacks are ONLY available on Panorama version 7.0.0 and higher.
func (*PaloAlto) Commit ¶
Commit issues a commit on the device. When issuing a commit against a Panorama device, the configuration will only be committed to Panorama, and not an individual device-group.
func (*PaloAlto) CommitAll ¶
CommitAll issues a commit to a Panorama device, with the given devicegroup. You can (optionally) specify individual devices within that device group by adding each serial number as an additional parameter.
func (*PaloAlto) CreateAddress ¶
func (p *PaloAlto) CreateAddress(name, addrtype, address, description string, devicegroup ...string) error
CreateAddress will add a new address object to the device. Addrtype should be one of: ip, range, or fqdn. If creating an address object on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateAddressFromCsv ¶
CreateAddressFromCsv takes a CSV file with the following format: name,type,address,description,device-group,tag. Name is what you want the address object to be called. Type is one of: ip, range, or fqdn. Address is the IP address of the object. Description is optional, just leave the field blank if you do not want one. Device-group is the name of the device-group where you want the address object created under. Tag is the name of the tag that you wish to apply to the object. If you are creating shared objects in Panorama, or you are creating objects on a local device, then you can leave the device-group field blank.
func (*PaloAlto) CreateAddressGroup ¶
func (p *PaloAlto) CreateAddressGroup(name string, members []string, description string, devicegroup ...string) error
CreateAddressGroup will create a new static address group on the device. You can specify members to add by using a []string variable (i.e. members := []string{"server1", "server2"}). If creating an address group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateDeviceGroup ¶
CreateDeviceGroup will create a new device-group on a Panorama device. You can add devices as well by specifying the serial numbers in a string slice ([]string). Specify "nil" if you do not wish to add any.
func (*PaloAlto) CreateDynamicAddressGroup ¶
func (p *PaloAlto) CreateDynamicAddressGroup(name, criteria, description string, devicegroup ...string) error
CreateDynamicAddressGroup will create a new dynamic address group on the device. The filter must be written like so: 'vm-servers' and 'some tag' or 'pcs' - using the tags as the match criteria. If creating dynamic address group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateExternalDynamicList ¶
func (p *PaloAlto) CreateExternalDynamicList(listtype string, name string, url string, recurrance *Recurrance, devicegroup ...string) error
CreateExternalDynamicList will create an external dynamic list on the device. Listtype must be one of: ip, domain, or url. Configuring the recurrance requires you to use the Recurrance struct when passing the configuration for this parameter - please see the documentation for that struct. If creating an EDL on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateInterface ¶
CreateInterface creates the given interface type specified in the "iftype" parameter: tap, vwire, layer2, layer3, vlan, loopback or tunnel. If adding a sub-interface, be sure to append the VLAN tag to the interface name like so: ethernet1/1.700. The (optional) ipaddr parameter allows you to assign an IP address to a layer 3/vlan/loopback or tunnel interface, or an IP classifier to a virtual-wire sub-interface. You do not need to specify the ipaddr parameter on a "tap" or "layer2" interface type. Note that you must specify the subnet mask in CIDR notation when including an IP address, i.e.: 1.1.1.1/24.
func (*PaloAlto) CreateLayer3Interface ¶
CreateLayer3Interface adds a new layer-3 interface or sub-interface to the device. If adding a sub-interface, be sure to append the VLAN tag to the interface name like so: ethernet1/1.700. You must specify the subnet mask in CIDR notation when specifying the IP address, i.e.: 1.1.1.1/32.
func (*PaloAlto) CreateService ¶
func (p *PaloAlto) CreateService(name, protocol, port, description string, devicegroup ...string) error
CreateService adds a new service object to the device. Port can be a single port number, range (1-65535), or comma separated (80, 8080, 443). If creating a service on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateServiceGroup ¶
CreateServiceGroup will create a new service group on the device. You can specify members to add by using a []string variable (i.e. members := []string{"tcp-service1", "udp-service1"}). If creating a service group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateStaticRoute ¶
CreateStaticRoute adds a new static route to a given virtual-router. For the destination, you must include the mask, i.e. "192.168.0.0/24" or "0.0.0.0/0." For nexthop, you can also specify an interface instead of an IP address. You can optionally specify a metric for the route (default metric is 10).
func (*PaloAlto) CreateTag ¶
CreateTag will add a new tag to the device. You can use the following colors: Red, Green, Blue, Yellow, Copper, Orange, Purple, Gray, Light Green, Cyan, Light Gray, Blue Gray, Lime, Black, Gold, Brown. If creating a tag on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateTemplate ¶
CreateTemplate adds a new template to Panorama. If you wish to associate devices, then separate their serial numbers with a comma, i.e.: "0101010101, 0202020202."
func (*PaloAlto) CreateTemplateStack ¶
func (p *PaloAlto) CreateTemplateStack(name, description, templates string, devices ...string) error
CreateTemplateStack adds a new template stack to Panorama. If you are assigning multiple templates to the stack, the values for the templates parameter must be separated by a comma, i.e.: "user_template, object_template". If you wish to associate devices, then separate their serial numbers with a comma, just like you would template names. This is ONLY available on Panorama version 7.0.0 and higher.
func (*PaloAlto) CreateURLCategory ¶
func (p *PaloAlto) CreateURLCategory(name string, urls []string, description string, devicegroup ...string) error
CreateURLCategory creates a custom URL category to be used in a policy. When specifying multiple URL's, use a []string variable for the url parameter (i.e. members := []string{"www.*.com", "*.somesite.net"}). If creating a URL category on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) CreateVirtualRouter ¶
CreateVirtualRouter will add a new virtual-router to the device.
func (*PaloAlto) CreateVlan ¶
CreateVlan will add a new layer 2 vlan to the device. Optionally, if you wish to assign a vlan interface to the vlan, specify the interface name as the last parameter. Otherwise, only specify the name of the vlan when creating it.
func (*PaloAlto) CreateVwire ¶
CreateVwire creates a virtual-wire on the device. For the tagallowed parameter, enter integers (e.g. 10) or ranges (100-200) separated by commas (e.g. 1-10,15,20-30). Integer values can be between 0 and 4094.
func (*PaloAlto) CreateZone ¶
CreateZone will add a new zone to the device. Zonetype must be one of: tap, vwire, layer2, layer3. If you wish to enable user-id on the zone, specify "true" for the userid parameter, "false" if not.
func (*PaloAlto) DeleteAddress ¶
DeleteAddress will remove an address object from the device. If deleting an address object on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteAddressGroup ¶
DeleteAddressGroup will remove an address group from the device. If deleting an address group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteDeviceGroup ¶
DeleteDeviceGroup will delete the given device-group from Panorama.
func (*PaloAlto) DeleteExternalDynamicList ¶
DeleteExternalDynamicList removes an external dynamic list from the device. If deleting an EDL on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteInterface ¶
DeleteInterface removes an interface or sub-interface from the device. You must specify the interface type in the iftype parameter: tap, vwire, layer2, layer3, vlan, loopback or tunnel.
func (*PaloAlto) DeleteService ¶
DeleteService will remove a service object from the device. If deleting a service on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteServiceGroup ¶
DeleteServiceGroup will remove a service group from the device. If deleting a service group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteStaticRoute ¶
DeleteStaticRoute will remove a static route from the device.
func (*PaloAlto) DeleteTag ¶
DeleteTag will remove a tag from the device. If deleting a tag on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteTemplate ¶
DeleteTemplate removes the given template from Panorama. If you wish to delete a template stack, then specify "true" for the stack parameter, otherwise specifying "false" will only delete single templates. Template stacks are ONLY available on Panorama version 7.0.0 and higher.
func (*PaloAlto) DeleteURLCategory ¶
DeleteURLCategory removes a custom URL category from the device. If deleting a URL category on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) DeleteVirtualRouter ¶
DeleteVirtualRouter removes a virtual-router from the device.
func (*PaloAlto) DeleteVlan ¶
DeleteVlan removes a vlan from the device.
func (*PaloAlto) DeleteVwire ¶
DeleteVwire removes a virtual-wire from the device.
func (*PaloAlto) DeleteZone ¶
DeleteZone will remove a zone from the device.
func (*PaloAlto) DeviceGroups ¶
func (p *PaloAlto) DeviceGroups() (*DeviceGroups, error)
DeviceGroups returns information about all of the device-groups in Panorama, and what devices are linked to them.
func (*PaloAlto) Devices ¶
Devices returns information about all of the devices that are managed by Panorama.
func (*PaloAlto) EditGroup ¶
EditGroup will add or remove objects from the specified group type (i.e., "address" or "service"). Action must be "add" or "remove." If editing a group on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) EditURLCategory ¶
EditURLCategory adds or removes URL's from the given custom URL category. Action must be "add" or "remove." If editing a URL category on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) Jobs ¶
Jobs returns information about every job on the device. Status can be one of: all, pending, or processed. If you want information about a specific job, specify the job ID instead of one of the other options.
func (*PaloAlto) Policy ¶
Policy returns information about the security policies for the given device-group. If you have pre and/or post rules, then both of them will be returned. They are separated under a "Pre" and "Post" field in the returned "Policy" struct.
func (*PaloAlto) RemoveDevice ¶
RemoveDevice will remove a device from Panorama. If you specify the optional devicegroup parameter, it will only remove the device from the given device-group.
func (*PaloAlto) RemoveInterfaceFromVirtualRouter ¶
RemoveInterfaceFromVirtualRouter removes a given interface from the specified virtual-router.
func (*PaloAlto) RemoveInterfaceFromVlan ¶
RemoveInterfaceFromVlan removes a given interface from the specified vlan.
func (*PaloAlto) RemoveInterfaceFromZone ¶
RemoveInterfaceFromZone removes an interface from the specified zone.
func (*PaloAlto) RemoveTag ¶
RemoveTag will remove a single tag from an address/service object. If removing a tag on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) RenameObject ¶
RenameObject will rename the given object from oldname to the newname. You can rename the following object types: address, address-groups, service, service-groups, tags. If renaming objects on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) RestartSystem ¶
RestartSystem will issue a system restart to the device.
func (*PaloAlto) ServiceGroups ¶
func (p *PaloAlto) ServiceGroups(devicegroup ...string) (*ServiceGroups, error)
ServiceGroups returns information about all of the service groups. You can (optionally) specify a device-group when ran against a Panorama device. If no device-group is specified, then all service groups are returned, including shared objects if ran against a Panorama device.
func (*PaloAlto) Services ¶
func (p *PaloAlto) Services(devicegroup ...string) (*ServiceObjects, error)
Services returns information about all of the service objects. You can (optionally) specify a device-group when ran against a Panorama device. If no device-group is specified, then all objects are returned, including shared objects if ran against a Panorama device.
func (*PaloAlto) SetPanoramaServer ¶
SetPanoramaServer will configure a device to be managed by the given Panorama server's primary IP address. You can optionally add a second Panorama server by specifying an IP address for the "secondary" parameter.
func (*PaloAlto) SetShared ¶
SetShared will set Panorama's device-group to shared for all subsequent configuration changes. For example, if you set this to "true" and then create address or service objects, they will all be shared objects. Set this back to "false" to return to normal mode.
func (*PaloAlto) TagObject ¶
TagObject will apply the given tag to the specified address or service object(s). You can specify multiple tags by separating them with a comma, i.e. "servers, vm". If you have address/service objects with the same name, then the tag(s) will be applied to all that match. If tagging objects on a Panorama device, specify the device-group as the last parameter.
func (*PaloAlto) TemplateStacks ¶
func (p *PaloAlto) TemplateStacks() (*TemplateStacks, error)
TemplateStacks returns information about all of the template stacks in Panorama, and what templates, devices are assigned to them. This is ONLY available on Panorama version 7.0.0 and higher.
func (*PaloAlto) Templates ¶
Templates returns information about all of the templates in Panorama, and what devices they are applied to.
func (*PaloAlto) TestRouteLookup ¶
TestRouteLookup will lookup the given destination IP in the virtual-router "vr" and check the routing (fib) table and display the results.
func (*PaloAlto) TestURL ¶
TestURL will verify what category the given URL falls under. It will return two results in a string slice ([]string). The first one is from the Base db categorization, and the second is from the Cloud db categorization. If you specify a URL with a wildcard, such as *.paloaltonetworks.com, it will not return a result.
func (*PaloAlto) URLCategory ¶
func (p *PaloAlto) URLCategory(devicegroup ...string) (*URLCategory, error)
URLCategory returns a list of all custom URL category objects. You can (optionally) specify a device-group when ran against a Panorama device. If no device-group is specified, then all objects are returned.
func (*PaloAlto) XpathClone ¶
XpathClone allows you to clone an existing part of the devices configuration. Use the xpath parameter to specify the location of the object to be cloned. Use the from parameter to specify the source object, and the newname parameter to provide a name for the cloned object.
func (*PaloAlto) XpathConfig ¶
XpathConfig allows you to configure the device using an Xpath expression for the given xpath parameter. The element parameter can either be an XML file or an XML string when configuring the device. The action parameter can be one of: set, edit, rename, override or delete. Set actions add, update, or merge configuration nodes, while edit actions replace configuration nodes - use the edit action with caution! If you are renaming an object, specify the new name for the object in the element parameter. If you are deleting a part of the configuration, you do not need the element parameter. For all other actions you will need to provide it.
func (*PaloAlto) XpathGetConfig ¶
XpathGetConfig allows you to view the active or candidate configuration at the location specified in the xpath parameter.
func (*PaloAlto) XpathMove ¶
XpathMove allows you to move the location of an existing configuration object. Use the xpath parameter to specify the location of the object to be moved, and the where parameter to specify type of move. You can optionally use the destination parameter to specify the destination path.
func (*PaloAlto) XpathMulti ¶
XpathMulti allows you to move and clone addresses across device groups and virtual systems. The element parameter can be either an XML file or XML string. The action parameter must be one of: clone or move. The xpath parameter is for the destination where the addresses will be moved to. The element parameter must include in the XML the xpath for the source and the list of objects within the specified source.
type Recurrance ¶
Recurrance contains the information for external dynamic lists when it comes to how often they are downloaded. Method must be one of: five-minute, hourly, daily, weekly, monthly. DayOfWeek is the name of the day, such as "tuesday." DayOfMonth is specified as a number, ranging from 1-31. Hour must be in 23-hour format, such as "03" for 3 am. The hourly and five-minute methods do not require any additional fields. DayOfWeek and DayOfMonth both require the Hour field as well.
type Rule ¶
type Rule struct {
Name string `xml:"name,attr"`
From string `xml:"from>member"`
To string `xml:"to>member"`
Source []string `xml:"source>member"`
Destination []string `xml:"destination>member"`
SourceUser []string `xml:"source-user>member"`
Application []string `xml:"application>member"`
Service []string `xml:"service>member"`
Category []string `xml:"category>member"`
Action string `xml:"action"`
LogStart string `xml:"log-start"`
LogEnd string `xml:"log-end"`
Tag []string `xml:"tag>member"`
LogSetting string `xml:"log-setting"`
URLFilteringProfile string `xml:"profile-setting>profiles>url-filtering>member"`
FileBlockingProfile string `xml:"profile-setting>profiles>file-blocking>member"`
AntiVirusProfile string `xml:"profile-setting>profiles>virus>member"`
AntiSpywareProfile string `xml:"profile-setting>profiles>spyware>member"`
VulnerabilityProfile string `xml:"profile-setting>profiles>vulnerability>member"`
WildfireProfile string `xml:"profile-setting>profiles>wildfire-analysis>member"`
SecurityProfileGroup string `xml:"profile-setting>group>member"`
}
Rule contains information about each individual security rule.
type SecurityProfiles ¶
type SecurityProfiles struct {
URLFiltering string
FileBlocking string
AntiVirus string
AntiSpyware string
Vulnerability string
Wildfire string
Group string
}
SecurityProfiles contains a list of security profiles to apply to a rule. If you have a security group then you can just specify that and omit the individual ones.
type Serial ¶
type Serial struct {
Serial string `xml:"name,attr"`
}
Serial contains the serial number of each device in the device-group.
type Service ¶
type Service struct {
Name string `xml:"name,attr"`
TCPPort string `xml:"protocol>tcp>port,omitempty"`
UDPPort string `xml:"protocol>udp>port,omitempty"`
Description string `xml:"description,omitempty"`
}
Service contains information about each individual service object.
type ServiceGroup ¶
type ServiceGroup struct {
Name string `xml:"name,attr"`
Members []string `xml:"members>member,omitempty"`
Description string `xml:"description,omitempty"`
}
ServiceGroup contains information about each individual service group.
type ServiceGroups ¶
type ServiceGroups struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Groups []ServiceGroup `xml:"result>service-group>entry"`
}
ServiceGroups contains a slice of all service groups.
type ServiceObjects ¶
type ServiceObjects struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Services []Service `xml:"result>service>entry"`
}
ServiceObjects contains a slice of all service objects.
type Template ¶
type Template struct {
Name string `xml:"name,attr"`
Description string `xml:"description"`
Devices []Serial `xml:"devices>entry"`
}
Template contains information about each individual template.
type TemplateStack ¶
type TemplateStack struct {
Name string `xml:"name,attr"`
Description string `xml:"description"`
Members []string `xml:"templates>member"`
Devices []Serial `xml:"devices>entry"`
}
TemplateStack contains information about each individual template stack.
type TemplateStacks ¶
type TemplateStacks struct {
XMLName xml.Name `xml:"response"`
Status string `xml:"status,attr"`
Code string `xml:"code,attr"`
Templates []TemplateStack `xml:"result>template-stack>entry"`
}
TemplateStacks lists all of the template stacks in Panorama.