From 4ae8f9e078034538745a86b5e517f18a6e3ce973 Mon Sep 17 00:00:00 2001 From: Brendan McDevitt Date: Wed, 6 Apr 2022 02:35:02 -0500 Subject: [PATCH] update README --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- db/seeds.rb | 3 ++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b44ce9e..497dd59 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,14 @@ # data_importer -Import common security data such as CVE, CPE, and Advisories from various CNAs into a postgresql database in a rails application. +Import common security data such as CVE, CPE, and Advisories from various CNAs into a rails rails app with a postgresql db backend. -## Getting started +## Supported data models: +- `Cve` data from [cve_list](https://github.com/CVEProject/cvelist) mitre. +- `Cpe` data from [nvd](https://nvd.nist.gov/products/cpe) 2.2 format. +- `GithubPoc` data from [nomi-sec](https://github.com/nomi-sec/PoC-in-GitHub). +- `InthewildCveExploit` data from [inthewild.io](https://inthewild.io/api/exploited) exploited feed. + +## Initial Setup ### Build container `docker-compose build` @@ -11,8 +17,35 @@ Import common security data such as CVE, CPE, and Advisories from various CNAs i ``` docker-compose run web rake db:create docker-compose run web rake db:migrate -docker-compose run web rake db:setup +docker-compose run web rake db:seed ``` ### Launch Pry console `docker-compose run web rails console` + +### HTTP API + +#### Cves +``` + get "/cves", to: "cves#index" + get "/cves/:cve_id", to: "cves#show" + get "/cves/years/:year", to: "cves#show_year" +``` +#### Cpes +``` + get "/cpes", to: "cpes#index" + get "/cpes/:id", to: "cpes#show" +``` + +#### GithubPocs +``` + get "/github_pocs", to: "github_pocs#index" + get "/github_pocs/:id", to: "github_pocs#show" + get "/github_pocs/cve/:cve_id", to: "github_pocs#show_for_cve" +``` + +#### InthewildCveExploits +``` + get "/inthewild_cve_exploits", to: "inthewild_cve_exploits#index" + get "/inthewild_cve_exploits/:cve_id", to: "inthewild_cve_exploits#show" +``` \ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index 16931cd..6598da4 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -18,6 +18,7 @@ end def perform import_cves import_github_pocs + import_inthewild_cve_exploits import_cpes end @@ -41,4 +42,4 @@ def import_inthewild_cve_exploits InthewildCveExploitImporter.new.import end -import_inthewild_cve_exploits \ No newline at end of file +perform \ No newline at end of file