diff options
author | Kristofer Hallin <kristofer@sunet.se> | 2021-10-07 21:34:49 +0200 |
---|---|---|
committer | Kristofer Hallin <kristofer@sunet.se> | 2021-10-07 21:34:49 +0200 |
commit | 446d9f04be3602d395407e79e781b7c591b45ad5 (patch) | |
tree | 0849d34c652365244f9dfaac8f3f8c6ac144d82f /README.md | |
parent | 742dcd5639ffa27d15d594e322505cc317edfc70 (diff) |
Updated README.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -53,25 +53,16 @@ Install dependencies (Debian). sudo apt install python3 python3-pip python3-leveldb pip3 install falcon -Start CouchDB, make sure to give it a username and password: +Start CouchDB and the collector. Make sure to give it a username and password: cd docker export COUCHDB_USER=couchdb export COUCHDB_PASSWORD=insecure - docker-compose up -d - -Start the demo HTTP server. Here we should pass on a few environment -variables to let it know which CouchDB to use: - - cd demo export COUCHDB_NAME=test - export COUCHDB_HOSTNAME=localhost - export COUCHDB_USER=couchdb - export COUCHDB_PASSWORD=insecure - python3 ../src/wsgi.py + docker-compose up -Try adding some observations, basic auth user:pw from `wsgi_demo_users.yaml`, -including `{"domain": "sunet.se"}` in at least one of them: +Now the database and the API server should be running, now we can try +adding some observations: echo '[{ "ip": "192.0.2.10", @@ -92,12 +83,12 @@ including `{"domain": "sunet.se"}` in at least one of them: "cve_2021_21974": "CVE-2021-21974 patched", "cve_2021_21985": "CVE-2021-21985 not applicable" } - }]' | curl -s -u user3:pw3 --data-binary @- http://localhost:8000/sc/v0/add + }]' | curl -s -u user3:pw3 --data-binary @- http://localhost:80/sc/v0/add Try retreiving all observations for a user with read access to 'sunet.se': - curl -s -u user1:pw1 http://localhost:8000/sc/v0/get | json_pp -json_opt utf8,pretty + curl -s -u user1:pw1 http://localhost:80/sc/v0/get | json_pp -json_opt utf8,pretty We might also filter the data: - curl -s -u user1:pw1 http://localhost:8000/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty + curl -s -u user1:pw1 http://localhost:80/sc/v0/get?port=111 | json_pp -json_opt utf8,pretty |