Sign inSign up

omitsis/versionscanner

By omitsis

•Updated over 2 years ago

Image
0

1.8K

omitsis/versionscanner repository overview

NEW VERSION: ORWINN⁠

⁠omitsis versions scanner

This is a small program that runs through all the docker containers in a host, checking the software versions of software defined in a json configuration, and will warn if versions are EOL, or are close to end of support or life.

⁠example with docker-compose

version: "3.9"

services:
  versionscanner:
    image: omitsis/versionscanner
    container_name: versionscanner
    hostname: version-scanner-test
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/hostname:/etc/hostname:ro
    envvionment:
      VS_SLACK_TOKEN: xoxb-XXXXX
      VS_SLACK_CHANNEL: "version_alerts"
      VS_CONFIG_JSON_COMMAND: "curl -s -o - --request GET --url 'https://raw.githubusercontent.com/user/repo/main/mysoftware.json'"
      RUN_INTERVAL: 120 # minutes

⁠software.json

Example file content:

{
   "software": [
        {
            "name": "php",
            "command": ["php", "-r", "echo PHP_VERSION;"],
            "regex": "(\\d+(\\.\\d+)+)"
        },
        {
            "name": "mariadb",
            "command": ["mariadb", "--version"],
            "regex": "(\\d+(\\.\\d+)+)-MariaDB"
        }
   ]
}

Contains a list of software. Each item has:

  • name: The name of the software, must the the name that it has on endoflife.date⁠. For example, ffmpeg from https://endoflife.date/ffmpeg.
  • command: The command that outputs the version number. For example ffmpeg -version.
  • regex: The regex to extract the version number. By default it uses (\\d+(\\.\\d+)+), but some programs may need a different regex. The version number should be compatible with endoflife.date.

⁠skip a container

If you want to skip checks for a certain container, for example if it must run in a particular outdated version for a known and conscious decision, you can add a label versionscanner.enabled with value false to the docker container and it will skip:

version: "3.9"

services:
    outdated-db:
        image: mariadb:10.9
        container_name: outdated-mariadb
        environment:
            MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true
        labels:
            versionscanner.enabled: false

⁠Environment Variables

  • VS_SLACK_TOKEN - Slack API token to send messages to the channel.
  • VS_SLACK_CHANNEL - Slack channel where to send messages to.
  • VS_CONFIG_JSON_COMMAND (optional) - A command to run to get the json config and load it. It must return a raw json string.
  • VS_RUN_INTERVAL - In minutes. The time interval to run the checks. Default: 24h.

Tag summary

Content type

Image

Digest

sha256:497c585dc…

Size

20.1 MB

Last updated

over 2 years ago

docker pull omitsis/versionscanner