config

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config/config.go

config/platforms.go

Index

Constants

This section is empty.

Variables

View Source
var AffectedFamilies = map[string][]string{
	"200":   {"PA-200"},
	"220":   {"PA-220", "PA-220-ZTP", "PA-220R", "PA-220R-ZTP"},
	"3000":  {"PA-3020", "PA-3050", "PA-3060"},
	"3200":  {"PA-3220", "PA-3220-ZTP", "PA-3250", "PA-3250-ZTP", "PA-3260"},
	"500":   {"PA-500"},
	"5000":  {"PA-5020", "PA-5050", "PA-5060"},
	"5200":  {"PA-5220", "PA-5250", "PA-5260", "PA-5280"},
	"7000":  {"PA-7050", "PA-7080"},
	"7000b": {"PA-7050", "PA-7080"},
	"800":   {"PA-820", "PA-820-ZTP", "PA-850", "PA-850-ZTP"},
	"vm":    {"PA-VM", "PA-VM (lite)"},
	"vmarm": {"PA-VMARM"},
}

AffectedFamilies represents the families of devices affected by the issue

View Source
var MinimumPatchedVersions = map[string][]MinimumPatchedVersion{
	"8.1": {
		{Maintenance: 21, Hotfix: 3},
		{Maintenance: 25, Hotfix: 3},
		{Maintenance: 26, Hotfix: 0},
	},
	"9.0": {
		{Maintenance: 16, Hotfix: 7},
		{Maintenance: 17, Hotfix: 5},
	},
	"9.1": {
		{Maintenance: 11, Hotfix: 5},
		{Maintenance: 12, Hotfix: 7},
		{Maintenance: 13, Hotfix: 5},
		{Maintenance: 14, Hotfix: 8},
		{Maintenance: 16, Hotfix: 5},
		{Maintenance: 17, Hotfix: 0},
	},
	"10.0": {
		{Maintenance: 8, Hotfix: 8},
		{Maintenance: 11, Hotfix: 4},
		{Maintenance: 12, Hotfix: 5},
	},
	"10.1": {
		{Maintenance: 3, Hotfix: 3},
		{Maintenance: 4, Hotfix: 6},
		{Maintenance: 5, Hotfix: 4},
		{Maintenance: 6, Hotfix: 8},
		{Maintenance: 7, Hotfix: 1},
		{Maintenance: 8, Hotfix: 7},
		{Maintenance: 9, Hotfix: 8},
		{Maintenance: 10, Hotfix: 5},
		{Maintenance: 11, Hotfix: 5},
		{Maintenance: 12, Hotfix: 0},
	},
	"10.2": {
		{Maintenance: 0, Hotfix: 2},
		{Maintenance: 1, Hotfix: 1},
		{Maintenance: 2, Hotfix: 4},
		{Maintenance: 3, Hotfix: 12},
		{Maintenance: 4, Hotfix: 10},
		{Maintenance: 6, Hotfix: 1},
		{Maintenance: 7, Hotfix: 3},
		{Maintenance: 8, Hotfix: 0},
	},
	"10.2-gp": {
		{Maintenance: 0, Hotfix: 3},
		{Maintenance: 1, Hotfix: 2},
		{Maintenance: 2, Hotfix: 5},
		{Maintenance: 3, Hotfix: 13},
		{Maintenance: 4, Hotfix: 16},
		{Maintenance: 5, Hotfix: 6},
		{Maintenance: 6, Hotfix: 3},
		{Maintenance: 7, Hotfix: 8},
		{Maintenance: 8, Hotfix: 3},
		{Maintenance: 9, Hotfix: 1},
	},
	"11.0": {
		{Maintenance: 0, Hotfix: 2},
		{Maintenance: 1, Hotfix: 3},
		{Maintenance: 2, Hotfix: 3},
		{Maintenance: 3, Hotfix: 3},
		{Maintenance: 4, Hotfix: 0},
	},
	"11.0-gp": {
		{Maintenance: 0, Hotfix: 3},
		{Maintenance: 1, Hotfix: 4},
		{Maintenance: 2, Hotfix: 4},
		{Maintenance: 3, Hotfix: 10},
		{Maintenance: 4, Hotfix: 1},
	},
	"11.1": {
		{Maintenance: 0, Hotfix: 2},
		{Maintenance: 1, Hotfix: 0},
	},
	"11.1-gp": {
		{Maintenance: 0, Hotfix: 3},
		{Maintenance: 1, Hotfix: 1},
		{Maintenance: 2, Hotfix: 3},
	},
}

