Beispiel #1
0
        public static List <SectionDetails> CheckScores()
        {
            List <SectionDetails> details = new List <SectionDetails>();

            // Get information we use from secedit for use in sections
            SecurityPolicyManager.GetSeceditInfo();

            // Reset max score
            MaxScore = 0;

            // Enumerate all scoring sections
            foreach (ISection section in ScoringSections)
            {
                // Get max score
                int maxScore = section.MaxScore();

                // Optimization: Check if anything is scored, skip if not
                if (maxScore == 0)
                {
                    continue;
                }

                // Increment total max score by section's
                MaxScore += maxScore;

                // Get scoring details for specific section
                SectionDetails sectionScore = section.GetScore();

                // Add details to list
                details.Add(sectionScore);
            }

            return(details);
        }
Beispiel #2
0
        public static List <SectionDetails> CheckScores()
        {
            List <SectionDetails> details = new List <SectionDetails>();

            // Get information we use from secedit for use in sections
            SecurityPolicyManager.GetSeceditInfo();

            // Reset max score
            MaxScore = 0;

            // Enumerate all scoring sections
            foreach (ISection section in ScoringSections)
            {
                // Get max score
                int maxScore = section.MaxScore();

                // Optimization: Check if anything is scored, skip if not
                if (maxScore == 0)
                {
                    continue;
                }

                // Increment total max score by section's
                MaxScore += maxScore;

                try
                {
                    // Get scoring details for specific section
                    SectionDetails sectionScore = section.GetScore();

                    // Add details to list
                    details.Add(sectionScore);
                }
                catch (Exception ex)
                {
                    EventLog.WriteEntry(".NET Runtime", ex.ToString(), EventLogEntryType.Error, 1026);
                }
            }

            return(details);
        }