Skip to content

Commit

Permalink
[Cleanup] Reformat audit json files with jq
Browse files Browse the repository at this point in the history
Reformat the files by running

    for f in *json
    do
       jq . $f > out
       mv out $f
    done

This makes it a lot easier to work with the files in
CLion (which happily wants to reformat the file when
adding new fields)

Change-Id: If84830a897abe30af4d7226197c1abd81b91a59d
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/181597
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
trondn committed Oct 20, 2022
1 parent 1210e09 commit f303f7f
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 129 deletions.
78 changes: 42 additions & 36 deletions auditd/etc/auditd_descriptor.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
{
"version" : 2,
"module" : "auditd",
"events" : [
{ "id" : 4096,
"name" : "configured audit daemon",
"description" : "loaded configuration file for audit daemon",
"sync" : false,
"enabled" : true,
"filtering_permitted" : false,
"mandatory_fields" : {
"timestamp" : "",
"real_userid" : {"domain" : "", "user" : ""},
"hostname" : "",
"version" : 1,
"auditd_enabled" : true,
"rotate_interval" : 1,
"log_path" : "",
"descriptors_path" : ""
},
"optional_fields" : {}
},

{ "id" : 4097,
"name" : "shutting down audit daemon",
"description" : "The audit daemon is being shutdown",
"sync" : false,
"enabled" : true,
"filtering_permitted" : false,
"mandatory_fields" : {
"timestamp" : "",
"real_userid" : {"domain" : "", "user" : ""}
},
"optional_fields" : {}
}

]
"version": 2,
"module": "auditd",
"events": [
{
"id": 4096,
"name": "configured audit daemon",
"description": "loaded configuration file for audit daemon",
"sync": false,
"enabled": true,
"filtering_permitted": false,
"mandatory_fields": {
"timestamp": "",
"real_userid": {
"domain": "",
"user": ""
},
"hostname": "",
"version": 1,
"auditd_enabled": true,
"rotate_interval": 1,
"log_path": "",
"descriptors_path": ""
},
"optional_fields": {}
},
{
"id": 4097,
"name": "shutting down audit daemon",
"description": "The audit daemon is being shutdown",
"sync": false,
"enabled": true,
"filtering_permitted": false,
"mandatory_fields": {
"timestamp": "",
"real_userid": {
"domain": "",
"user": ""
}
},
"optional_fields": {}
}
]
}
48 changes: 29 additions & 19 deletions auditd/etc/example_descriptor.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
"version" : 1,
"module" : "example",
"events" : [
{ "id" : 8192,
"name" : "example event",
"description" : "this is the full description of the example event",
"sync" : false,
"enabled" : true,
"mandatory_fields" : {
"timestamp" : "",
"real_userid" : {"domain" : "", "user" : ""}
},
"optional_fields" : {
"sessionid" : "",
"remote" : {"ip" : "", "port" : 1},
"effective_userid" : {"domain" : "", "user" : ""}
}
}
]
"version": 1,
"module": "example",
"events": [
{
"id": 8192,
"name": "example event",
"description": "this is the full description of the example event",
"sync": false,
"enabled": true,
"mandatory_fields": {
"timestamp": "",
"real_userid": {
"domain": "",
"user": ""
}
},
"optional_fields": {
"sessionid": "",
"remote": {
"ip": "",
"port": 1
},
"effective_userid": {
"domain": "",
"user": ""
}
}
}
]
}
147 changes: 73 additions & 74 deletions auditd/etc/module_descriptors.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,75 @@
{
"modules" : [
{
"auditd" : {
"startid" : 4096,
"file" : "kv_engine/auditd/etc/auditd_descriptor.json",
"header" : "kv_engine/auditd/auditd_audit_events.h"

}
},
{
"ns_server" : {
"startid" : 8192,
"file" : "ns_server/etc/audit_descriptor.json"
}
},
{
"xdcr" : {
"startid" : 16384,
"file" : "goproj/src/github.com/couchbase/goxdcr/etc/audit_descriptor.json"
}
},
{
"memcached" : {
"startid" : 20480,
"file" : "kv_engine/etc/memcached_descriptor.json",
"header":"kv_engine/memcached_audit_events.h"
}
},
{
"fts" : {
"startid" :24576,
"file" : "cbft/etc/audit_descriptor.json"
}
},
{
"n1ql" : {
"startid" :28672,
"file" : "goproj/src/github.com/couchbase/query/etc/audit_descriptor.json"
}
},
{
"eventing" : {
"startid" : 32768,
"file" : "goproj/src/github.com/couchbase/eventing/audit/audit_descriptor.json",
"enterprise" : true
}
},
{
"analytics" : {
"startid" : 36864,
"file" : "analytics/cbas/cbas-server/src/main/resources/com/couchbase/analytics/audit/audit_descriptor.json",
"enterprise" : true
}
},
{
"view_engine" : {
"startid" : 40960,
"file" : "couchdb/src/couch_audit/etc/audit_descriptor.json"
}
},
{
"backup" : {
"startid" : 45056,
"file" : "cbbs/audit/audit_descriptor.json",
"enterprise": true
}
},
{
"index" : {
"startid" : 49152,
"file" : "goproj/src/github.com/couchbase/indexing/secondary/audit/audit_descriptor.json"
}
}
]
"modules": [
{
"auditd": {
"startid": 4096,
"file": "kv_engine/auditd/etc/auditd_descriptor.json",
"header": "kv_engine/auditd/auditd_audit_events.h"
}
},
{
"ns_server": {
"startid": 8192,
"file": "ns_server/etc/audit_descriptor.json"
}
},
{
"xdcr": {
"startid": 16384,
"file": "goproj/src/github.com/couchbase/goxdcr/etc/audit_descriptor.json"
}
},
{
"memcached": {
"startid": 20480,
"file": "kv_engine/etc/memcached_descriptor.json",
"header": "kv_engine/memcached_audit_events.h"
}
},
{
"fts": {
"startid": 24576,
"file": "cbft/etc/audit_descriptor.json"
}
},
{
"n1ql": {
"startid": 28672,
"file": "goproj/src/github.com/couchbase/query/etc/audit_descriptor.json"
}
},
{
"eventing": {
"startid": 32768,
"file": "goproj/src/github.com/couchbase/eventing/audit/audit_descriptor.json",
"enterprise": true
}
},
{
"analytics": {
"startid": 36864,
"file": "analytics/cbas/cbas-server/src/main/resources/com/couchbase/analytics/audit/audit_descriptor.json",
"enterprise": true
}
},
{
"view_engine": {
"startid": 40960,
"file": "couchdb/src/couch_audit/etc/audit_descriptor.json"
}
},
{
"backup": {
"startid": 45056,
"file": "cbbs/audit/audit_descriptor.json",
"enterprise": true
}
},
{
"index": {
"startid": 49152,
"file": "goproj/src/github.com/couchbase/indexing/secondary/audit/audit_descriptor.json"
}
}
]
}

0 comments on commit f303f7f

Please sign in to comment.