Gary Lockyer via samba-technical
2018-04-05 03:13:59 UTC
I'm currently adding logging of Database changes, the attached patch set
is the work to date.
It still needs the the following done:
* separating out the common code with the auth logging
* cleaning up the code
* plumbing the remote IP through
- it's not currently available in all cases
* Add a session ID GUID and log that in the Authorization messages as
well
* Log/Audit group membership changes.
* Write unit and integration Tests.
Notes:
* Currently the attribute truncation limit is set artificially low to
aid development
Sample Human readable messages.
Values enclosed in {} are base64 encoded
Values ending with ... have been truncated.
Line breaks added for clarity
Samdb Change [Add] at [Thu, 05 Apr 2018 14:56:28.086708 NZST]
transaction id [d9184e5e-aeca-4793-b7a7-a8a558378421]
status [Success] remote host [Unknown]
SID [S-1-5-21-202143440-2159076023-2784540227-500]
DN [CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com]
attributes [
accountExpires [9223372036854775807]
adminCount [1]
clearTextPassword [REDACTED SECRET ATTRIBUTE]
description [Key Distribution Cen...]
isCriticalSystemObject [TRUE]
objectClass [top] [person] [organizationalPerson] [user]
objectSid {AQUAAAAAAAUVAAAA0HYMDLfisIA=...}
sAMAccountName [krbtgt]
servicePrincipalName [kadmin/changepw]
showInAdvancedViewOnly [TRUE] userAccountControl [514]]
Password Change [Reset] at [Thu, 05 Apr 2018 14:56:28.086738 NZST]
transaction id [d9184e5e-aeca-4793-b7a7-a8a558378421]
status [Success] remote host [Unknown]
SID [S-1-5-21-202143440-2159076023-2784540227-500]
DN [CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com]
Sample JSON messages:
JSON samdbChange: {
"timestamp": "2018-04-05T14:56:28.086749+1200",
"type": "samdbChange",
"samdbChange": {
"status": "Success",
"version": {"major": 1, "minor": 0},
"remoteAddress": "NULL",
"operation": "Add",
"userSid": "S-1-5-21-202143440-2159076023-2784540227-500",
"dn": "CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com",
"transactionId": "d9184e5e-aeca-4793-b7a7-a8a558378421",
"attributes": {
"adminCount": {"values": [{"value": "1"}]},
"objectSid": {"values": [
{"truncated": true, "base64": true,
"value": "AQUAAAAAAAUVAAAA0HYMDLfisIA="}]},
"accountExpires": {"values": [{"value": "9223372036854775807"}]},
"objectClass": {"values": [
{"value": "top"},
{"value": "person"},
{"value": "organizationalPerson"},
{"value": "user"}
]},
"clearTextPassword": {"redacted": true},
"description": {"values": [
{"truncated": true, "value": "Key Distribution Cen"}
]},
"isCriticalSystemObject": {"values": [{"value": "TRUE"}]},
"sAMAccountName": {"values": [{"value": "krbtgt"}]},
"servicePrincipalName": {"values": [{"value": "kadmin/changepw"}]},
"showInAdvancedViewOnly": {"values": [{"value": "TRUE"}]},
"userAccountControl": {"values": [{"value": "514"}]}}}}
JSON passwordChange: {
"timestamp": "2018-04-05T14:56:28.086947+1200",
"type": "passwordChange",
"passwordChange": {
"status": "Success",
"version": {"major": 1, "minor": 0},
"remoteAddress": "NULL",
"userSid": "S-1-5-21-202143440-2159076023-2784540227-500",
"action": "Reset",
"dn": "CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com",
"transactionId": "d9184e5e-aeca-4793-b7a7-a8a558378421"}}
Comments appreciated
Gary
is the work to date.
It still needs the the following done:
* separating out the common code with the auth logging
* cleaning up the code
* plumbing the remote IP through
- it's not currently available in all cases
* Add a session ID GUID and log that in the Authorization messages as
well
* Log/Audit group membership changes.
* Write unit and integration Tests.
Notes:
* Currently the attribute truncation limit is set artificially low to
aid development
Sample Human readable messages.
Values enclosed in {} are base64 encoded
Values ending with ... have been truncated.
Line breaks added for clarity
Samdb Change [Add] at [Thu, 05 Apr 2018 14:56:28.086708 NZST]
transaction id [d9184e5e-aeca-4793-b7a7-a8a558378421]
status [Success] remote host [Unknown]
SID [S-1-5-21-202143440-2159076023-2784540227-500]
DN [CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com]
attributes [
accountExpires [9223372036854775807]
adminCount [1]
clearTextPassword [REDACTED SECRET ATTRIBUTE]
description [Key Distribution Cen...]
isCriticalSystemObject [TRUE]
objectClass [top] [person] [organizationalPerson] [user]
objectSid {AQUAAAAAAAUVAAAA0HYMDLfisIA=...}
sAMAccountName [krbtgt]
servicePrincipalName [kadmin/changepw]
showInAdvancedViewOnly [TRUE] userAccountControl [514]]
Password Change [Reset] at [Thu, 05 Apr 2018 14:56:28.086738 NZST]
transaction id [d9184e5e-aeca-4793-b7a7-a8a558378421]
status [Success] remote host [Unknown]
SID [S-1-5-21-202143440-2159076023-2784540227-500]
DN [CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com]
Sample JSON messages:
JSON samdbChange: {
"timestamp": "2018-04-05T14:56:28.086749+1200",
"type": "samdbChange",
"samdbChange": {
"status": "Success",
"version": {"major": 1, "minor": 0},
"remoteAddress": "NULL",
"operation": "Add",
"userSid": "S-1-5-21-202143440-2159076023-2784540227-500",
"dn": "CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com",
"transactionId": "d9184e5e-aeca-4793-b7a7-a8a558378421",
"attributes": {
"adminCount": {"values": [{"value": "1"}]},
"objectSid": {"values": [
{"truncated": true, "base64": true,
"value": "AQUAAAAAAAUVAAAA0HYMDLfisIA="}]},
"accountExpires": {"values": [{"value": "9223372036854775807"}]},
"objectClass": {"values": [
{"value": "top"},
{"value": "person"},
{"value": "organizationalPerson"},
{"value": "user"}
]},
"clearTextPassword": {"redacted": true},
"description": {"values": [
{"truncated": true, "value": "Key Distribution Cen"}
]},
"isCriticalSystemObject": {"values": [{"value": "TRUE"}]},
"sAMAccountName": {"values": [{"value": "krbtgt"}]},
"servicePrincipalName": {"values": [{"value": "kadmin/changepw"}]},
"showInAdvancedViewOnly": {"values": [{"value": "TRUE"}]},
"userAccountControl": {"values": [{"value": "514"}]}}}}
JSON passwordChange: {
"timestamp": "2018-04-05T14:56:28.086947+1200",
"type": "passwordChange",
"passwordChange": {
"status": "Success",
"version": {"major": 1, "minor": 0},
"remoteAddress": "NULL",
"userSid": "S-1-5-21-202143440-2159076023-2784540227-500",
"action": "Reset",
"dn": "CN=krbtgt,CN=Users,DC=addom,DC=samba,DC=example,DC=com",
"transactionId": "d9184e5e-aeca-4793-b7a7-a8a558378421"}}
Comments appreciated
Gary