diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2021-03-19 17:43:30 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-19 18:13:11 +0000 |
commit | 4e410825f29880ff9502d41e3874b9ec8cef49cd (patch) | |
tree | db99929e198cea36e3c167da546e38042874cbcb /src/mongo/db | |
parent | e0c02385a21c388365b8908ebe33aaeeda3725e0 (diff) | |
download | mongo-4e410825f29880ff9502d41e3874b9ec8cef49cd.tar.gz |
SERVER-24912 Audit setting ClientMetadata as its own event
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/audit.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/audit.h | 5 | ||||
-rw-r--r-- | src/mongo/db/repl/replication_info.cpp | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/audit.cpp b/src/mongo/db/audit.cpp index 08b811dc3f2..512e8692e69 100644 --- a/src/mongo/db/audit.cpp +++ b/src/mongo/db/audit.cpp @@ -36,6 +36,10 @@ namespace audit { ImpersonatedClientAttrs::ImpersonatedClientAttrs(Client* client) {} +void logClientMetadata(Client* client) { + invariant(client); +} + void logAuthentication(Client* client, const AuthenticateEvent&) { invariant(client); } diff --git a/src/mongo/db/audit.h b/src/mongo/db/audit.h index bb24e80e087..914184c49b3 100644 --- a/src/mongo/db/audit.h +++ b/src/mongo/db/audit.h @@ -88,6 +88,11 @@ public: }; /** + * Logs the metadata for a client connection once it is finalized. + */ +void logClientMetadata(Client* client); + +/** * AuthenticateEvent is a opaque view into a finished authentication handshake. * * This object is only valid within its initial stack context. diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 79d74e4329d..1bae39415cf 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -37,6 +37,7 @@ #include "mongo/bson/util/bson_extract.h" #include "mongo/client/connpool.h" #include "mongo/client/dbclient_connection.h" +#include "mongo/db/audit.h" #include "mongo/db/client.h" #include "mongo/db/commands/server_status.h" #include "mongo/db/commands/test_commands_enabled.h" @@ -298,6 +299,8 @@ public: auto client = opCtx->getClient(); if (ClientMetadata::tryFinalize(client)) { + audit::logClientMetadata(client); + // If we are the first hello, then set split horizon parameters. auto sniName = client->getSniNameForSession(); SplitHorizon::setParameters(client, std::move(sniName)); |