public static bool IsExternalAccess(string userId, OrganizationId userOrganization, OrganizationId currentOrganization) { if (string.IsNullOrEmpty(userId)) { return(true); } if (AuditFeatureManager.IsExternalAccessCheckOnDedicatedEnabled()) { NTAccount ntaccount = new NTAccount(AdminAuditExternalAccessDeterminer.TransformUserID(userId)); SecurityIdentifier securityIdentifier; try { securityIdentifier = (SecurityIdentifier)ntaccount.Translate(typeof(SecurityIdentifier)); } catch (IdentityNotMappedException) { ntaccount = new NTAccount(userId); try { securityIdentifier = (SecurityIdentifier)ntaccount.Translate(typeof(SecurityIdentifier)); } catch (IdentityNotMappedException) { return(true); } } bool flag; return(AdminAuditExternalAccessDeterminer.externalAccessLRUCache.Get(securityIdentifier.ToString(), out flag)); } bool flag2 = userOrganization == null || currentOrganization == null; return(!flag2 && !userOrganization.Equals(currentOrganization)); }
public static bool IsAuditConfigFromUCCPolicyEnabled(MailboxSession mailboxSession, IExchangePrincipal exchangePrincipal) { if (AuditFeatureManager.AuditConfigFromUCCPolicyOverride != null) { return(AuditFeatureManager.AuditConfigFromUCCPolicyOverride()); } if (AuditFeatureManager.isAuditConfigFromUCCPolicyInRegistry) { bool?flag = AuditFeatureManager.ReadTertiaryValueFromRegistry("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Audit\\Parameters", "AuditConfigFromUCCPolicyEnabled"); AuditFeatureManager.isAuditConfigFromUCCPolicyInRegistry = (flag != null); if (flag != null) { return(flag.Value); } } if (mailboxSession != null) { return(mailboxSession.IsAuditConfigFromUCCPolicyEnabled); } if (exchangePrincipal != null) { VariantConfigurationSnapshot configuration = exchangePrincipal.GetConfiguration(); if (configuration != null) { return(configuration.Ipaed.AuditConfigFromUCCPolicy.Enabled); } } return(false); }
public static bool IsExternalAccessCheckOnDedicatedEnabled() { if (AuditFeatureManager.ExternalAccessCheckOnDedicatedEnabledOverride != null) { return(AuditFeatureManager.ExternalAccessCheckOnDedicatedEnabledOverride()); } return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditExternalAccessCheckOnDedicated.Enabled); }
public static bool IsAdminAuditEventLogThrottlingEnabled() { if (AuditFeatureManager.AdminAuditEventLogThrottlingOverride != null) { return(AuditFeatureManager.AdminAuditEventLogThrottlingOverride()); } return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditEventLogThrottling.Enabled); }
public static bool IsAdminAuditCmdletBlockListEnabled() { if (AuditFeatureManager.adminAuditCmdletBlockListOverride != null) { return(AuditFeatureManager.adminAuditCmdletBlockListOverride()); } return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditCmdletBlockList.Enabled); }
public static bool IsFolderBindExtendedThrottlingEnabled() { if (AuditFeatureManager.folderBindExtendedThrottlingOverride != null) { return(AuditFeatureManager.folderBindExtendedThrottlingOverride()); } return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.FolderBindExtendedThrottling.Enabled); }
private static bool?ReadTertiaryValueFromRegistry(string registrySubkeyPath, string valueName) { switch (AuditFeatureManager.IsFeatureEnabled(registrySubkeyPath, valueName)) { case AuditFeatureManager.Tertiary.False: return(new bool?(false)); case AuditFeatureManager.Tertiary.True: return(new bool?(true)); default: return(null); } }
public static bool IsPartitionedMailboxLogEnabled(IExchangePrincipal exchangePrincipal) { if (AuditFeatureManager.partitionedMailboxLogOverride != null) { return(AuditFeatureManager.partitionedMailboxLogOverride()); } if (AuditFeatureManager.isPartitionedMailboxLogEnabled == null) { bool?flag = AuditFeatureManager.ReadTertiaryValueFromRegistry("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Audit\\Parameters", "PartitionedMailboxLogEnabled"); if (flag != null) { AuditFeatureManager.isPartitionedMailboxLogEnabled = flag; } else { AuditFeatureManager.isPartitionedMailboxLogEnabled = new bool?(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.PartitionedMailboxAuditLogs.Enabled); } } return(AuditFeatureManager.isPartitionedMailboxLogEnabled.Value); }
public static bool IsMailboxAuditLocalQueueEnabled(IExchangePrincipal exchangePrincipal) { return(AuditFeatureManager.IsEnabled(AuditFeatureManager.MailboxAuditLocalQueueOverride, AuditFeatureManager.isMailboxAuditLocalQueueEnabled, exchangePrincipal, (VariantConfigurationSnapshot.IpaedSettingsIni settings) => settings.MailboxAuditLocalQueue)); }
public static bool IsPartitionedAdminLogEnabled(IExchangePrincipal exchangePrincipal) { return(AuditFeatureManager.IsEnabled(AuditFeatureManager.partitionedAuditLogOverride, AuditFeatureManager.isPartitionedAdminLogEnabled, exchangePrincipal, (VariantConfigurationSnapshot.IpaedSettingsIni settings) => settings.PartitionedAdminAuditLogs)); }
internal static void TestOnlyResetPartitionedAdminLogEnabled() { AuditFeatureManager.isPartitionedAdminLogEnabled = new Lazy <bool?>(() => AuditFeatureManager.ReadTertiaryValueFromRegistry("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Audit\\Parameters", "PartitionedAdminLogEnabled"), LazyThreadSafetyMode.ExecutionAndPublication); }