{"id":30883270,"url":"https://github.com/globocom/tdi","last_synced_at":"2025-09-08T09:44:06.210Z","repository":{"id":15789511,"uuid":"18528744","full_name":"globocom/tdi","owner":"globocom","description":"Test Driven Infrastructure. Automates validation of deployed servers.","archived":false,"fork":false,"pushed_at":"2017-04-19T21:07:50.000Z","size":515,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-08-13T09:14:37.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globocom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-07T18:44:32.000Z","updated_at":"2021-02-11T17:31:44.000Z","dependencies_parsed_at":"2022-07-16T07:30:30.154Z","dependency_job_id":null,"html_url":"https://github.com/globocom/tdi","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/tdi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ftdi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ftdi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ftdi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ftdi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/tdi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ftdi/sbom","scorecard":{"id":430091,"data":{"date":"2025-08-11","repo":{"name":"github.com/globocom/tdi","commit":"cefd7262c19f04374a189a25f204c5c19d2564b8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-2gw2-8q9w-cw8p","Warn: Project is vulnerable to: GHSA-jppv-gw3r-w3q8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:08:00.385Z","repository_id":15789511,"created_at":"2025-08-19T03:08:00.385Z","updated_at":"2025-08-19T03:08:00.385Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166943,"owners_count":25233959,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-09-08T09:44:03.907Z","updated_at":"2025-09-08T09:44:06.197Z","avatar_url":"https://github.com/globocom.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TDI\n\nTest Driven Infrastructure acceptance helpers.\n\nValidate your deployed infrastructure and external dependencies.\n\n## Installation\n\nAdd this line to your Gemfile:\n\n```bash\ngem 'tdi'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\nOr install with:\n\n```bash\n$ gem install tdi\n```\n\n## Usage\n\n```bash\n$ tdi [-h]\n\nUsage:\n\n    tdi test_plan_file [options]\n\nExamples:\n\n    tdi tdi.json\n\n    tdi tdi.json -n\n    tdi tdi.json --nofail\n\n    tdi tdi.json -w\n    tdi tdi.json --warnfail\n\n    tdi tdi.json -p app\n    tdi tdi.json --plan app\n    tdi tdi.json --plan app::acl\n    tdi tdi.json --plan app::acl,app::file\n\n    tdi tdi.json -r /tmp/tdi-report.json\n    tdi tdi.json --reportfile /tmp/tdi-report.json\n\n    tdi tdi.json -s\n    tdi tdi.json --shred\n\n    tdi tdi.json -v\n    tdi tdi.json -vv\n    tdi tdi.json -vvv\n\n    tdi --version\n\nOptions:\n\n    -n, --nofail          No fail mode.\n    -w, --warnfail        Fail if any warning.\n    -p, --plan            Test plan list.\n    -r, --reportfile      Report file to save test plan status.\n    -s, --shred           Wipe out the test plan, leaving no trace behind.\n    -v, --verbose         Verbose mode.\n        --version         Version.\n    -h, --help            Display this help message.\n```\n\n## Test plan samples\n\n[Sample TDI JSONs](https://github.com/globocom/tdi/tree/master/doc/json)\n\n### ACL\n\nTest network access/filters for TCP services.\n\n[acl.json](https://github.com/globocom/tdi/tree/master/doc/json/acl.json)\n\n```json\n{\n  \"app\": {\n    \"desc\": \"Test role\",\n    \"acl\": {\n      \"port\": 80,\n\n      \"www.globo.com\": {},\n\n      \"globoesporte.globo.com\": {},\n\n      \"cartolafc.globo.com\": {},\n\n      \"doesnotexist.globo.com\": {},\n\n      \"www.example.com\": {\n        \"port\": [80, 9999],\n        \"timeout\": 3\n      },\n\n      \"localhost\": {\n        \"port\": [22, 31337]\n      }\n    }\n  }\n}\n```\n\n### FILE\n\nTest files and diretories permissions.\n\n[file.json](https://github.com/globocom/tdi/tree/master/doc/json/file.json)\n\n```json\n{\n  \"app\": {\n    \"desc\": \"Test role\",\n    \"file\": {\n      \"user\": \"nobody\",\n      \"perm\": \"rw\",\n      \"type\": \"file\",\n      \"location\": \"local\",\n\n      \"/tmp/afile1.txt\": {},\n\n      \"/tmp/afile2.txt\": {\n        \"perm\": \"ro\"\n      },\n\n      \"/tmp/afile3.txt\": {\n        \"user\": \"root\"\n      },\n\n      \"/tmp/doesnotexist/afile.txt\": {},\n\n      \"/tmp/doesnotexist\": {\n        \"type\": \"directory\"\n      },\n\n      \"/tmp\": {\n        \"type\": \"directory\"\n      }\n    }\n  }\n}\n```\n\n### HTTP\n\nTest URLs and match expected responses.\n\n[http.json](https://github.com/globocom/tdi/tree/master/doc/json/http.json)\n\n```json\n{\n  \"app\": {\n    \"desc\": \"Test role\",\n    \"http\": {\n      \"globoesporte.globo.com\": {\n        \"match\": \"\u003chtml\"\n      },\n\n      \"http://globoesporte.com\": {\n        \"code\": 301,\n        \"expect_header\": \"Location: http://globoesporte.globo.com/\"\n      },\n\n      \"http://api.sde.globo.com/docs\": {\n        \"code\" : 301\n      },\n\n      \"https://api.sde.globo.com/path/to/resource\": {\n        \"code\" : 401\n      },\n\n      \"doesnotexist.globo.com\": {},\n\n      \"https://api.cartola.globo.com/mercado/status.json\": {},\n\n      \"https://api.cartola.globo.com/wrong-url\": {},\n\n      \"http://g1.globo.com\": {\n        \"code\": 301,\n        \"match\": \"\u003chtml\"\n      },\n\n      \"http://g1.globo.com/index.html\": {\n        \"match\": \"\u003chtml\"\n      }\n    }\n  }\n}\n```\n\n### SSH\n\nTest SSH access and login using public/private key pairs.\n\n[ssh.json](https://github.com/globocom/tdi/tree/master/doc/json/ssh.json)\n\n```json\n{\n  \"app\": {\n    \"desc\": \"Test role\",\n    \"ssh\": {\n      \"timeout\": 7,\n\n      \"u_remote@localhost\": {\n        \"local_user\": \"u_local\"\n      },\n\n      \"u_remote2@localhost\": {\n        \"local_user\": [\"u_local\", \"u_local2\"]\n      }\n    }\n  }\n}\n```\n\n## Generating test plans\n\nYou may write your test plans as JSON in the following ways:\n\n* By hand, as pure JSON files\n\n* Using some templating engine (ERB, Jinja, etc...)\n\n* With your favorite programming language (Ruby, Python, etc...)\n\nIt does not matter how you generate your test plan, as long as it results in a\nvalid JSON file. Certainly it would be a good idea to write your test plans from\nwithin Capistrano/Fabric/Chef/Puppet. Since the difference between environments\n(development, staging, production) should be known by your deployment tool, it\nwould be clever to let that tool decide which paths, users, permissions and\naddresses to write into the test plan file.\n\nBellow we give you some suggestions on how to generate your test plans more\nefficiently (because writting JSON by hand is boring):\n\n### Ruby\n\n```ruby\nrequire 'json'\n\ntdi_plan = {\n  :app =\u003e {\n    :desc =\u003e 'Test role',\n    :acl =\u003e {'localhost' =\u003e {:port =\u003e [22, 80]}},\n    :http =\u003e {\n      'globo.com' =\u003e {:code =\u003e 301},\n      'noexist.globo.com' =\u003e {:code =\u003e 200},\n    },\n  }\n}\n\nFile.open('tdi.json', 'w').write(JSON.pretty_generate(tdi_plan))\n```\n\n### Python\n\n```python\nimport json\n\ntdi_plan = {\n  'app': {\n    'desc': 'Test role',\n    'acl': {'localhost': {'port': [22, 80]}},\n    'http': {\n      'globo.com': {'code': 301},\n      'noexist.globo.com': {'code': 200},\n    },\n  }\n}\n\nopen('tdi.json', 'w').write(json.dumps(tdi_plan, indent=2))\n```\n\n### Validating your plan file\n\nUse JSONLint site to validate your JSONs.\n\nhttp://jsonlint.com/\n\n## Running test plans and their possible `return codes`\n\nReturn codes are:\n\n* `0` if all `success`\n\n![success](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/success.png)\n\n* `0` by default even if warning (warning should not generate a validation error)\n\n![warning](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/warning.png)\n\n* `1` if any `failure`\n\n![failure](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/failure.png)\n\n* `2` if any `warning` plus option `-w` or `--warnfail`\n\n![warnfail](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/warnfail.png)\n\n* `3` if both `failure` and `warning` plus option `-w` or `--warnfail`\n\n![both](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/both.png)\n\n* `0` regardless failure or warning if `-n` or `--nofail`\n\n![nofail](https://raw.githubusercontent.com/globocom/tdi/master/doc/output/nofail.png)\n\n## Contributors\n\n[People](https://github.com/globocom/tdi/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ftdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Ftdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ftdi/lists"}