예제 #1
0
        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));
        }
예제 #2
0
 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);
 }
예제 #3
0
 public static bool IsExternalAccessCheckOnDedicatedEnabled()
 {
     if (AuditFeatureManager.ExternalAccessCheckOnDedicatedEnabledOverride != null)
     {
         return(AuditFeatureManager.ExternalAccessCheckOnDedicatedEnabledOverride());
     }
     return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditExternalAccessCheckOnDedicated.Enabled);
 }
예제 #4
0
 public static bool IsAdminAuditEventLogThrottlingEnabled()
 {
     if (AuditFeatureManager.AdminAuditEventLogThrottlingOverride != null)
     {
         return(AuditFeatureManager.AdminAuditEventLogThrottlingOverride());
     }
     return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditEventLogThrottling.Enabled);
 }
예제 #5
0
 public static bool IsAdminAuditCmdletBlockListEnabled()
 {
     if (AuditFeatureManager.adminAuditCmdletBlockListOverride != null)
     {
         return(AuditFeatureManager.adminAuditCmdletBlockListOverride());
     }
     return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.AdminAuditCmdletBlockList.Enabled);
 }
예제 #6
0
 public static bool IsFolderBindExtendedThrottlingEnabled()
 {
     if (AuditFeatureManager.folderBindExtendedThrottlingOverride != null)
     {
         return(AuditFeatureManager.folderBindExtendedThrottlingOverride());
     }
     return(VariantConfiguration.InvariantNoFlightingSnapshot.Ipaed.FolderBindExtendedThrottling.Enabled);
 }
예제 #7
0
        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);
            }
        }
예제 #8
0
 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);
 }
예제 #9
0
 public static bool IsMailboxAuditLocalQueueEnabled(IExchangePrincipal exchangePrincipal)
 {
     return(AuditFeatureManager.IsEnabled(AuditFeatureManager.MailboxAuditLocalQueueOverride, AuditFeatureManager.isMailboxAuditLocalQueueEnabled, exchangePrincipal, (VariantConfigurationSnapshot.IpaedSettingsIni settings) => settings.MailboxAuditLocalQueue));
 }
예제 #10
0
 public static bool IsPartitionedAdminLogEnabled(IExchangePrincipal exchangePrincipal)
 {
     return(AuditFeatureManager.IsEnabled(AuditFeatureManager.partitionedAuditLogOverride, AuditFeatureManager.isPartitionedAdminLogEnabled, exchangePrincipal, (VariantConfigurationSnapshot.IpaedSettingsIni settings) => settings.PartitionedAdminAuditLogs));
 }
예제 #11
0
 internal static void TestOnlyResetPartitionedAdminLogEnabled()
 {
     AuditFeatureManager.isPartitionedAdminLogEnabled = new Lazy <bool?>(() => AuditFeatureManager.ReadTertiaryValueFromRegistry("SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Audit\\Parameters", "PartitionedAdminLogEnabled"), LazyThreadSafetyMode.ExecutionAndPublication);
 }