{"id":15434381,"url":"https://github.com/ninoseki/daino","last_synced_at":"2025-04-19T18:09:36.832Z","repository":{"id":62556649,"uuid":"189711462","full_name":"ninoseki/daino","owner":"ninoseki","description":"daino(大脳) is a dead simple Cortex API wrapper for Ruby.","archived":false,"fork":false,"pushed_at":"2023-12-15T20:19:16.000Z","size":27,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T08:52:39.742Z","etag":null,"topics":["api-wrapper","cortex"],"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/ninoseki.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":"2019-06-01T08:55:15.000Z","updated_at":"2019-12-24T13:00:58.000Z","dependencies_parsed_at":"2024-10-20T14:43:42.006Z","dependency_job_id":null,"html_url":"https://github.com/ninoseki/daino","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"c3cd47758236e469d2cf4e9a475c51be643d1b9e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninoseki%2Fdaino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninoseki%2Fdaino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninoseki%2Fdaino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninoseki%2Fdaino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninoseki","download_url":"https://codeload.github.com/ninoseki/daino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249758892,"owners_count":21321621,"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":["api-wrapper","cortex"],"created_at":"2024-10-01T18:39:07.524Z","updated_at":"2025-04-19T18:09:36.813Z","avatar_url":"https://github.com/ninoseki.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# daino\n\n[![Gem Version](https://badge.fury.io/rb/daino.svg)](https://badge.fury.io/rb/daino)\n[![Build Status](https://travis-ci.com/ninoseki/daino.svg?branch=master)](https://travis-ci.com/ninoseki/daino)\n[![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/daino/badge)](https://www.codefactor.io/repository/github/ninoseki/daino)\n[![Coverage Status](https://coveralls.io/repos/github/ninoseki/daino/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/daino?branch=master)\n\ndaino(`大脳`) is a dead simple [Cortex](https://github.com/TheHive-Project/Cortex) API wrapper for Ruby.\n\n## Installation\n\n```bash\ngem install daino\n```\n\n## Usage\n\n```ruby\nrequire \"daino\"\n\n# when given nothing, it tries to load your API key from ENV[\"CORTEX_API_KEY\"] \u0026 API endpoint from ENV[\"CORTEX_API_ENDPOINT\"]\napi = Daino::API.new\n# or you can set them manually\napi = Daino::API.new(api_endpoint: \"http://your_api_endpoint\", api_key: \"yoru_api_key\")\n\n# search jobs\njobs = api.job.search(data: \"1.1.1.1\", data_type: \"ip\")\n\njobs.each do |job|\n  id = job.dig(\"id\")\n  next unless id\n\n  # get a report of a job\n  report = api.job.report(id)\n  puts JSON.pretty_generate(report)\nend\n```\n\n## Implemented methods\n\n### Analyzer\n\n| HTTP Method | URI                           | Action                | API method                                                                                                                                                                                                     |\n|-------------|-------------------------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| GET         | /api/analyzer                 | List analyzers        | `#api.analyzer.list`                                                                                                                                                                                           |\n| POST        | /api/analyzer/_search         | Search analyzers      | `#api.analyzer.search(attributes)`                                                                                                                                                                             |\n| GET         | /api/analyzer/:analyzerId     | Get an analyzer       | `#api.analyzer.get_by_id(id)`                                                                                                                                                                                  |\n| GET         | /api/analyzer/:analyzerId     | Get an analyzer       | `#api.analyzer.get_by_id(id)` or `#api.analyzer.get_by_name(name)`                                                                                                                                             |\n| GET         | /api/analyzer/type/:dataType  | Get analyzers by type | `#api.analyzer.get_by_type(type)`                                                                                                                                                                              |\n| POST        | /api/analyzer/:analyzerId/run | Run an analyzer       | `#api.analyzer.run_by_id(id, data:, data_type:, tlp: 0, message: nil, parameters: nil, force: nil)` or `#api.analyzer.run_by_name(name, data:, data_type:, tlp: 0, message: nil, parameters: nil, force: nil)` |\n\n### Job\n\n| HTTP Method | URI                       | Action                 | API method                      |\n|-------------|---------------------------|------------------------|---------------------------------|\n| POST        | /api/job/_search          | Search jobs            | `#api.job.search(range: \"all\")` |\n| GET         | /api/job/:jobId           | Get a job by id        | `#api.job.get_by_id(id)`        |\n| GET         | /api/job/:jobId/report    | Get a report of a job  | `#api.job.report(id)`           |\n| GET         | /api/job/:jobID/artifacts | Get artifacts of a job | `#api.job.artifacts(id)`        |\n| DELETE      | /api/job/:jobId           | Delete a job           | `#api.job.delete_by_id(id)`     |\n\n### Organization\n\n| HTTP Method | URI                                    | Action                       | API method                                                        |\n|-------------|----------------------------------------|------------------------------|-------------------------------------------------------------------|\n| GET         | /api/organization                      | List organizations           | `#api.organization.list`                                          |\n| POST        | /api/organization/_search              | Search organizations         | `#api.organization.search(attributes)`                            |\n| GET         | /api/organization/:organizationId      | Get an organization          | `#api.organization.get_by_id(id)`                                 |\n| GET         | /api/organization/:organizationId/user | Get users of an organization | `#api.organization.users(id)`                                     |\n| POST        | /api/organization                      | Create an organization       | `#api.organization.create(name:, description:, status: \"Active\")` |\n| DELETE      | /api/organization/:organizationId      | Delete an organization       | `#api.organization.delete_by_id(id)`                              |\n\n### User\n\n| HTTP Method | URI                 | Action        | API method                                                             |\n|-------------|---------------------|---------------|------------------------------------------------------------------------|\n| GET         | /api/user           | List users    | `#api.user.list`                                                       |\n| POST        | /api/user/_search   | Search users  | `#api.user.search(attributes)`                                         |\n| GET         | /api/user/:userName | Get a user    | `#api.user.get_by_name(name)`                                          |\n| POST        | /api/user           | Create a user | `#api.user.create(name:, roles:, organization:, login:, status: \"Ok\")` |\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninoseki%2Fdaino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninoseki%2Fdaino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninoseki%2Fdaino/lists"}