GithubHelp home page GithubHelp logo

najarramsada / phpipamscanagent Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 31 KB

phpIPAM Scan Agent in Docker container

License: MIT License

PHP 95.88% Shell 4.12%
phpipam phpipamscan phpipamscanagent phpipam-docker phpipamscan-docker

phpipamscanagent's Introduction

Description

phpipamscanagent is a scanning agent for phpipam server to be deployed to remote servers in docker environment. This is a docker container for the phpIPAM agent, please see https://github.com/phpipam/phpipam-agent for installation on standalone server.

This docker container will run phpIPAM scan agent with update and discover parameters and can be used to setup a scheduled scan of the subnets without installing PHP or any of the php modules on host server.

License

phpipam is released under the GPL v3 license, see misc/gpl-3.0.txt. This docker container is released under the same license.

Requirements

  • A running phpIPAM server either in Docker container or standalone server. Visit https://github.com/pierrecdn/phpipam.
  • A valid database username and password of the phpIPAM database.
  • You will need to update the config.php file with your own environment for subnet scanning to work.
  • This docker container includes the required PHP & PHP modules for phpIPAM scan agent to work. You can install additional packages by modifying the dockerfile if you wish to.

Install

  • Update the config.php files with your scanagent key and database parameters. Update the scanagent key obtained from phpIPAM server.

    • $config['key'] = "335bdc3f11b1879e010776f6979c053c";

    Update the database parameters to match your environment

    • $config['db']['host'] = "DBHostname";
    • $config['db']['user'] = "DBUsername";
    • $config['db']['pass'] = "DBPassword";
    • $config['db']['name'] = "phpipam";
    • $config['db']['port'] = 3306;

Run

docker run --rm -v /src/config.php:/ipamscan/config.php najarramsada/phpipamscanagent

--rm will remove the container after it has completed the update and discover of IPs.

To run the this image in bash mode

  • docker run -it -v /src/config.php:/ipamscan/config.php najarramsada/phpipamscanagent bash

To run the this image in detached mode

  • docker run -t -d -v /src/config.php:/ipamscan/config.php najarramsada/phpipamscanagent

Scheduled scans

For scheduled scans set up a crontab to run the container every 15 mins.

  • Update the cronjob.sh with the correct location of the config file and setup a crontab on host server.
  • crontab -e
  • */15 * * * * /src/cronjob.sh

cronjob.sh should have the docker run command

#!/bin/bash

docker run --rm --network=host -v /src/config.php:/ipamscan/config.php najarramsada/phpipamscanagent

Contact

[email protected]

phpipamscanagent's People

Contributors

najarramsada avatar

Watchers

 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.