示例#1
0
 private smf_item CreateFakeItemToCollect()
 {
     return(new smf_item()
     {
         fmri = OvalHelper.CreateItemEntityWithStringValue("davi")
     });
 }
        private ItemType CreateTextFileContentItemType(string filepath, string pattern, int instance, string text)
        {
            var status = StatusEnumeration.exists;
            EntityItemAnySimpleType textEntity = null;

            if (string.IsNullOrEmpty(text))
            {
                status = StatusEnumeration.doesnotexist;
            }
            else
            {
                textEntity = OvalHelper.CreateEntityItemAnyTypeWithValue(text);
            }

            return(new textfilecontent_item()
            {
                status = status,
                pattern = OvalHelper.CreateItemEntityWithStringValue(pattern),
                instance = OvalHelper.CreateItemEntityWithIntegerValue(instance.ToString()),
                filename = OvalHelper.CreateItemEntityWithStringValue(Path.GetFileName(filepath)),
                path = OvalHelper.CreateItemEntityWithStringValue(Path.GetDirectoryName(filepath)),
                filepath = OvalHelper.CreateItemEntityWithStringValue(filepath),
                text = textEntity
            });
        }
示例#3
0
        public void Should_be_possible_to_collect_a_UserSID55Item()
        {
            var fakeItemToCollect = new user_sid_item()
            {
                status   = StatusEnumeration.notcollected,
                user_sid = OvalHelper.CreateItemEntityWithStringValue("S-1-18")
            };
            var fakeAccount     = GetFakeWindowsAccount(true, new string[] { "S-1-5-32-500", "S-1-5-32-501" });
            var objectCollector = CreateMockedObjectCollector(fakeAccount);

            var collectedItems = objectCollector.CollectDataForSystemItem(fakeItemToCollect);

            Assert.IsNotNull(collectedItems, "The result of collect cannot be null.");
            Assert.AreEqual(1, collectedItems.Count(), "Unexpected number of collected objects was found.");
            Assert.IsNotNull(collectedItems.ElementAt(0).ExecutionLog, "The execution log for collected item cannot be null.");

            var collectedItem = (user_sid_item)collectedItems.ElementAt(0).ItemType;

            Assert.AreEqual(StatusEnumeration.exists, collectedItem.status, "Invalid Item Type Status was found.");
            Assert.AreEqual("S-1-18", collectedItem.user_sid.Value, "Unexpected item type value was found.");
            Assert.AreEqual("1", collectedItem.enabled.Value, "Unexpected item type value was found.");
            Assert.AreEqual(2, collectedItem.group_sid.Count(), "Unexpected number of group SIDs was found in collected user_sid_item.");
            Assert.AreEqual("S-1-5-32-500", collectedItem.group_sid.ElementAt(0).Value, "A unexpected group SID was found in collected user_sid_item.");
            Assert.AreEqual("S-1-5-32-501", collectedItem.group_sid.ElementAt(1).Value, "A unexpected group SID was found in collected user_sid_item.");
        }
示例#4
0
 private user_sid_item CreateFakeUserSIDItem()
 {
     return(new user_sid_item()
     {
         user_sid = OvalHelper.CreateItemEntityWithStringValue("S-1-15-18")
     });
 }
        private void CreateFileAuditedPermissions53ItemType(fileauditedpermissions_item item, string filepath, string trusteeSID)
        {
            var defaultAuditEntityStatus = AuditEventStatus.AUDIT_NONE.ToString();

            item.filepath               = OvalHelper.CreateItemEntityWithStringValue(filepath);
            item.path                   = OvalHelper.CreateItemEntityWithStringValue(Path.GetDirectoryName(filepath));
            item.filename               = OvalHelper.CreateItemEntityWithStringValue(Path.GetFileName(filepath));
            item.trustee_sid            = OvalHelper.CreateItemEntityWithStringValue(trusteeSID);
            item.access_system_security = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_append_data       = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_delete_child      = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_execute           = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_read_attributes   = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_read_data         = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_read_ea           = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_write_attributes  = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_write_data        = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.file_write_ea          = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.generic_all            = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.generic_execute        = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.generic_read           = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.generic_write          = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.standard_delete        = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.standard_read_control  = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.standard_synchronize   = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.standard_write_dac     = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
            item.standard_write_owner   = OvalHelper.CreateAuditItemTypeWithValue(defaultAuditEntityStatus);
        }
示例#6
0
        public void Should_be_possible_to_collect_a_simple_groupSID_object()
        {
            var fakeItemToCollect = new group_sid_item()
            {
                group_sid = OvalHelper.CreateItemEntityWithStringValue("S-1-32-500")
            };
            var fakeGroupAccount = new WindowsGroupAccount()
            {
                UserSIDs = new string[] { "S-1-0", "S-1-1" }.ToList()
            };
            GroupSIDObjectCollector systemDataSource = this.createMockedGroupSIDSystemDataSource(fakeGroupAccount);

            var result = systemDataSource.CollectDataForSystemItem(fakeItemToCollect);

            Assert.IsNotNull(result, "The result of collect cannot be null.");
            Assert.AreEqual(1, result.Count(), "Unexpected number of collected objects was found.");
            Assert.IsNotNull(result.ElementAt(0).ExecutionLog, "The execution log for collected item cannot be null.");

            group_sid_item collectedItem = (group_sid_item)result.ElementAt(0).ItemType;

            Assert.AreEqual(StatusEnumeration.exists, collectedItem.status, "Invalid Item Type Status was found.");
            Assert.AreEqual("S-1-32-500", collectedItem.group_sid.Value, "Unexpected item type value was found.");
            Assert.AreEqual(2, collectedItem.user_sid.Count(), "Unexpected number of user SIDs was found in collected group_sid_item.");
            Assert.AreEqual("S-1-0", collectedItem.user_sid.ElementAt(0).Value, "A unexpected group SID was found in collected group_sid_item.");
            Assert.AreEqual("S-1-1", collectedItem.user_sid.ElementAt(1).Value, "A unexpected group SID was found in collected group_sid_item.");
        }
示例#7
0
        public static Dictionary <string, EntitySimpleBaseType> GetFileContentEntitiesFromObjectType(textfilecontent54_object textFileContentObject)
        {
            string fileName = textfilecontent54_ItemsChoices.filename.ToString();
            string filePath = textfilecontent54_ItemsChoices.filepath.ToString();
            string path     = textfilecontent54_ItemsChoices.path.ToString();
            string pattern  = textfilecontent54_ItemsChoices.pattern.ToString();
            string instance = textfilecontent54_ItemsChoices.instance.ToString();

            object[] allEntities    = textFileContentObject.Items.ToArray();
            string[] allEntityNames = textFileContentObject.Textfilecontent54ItemsElementName.Select(i => i.ToString()).ToArray <String>();

            Dictionary <String, EntitySimpleBaseType> fileContentEntities = new Dictionary <string, EntitySimpleBaseType>();

            if (textFileContentObject.IsFilePathDefined())
            {
                fileContentEntities.Add(filePath, OvalHelper.GetEntityObjectByName(filePath, allEntities, allEntityNames));
            }
            else
            {
                fileContentEntities.Add(fileName, OvalHelper.GetEntityObjectByName(fileName, allEntities, allEntityNames));
                fileContentEntities.Add(path, OvalHelper.GetEntityObjectByName(path, allEntities, allEntityNames));
            }

            fileContentEntities.Add(pattern, OvalHelper.GetEntityObjectByName(pattern, allEntities, allEntityNames));
            fileContentEntities.Add(instance, OvalHelper.GetEntityObjectIntTypeByName(instance, allEntities, allEntityNames));
            return(fileContentEntities);
        }
示例#8
0
        protected override IEnumerable <CollectedItem> collectDataForSystemItem(ItemType systemItem)
        {
            this.CreateSMFCollectorInstance();

            var smfItem = (smf_item)systemItem;

            try
            {
                var collectedSmf = this.TryToCollectSMF(smfItem.fmri.Value);
                smfItem.service_name  = OvalHelper.CreateItemEntityWithStringValue(collectedSmf.ServiceName);
                smfItem.service_state = new EntityItemSmfServiceStateType()
                {
                    Value = collectedSmf.ServiceState
                };
                smfItem.protocol = new EntityItemSmfProtocolType()
                {
                    Value = collectedSmf.Protocol
                };
                smfItem.server_executable = OvalHelper.CreateItemEntityWithStringValue(collectedSmf.ServerExecutable);
                smfItem.server_arguements = OvalHelper.CreateItemEntityWithStringValue(collectedSmf.ServerArgs);
                smfItem.exec_as_user      = OvalHelper.CreateItemEntityWithStringValue(collectedSmf.ExecAsUser);
            }
            catch (NoSMFDataException)
            {
                ExecutionLogBuilder.AddInfo("An error occurred while trying to collect smf_object");
                smfItem.status      = StatusEnumeration.error;
                smfItem.message     = MessageType.FromErrorString("The fmri format is invalid.");
                smfItem.fmri.status = StatusEnumeration.error;
            }

            return(new ItemTypeHelper().CreateCollectedItemsWithOneItem(smfItem, BuildExecutionLog()));
        }
示例#9
0
        protected override IEnumerable <Common.BasicClasses.CollectedItem> collectDataForSystemItem(OVAL.SystemCharacteristics.ItemType systemItem)
        {
            CiscoIOSVersion myVersion = CiscoIOSHelper.CiscoGetVersion(TelnetConnection);

            version_item vItem = (version_item)systemItem;

            vItem.mainline_rebuild = OvalHelper.CreateItemEntityWithStringValue(myVersion.MainlineRebuild);
            vItem.major_release    = OvalHelper.CreateItemEntityWithStringValue(myVersion.MajorRelease);
            vItem.major_version    = OvalHelper.CreateItemEntityWithIntegerValue(myVersion.MajorVersion.ToString());
            vItem.minor_version    = OvalHelper.CreateItemEntityWithIntegerValue(myVersion.MinorVersion.ToString());
            if (myVersion.Rebuild >= 0)
            {
                vItem.rebuild = OvalHelper.CreateItemEntityWithIntegerValue(myVersion.Rebuild.ToString());
            }
            if (myVersion.Release >= 0)
            {
                vItem.release = OvalHelper.CreateItemEntityWithIntegerValue(myVersion.Release.ToString());
            }
            vItem.subrebuild       = OvalHelper.CreateItemEntityWithStringValue(myVersion.SubRebuild);
            vItem.train_identifier = OvalHelper.CreateItemEntityWithStringValue(myVersion.TrainIdentifier);
            vItem.train_number     = OvalHelper.CreateItemEntityWithStringValue(myVersion.TrainNumber);
            vItem.version_string   = new EntityItemIOSVersionType {
                Value = myVersion.VersionString
            };

            return(new ItemTypeHelper().CreateCollectedItemsWithOneItem(systemItem, BuildExecutionLog()));
        }
示例#10
0
 private environmentvariable_item CreateFakeEnvironmentVariableItem(string fakeVariable)
 {
     return(new environmentvariable_item()
     {
         name = OvalHelper.CreateItemEntityWithStringValue(fakeVariable)
     });
 }
示例#11
0
        protected override IEnumerable <CollectedItem> collectDataForSystemItem(ItemType systemItem)
        {
            this.CreateRPMInfosCollectorInstance();

            var rpmInfoItem = (rpminfo_item)systemItem;

            try
            {
                var collectedVariableValue = this.TryToCollectRPMInfo(rpmInfoItem.name.Value);

                rpmInfoItem.arch  = OvalHelper.CreateItemEntityWithStringValue(collectedVariableValue.Arch);
                rpmInfoItem.epoch = new rpminfo_itemEpoch()
                {
                    Value = collectedVariableValue.Epoch.ToString()
                };
                rpmInfoItem.release = new rpminfo_itemRelease()
                {
                    Value = collectedVariableValue.Release
                };
                rpmInfoItem.version = new rpminfo_itemVersion()
                {
                    Value = collectedVariableValue.Version
                };
                rpmInfoItem.evr = new EntityItemEVRStringType()
                {
                    Value = collectedVariableValue.Evr
                };
            }
            catch (PackageNotInstalledException)
            {
                base.SetDoesNotExistStatusForItemType(systemItem, rpmInfoItem.name.Value);
            }
            return(new ItemTypeHelper().CreateCollectedItemsWithOneItem(systemItem, BuildExecutionLog()));
        }
