{"id":18728737,"url":"https://github.com/rubyonworld/rb-security-txt","last_synced_at":"2026-04-30T13:32:25.285Z","repository":{"id":174008060,"uuid":"540253694","full_name":"RubyOnWorld/rb-security-txt","owner":"RubyOnWorld","description":"This gem provides a Rack middleware and matching Rails engine that will provide a nicely formatted security.txt for your application. It also includes a generator and parser of security.txt files.","archived":false,"fork":false,"pushed_at":"2022-09-23T02:46:53.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:32:46.443Z","etag":null,"topics":["gem","middleware","nicely","rack","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"securitytxt.gemspec","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-23T02:46:36.000Z","updated_at":"2022-09-27T20:59:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3098c2f-6e63-4c2b-9877-c3a9e1d8cc14","html_url":"https://github.com/RubyOnWorld/rb-security-txt","commit_stats":null,"previous_names":["rubyonworld/rb-security-txt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/rb-security-txt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frb-security-txt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frb-security-txt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frb-security-txt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frb-security-txt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/rb-security-txt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Frb-security-txt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gem","middleware","nicely","rack","rails"],"created_at":"2024-11-07T14:24:10.762Z","updated_at":"2026-04-30T13:32:25.280Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Security.txt toolbox for your Ruby app\n\nThis gem provides a Rack middleware and matching Rails engine\nthat will provide a nicely formatted [security.txt](https://tools.ietf.org/html/draft-foudil-securitytxt-02) for your application.\nIt also includes a generator and parser of security.txt files.\n\nReferences:\n* [security.txt rfc draft](https://tools.ietf.org/html/draft-foudil-securitytxt-02)\n* [security.txt project on github](https://github.com/securitytxt/security-txt)\n* [securitytxt.org](https://securitytxt.org/)\n\n\n## Installation\nAdd this line to your application's Gemfile:\n```ruby\n  gem 'securitytxt'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\n## Using the Rails engine\nCreate an initializer with the policy you want to set:\n```ruby\n# config/initializers/securitytxt.rb\nSecurityTxt.contact = \"me@organization.com\"\nSecurityTxt.encryption = \"https://www.mykey.com/pgp-key.txt\"\n```\n\n## Using the Rack middleware\nAdd the middleware to your chain in your config.ru\n\n```ruby\nrequire 'securitytxt'\n\npolicy = {\n  \"contact\" =\u003e \"me@organization.com\",\n  \"encryption\" =\u003e \"https://www.mykey.com/pgp-key.txt\"\n}\nuse SecurityTxt::Middleware, policy\n```\n\n## Parsing a Security.txt\n\nSimply passing a string should be enough to get data back\n\n```ruby\nrequire \"securitytxt/parser\"\nrequire \"open-uri\"\nSecurityTxt::Parser.new.parse(open(\"https://securitytxt.org/.well-known/security.txt\").read)\n# Outputs {\"contact\"=\u003e\"https://hackerone.com/ed\", \"encryption\"=\u003e\"https://keybase.pub/edoverflow/pgp_key.asc\", \"acknowledgements\"=\u003e\"https://hackerone.com/ed/thanks\"}\n```\n\n## Generating a Security.txt\n\n```ruby\nrequire 'securitytxt/generator'\nputs SecurityTxt::Generator.new({\"contact\"=\u003e\"https://hackerone.com/ed\", \"encryption\"=\u003e\"https://keybase.pub/edoverflow/pgp_key.asc\", \"acknowledgements\"=\u003e\"https://hackerone.com/ed/thanks\"}).generate\n# Outputs\n#\n# Contact: https://hackerone.com/ed\n# Encryption: https://keybase.pub/edoverflow/pgp_key.asc\n# Acknowledgements: https://hackerone.com/ed/thanks\n```\n\n## CLI usage\n\n```\nSecuritytxt - A CLI tool to parse and generate securitytxt content.\n\nHelp menu:\n   -p, --parse FILE | URL           Parse securitytxt file or URL\n   -g, --generate                   Generate a securitytxt string.\n   -c, --contact DETAILS            List of contact details separated by comma(,) without spaces. (used with -g/--generate)\n   -e, --encryption URL             Link to a page which contains your key.(used with -g/--generate)\n   -a, --acknowledgements URL       Link to a page where security researchers are recognized for their reports.(used with -g/--generate)\n   -h, --help                       Show this help message\n```\n\n## License\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Frb-security-txt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Frb-security-txt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Frb-security-txt/lists"}