{"id":23698567,"url":"https://github.com/blu-base/train-salt","last_synced_at":"2026-01-25T16:30:18.471Z","repository":{"id":269323960,"uuid":"903926277","full_name":"blu-base/train-salt","owner":"blu-base","description":"Train plugin for inspec to run via salt-api","archived":false,"fork":false,"pushed_at":"2024-12-22T23:22:45.000Z","size":39,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T07:18:57.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blu-base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-15T22:44:40.000Z","updated_at":"2024-12-22T23:22:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"2006e045-19ec-4d37-96fc-029620812dca","html_url":"https://github.com/blu-base/train-salt","commit_stats":null,"previous_names":["blu-base/train-salt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Ftrain-salt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Ftrain-salt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Ftrain-salt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Ftrain-salt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blu-base","download_url":"https://codeload.github.com/blu-base/train-salt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768928,"owners_count":19693763,"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":[],"created_at":"2024-12-30T07:17:42.411Z","updated_at":"2026-01-25T16:30:18.358Z","avatar_url":"https://github.com/blu-base.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# train-salt - Train Plugin for connecting to remote systems via the Salt API\n\n\u003e [!CAUTION]\n\u003e Consider this project as experimental\n\n\nThis plugin allows applications, such as [inspec](https://github.com/inspec/inspec)\nand [cinc-auditor](https://cinc.sh/start/auditor/),\nthat rely on Train to communicate via Salt's API service.\n[Salt](https://saltproject.io/) is an agent-based configuration management\nsystem. Instead of using ssh, this plugin sends requests via the\nsalt api to remote systems. \n\n## Quickstart\n\n### Install `train-salt` for `inspec`\n\nYou will need InSpec v2.3 or later.\n\nIf you just want to use this (not learn how to write a plugin), you can so by simply running:\n\n```\n$ inspec plugin install train-salt\n```\n\nor, if you use `cinc-auditor`:\n\n```\n$ cinc-auditor plugin install train-salt\n```\n\n### Set up the `salt-api` service\n\nYou'll need to setup a salt-api service, such as salt's [cherrypy\nnetapi](https://docs.saltproject.io/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html).\nPlease refer to the respective documentation for Salt:\n[netapi](https://docs.saltproject.io/en/latest/ref/netapi/all/index.html). The\nconfiguration of the `salt-master` service and `salt-api` service are tightly\ncoupled.\n\nDon't forget to enable `netapi` clients in the salt-master configuration.\n`train-salt` uses the `local` client and mostly the `cmd.run_all` execution\nmodule. Ensure your master's configuration contains:\n\n```\nnetapi_enable_clients:\n  - local\n```\n\n\nNow setup an account to be used by `train-salt`. Please be referred to the\n[external authentication\nsystem](https://docs.saltproject.io/en/latest/topics/eauth/index.html)\ndocumentation. If you create an account on the same system as the salt-api\nservice, you can use the linux `pam` module. Your external authentication\nconfiguration for the `salt-master` could look like:\n\n```\nexternal_auth:\n  pam:\n    inspec-api-user:\n      - '*':\n         - test.*\n         - cmd.run_all\n```\n\nDon't forget to restart the `salt-master` and `salt-api` service after changing\nits configuration.\n\n### Execute commands via the salt backend\n\nPrepare a configuration file containing the address of the `salt-api`\nservice and the credentials to be used with the Salt API. E.g.:\n\ntrain-salt-config.json\n```json\n{\n  \"url\": \"https://salt-master:8000\",\n  \"username\": \"inspec-api-user\",\n  \"password\": \"mysecret\",\n  \"eauth\": \"pam\"\n}\n```\n\nYou can then run:\n\n```\n$ inspec detect -t salt://minion_id --config train-salt-config.json\n== Platform Details\n\nName:      ubuntu\nFamilies:  debian, linux, unix, os\nRelease:   22.04\nArch:      x86_64\n\n$ inspec shell -t salt://minion_id --config train-salt-config.json -c 'command(\"hostname\").stdout'\nminion_id\n```\n\n## Relationship between InSpec and Train\n\nTrain itself has no CLI, nor a sophisticated test harness. InSpec does have\nsuch facilities, so installing Train plugins will require an InSpec\ninstallation. You do not need to use or understand InSpec.\n\nTrain plugins may be developed without an InSpec installation.\n\n## How to build\n\nInstall the required gems. Jump in this project's root directory, and run:\n\n```\n$ bundle install\n```\n\nThen build the gem using the gemspec file.\n```\ngem build train-salt.gemspec\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblu-base%2Ftrain-salt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblu-base%2Ftrain-salt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblu-base%2Ftrain-salt/lists"}