add more verbosity
This commit is contained in:
parent
4ae8f9e078
commit
d81c31febe
2 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
# data_importer
|
# data_importer
|
||||||
|
|
||||||
Import common security data such as CVE, CPE, and Advisories from various CNAs into a rails rails app with a postgresql db backend.
|
Import common security data such as CVE, CPE, and Security Advisories from various CNAs into a rails app with a postgresql db backend.
|
||||||
|
|
||||||
## Supported data models:
|
## Supported data models:
|
||||||
- `Cve` data from [cve_list](https://github.com/CVEProject/cvelist) mitre.
|
- `Cve` data from [cve_list](https://github.com/CVEProject/cvelist) mitre.
|
||||||
|
@ -24,6 +24,7 @@ docker-compose run web rake db:seed
|
||||||
`docker-compose run web rails console`
|
`docker-compose run web rails console`
|
||||||
|
|
||||||
### HTTP API
|
### HTTP API
|
||||||
|
For now unauthenticated api over localhost:3000 until I put in some basic token auth. All response data is json rendered.
|
||||||
|
|
||||||
#### Cves
|
#### Cves
|
||||||
```
|
```
|
||||||
|
|
|
@ -49,6 +49,7 @@ class CpeImporter
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.import(bulk_count = 20000, filepath = '/data_importer/data/official-cpe-dictionary_v2.2.xml.gz')
|
def self.import(bulk_count = 20000, filepath = '/data_importer/data/official-cpe-dictionary_v2.2.xml.gz')
|
||||||
|
puts "Now importing Cpes."
|
||||||
Zlib::GzipReader.open(filepath) do |file|
|
Zlib::GzipReader.open(filepath) do |file|
|
||||||
items = []
|
items = []
|
||||||
Nokogiri::XML::Reader.from_io(file).each do |node|
|
Nokogiri::XML::Reader.from_io(file).each do |node|
|
||||||
|
|
Loading…
Add table
Reference in a new issue