Code Monkey home page Code Monkey logo

pan-af's Introduction

PAN-AF

This project is an automation framework for Palo Alto Networks firewalls. Instead of creating the same components for each new project (credential generation/storage, web framework, etc...), I opted to put my automation efforts into this framework.

Dynamic User Groups for Palo Alto Networks devices

This package does quite a lot around dynamic user and dynamic group registration. The idea is to give you something consistent to correlate activity around as IP addresses change in a dynamic network. If you know more information about the device, you may add it in the database using the web interface. Otherwise, the code generates a user-id based on mac info and hostname if it is provided when requesting a DHCP lease.

The logic is as follows:

  1. Collect all DHCP leases from the firewall
  2. Collect all ARP entries from the firewall (This captures devices with static IP addresses)
  3. Poll all MAC addresses in the database
  4. If the MAC is in the database, assign the name and group from the database
  5. If the MAC is not in the database and the hostname is available, assign a name based on MAC plus hostname
  6. If the MAC is not in the database and the hostname is not available, assign a name based on the MAC address only
  7. Upload all of the device-name-to-user-id-mappings and user-id-to-group-mappings to the firewall

To install, issue the following commands:

wget -q https://raw.githubusercontent.com/p0lr/PAN-AF/master/install.sh
chmod +x install.sh
./install.sh

To use:

Browse to http://<ip>
Click on the Palo Alto Networks logo
Click on "Manage Firewall" in the navigation menu
Enter the firewall IP address or hostname, username, and password for an account that has the proper permissions
Click on "Generate Key" in the navigation menu
Add your devices

That's it!

  • The firewall logs will now show your IP addresses with the appropriate names.
  • If you registered any devices in groups, the group names will automatically appear in source and destination drop-downs in the firewall management interface.

BONUS

So much automation!

pan-af's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.