|
2 months ago | |
---|---|---|
lib | 2 months ago | |
spec | 2 months ago | |
.dockerignore | 2 months ago | |
.drone.yml | 2 months ago | |
.editorconfig | 2 months ago | |
.gitignore | 2 months ago | |
.rspec | 3 months ago | |
.ruby-gemset | 3 months ago | |
.ruby-version | 3 months ago | |
Dockerfile | 2 months ago | |
Gemfile | 2 months ago | |
Gemfile.lock | 2 months ago | |
LICENSE | 3 months ago | |
README.md | 2 months ago | |
Rakefile | 3 months ago | |
run.rb | 2 months ago |
README.md
Sanity
“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:
- Create an empty directory
- Create a file
targets.json
there (see below for examples) - Run
docker run -v $(pwd):/app datenimperator/sanity:latest
- 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/"
]
}
}