示例#12
0
        private regkeyeffectiverights_item CreateItemTypeFromWinACE(object collectedData, string regHive, string regKey, string collectedSid)
        {
            WMIWinACE systemData = (WMIWinACE)collectedData;

            return(new regkeyeffectiverights_item()
            {
                status = StatusEnumeration.exists,
                hive = new EntityItemRegistryHiveType()
                {
                    Value = regHive
                },
                key = OvalHelper.CreateItemEntityWithStringValue(regKey),
                trustee_sid = OvalHelper.CreateItemEntityWithStringValue(collectedSid),
                access_system_security = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.ACCESS_SYSTEM_SECURITY),
                standard_delete = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.DELETE),
                standard_read_control = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.READ_CONTROL),
                standard_synchronize = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.SYNCHRONIZE),
                standard_write_dac = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.WRITE_DAC),
                standard_write_owner = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.WRITE_OWNER),
                generic_all = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.GENERIC_ALL),
                generic_execute = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.GENERIC_EXECUTE),
                generic_read = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.GENERIC_READ),
                generic_write = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.GENERIC_WRITE),
                key_create_link = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_CREATE_LINK),
                key_create_sub_key = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_CREATE_SUB_KEY),
                key_enumerate_sub_keys = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_ENUMERATE_SUB_KEYS),
                key_notify = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_NOTIFY),
                key_query_value = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_QUERY_VALUE),
                key_set_value = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_SET_VALUE),
                key_wow64_32key = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_WOW64_32KEY),
                key_wow64_64key = OvalHelper.CreateBooleanEntityItemFromBoolValue(systemData.KEY_WOW64_64KEY)
            });
        }
示例#13
0
 private ItemType createFakeSidItem()
 {
     return(new sid_item()
     {
         trustee_name = OvalHelper.CreateItemEntityWithStringValue("lfernandes")
     });
 }
示例#14
0
 private sid_item CreateFakeSidItem()
 {
     return(new sid_item()
     {
         trustee_name = OvalHelper.CreateItemEntityWithStringValue("Administrator")
     });
 }
 private textfilecontent_item GetTextFileContentItem()
 {
     return(new textfilecontent_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue(FAKE_FILEPATH)
     });
 }
 private ItemType GetFakeEnvironmentVariableItem()
 {
     return(new environmentvariable_item()
     {
         name = OvalHelper.CreateItemEntityWithStringValue(FAKE_ENVIRONMENT_VARIABLE_NAME)
     });
 }
        public void Should_be_possible_to_collect_a_wmi57_item()
        {
            var fakeWmi57ItemToCollect = new wmi57_item()
            {
                @namespace = OvalHelper.CreateItemEntityWithStringValue("root\\cimv2"), wql = OvalHelper.CreateItemEntityWithStringValue("Select Name, Domain From Win32_Account")
            };
            var wmi57ObjectCollector = CreateWmi57ObjectCollectorWithAFakeWmiDataProvider();

            var collectedItems = wmi57ObjectCollector.CollectDataForSystemItem(fakeWmi57ItemToCollect);

            Assert.AreEqual(1, collectedItems.Count());
            var collectedItem = (wmi57_item)collectedItems.Single().ItemType;

            Assert.AreEqual(StatusEnumeration.exists, collectedItem.status);

            Assert.AreEqual("root\\cimv2", [email protected]);
            Assert.AreEqual("Select Name, Domain From Win32_Account", collectedItem.wql.Value);
            Assert.AreEqual(2, collectedItem.result.Count());

            Assert.AreEqual(2, collectedItem.result[0].field.Count());
            Assert.AreEqual(ComplexDatatypeEnumeration.record, collectedItem.result[0].datatype);
            Assert.AreEqual("name", collectedItem.result[0].field[0].name);
            Assert.AreEqual("cpaiva", collectedItem.result[0].field[0].Value);
            Assert.AreEqual("domain", collectedItem.result[0].field[1].name);
            Assert.AreEqual("mss", collectedItem.result[0].field[1].Value);

            Assert.AreEqual(2, collectedItem.result[1].field.Count());
            Assert.AreEqual(ComplexDatatypeEnumeration.record, collectedItem.result[1].datatype);
            Assert.AreEqual("name", collectedItem.result[1].field[0].name);
            Assert.AreEqual("jcastro", collectedItem.result[1].field[0].Value);
            Assert.AreEqual("domain", collectedItem.result[1].field[1].name);
            Assert.AreEqual("local", collectedItem.result[1].field[1].Value);
        }
 private rpminfo_item CreateFakeRpmInfoItem()
 {
     return(new rpminfo_item()
     {
         name = OvalHelper.CreateItemEntityWithStringValue("fakePackage")
     });
 }
