From 102cc8aeb299faadd9349c3ffd23f7ca9ff3c32b Mon Sep 17 00:00:00 2001 From: Gabriel Marks Date: Thu, 7 Oct 2021 14:38:29 +0000 Subject: SERVER-60362 Implement KMIP-based Audit Log Encryption --- src/mongo/db/audit.cpp | 2 ++ src/mongo/db/audit.h | 5 +++++ src/mongo/db/mongod_main.cpp | 1 + src/mongo/s/mongos_main.cpp | 1 + 4 files changed, 9 insertions(+) diff --git a/src/mongo/db/audit.cpp b/src/mongo/db/audit.cpp index 2f62a0d26b9..c741b8c4e4c 100644 --- a/src/mongo/db/audit.cpp +++ b/src/mongo/db/audit.cpp @@ -39,6 +39,8 @@ std::function initializeSynchronizeJob; ImpersonatedClientAttrs::ImpersonatedClientAttrs(Client* client) {} +void rotateAuditLog() {} + void logClientMetadata(Client* client) { invariant(client); } diff --git a/src/mongo/db/audit.h b/src/mongo/db/audit.h index 2e4904e09df..684983bf7be 100644 --- a/src/mongo/db/audit.h +++ b/src/mongo/db/audit.h @@ -151,6 +151,11 @@ private: ErrorCodes::Error _result; }; +/** + * Rotates the audit log in enterprise. Only to be called on startup. + */ +void rotateAuditLog(); + /** * Logs the result of an authentication attempt. */ diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp index b785bd235a0..36f6842d691 100644 --- a/src/mongo/db/mongod_main.cpp +++ b/src/mongo/db/mongod_main.cpp @@ -1469,6 +1469,7 @@ int mongod_main(int argc, char* argv[]) { } } + audit::rotateAuditLog(); setUpCollectionShardingState(service); setUpCatalog(service); setUpReplication(service); diff --git a/src/mongo/s/mongos_main.cpp b/src/mongo/s/mongos_main.cpp index e945b019249..8753323ccf4 100644 --- a/src/mongo/s/mongos_main.cpp +++ b/src/mongo/s/mongos_main.cpp @@ -907,6 +907,7 @@ ExitCode mongos_main(int argc, char* argv[]) { return EXIT_ABRUPT; } + audit::rotateAuditLog(); registerShutdownTask(cleanupTask); const auto service = getGlobalServiceContext(); -- cgit v1.2.1