{"id":21515672,"url":"https://github.com/sqreen/rb-security-txt","last_synced_at":"2025-07-24T05:35:35.453Z","repository":{"id":72623075,"uuid":"117183926","full_name":"sqreen/rb-security-txt","owner":"sqreen","description":"Tools about security.txt for Ruby","archived":false,"fork":false,"pushed_at":"2023-10-14T13:52:05.000Z","size":32,"stargazers_count":20,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T20:12:28.354Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqreen.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}},"created_at":"2018-01-12T02:53:39.000Z","updated_at":"2025-03-30T23:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"40519bf0-1a0c-48c4-ab1a-876a7abd8c88","html_url":"https://github.com/sqreen/rb-security-txt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sqreen/rb-security-txt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqreen%2Frb-security-txt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqreen%2Frb-security-txt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqreen%2Frb-security-txt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqreen%2Frb-security-txt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqreen","download_url":"https://codeload.github.com/sqreen/rb-security-txt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqreen%2Frb-security-txt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796853,"owners_count":23985486,"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-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":"2024-11-23T23:56:19.913Z","updated_at":"2025-07-24T05:35:35.436Z","avatar_url":"https://github.com/sqreen.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%2Fsqreen%2Frb-security-txt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqreen%2Frb-security-txt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqreen%2Frb-security-txt/lists"}