MinimumPatchedVersions represents the minimum patched versions for each PAN-OS feature release

View Source
var UnaffectedFamilies = map[string][]string{
	"400":   {"PA-410", "PA-415", "PA-415-5G", "PA-440", "PA-445", "PA-450", "PA-450R", "PA-460"},
	"1400":  {"PA-1410", "PA-1420"},
	"3400":  {"PA-3410", "PA-3420", "PA-3430", "PA-3440"},
	"5400":  {"PA-5450"},
	"5400f": {"PA-5410", "PA-5420", "PA-5430", "PA-5440", "PA-5445"},
	"7500":  {"PA-7500"},
}

UnaffectedFamilies represents the families of devices unaffected by the issue

Functions

func ParseFlags

func ParseFlags() (*Flags, *Config)

ParseFlags parses command-line flags and returns a configuration object.

Types

type AuthConfig

type AuthConfig struct {
	Credentials struct {
		Panorama struct {
			Username string `yaml:"username"`
			Password string `yaml:"password"`
		} `yaml:"panorama"`
		Firewall struct {
			Username string `yaml:"username"`
			Password string `yaml:"password"`
		} `yaml:"firewall"`
	} `yaml:"auth"`
}

AuthConfig represents the authentication configuration.

type Config

type Config struct {
	Panorama []struct {
		Hostname string `yaml:"hostname"`
	} `yaml:"panorama"`
	Auth           AuthConfig
	HostnameFilter string
	ReportOnly     bool
}

func Load

func Load(configFile, secretsFile string, flags *Flags) (*Config, error)

Load reads configuration and secrets from YAML files and returns a Config struct. This function reads configuration data from a specified config file and secrets from a secrets file, combining them into a single Config struct.

type DeviceCertificateStatus added in v1.0.4

type DeviceCertificateStatus struct {
	Msg             string `xml:"msg"`
	NotValidAfter   string `xml:"not_valid_after"`
	NotValidBefore  string `xml:"not_valid_before"`
	SecondsToExpire string `xml:"seconds-to-expire"`
	Status          string `xml:"status"`
	Timestamp       string `xml:"timestamp"`
	Validity        string `xml:"validity"`
}

DeviceCertificateStatus represents the response of command `show device-certificate status`.

type DeviceEntry

type DeviceEntry struct {
	Name            string                  `xml:"name,attr"`
	Serial          string                  `xml:"serial"`
	Hostname        string                  `xml:"hostname"`
	IPAddress       string                  `xml:"ip-address"`
	IPv6Address     string                  `xml:"ipv6-address"`
	Model           string                  `xml:"model"`
	Family          string                  `xml:"family"`
	SWVersion       string                  `xml:"sw-version"`
	AppVersion      string                  `xml:"app-version"`
	AVVersion       string                  `xml:"av-version"`
	WildfireVersion string                  `xml:"wildfire-version"`
	ThreatVersion   string                  `xml:"threat-version"`
	Result          string                  `json:"result,omitempty"`
	Errors          []string                `json:"errors,omitempty"`
	DeviceCert      DeviceCertificateStatus `json:"deviceCert,omitempty"`
}

DeviceEntry represents a single device entry from the Panorama response.

type DevicesResponse

type DevicesResponse struct {
	XMLName xml.Name `xml:"response"`
	Status  string   `xml:"status,attr"`
	Result  struct {
		Devices struct {
			Entries []DeviceEntry `xml:"entry"`
		} `xml:"devices"`
	} `xml:"result"`
}

DevicesResponse represents the structure of the XML response from Panorama.

type Flags

type Flags struct {
	DebugLevel     int
	Concurrency    int
	ConfigFile     string
	SecretsFile    string
	HostnameFilter string
	Verbose        bool
	NoPanorama     bool
	ReportOnly     bool
}

Flags represents the command-line flags

type Inventory

type Inventory struct {
	Inventory []InventoryDevice `yaml:"inventory"`
}

Inventory represents the structure of the inventory.yaml file

type InventoryDevice added in v1.0.1

type InventoryDevice struct {
	Hostname  string `yaml:"hostname"`
	IPAddress string `yaml:"ip_address"`
}

InventoryDevice represents a single device in the inventory

type MinimumPatchedVersion

type MinimumPatchedVersion struct {
	Maintenance int
	Hotfix      int
}

MinimumPatchedVersion represents the minimum patched version for a specific release

type Panorama

type Panorama struct {
	Hostname string `yaml:"hostname"`
}

Panorama represents the configuration details for Panorama.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL