Skip to main content

Tool that checks the system capabilities

Project description

checkmaster

Server or workstation requirements validation tool, configurable, extensible and fast.

Setup

pip install checkmaster

Usage

The parameter --debug ERROR will show only the errors and not the entire log

checkmaster -c example_conf.json --debug ERROR

example of the output

ERROR checkmaster.sockets.ingoing_port {'kind': 'tcp', 'port': 8080, 'addrs': ['0.0.0.0']}
ERROR checkmaster.sockets.ingoing_port {'kind': 'tcp', 'port': 8443, 'addrs': ['0.0.0.0']}
ERROR checkmaster.sockets.ingoing_port {'kind': 'tcp', 'port': 5044, 'addrs': ['0.0.0.0']}
ERROR checkmaster.sockets.ingoing_port {'kind': 'udp', 'port': 1514}
ERROR checkmaster.sockets.ingoing_port {'kind': 'tcp', 'port': 1515, 'addrs': ['0.0.0.0']}
ERROR checkmaster.sockets.outgoing_port {'addr': 'that-host.net', 'port': 5150, 'kind': 'tcp', 'timeout': 2}
ERROR checkmaster.sockets.outgoing_port {'addr': 'that-host.net', 'port': 443, 'kind': 'tcp', 'timeout': 2}
ERROR checkmaster.sockets.outgoing_port {'addr': 'that-host.net', 'port': 5986, 'kind': 'tcp', 'timeout': 2}
ERROR checkmaster.sockets.outgoing_port {'addr': 'that-host.net', 'port': 22, 'kind': 'tcp', 'timeout': 2}

Configuration file format conversions

checkmaster -c examples/example_conf.yaml --yaml-to-json
checkmaster -c examples/example_conf.json --json-to-yaml

Configuration file

json configuration file like

{
    "checkmaster.sockets.ingoing_port": [
        {"kind": "tcp", "port": 22, "addrs": ["0.0.0.0"]},
        {"kind": "tcp", "port": 8080, "addrs": ["0.0.0.0"]},
        {"kind": "tcp", "port": 8443, "addrs": ["0.0.0.0"]},
        {"kind": "tcp", "port": 80, "status": "CLOSED"},
        {"kind": "tcp", "port": 5044, "addrs": ["0.0.0.0"]},
        {"kind": "udp", "port": 1514},
        {"kind": "tcp", "port": 1515, "addrs": ["0.0.0.0"]}
    ],
    "checkmaster.sockets.outgoing_port": [
        {"addr": "that-host.net", "port":5150, "kind": "tcp", "timeout": 2},
        {"addr": "that-host.net", "port":443, "kind": "tcp", "timeout": 2},
        {"addr": "that-host.net", "port":5986, "kind": "tcp", "timeout": 2},
        {"addr": "that-host.net", "port":22, "kind": "tcp", "timeout": 2}
    ],
    "checkmaster.commands.run": [
        {"cmd": "ping -c 1 google.com", "exit_status":0, "stdout_regexp": "1 received", "stderr_regexp": ""}
    ],

    "checkmaster.hardware.cores": {"operator": "ge", "value": 8},
    "checkmaster.hardware.ram": {"kind": "free",  "operator": "ge", "value": 4, "unit": "GB"},
    "checkmaster.distribution.processor": {"kind": "x86_64"},
    "checkmaster.distribution.system": {"kind": "Linux"},
    "checkmaster.distribution.distro": {"name": "ubuntu", "codename": "focal", "version": "20.04"},

    "checkmaster.filesystems.size": [
        {"path":"/", "kind":"free", "value":"100", "unit": "GB", "operator":"ge"}
    ],

    "checkmaster.filesystems.paths": [
        {"kind": "file", "path":"./README.md", "status": "present", "permissions": "0664", "uid": 1000, "gid": 1000},
        {"kind": "file", "path":"README.txt", "status": "absent"},
        {"kind": "directory", "path":"READMEs", "status": "absent"}
    ]
}
yaml configuration file like ... Click to expand!
````
checkmaster.commands.run:
- cmd: ping -c 1 google.com
  exit_status: 0
  stderr_regexp: ''
  stdout_regexp: 1 received
checkmaster.filesystems.paths:
- gid: 1000
  kind: file
  path: ./README.md
  permissions: '0664'
  status: present
  uid: 1000
- kind: file
  path: README.txt
  status: absent
- kind: directory
  path: READMEs
  status: absent
checkmaster.filesystems.size:
- kind: free
  operator: ge
  path: /
  unit: GB
  value: '100'
checkmaster.hardware.cores:
  operator: ge
  value: 8
checkmaster.hardware.ram:
  kind: free
  operator: ge
  unit: GB
  value: 4
checkmaster.sockets.ingoing_port:
- addrs:
  - 0.0.0.0
  kind: tcp
  port: 22
- addrs:
  - 0.0.0.0
  kind: tcp
  port: 8080
- addrs:
  - 0.0.0.0
  kind: tcp
  port: 8443
- kind: tcp
  port: 80
  status: CLOSED
- addrs:
  - 0.0.0.0
  kind: tcp
  port: 5044
- kind: udp
  port: 1514
- addrs:
  - 0.0.0.0
  kind: tcp
  port: 1515
checkmaster.sockets.outgoing_port:
- addr: that-host.net
  kind: tcp
  port: 5150
  timeout: 2
- addr: that-host.net
  kind: tcp
  port: 443
  timeout: 2
- addr: that-host.net
  kind: tcp
  port: 5986
  timeout: 2
- addr: that-host.net
  kind: tcp
  port: 22
  timeout: 2
````

Contribute

Feel free to open new issues and pull requests

For Developers

As you can see each checmaster rule, in the example configuration json file, have a python package and a function name like checkmaster.sockets.ingoing_port where checkmaster.sockets is the python package and the function is ingoing_port.

This means that you can load and use your own package.function in checkmaster without any changes in the code!

Authors

  • Giuseppe De Marco
  • 4Securitas ACSIA Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

checkmaster-0.4.0.tar.gz (24.1 kB view details)

Uploaded Source

File details

Details for the file checkmaster-0.4.0.tar.gz.

File metadata

  • Download URL: checkmaster-0.4.0.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.10

File hashes

Hashes for checkmaster-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1062e730f046e772d294e976c7413b3dc12b3fb91969751fc750663084f50686
MD5 f5d99be5794a7a0f1e0fa60084abb179
BLAKE2b-256 9ed71999cde082db68ef91b4a2d6c7016a8b49058d4816bafa38ef2d12521008

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page