Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
diagnostic_configuration.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief Defines custom telemetry or audit configurations
29 *
30 * @file diagnostic_configuration.h
31 */
32
33#ifndef API_MIP_DIAGNOSTIC_CONFIGURATION_H_
34#define API_MIP_DIAGNOSTIC_CONFIGURATION_H_
35
36#include <map>
37#include <memory>
38
39#include "mip/audit_delegate.h"
40#include "mip/http_delegate.h"
41#include "mip/mip_namespace.h"
44
45
46MIP_NAMESPACE_BEGIN
47
48/**
49 * @brief Custom diagnostic configurations (not commonly used)
50 */
51
53 std::string hostNameOverride; /**< Host audit/telemetry instance name. If not set, MIP will act as its own host. */
54 std::string libraryNameOverride; /**< Alternate audit/telemetry library (DLL) filename. */
55 std::shared_ptr<HttpDelegate> httpDelegateOverride; /**< If set, HTTP handling will be managed by this instance */
56 /**< If set, async task handling will be managed by this instance,
57 * taskDispatcherDelegateOverides should not be shared as they can hold audit/telemetry objects, and prevent their release until taskDispatcher is freed */
58 std::shared_ptr<TaskDispatcherDelegate> taskDispatcherDelegateOverride;
59 bool isNetworkDetectionEnabled {true}; /**< If set, audit/telemetry component will ping network status on background thread */
60 bool isLocalCachingEnabled {true}; /**< If set, audit/telemetry component will use on-disk caching */
61 /**< If set, audit/telemetry component will write warning/error logs to disk.
62 * These files can grow to be very large, and may require manual cleanup from the host application */
64 bool isMinimalTelemetryEnabled{false}; /**< If set, only necessary service data telemetry will be sent */
65 bool isFastShutdownEnabled {false}; /**< If set, No events will be uploaded on shutdown, Audit events will be uploaded immediately upon logging */
66 std::map<std::string, std::string> customSettings; /**< Custom audit/telemetry settings >**/
67 std::map<std::string, std::vector<std::string>> maskedProperties; /**< Audit/Telemetry events/properties which should be masked */
68 std::shared_ptr<AuditDelegate> auditPipelineDelegateOverride; /**< Audit delegate override for writting audit events */
69 std::shared_ptr<TelemetryDelegate> telemetryPipelineDelegateOverride; /**< Telemetry delegate override for writting telemetry events */
70 Cloud cloud {Cloud::Unknown}; /**< Cloud type for controlling telemetry and audit events for sovereign cloud scenario */
71 DataBoundary dataBoundary {DataBoundary::Default}; /**< Default regional boundary that defines where telemetry and audit events are stored. */
72 bool isAuditPriorityEnhanced {false}; /**< If set, Audit events will be uploaded immediately upon logging in default audit pipeline of MIP SDK*/
73 int maxTeardownTimeSec {2}; /**< If set, Shutdown will take this much time, Audit & Telemetry events will be uploaded on shutdown. Value must be >= 2. */
74 bool isMaxTeardownTimeEnabled {false}; /**If set, Shutdown will take *maxTeardownTimeSec* time, Audit & Telemetry events will be uploaded on shutdown.*/
75};
76
77/**
78@brief Configuration to use when default logging is enabled. This is set only once per process and any later change will be ignored.
79 */
81 int maxLogFileSizeMb = 20; /**< Maximum size for a logfile in MB (default is 20). The valid range for maxLogFileSizeMb is -1 through 1024. Set to 0 to disable logging. Set to -1 to indicate no limit. */
82 int maxLogFileCount = 2; /**< Maximum number of logfiles to store (default is 2). The valid range for maxLogFileCount is -1 to INT_MAX. Set to 0 to disable logging. Set to -1 to indicate no limit. */
83 bool isPiiAllowed = true; /**< Whether to allow PII in the logs (default is true). Set to true to allow Pii in logs. Set to false to mask Pii. OII data will not be masked. */
84};
85
86MIP_NAMESPACE_END
87#endif // API_MIP_DIAGNOSTIC_CONFIGURATION_H_
A file containing the AuditDelegate class to be used to override MIP audit.
Cloud
Azure cloud identifier.
@ Unknown
Cloud not specified or URL not recognized as an Azure cloud.
DataBoundary
Diagnostic region identifier.
@ Default
Region is not specified.
Contains HttpDelegate interface definition used to override MIP HTTP stack.
MIP namespace macros.
Custom diagnostic configurations (not commonly used)
DataBoundary dataBoundary
Default regional boundary that defines where telemetry and audit events are stored.
std::map< std::string, std::vector< std::string > > maskedProperties
Audit/Telemetry events/properties which should be masked.
int maxTeardownTimeSec
If set, Shutdown will take this much time, Audit & Telemetry events will be uploaded on shutdown.
bool isAuditPriorityEnhanced
If set, Audit events will be uploaded immediately upon logging in default audit pipeline of MIP SDK.
std::string libraryNameOverride
Alternate audit/telemetry library (DLL) filename.
std::shared_ptr< TelemetryDelegate > telemetryPipelineDelegateOverride
Telemetry delegate override for writting telemetry events.
bool isLocalCachingEnabled
If set, audit/telemetry component will use on-disk caching.
std::shared_ptr< AuditDelegate > auditPipelineDelegateOverride
Audit delegate override for writting audit events.
std::string hostNameOverride
Host audit/telemetry instance name.
bool isMinimalTelemetryEnabled
If set, only necessary service data telemetry will be sent.
bool isNetworkDetectionEnabled
If set, audit/telemetry component will ping network status on background thread.
Cloud cloud
Cloud type for controlling telemetry and audit events for sovereign cloud scenario.
std::shared_ptr< HttpDelegate > httpDelegateOverride
If set, HTTP handling will be managed by this instance.
std::map< std::string, std::string > customSettings
Custom audit/telemetry settings >
bool isFastShutdownEnabled
If set, No events will be uploaded on shutdown, Audit events will be uploaded immediately upon loggin...
std::shared_ptr< TaskDispatcherDelegate > taskDispatcherDelegateOverride
Configuration to use when default logging is enabled.
int maxLogFileCount
Maximum number of logfiles to store (default is 2).
int maxLogFileSizeMb
Maximum size for a logfile in MB (default is 20).
bool isPiiAllowed
Whether to allow PII in the logs (default is true).
A file containing the TaskDispatcherDelegate interface to be used to override MIP async task executor...
A file containing the TelemetryDelegate class to be used to override MIP telemetry.