summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnst Widerberg <ernst@sunet.se>2021-11-24 14:06:25 +0100
committerErnst Widerberg <ernst@sunet.se>2021-11-24 14:09:33 +0100
commit1d9b2b2fd9a676467f16b951f221e8a04b4edf63 (patch)
tree7246074b708ca499b4cf4c692cb3cd92d0097937
parent85fa96b3ace286d09485ff5da71ecd5952d529ae (diff)
Update README for current data format
-rw-r--r--README.md25
-rw-r--r--example_data.json47
2 files changed, 50 insertions, 22 deletions
diff --git a/README.md b/README.md
index e6ae44d..1537048 100644
--- a/README.md
+++ b/README.md
@@ -61,28 +61,9 @@ adding some observations. First, get a JWT for the default user `usr`:
JWT=$(curl http://localhost:8000/api/v1.0/auth -X POST -p -u usr:pwd | jq -r .access_token)
-Then we use the JWT to add an observation:
-
- echo '[{
- "ip": "192.0.2.10",
- "port": 443,
- "whois_description": "SOMENET",
- "asn": "AS65001",
- "asn_country_code": "SE",
- "ptr": "host10.test.soc.sunet.se",
- "abuse_mail": "abuse@test.soc.sunet.se",
- "domain": "sunet.se",
- "timestamp_in_utc": "2021-06-21T14:06 UTC",
- "producer_unique_keys": {
- "subject_cn": "unknown",
- "subject_o": "unknown",
- "full_name": "VMware ESXi 6.7.0 build-17700523",
- "end_of_general_support": false,
- "cve_2021_21972": "CVE-2021-21972 not applicable",
- "cve_2021_21974": "CVE-2021-21974 patched",
- "cve_2021_21985": "CVE-2021-21985 not applicable"
- }
- }]' | curl -s --data-binary @- -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/add
+Then we use the JWT to add an observation (defined in `example_data.json`):
+
+ curl -s --data-binary @example_data.json -H "Authorization: Bearer $JWT" http://localhost:80/sc/v0/add
Try retreiving all observations permitted by our JWT:
diff --git a/example_data.json b/example_data.json
new file mode 100644
index 0000000..3af9f35
--- /dev/null
+++ b/example_data.json
@@ -0,0 +1,47 @@
+{
+ "document_version": 1,
+ "ip": "192.0.2.10",
+ "port": 443,
+ "whois_description": "SOMENET",
+ "asn": "AS65001",
+ "asn_country_code": "SE",
+ "ptr": "host10.test.soc.sunet.se",
+ "abuse_mail": "abuse@test.soc.sunet.se",
+ "domain": "sunet.se",
+ "timestamp_in_utc": "2021-06-21T14:06 UTC",
+ "user_presentation": {
+ "description": "A presentation of the observation as a whole (optional)",
+ "data": {
+ "subject_cn": {
+ "data": "unknown",
+ "display_name": "Subject Common Name",
+ "description": "A description of this key (optional)"
+ },
+ "subject_o": {
+ "data": "unknown",
+ "display_name": "Subject O",
+ "description": "..."
+ },
+ "full_name": {
+ "data": "VMware ESXi 6.7.0 build-17700523",
+ "display_name": "Full Name"
+ },
+ "end_of_general_support": {
+ "data": false,
+ "display_name": "End of general support"
+ },
+ "cve_2021_21972": {
+ "data": "CVE-2021-21972 not applicable",
+ "display_name": "CVE 2021 21972"
+ },
+ "cve_2021_21974": {
+ "data": "CVE-2021-21974 patched",
+ "display_name": "CVE 2021 21974"
+ },
+ "cve_2021_21985": {
+ "data": "CVE-2021-21985 not applicable",
+ "display_name": "CVE 2021 21985"
+ }
+ }
+ }
+}