command
Version:
v0.0.0-...-04dc923
Opens a new window with list of versions in this module.
Published: Jan 12, 2025
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
PAN-OS Session Viewer
This Go script retrieves and displays session information from Palo Alto Networks firewalls.
Table of Contents
Features
- Connects to a Palo Alto Networks firewall using API
- Retrieves all active sessions
- Filters sessions older than a specified duration
- Displays detailed information for filtered sessions
Prerequisites
- Go 1.20 or higher
- Access to a Palo Alto Networks firewall
- API key for the firewall
Quick Start
-
Download the pre-compiled binary for your host machine from the Releases page.
-
Create a settings.yaml
file in the same directory as the binary:
hostname: your-firewall-hostname
minutes: 1440 # 24 hours in minutes
-
Create a .secrets.yaml
file in the same directory as the binary:
api_key: your-api-key-here
-
Run the binary:
./pan-os-session-analyzer
Installation from Source
-
Clone this repository:
git clone https://github.com/cdot65/paloaltonetworks-automation-examples.git
cd paloaltonetworks-automation-examples/go/pan-os-session-analyzer
-
Build the binary:
go mod init github.com/cdot65/pan-os-session-analyzer
go mod tidy
go build -o pan-os-session-analyzer
-
Create the required configuration files as described in the Configuration section.
-
Run the binary:
./pan-os-session-analyzer
Configuration
-
Create a settings.yaml
file with your firewall configuration:
hostname: your-firewall-hostname
minutes: 1440 # 24 hours in minutes
-
Create a .secrets.yaml
file with your API key:
api_key: your-api-key-here
Usage
Run the script with the following command:
```
./pan-os-session-analyzer
```
Output
The script will display:
- A list of sessions older than the specified duration
- Detailed information for each session, including:
- Session ID
- Start Time
- Source
- Destination
- Application
- State
Screenshots
Here are some screenshots showcasing the execution:
execute the binary
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.