Confdump Agent  1.4.0
WmiLists.cpp
Go to the documentation of this file.
00001 /* 
00002  * Confdump-Agent - Dump static and runtime system configuration
00003  * Copyright (C) 2009-2012  Straton IT, SAS
00004  * 
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  * 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #include "Confdump/System/Wmi/WmiLists.hpp"
00019 
00020 namespace Confdump
00021 {
00022 namespace System
00023 {
00024 namespace Wmi
00025 {
00026 
00027 QStringList WmiLists::nsWhiteList_;
00028 QStringList WmiLists::tableBlackList_;
00029 
00030 WmiLists::WmiLists()
00031 {
00032         if ( tableBlackList_.empty() )
00033         {
00034                 tableBlackList_
00035                         << "root\\cimv2.cim_managedsystemelement"
00036                         << "root\\cimv2.cim_logicalelement"
00037                         << "root\\cimv2.cim_logicalfile"
00038                         << "root\\cimv2.cim_devicefile"
00039                         << "root\\cimv2.cim_directory"
00040                         << "root\\cimv2.win32_directory"
00041                         << "root\\cimv2.cim_datafile"
00042                         << "root\\cimv2.win32_shortcutfile"
00043                         << "root\\cimv2.win32_securitysettinggroup"
00044                         << "root\\cimv2.win32_logicalfilegroup"
00045                         << "root\\cimv2.cim_statisticalinformation"
00046                         << "root\\cimv2.win32_perf"
00047                         << "root\\cimv2.win32_perfrawdata"
00048                         << "root\\cimv2.win32_perfformatteddata"
00049                         << "root\\cimv2.win32_subdirectory"
00050                         << "root\\cimv2.cim_setting"
00051                         << "root\\cimv2.win32_securitysetting"
00052                         << "root\\cimv2.win32_logicalfilesecuritysetting"
00053                         << "root\\cimv2.win32_logicalsharesecuritysetting"
00054                         << "root\\cimv2.win32_property"
00055                         << "root\\cimv2.win32_softwarefeaturecheck"
00056                         << "root\\cimv2.cim_softwareelementchecks"
00057                         << "root\\cimv2.win32_softwareelementcheck"
00058                         << "root\\cimv2.win32_settingcheck"
00059                         << "root\\cimv2.win32_actioncheck"
00060                         << "root\\cimv2.cim_check"
00061                         << "root\\cimv2.cim_versioncompatibilitycheck"
00062                         << "root\\cimv2.cim_memorycheck"
00063                         << "root\\cimv2.cim_osversioncheck"
00064                         << "root\\cimv2.cim_softwareelementversioncheck"
00065                         << "root\\cimv2.cim_diskspacecheck"
00066                         << "root\\cimv2.cim_swapspacecheck"
00067                         << "root\\cimv2.cim_settingcheck"
00068                         << "root\\cimv2.win32_productcheck"
00069                         << "root\\cimv2.win32_checkcheck"
00070                         << "root\\cimv2.win32_pingstatus"
00071                         << "root\\cimv2.win32_securitysettingaccess"
00072                         << "root\\cimv2.win32_logicalfileaccess"
00073                         << "root\\cimv2.cim_component"
00074                         << "root\\cimv2.win32_securitysettingowner"
00075                         << "root\\cimv2.win32_logicalfileowner"
00076                         << "root\\cimv2.win32_tssessiondirectorysetting"
00077                         << "root\\cimv2.cim_directorycontainsfile"
00078                         << "root\\cimv2.cim_elementsetting"
00079                         << "root\\cimv2.win32_systemsetting"
00080                         << "root\\cimv2.win32_securitysettingofobject"
00081                         << "root\\cimv2.win32_securitysettingoflogicalfile"
00082                         << "root\\cimv2.win32_securitysettingauditing"
00083                         << "root\\cimv2.win32_logicalfileauditing"
00084                 ;
00085         }
00086         
00087         if ( nsWhiteList_.empty() )
00088         {
00089                 nsWhiteList_
00090                         << "root\\cimv2"
00091                         << "root\\microsoftiisv2"
00092                         << "root\\securitycenter"
00093                 ;
00094         }
00095 }
00096 
00097 bool WmiLists::isTableAllowed( QString ns, QString table ) const
00098 {
00099         QString qualifiedName = QString( "%1.%2" ).arg( ns ).arg( table );
00100         return !tableBlackList_.contains( qualifiedName.toLower() );
00101 }
00102 
00103 bool WmiLists::isNamespaceAllowed( QString ns ) const
00104 {
00105         return nsWhiteList_.contains( ns.toLower() );
00106 }
00107 
00108 }
00109 }
00110 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends