data_importer/README.md

51 lines
1.4 KiB
Markdown
Raw Normal View History

2022-03-30 16:02:23 +00:00
# data_importer
2022-04-06 02:35:02 -05:00
Import common security data such as CVE, CPE, and Advisories from various CNAs into a rails rails app with a postgresql db backend.
2022-03-30 16:02:23 +00:00
2022-04-06 02:35:02 -05:00
## 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
2022-03-30 16:02:23 +00:00
2022-04-01 14:10:16 -05:00
### Build container
`docker-compose build`
2022-03-30 16:02:23 +00:00
2022-04-01 14:10:16 -05:00
### Database creation and seeding initial data
2022-04-01 14:14:33 -05:00
```
docker-compose run web rake db:create
docker-compose run web rake db:migrate
2022-04-06 02:35:02 -05:00
docker-compose run web rake db:seed
2022-04-01 14:14:33 -05:00
```
2022-03-30 16:02:23 +00:00
2022-04-01 14:10:16 -05:00
### Launch Pry console
`docker-compose run web rails console`
2022-04-06 02:35:02 -05:00
### 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"
```