示例#19
0
        protected override IEnumerable <CollectedItem> collectDataForSystemItem(ItemType systemItem)
        {
            CreatePasswordItemsCollectorInstance();
            var passwordItem = (password_item)systemItem;

            try
            {
                var passwordInfo = this.TryToCollectPasswordItem(passwordItem.username.Value);
                passwordItem.gcos       = OvalHelper.CreateItemEntityWithStringValue(passwordInfo.Gecos);
                passwordItem.group_id   = OvalHelper.CreateItemEntityWithIntegerValue(passwordInfo.Gid);
                passwordItem.home_dir   = OvalHelper.CreateItemEntityWithStringValue(passwordInfo.HomeDir);
                passwordItem.last_login = new EntityItemIntType()
                {
                    status = StatusEnumeration.notcollected
                };
                passwordItem.login_shell = OvalHelper.CreateItemEntityWithStringValue(passwordInfo.Shell);
                passwordItem.password    = OvalHelper.CreateItemEntityWithStringValue(passwordInfo.Password);
                passwordItem.user_id     = OvalHelper.CreateItemEntityWithIntegerValue(passwordInfo.Uid);
            }
            catch (PasswordItemNotExistsException)
            {
                passwordItem.status = StatusEnumeration.doesnotexist;
            }


            return(new ItemTypeHelper().CreateCollectedItemsWithOneItem(systemItem, BuildExecutionLog()));
        }
示例#20
0
 private OVAL.SystemCharacteristics.Unix.process_item CreateProcessItem(UnixProcessInfo targetProcess)
 {
     return(new OVAL.SystemCharacteristics.Unix.process_item()
     {
         command = OvalHelper.CreateItemEntityWithStringValue(targetProcess.Command),
         pid = OvalHelper.CreateItemEntityWithIntegerValue(targetProcess.Pid.ToString()),
         ppid = OvalHelper.CreateItemEntityWithIntegerValue(targetProcess.PPid.ToString()),
         priority = OvalHelper.CreateItemEntityWithIntegerValue(targetProcess.Prio.ToString()),
         tty = OvalHelper.CreateItemEntityWithStringValue(targetProcess.Tty),
         user_id = OvalHelper.CreateItemEntityWithIntegerValue(targetProcess.User),
         start_time = new OVAL.SystemCharacteristics.EntityItemStringType()
         {
             status = OVAL.SystemCharacteristics.StatusEnumeration.notcollected
         },
         exec_time = new OVAL.SystemCharacteristics.EntityItemStringType()
         {
             status = OVAL.SystemCharacteristics.StatusEnumeration.notcollected
         },
         ruid = new OVAL.SystemCharacteristics.EntityItemIntType()
         {
             status = OVAL.SystemCharacteristics.StatusEnumeration.notcollected
         },
         scheduling_class = new OVAL.SystemCharacteristics.EntityItemStringType()
         {
             status = OVAL.SystemCharacteristics.StatusEnumeration.notcollected
         }
     });
 }
        public void Should_be_possible_to_get_a_registryObject_with_his_variable_processed_with_multiple_values()
        {
            oval_definitions definitions        = ProbeHelper.GetFakeOvalDefinitions(DEFINITIONS_WITH_CONST_VARIABLES);
            registry_object  ovalRegistryObject = (registry_object)ProbeHelper.GetOvalComponentByOvalID(definitions, OBJ_3000_ID);

            Assert.IsNotNull(ovalRegistryObject, "the oval registry object is not exists in the fakeDefinitions");

            Dictionary <String, EntityObjectStringType> allRegistryEntities = OvalHelper.GetRegistryEntitiesFromObjectType(ovalRegistryObject);
            string expectedHiveValue = allRegistryEntities[registry_object_ItemsChoices.hive.ToString()].Value;
            string expectedNameValue = allRegistryEntities[registry_object_ItemsChoices.name.ToString()].Value;

            string[]           variableValues     = new string[] { VAR_3000_VALUE_1, VAR_3000_VALUE_2 };
            VariablesEvaluated variablesEvaluated = VariableHelper.CreateVariableWithMultiplesValue(OBJ_3000_ID, VAR_3000_ID, variableValues);
            RegistryEntityVariableEvaluator registryEntityVariableEvaluator = new RegistryEntityVariableEvaluator(variablesEvaluated);


            IEnumerable <RegistryObject> registries = registryEntityVariableEvaluator.ProcessVariableForRegistryObject(ovalRegistryObject);


            Assert.AreEqual(2, registries.Count(), "the quantity of registries is not expected");
            Assert.AreEqual(expectedHiveValue, registries.ElementAt(0).Hive, "the hive value is not expected");
            Assert.AreEqual(VAR_3000_VALUE_1, registries.ElementAt(0).Key, "the key value is not expected");
            Assert.AreEqual(expectedNameValue, registries.ElementAt(0).Name, "the name value is not expected");

            Assert.AreEqual(expectedHiveValue, registries.ElementAt(1).Hive, "the hive value is not expected");
            Assert.AreEqual(VAR_3000_VALUE_2, registries.ElementAt(1).Key, "the key value is not expected");
            Assert.AreEqual(expectedNameValue, registries.ElementAt(1).Name, "the name value is not expected");
        }
