Esempio n. 1
0
        protected override IConfigurable PrepareDataObject()
        {
            RuleStorage ruleStorage = (RuleStorage)base.PrepareDataObject();

            ruleStorage.Name = base.Name;
            ruleStorage.SetId(((ADObjectId)this.policyStorage.Identity).GetChildId(base.Name));
            ruleStorage.MasterIdentity = Guid.NewGuid();
            PsDlpComplianceRule psDlpComplianceRule = new PsDlpComplianceRule(ruleStorage)
            {
                Comment  = base.Comment,
                Disabled = base.Disabled,
                Mode     = Mode.Enforce,
                Policy   = Utils.GetUniversalIdentity(this.policyStorage),
                Workload = this.policyStorage.Workload,
                ContentPropertyContainsWords        = this.ContentPropertyContainsWords,
                ContentContainsSensitiveInformation = this.ContentContainsSensitiveInformation,
                AccessScopeIs = this.AccessScopeIs,
                BlockAccess   = this.BlockAccess
            };

            if (!psDlpComplianceRule.GetTaskActions().Any <PsComplianceRuleActionBase>())
            {
                throw new RuleContainsNoActionsException(psDlpComplianceRule.Name);
            }
            ADObjectId adobjectId;

            base.TryGetExecutingUserId(out adobjectId);
            psDlpComplianceRule.UpdateStorageProperties(this, base.DataSession as IConfigurationSession, true);
            return(ruleStorage);
        }
Esempio n. 2
0
        protected override IConfigurable PrepareDataObject()
        {
            RuleStorage ruleStorage = (RuleStorage)base.PrepareDataObject();

            ruleStorage.Name = base.Name;
            ruleStorage.SetId(((ADObjectId)this.policyStorage.Identity).GetChildId(base.Name));
            PsHoldRule psHoldRule = new PsHoldRule(ruleStorage)
            {
                Comment                 = base.Comment,
                Disabled                = base.Disabled,
                Mode                    = Mode.Enforce,
                Policy                  = Utils.GetUniversalIdentity(this.policyStorage),
                Workload                = this.policyStorage.Workload,
                ContentMatchQuery       = this.ContentMatchQuery,
                ContentDateFrom         = this.ContentDateFrom,
                ContentDateTo           = this.ContentDateTo,
                HoldContent             = this.HoldContent,
                HoldDurationDisplayHint = this.HoldDurationDisplayHint
            };

            if (!psHoldRule.GetTaskActions().Any <PsComplianceRuleActionBase>())
            {
                throw new RuleContainsNoActionsException(psHoldRule.Name);
            }
            ADObjectId adobjectId;

            base.TryGetExecutingUserId(out adobjectId);
            psHoldRule.UpdateStorageProperties(this, base.DataSession as IConfigurationSession, true);
            return(ruleStorage);
        }
        public static RuleStorage ToRuleStorage(RuleConfiguration rule)
        {
            RuleStorage ruleStorage = new RuleStorage();

            ruleStorage[ADObjectSchema.OrganizationalUnitRoot] = new ADObjectId(rule.TenantId);
            ruleStorage.Name = rule.Name;
            ruleStorage.SetId((ADObjectId)DalHelper.ConvertFromStoreObject(rule.ObjectId, typeof(ADObjectId)));
            UnifiedPolicyStorageFactory.CopyPropertiesToStorage <RuleConfiguration>(new TenantSettingFacade <RuleStorage>(ruleStorage), rule);
            return(ruleStorage);
        }
Esempio n. 4
0
        protected override IConfigurable PrepareDataObject()
        {
            RuleStorage ruleStorage = (RuleStorage)base.PrepareDataObject();

            ruleStorage.Name = this.ruleName;
            ruleStorage.SetId(((ADObjectId)this.policyStorage.Identity).GetChildId(this.ruleName));
            DeviceRuleBase deviceRuleBase = this.CreateDeviceRule(ruleStorage);

            deviceRuleBase.Policy       = Utils.GetUniversalIdentity(this.policyStorage);
            deviceRuleBase.Workload     = this.policyStorage.Workload;
            deviceRuleBase.TargetGroups = this.TargetGroups;
            this.SetPropsOnDeviceRule(deviceRuleBase);
            deviceRuleBase.UpdateStorageProperties(this, base.DataSession as IConfigurationSession, true);
            return(ruleStorage);
        }
        protected override IConfigurable PrepareDataObject()
        {
            RuleStorage ruleStorage = (RuleStorage)base.PrepareDataObject();

            ruleStorage.Name = this.Name;
            ruleStorage.SetId(((ADObjectId)this.policyStorage.Identity).GetChildId(this.Name));
            AuditConfigurationRule auditConfigurationRule = new AuditConfigurationRule(ruleStorage)
            {
                Policy         = Utils.GetUniversalIdentity(this.policyStorage),
                Workload       = this.policyStorage.Workload,
                AuditOperation = this.AuditOperation
            };

            auditConfigurationRule.UpdateStorageProperties();
            return(ruleStorage);
        }