protected override void GenerateSection(string title, GenerateContentDelegate generateContent) { Report = Reports[0]; base.GenerateSection(title + " - " + Report.GenerationDate.ToString("u"), generateContent); Report = Reports[1]; base.GenerateSection(title + " - " + Report.GenerationDate.ToString("u"), generateContent); }
protected void GenerateSection(string title, GenerateContentDelegate generateContent) { string id = "section" + title.Replace(" ", ""); Add(@" <!-- Section " + title + @" --> <div id=""" + id + @"""> <div class=""row""> <div class=""col-lg-12""> <div class=""starter-template""> <div class=""card mb-4""> <div class=""card-header""> <h1 class=""card-title""><a data-toggle=""collapse"" aria-expanded=""true"" href=""#panel" + id + @""">" + title + @"</a></h1> </div> <div class=""card-body collapse show"" id=""panel" + id + @"""> "); generateContent(); Add(@" </div> </div> </div> </div> </div> </div> <!-- Section " + title + @" end --> "); }
protected void GenerateSectionFluid(string title, GenerateContentDelegate generateContent, string selectedTab, bool defaultIfTabEmpty = false) { string id = GenerateId(title); bool isActive = (String.IsNullOrEmpty(selectedTab) ? defaultIfTabEmpty : selectedTab == id); Add(@" <!-- Section "); Add(title); Add(@" --> <div class=""tab-pane"); if (isActive) { Add(" active"); } Add(@""" id="""); Add(id); Add(@"""> <div class=""row""><div class=""col-lg-12""> <div class=""starter-template""> <div class=""row""><div class=""col-lg-12""> <h1>" ); Add(title); Add(@"</h1> </div></div> "); generateContent(); Add(@" </div> </div> </div> </div> <!-- Section " + title + @" end --> "); }
protected void GenerateSection(string title, GenerateContentDelegate generateContent) { string id = "section" + title.Replace(" ", ""); Add(@" <!-- Section " + title + @" --> <div id=""" + id + @"""> <div class=""row""> <div class=""starter-template""> <div class=""panel panel-default""> <div class=""panel-heading panel-cp""> <h1 class=""panel-title""><a data-toggle=""collapse"" href=""#panel" + id + @""">" + title + @"</a></h1> </div> <div class=""panel-body collapse in"" id=""panel" + id + @"""> "); generateContent(); Add(@" </div> </div> </div> </div> </div> <!-- Section " + title + @" end --> "); }
protected void GenerateAccordion(string accordion, GenerateContentDelegate content) { Add(@" <!-- Accordion " + accordion + @" --> <div class=""row""> <div class=""col-md-12""> <div class=""panel-group"" id=""" + accordion + @"""> "); content(); Add(@" </div> </div> </div> <!-- Accordion " + accordion + @" end --> "); }
protected void GenerateAccordion(string accordion, GenerateContentDelegate content) { Add(@" <!-- Accordion " ); AddEncoded(accordion); Add(@" --> <div id="""); Add(accordion); Add(@"""> <div class=""card""> "); content(); Add(@"</div></div> <!-- Accordion " ); Add(accordion); Add(@" end --> "); }
protected void AddEndTable(GenerateContentDelegate footer = null) { Add(@"</tbody>"); if (footer != null) { Add("<tfoot>"); AddBeginRow(); footerMode = true; footer(); footerMode = false; AddEndRow(); Add("</tfoot>"); } else { Add("<tfoot></tfoot>"); } Add(@" </table> </div> </div> "); }
protected void GenerateAccordionDetailForRule(string id, string dataParent, string title, HealthcheckRiskRule rule, RuleBase <HealthcheckData> hcrule, GenerateContentDelegate content) { GenerateAccordionDetail(id, dataParent, title, () => { if (rule.Points == 0) { Add(@"<i class=""float-right""><span class='float-right'>Informative rule</span>"); if (ActionPlanOrchestrator != null) { ActionPlanOrchestrator.GenerateMainActionPlan(sb, rule, hcrule); } Add("</i>"); } else { Add(@"<i class=""float-right""><span class='float-right'>+ "); Add(rule.Points); Add(@" Point(s)</span>"); if (ActionPlanOrchestrator != null) { ActionPlanOrchestrator.GenerateMainActionPlan(sb, rule, hcrule); } Add("</i>"); } }, content); }
protected void GenerateIndicators(IRiskEvaluation data, IList <IRuleScore> rules, GenerateContentDelegate statistics) { GenerateSubSection("Indicators"); Add(@" <div class=""row""> <div class=""col-md-4""> <div class=""chart-gauge"">" ); GenerateGauge(data.GlobalScore); Add(@"</div> </div> <div class=""col-md-8""> <p class=""lead"">Domain Risk Level: " ); Add(data.GlobalScore.ToString()); Add(@" / 100</p>"); AddParagraph("It is the maximum score of the 4 indicators and one score cannot be higher than 100. The lower the better"); if (statistics != null) { statistics(); } Add(@" </div> </div> <div class=""row indicators-border""> "); GenerateSubIndicator("Stale Object", data.GlobalScore, data.StaleObjectsScore, rules, RiskRuleCategory.StaleObjects, "It is about operations related to user or computer objects"); GenerateSubIndicator("Trusts", data.GlobalScore, data.TrustScore, rules, RiskRuleCategory.Trusts, "It is about links between two Active Directories"); GenerateSubIndicator("Privileged Accounts", data.GlobalScore, data.PrivilegiedGroupScore, rules, RiskRuleCategory.PrivilegedAccounts, "It is about administrators of the Active Directory"); GenerateSubIndicator("Anomalies", data.GlobalScore, data.AnomalyScore, rules, RiskRuleCategory.Anomalies, "It is about specific security control points"); Add(@" </div> "); }
protected void GenerateAccordionDetail(string id, string dataParent, string title, int?itemCount, bool RuleStyle, GenerateContentDelegate content) { Add(@" <div class=""card-header"" id=""heading"); Add(id); Add(@"""> <span class=""card-title mb-0""> <button class=""btn btn-link"" data-toggle=""collapse"" data-target=""#"); Add(id); Add(@""" aria-expanded=""false"" aria-controls="""); Add(id); Add(@"""> "); Add(title); Add(@" </button> </span> "); if (itemCount != null) { if (!RuleStyle) { Add(@"<i class=""float-right"">["); Add((int)itemCount); Add(@"]</i>"); } else { Add(@"<i class=""float-right"">+ "); Add((int)itemCount); Add(@" Point(s)</i>"); } } Add(@" </div> <div id="""); Add(id); Add(@""" class=""collapse"" aria-labelledby=""heading"); Add(id); Add(@""" data-parent=""#"); Add(dataParent); Add(@"""> <div class=""card-body""> "); content(); Add(@" </div> </div>"); }