示例#22
0
 private xmlfilecontent_item CreateXmlFileItem(string filepath, string xpath)
 {
     return(new xmlfilecontent_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue(filepath),
         xpath = OvalHelper.CreateItemEntityWithStringValue(xpath)
     });
 }
示例#23
0
 private ItemType CreateUserItem(string userEntityValue)
 {
     return(new user_item()
     {
         status = StatusEnumeration.notcollected,
         user = OvalHelper.CreateItemEntityWithStringValue(userEntityValue)
     });
 }
 private ItemType NewFakeWmi57Item()
 {
     return(new wmi57_item()
     {
         @namespace = OvalHelper.CreateItemEntityWithStringValue("root\\cimv2"),
         wql = OvalHelper.CreateItemEntityWithStringValue("Select * from Win32_OperatingSystem")
     });
 }
示例#25
0
 private fileauditedpermissions_item CreateXmlFileItem(string filepath, string trusteeSID)
 {
     return(new fileauditedpermissions_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue(filepath),
         trustee_sid = OvalHelper.CreateItemEntityWithStringValue(trusteeSID)
     });
 }
示例#26
0
 private wmi_item CreateWmiItem(string nameSpace, string wql)
 {
     return(new wmi_item()
     {
         @namespace = OvalHelper.CreateItemEntityWithStringValue(nameSpace),
         wql = OvalHelper.CreateItemEntityWithStringValue(wql)
     });
 }
示例#27
0
 private group_sid_item CreateFakeGroupSIDItemType()
 {
     return(new group_sid_item()
     {
         group_sid = OvalHelper.CreateItemEntityWithStringValue("S-1-32"),
         user_sid = new EntityItemStringType[] { OvalHelper.CreateItemEntityWithStringValue("S-1-0"), OvalHelper.CreateItemEntityWithStringValue("S-1-1") }
     });
 }
示例#28
0
 private runlevel_item CreateFakeItemToCollect()
 {
     return(new runlevel_item()
     {
         service_name = OvalHelper.CreateItemEntityWithStringValue("ssh"),
         runlevel = OvalHelper.CreateItemEntityWithStringValue("2")
     });
 }
 private fileauditedpermissions_item CreateFakeFileAuditedPermissionsItem()
 {
     return(new fileauditedpermissions_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue(FAKE_FILEPATH),
         trustee_sid = OvalHelper.CreateItemEntityWithStringValue(FAKE_SID)
     });
 }
示例#30
0
 private xmlfilecontent_item CreateFakeXmlFileContentItem()
 {
     return(new xmlfilecontent_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue("c:\\temp"),
         xpath = OvalHelper.CreateItemEntityWithStringValue("//generator/product_name")
     });
 }