centralized logging is missing due to rgw_enable_ops_log
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceph RADOS Gateway Charm |
New
|
Undecided
|
Unassigned |
Bug Description
Ceph radosgw has a mechanism to log operations into Ceph itself. The handy feature is not enabled by default so it would be nice if the charm enables it for auditing purposes.
Currently GET operation for example is logged at each radosgw unit.
e.g. /var/log/
However, the equivalent log cannot be retrieved via the Ceph embedded feature.
# radosgw-admin log list | head
[
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
"obj_delete_
# radosgw-admin log show --bucket simplestreams \
--bucket-id 52b9a1c1-
--date 2023-06-01-12
error reading log 2023-06-
By enabling the feature by hand, it allows to see the log through the radsgw-admin interface.
https:/
$ juju config ceph-radosgw config-
$ curl -v https:/
# radosgw-admin log show --bucket simplestreams \
--bucket-id 52b9a1c1-
--date 2023-06-01-12 | head
{
"bucket_id": "52b9a1c1-
"bucket_owner": "1515718f589242
"bucket": "simplestreams",
"log_entries": [
{
"bucket": "simplestreams",
"time": "2023-06-
# radosgw-admin log show --bucket simplestreams \
--bucket-id 52b9a1c1-
--date 2023-06-01-12 | grep foo
"uri": "GET /simplestreams/foo HTTP/1.1",
We should additionally set either "rgw remote addr param" or "rgw log http headers" with "HTTP_X_ FORWARDED_ FOR" otherwise the remote ip is always 127.0.0.1.
$ juju config ceph-radosgw \ flags=' {"global" :{"rgw enable ops log": true, "rgw remote addr param": "HTTP_X_ FORWARDED_ FOR"}}'
config-
{
"bucket" : "simplestreams", 01T13:10: 00.060561Z" ,
"time_ local": "2023-06- 01T13:10: 00.060561+ 0000",
"remote_ addr": "192.168.151.107",
"object_ owner": "1515718f589242 8fa97d464124384 8ed",
"operation ": "get_obj",
"http_ status" : "200",
"error_ code": "",
"bytes_ sent": 0,
"bytes_ received" : 0,
"object_ size": 0,
"total_ time": 4,
"user_ agent": "curl/7.81.0",
"referrer" : "",
"trans_ id": "tx00000ff5efd6 ded2863e0- 00647898a8- 9207-default" ,
"authentic ation_type" : "Local",
"temp_ url": false
"time": "2023-06-
"user": "anonymous",
"uri": "GET /simplestreams/foo HTTP/1.1",
},
$ juju config ceph-radosgw \ flags=' {"global" :{"rgw enable ops log": true, "rgw log http headers": "http_x_ forwarded_ for"}}'
config-
{
"bucket" : "simplestreams", 01T12:44: 27.316514Z" ,
"time_ local": "2023-06- 01T12:44: 27.316514+ 0000",
"remote_ addr": "127.0.0.1",
"object_ owner": "1515718f589242 8fa97d464124384 8ed",
"operation ": "get_obj",
"http_ status" : "200",
"error_ code": "",
"bytes_ sent": 0,
"bytes_ received" : 0,
"object_ size": 0,
"total_ time": 8,
"user_ agent": "curl/7.81.0",
"referrer" : "",
"http_ x_headers" : [
" HTTP_X_ FORWARDED_ FOR": "192.168.151.107"
"trans_ id": "tx000002dcd746 3dff3832f- 00647892ab- 8c1f-default" ,
"authentic ation_type" : "Local",
"temp_ url": false
"time": "2023-06-
"user": "anonymous",
"uri": "GET /simplestreams/foo HTTP/1.1",
{
}
],
}