A little sanity for our infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Christian Aust 912866e261 Fix permission denied error on execution 4 weeks ago
lib New command signature and Dockerfile 4 weeks ago
spec A little more precision on result definition logic 4 weeks ago
.dockerignore Exclude coverage results from docker image 4 weeks ago
.drone.yml Only push on successful master branch builds 1 month ago
.editorconfig Editorconfig settings 1 month ago
.gitignore Results to file 4 weeks ago
.rspec rspec, Drone CI 1 month ago
.ruby-gemset Initial commit 1 month ago
.ruby-version Initial commit 1 month ago
Dockerfile Fix permission denied error on execution 4 weeks ago
Gemfile Validate XML output against jUnit Schema, see https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd 1 month ago
Gemfile.lock Validate XML output against jUnit Schema, see https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd 1 month ago
LICENSE Initial commit 1 month ago
README.md New command signature and Dockerfile 4 weeks ago
Rakefile rspec, Drone CI 1 month ago
run.rb New command signature and Dockerfile 4 weeks ago

README.md

Sanity

Build Status Docker pulls

“Any daily work task that takes 5 minutes will cost over 20 hours a year, or over half of a work week. Even if it takes 20 hours to automate that daily 5 minute task, the automation will break even in a year.” -- Anthony J. Stieber, Breaking into Information Security

Taking care for a running online application requires repetitive, dull little tasks. Check the web server response. See if certificates will expire (or even worse: Already did.) Check the server time. It adds up for one application, and we certainly have more than one. Sanity runs sanity checks on targets you define. It's meant to be run by CI pipelines and the like, producing output like a unit test suite.

Execution

To run the docker image as provided, use this sequence:

  1. Create an empty directory
  2. Create a file targets.json there (see below for examples)
  3. Run docker run -v $(pwd):/app datenimperator/sanity:latest
  4. Test results will be in directory ./run.

Implemented checks

  • Static web response sanity
  • SSL sanity
  • DNS sanity

Test code is in lib/sanity/tests for reference and details.

Results are written to XML files, one per application in the targets definition. Result files are created in path ./run/*.xml

Example target file

Create a file targets.json in the base directory of this repo. It may contain multiple apps, and for each app any combination of supported tests along with any number of targets (at least one, though).

{
  "app_1": {
    "StaticWeb": [
      "https://software-berater.net/assets/css/main.css"
    ],
    "SSL": [
      "https://software-berater.net/"
    ],
    "DNS": [
      "www.software-berater.net"
    ]
  }
}

Target configuration (optional)

Target definition may contain configuration, if needed and supported by the test.

{
  "app_1": {
    // complex configuration
    "StaticWeb": {
      "config": { "key": "value" },
      "targets": [
        "https://software-berater.net/assets/css/main.css"
      ]
    },
    // simple configuration
    "SSL": [
      "https://software-berater.net/"
    ]
  }
}