phpIPAM-agent Docker image
Find a file
2022-01-10 10:25:29 -06:00
.gitignore don't sync my docker-compose file 2022-01-05 15:22:55 -06:00
build.sh update docker build repo tag 2022-01-05 15:12:24 -06:00
Dockerfile update all packages during image build 2022-01-08 20:56:25 -06:00
entrypoint.sh default to 15-minute scan interval 2022-01-06 12:44:17 -06:00
example-docker-compose.yml add PHPIPAM_RESET_AUTODISCOVER and PHPIPAM_REMOVE_DHCP parameters 2022-01-06 12:22:50 -06:00
LICENSE Initial commit 2018-09-07 01:43:07 +02:00
php.ini Initial commit 2018-09-07 01:43:07 +02:00
README.md Update README.md - fix typo 2022-01-10 10:25:29 -06:00

phpipam-agent

phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application.

phpIPAM is developed and maintained by Miha Petkovsek, released under the GPL v3 license, project source is here

Learn more on phpIPAM homepage

This container can be used as a remote discovery scan agent.

How to use this Docker image

Setup PHPIPAM

  • Configure a remote agent (Administration > scan agents), get the key. config_agent

  • For each subnet, enable scan & configure the remote agent by selecting a remote. config_subnet

Setup database

$ mysql -u root -p
> GRANT SELECT on `phpipam`.* TO 'username'@'192.168.1.%' identified by "securePasswordHere";
> GRANT INSERT on `phpipam`.* TO 'username'@'192.168.1.%' identified by "securePasswordHere";
> GRANT UPDATE on `phpipam`.* TO 'username'@'192.168.1.%' identified by "securePasswordHere";
> GRANT DELETE on `phpipam`.* TO 'username'@'192.168.1.%' identified by "securePasswordHere";

Use % as a wildcard. 'phpipam'@'192.168.1.%' would allow the user phpipam to access the database from any host on the 192.168.1.0/24 network. 'phpipam'@'%' would let that user in from ANY host.

Run this container

version: '3'
services:
    phpipam-agent:
        container_name: phpipam-agent
        restart: unless-stopped
        image: jbowdre/phpipam-agent:latest
        environment:
          - PHPIPAM_DB_HOST=ipamhost.local
          - PHPIPAM_DB_NAME=phpipam
          - PHPIPAM_DB_USER=phpipam
          - PHPIPAM_DB_PASS=phpipamadmin
          - PHPIPAM_DB_PORT=3306
          - PHPIPAM_AGENT_KEY=2RuQ0rt4Rir29vGN4_1ZOqShcUX7PSUb
          - PHPIPAM_SCAN_INTERVAL=15m
          - PHPIPAM_RESET_AUTODISCOVER=false
          - PHPIPAM_REMOVE_DHCP_false
          - TZ=UTC

Configuration Parameters

Parameter Description
PHPIPAM_DB_HOST IP/FQDN where the phpIPAM database is running
PHPIPAM_DB_NAME Name of the database on the host (Optional; default: phpipam)
PHPIPAM_DB_USER Database user with required privileges (Optional; default: phpipam)
PHPIPAM_DB_PASS Password for that user
PHPIPAM_DB_PORT Port number for the database listener (Optional; default: 3306)
PHPIPAM_AGENT_KEY Unique key generated by phpIPAM for each scan agent
PHPIPAM_SCAN_INTERVAL How frequently the Status and Discovery scans will run (Valid options: 5m, 10m, 15m, 30m, 1h, 2h, 4h, 6h, 12h) (Optional; default: 15m)
PHPIPAM_RESET_AUTODISCOVER Enable the agent to remove autodiscovered IPs which are offline (Optional; default: false)
PHPIPAM_REMOVE_DHCP Enable the agent to remove inactive DHCP addresses (Optional; default: false)

Logging

The logs are available on stdout/stderr (allowing to use docker logs).

Acknowledgements

Based on mc303/phpipam-agent which is based on pierrecdn/phpipam-agent and published on docker hub.