Skip to content

h0bbel/phpIPAMtoHomepage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpIPAM to Homepage

Powershell script to grab hostnames from the phpIPAM API, run nmap against those hosts (scanning for port 22/80/443/3389 only) and create a services.yaml for Homepage with entries for all hosts have those ports open. If a host has more than one open port, one entry per open port is added.

The generated services.yaml file can be copied to a running Homepage install, thus creating an automated way of adding all known hosts.

How to run

Option 1: Container

Download the pre-configured container, configure the required environment variables and run it. The container exits after it's finished, and the result is saved in services.yaml

Option 2: Run in PowerShell/PowerCLI

Set the environment variables and run the script

NOTE: Ouput for the services.yaml file is hard coded to /homepage.

Environment Variables

$Env:phpIPAMURL set to the URL for phpIPAM instance.

Note: The URL must end with a trailing slash

$Env:AppID set to the App id created in the phpIPAM API via Administration -> API -> Create API Key. Create an App id with App security: SSL with App code token. phpIPAMtoHomepage only requires READ permissions.

screenshot

$Env:Token set to the "App code" created in the phpIPAM API settings.

Docker Volumes

/homepage should be mapped to a location where this container can write the services.yaml file, and Homepage can read it from.

Example

docker run -v .:/homepage -e phpIPAMURL=https://ipam.example.com/api/ -e AppID=chmo-test -e Token=QWDb36x4M893mFBHuQKZyp3WmiOCyeje ghcr.io/h0bbel/phpipamtohomepage:latest

This runs the container and the generated output services.yaml file is saved in the current working directory.

About

Powershell script to grab hostnames from the phpIPAM API and create a services.yaml for Homepage

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors