{"id":16191244,"url":"https://github.com/simonbaeumer/goss","last_synced_at":"2025-11-11T22:09:04.872Z","repository":{"id":64302844,"uuid":"157565218","full_name":"SimonBaeumer/goss","owner":"SimonBaeumer","description":"Quick and Easy server testing/validation","archived":false,"fork":false,"pushed_at":"2019-07-25T16:04:32.000Z","size":3252,"stargazers_count":27,"open_issues_count":20,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-17T03:21:42.362Z","etag":null,"topics":["devops","docker","go","golang","goss","health-endpoint","infrastructure-as-code","linux","tdd","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonBaeumer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-14T14:58:48.000Z","updated_at":"2025-02-25T18:34:43.000Z","dependencies_parsed_at":"2023-01-15T09:45:20.379Z","dependency_job_id":null,"html_url":"https://github.com/SimonBaeumer/goss","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonBaeumer%2Fgoss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonBaeumer%2Fgoss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonBaeumer%2Fgoss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonBaeumer%2Fgoss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonBaeumer","download_url":"https://codeload.github.com/SimonBaeumer/goss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244350996,"owners_count":20439291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","docker","go","golang","goss","health-endpoint","infrastructure-as-code","linux","tdd","testing"],"created_at":"2024-10-10T07:45:28.702Z","updated_at":"2025-11-11T22:09:04.783Z","avatar_url":"https://github.com/SimonBaeumer.png","language":"Go","readme":"# Goss - Quick and Easy server validation\n\n[![Build Status](https://travis-ci.org/SimonBaeumer/goss.svg?branch=master)](https://travis-ci.org/SimonBaeumer/goss)\n[![Go Report Card](https://goreportcard.com/badge/github.com/SimonBaeumer/goss)](https://goreportcard.com/report/github.com/SimonBaeumer/goss)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/4024768d424e4731012e/test_coverage)](https://codeclimate.com/github/SimonBaeumer/goss/test_coverage)\n\n## Goss in 45 seconds\n\n**Note:** For an even faster way of doing this, see: [autoadd](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#autoadd-aa---auto-add-all-matching-resources-to-test-suite)\n\n**Note:** For testing docker containers see the [dgoss](https://github.com/SimonBaeumer/goss/tree/master/extras/dgoss) wrapper\n\n**Note:** For some Docker/Kubernetes healthcheck, health endpoint, and\ncontainer ordering examples, see the blog post from @aelsabbahy [here][kubernetes-simplified-health-checks].\n\n\u003ca href=\"https://asciinema.org/a/4suhr8p42qcn6r7crfzt6cc3e?autoplay=1\" target=\"_blank\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/6783261/17330426/ce7ad066-5894-11e6-84ea-29fd4207af58.gif\" alt=\"asciicast\"\u003e\u003c/a\u003e\n\n## Introduction\n\n### What is Goss?\n\nGoss is a YAML based [serverspec](http://serverspec.org/) alternative tool for validating a server’s configuration. It eases the process of writing tests by allowing the user to generate tests from the current system state. Once the test suite is written they can be executed, waited-on, or served as a health endpoint.\n\n### Why use Goss?\n\n* Goss is EASY! - [Goss in 45 seconds](#goss-in-45-seconds)\n* Goss is FAST! - small-medium test suits are near instantaneous, see [benchmarks](https://github.com/SimonBaeumer/goss/wiki/Benchmarks)\n* Goss is SMALL! - \u003c10MB single self-contained binary\n\n### Why a fork?\n\nI forked this project because the [original](https://github.com/aelsabbahy/goss) repository isn't under active development anymore.\nDue to the reason we use it heavily in production I started this fork.\n\n## Installation\n\nThis will install goss and [dgoss](https://github.com/SimonBaeumer/goss/tree/master/extras/dgoss).\n\n**Note:** Using `curl | sh` is not recommended for production systems, use manual installation below.\n\n```bash\n# Install latest version to /usr/local/bin\ncurl -fsSL https://raw.githubusercontent.com/SimonBaeumer/goss/add-coverage/install.sh | sh\n\n# Install v0.4.0 version to ~/bin\ncurl -fsSL https://raw.githubusercontent.com/SimonBaeumer/goss/add-coverage/install.sh | GOSS_VER=v0.4.0 GOSS_DST=~/bin sh\n```\n\n### Manual installation\n\n```bash\n# See https://github.com/aelsabbahy/goss/releases for release versions\ncurl -L https://github.com/SimonBaeumer/goss/releases/download/_VERSION_/goss-linux-amd64 -o /usr/local/bin/goss\nchmod +rx /usr/local/bin/goss\n\n# (optional) dgoss docker wrapper (use 'master' for latest version)\ncurl -L https://raw.githubusercontent.com/SimonBaeumer/goss/_VERSION_/extras/dgoss/dgoss -o /usr/local/bin/dgoss\nchmod +rx /usr/local/bin/dgoss\n```\n\n### Build it yourself\n\n```bash\n# Enable git-hooks for development environments\nmake init\n# Build the source\nmake build\n```\n\n## Full Documentation\n\nDocumentation is available here: https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md\n\n## Quick start\n\n### Writing a simple sshd test\n\nAn initial set of tests can be derived from the system state by using the [add](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#add-a---add-system-resource-to-test-suite) or [autoadd](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#autoadd-aa---auto-add-all-matching-resources-to-test-suite) commands.\n\nLet's write a simple sshd test using autoadd.\n\n```\n# Running it as root will allow it to also detect ports\n$ sudo goss autoadd sshd\n```\n\nGenerated `goss.yaml`:\n\n```yaml\n$ cat goss.yaml\nport:\n  tcp:22:\n    listening: true\n    ip:\n    - 0.0.0.0\n  tcp6:22:\n    listening: true\n    ip:\n    - '::'\nservice:\n  sshd:\n    enabled: true\n    running: true\nuser:\n  sshd:\n    exists: true\n    uid: 74\n    gid: 74\n    groups:\n    - sshd\n    home: /var/empty/sshd\n    shell: /sbin/nologin\ngroup:\n  sshd:\n    exists: true\n    gid: 74\nprocess:\n  sshd:\n    running: true\n```\n\nNow that we have a test suite, we can:\n\n* Run it once\n\n```\ngoss validate\n...............\n\nTotal Duration: 0.021s # \u003c- yeah, it's that fast..\nCount: 15, Failed: 0\n```\n\n* Edit it to use [templates](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#templates), and run with a vars file\n\n```\ngoss --vars vars.yaml validate\n```\n\n* keep running it until the system enters a valid state or we timeout\n\n```\ngoss validate --retry-timeout 30s --sleep 1s\n```\n\n* serve the tests as a health endpoint\n\n```\ngoss serve \u0026\ncurl localhost:8080/healthz\n\n# JSON endpoint\ngoss serve --format json \u0026\ncurl localhost:8080/healthz\n```\n\n### Manually editing Goss files\n\nGoss files can be manually edited to use:\n\n* [Patterns](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#patterns)\n* [Advanced Matchers](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#advanced-matchers)\n* [Templates](https://github.com/SimonBaeumer/goss/blob/master/docs/manual.md#templates)\n* `title` and `meta` (arbitrary data) attributes are persisted when adding other resources with `goss add`\n\nSome examples:\n\n```yaml\nuser:\n  sshd:\n    title: UID must be between 50-100, GID doesn't matter. home is flexible\n    meta:\n      desc: Ensure sshd is enabled and running since it's needed for system management\n      sev: 5\n    exists: true\n    uid:\n      # Validate that UID is between 50 and 100\n      and:\n        gt: 50\n        lt: 100\n    home:\n      # Home can be any of the following\n      or:\n      - /var/empty/sshd\n      - /var/run/sshd\n\npackage:\n  kernel:\n    installed: true\n    versions:\n      # Must have 3 kernels and none of them can be 4.4.0\n      and:\n      - have-len: 3\n      - not:\n          contain-element: 4.4.0\n\n  # Loaded from --vars YAML/JSON file\n  {{.Vars.package}}:\n    installed: true\n\n{{if eq .Env.OS \"centos\"}}\n  # This test is only when $OS environment variable is set to \"centos\"\n  libselinux:\n    installed: true\n{{end}}\n```\n\n## Supported resources\n\n* package - add new package\n* file - add new file\n* addr - add new remote address:port - ex: google.com:80\n* port - add new listening [protocol]:port - ex: 80 or udp:123\n* service - add new service\n* user - add new user\n* group - add new group\n* command - add new command\n* dns - add new dns\n* process - add new process name\n* kernel-param - add new kernel-param\n* mount - add new mount\n* interface - add new network interface\n* http - add new network http url\n* goss - add new goss file, it will be imported from this one\n* matching - test for matches in supplied content\n\n## Supported output formats\n\n* rspecish **(default)** - Similar to rspec output\n* documentation - Verbose test results\n* JSON - Detailed test result\n* TAP\n* JUnit\n* nagios - Nagios/Sensu compatible output /w exit code 2 for failures.\n* silent - No output. Avoids exposing system information (e.g. when serving tests as a healthcheck endpoint).\n\n## Community Contributions\n\n* [goss-ansible](https://github.com/indusbox/goss-ansible) - Ansible module for Goss.\n* [degoss](https://github.com/naftulikay/ansible-role-degoss) - Ansible role for installing, running, and removing Goss in a single go.\n* [kitchen-goss](https://github.com/ahelal/kitchen-goss) - A test-kitchen verifier plugin for Goss.\n* [goss-fpm-files](https://github.com/deanwilson/unixdaemon-fpm-cookery-recipes) - Might be useful for building goss system packages.\n* [molecule](https://github.com/metacloud/molecule) - Automated testing for Ansible roles, with native Goss support.\n* [packer-provisioner-goss](https://github.com/YaleUniversity/packer-provisioner-goss) - A packer plugin to run Goss as a provision step.\n\n## Limitations\n\nCurrently goss only runs on Linux.\n\nThe following tests have limitations.\n\nPackage:\n\n* rpm\n* deb\n* Alpine apk\n* pacman\n\nService:\n\n* systemd\n* sysV init\n* OpenRC init\n* Upstart\n\n[kubernetes-simplified-health-checks]: https://medium.com/@aelsabbahy/docker-1-12-kubernetes-simplified-health-checks-and-container-ordering-with-goss-fa8debbe676c\n\n## Credits\n\nOriginal project: https://github.com/aelsabbahy/goss","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonbaeumer%2Fgoss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonbaeumer%2Fgoss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonbaeumer%2Fgoss/lists"}