diff options
author | Andy Schwerin <schwerin@10gen.com> | 2013-07-17 14:43:10 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2013-07-17 17:47:36 -0400 |
commit | 0eb227c15841da86dbf9d21e7e593c7659040963 (patch) | |
tree | b65159d2b8f30bf978b6003289a492734cfb69b9 /src/mongo/db/audit.cpp | |
parent | 752f704bc0fb5c771b74a033364eaa045eda2040 (diff) | |
download | mongo-0eb227c15841da86dbf9d21e7e593c7659040963.tar.gz |
SERVER-1891 Add audit logging hooks for authorization checks in mongod.
Diffstat (limited to 'src/mongo/db/audit.cpp')
-rw-r--r-- | src/mongo/db/audit.cpp | 63 |
1 files changed, 60 insertions, 3 deletions
diff --git a/src/mongo/db/audit.cpp b/src/mongo/db/audit.cpp index 15d7814d84f..6c78ded58c6 100644 --- a/src/mongo/db/audit.cpp +++ b/src/mongo/db/audit.cpp @@ -16,7 +16,11 @@ #include "mongo/db/audit.h" -#if !MONGO_ENTERPRISE_VERSION +#if MONGO_ENTERPRISE_VERSION +#define MONGO_AUDIT_STUB ; +#else +#define MONGO_AUDIT_STUB {} +#endif namespace mongo { namespace audit { @@ -24,8 +28,61 @@ namespace audit { void logCommandAuthzCheck(ClientBasic* client, const NamespaceString& ns, const BSONObj& cmdObj, - ErrorCodes::Error result) {} + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logDeleteAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + const BSONObj& pattern, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logFsyncUnlockAuthzCheck( + ClientBasic* client, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logGetMoreAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + long long cursorId, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logInProgAuthzCheck( + ClientBasic* client, + const BSONObj& filter, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logInsertAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + const BSONObj& insertedObj, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logKillCursorsAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + long long cursorId, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logKillOpAuthzCheck( + ClientBasic* client, + const BSONObj& filter, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logQueryAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + const BSONObj& query, + ErrorCodes::Error result) MONGO_AUDIT_STUB + + void logUpdateAuthzCheck( + ClientBasic* client, + const NamespaceString& ns, + const BSONObj& query, + const BSONObj& updateObj, + bool isUpsert, + bool isMulti, + ErrorCodes::Error result) MONGO_AUDIT_STUB + } // namespace audit } // namespace mongo -#endif // !MONGO_ENTERPRISE |