diff --git a/App_LocalResources/View.ascx.resx b/App_LocalResources/View.ascx.resx
index 341d186..46e727e 100644
--- a/App_LocalResources/View.ascx.resx
+++ b/App_LocalResources/View.ascx.resx
@@ -465,4 +465,7 @@ If you expect this addition, then just ignore this email; otherwise, an immediat
Header: {0}", HttpUtility.HtmlEncode(headerValue));
- }
- if (!string.IsNullOrEmpty(footerValue))
- {
- note += string.Format("
Footer: {0}", HttpUtility.HtmlEncode(footerValue));
- }
- note += "< br />";
-
- result.Notes.Add(note);
+ note += string.Format("
Header: {0}", HttpUtility.HtmlEncode(headerValue));
}
- }
- catch (Exception)
- {
- throw;
- }
+ if (!string.IsNullOrEmpty(footerValue))
+ {
+ note += string.Format("
Footer: {0}", HttpUtility.HtmlEncode(footerValue));
+ }
+ note += "< br />";
+ result.Notes.Add(note);
+ }
return result;
}
}
diff --git a/Components/Checks/CheckPasswordFormat.cs b/Components/Checks/CheckPasswordFormat.cs
index cdeebde..8998b14 100644
--- a/Components/Checks/CheckPasswordFormat.cs
+++ b/Components/Checks/CheckPasswordFormat.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Web;
-using System.Web.UI;
-using DotNetNuke.Security.Membership;
+using DotNetNuke.Security.Membership;
namespace DNN.Modules.SecurityAnalyzer.Components.Checks
{
@@ -9,25 +6,20 @@ public class CheckPasswordFormat : IAuditCheck
{
public string Id => "CheckPasswordFormat";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
- try
+ var format = MembershipProvider.Instance().PasswordFormat;
+ if (format == PasswordFormat.Hashed)
{
- var format = MembershipProvider.Instance().PasswordFormat;
- if (format == PasswordFormat.Hashed)
- {
- result.Severity = SeverityEnum.Pass;
- }
- else
- {
- result.Notes.Add("Setting:" + format.ToString());
- result.Severity = SeverityEnum.Failure;
- }
+ result.Severity = SeverityEnum.Pass;
}
- catch (Exception)
+ else
{
- throw;
+ result.Notes.Add("Setting:" + format.ToString());
+ result.Severity = SeverityEnum.Failure;
}
return result;
}
diff --git a/Components/Checks/CheckRarelyUsedSuperuser.cs b/Components/Checks/CheckRarelyUsedSuperuser.cs
index 84b2144..30af2f3 100644
--- a/Components/Checks/CheckRarelyUsedSuperuser.cs
+++ b/Components/Checks/CheckRarelyUsedSuperuser.cs
@@ -1,6 +1,5 @@
using System;
using DotNetNuke.Entities.Users;
-using DotNetNuke.Security.Membership;
namespace DNN.Modules.SecurityAnalyzer.Components.Checks
{
@@ -8,29 +7,24 @@ public class CheckRarelyUsedSuperuser : IAuditCheck
{
public string Id => "CheckRarelyUsedSuperuser";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
- try
- {
- var totalRecords = 0;
+ var totalRecords = 0;
- var superUsers = UserController.GetUsers(-1, 1, int.MaxValue, ref totalRecords, false, true);
- result.Severity = SeverityEnum.Pass;
- foreach (UserInfo user in superUsers)
+ var superUsers = UserController.GetUsers(-1, 1, int.MaxValue, ref totalRecords, false, true);
+ result.Severity = SeverityEnum.Pass;
+ foreach (UserInfo user in superUsers)
+ {
+ if (DateTime.Now.AddMonths(-6) > user.Membership.LastLoginDate ||
+ DateTime.Now.AddMonths(-6) > user.Membership.LastActivityDate)
{
- if (DateTime.Now.AddMonths(-6) > user.Membership.LastLoginDate ||
- DateTime.Now.AddMonths(-6) > user.Membership.LastActivityDate)
- {
- result.Severity = SeverityEnum.Warning;
- result.Notes.Add("Superuser:" + user.Username);
- }
+ result.Severity = SeverityEnum.Warning;
+ result.Notes.Add("Superuser:" + user.Username);
}
}
- catch (Exception)
- {
- throw;
- }
return result;
}
}
diff --git a/Components/Checks/CheckSiteRegistration.cs b/Components/Checks/CheckSiteRegistration.cs
index d51cb79..4133c45 100644
--- a/Components/Checks/CheckSiteRegistration.cs
+++ b/Components/Checks/CheckSiteRegistration.cs
@@ -1,5 +1,4 @@
-using System;
-using DotNetNuke.Entities.Portals;
+using DotNetNuke.Entities.Portals;
namespace DNN.Modules.SecurityAnalyzer.Components.Checks
{
@@ -7,28 +6,22 @@ public class CheckSiteRegistration : IAuditCheck
{
public string Id => "CheckSiteRegistration";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
- try
+ var portalController = new PortalController();
+ result.Severity = SeverityEnum.Pass;
+ foreach (PortalInfo portal in portalController.GetPortals())
{
- var portalController = new PortalController();
- result.Severity = SeverityEnum.Pass;
- foreach (PortalInfo portal in portalController.GetPortals())
+ //check for public registration
+ if (portal.UserRegistration == 2)
{
- //check for public registration
- if (portal.UserRegistration == 2)
- {
- result.Severity = SeverityEnum.Warning;
- result.Notes.Add("Portal:" + portal.PortalName);
- }
+ result.Severity = SeverityEnum.Warning;
+ result.Notes.Add("Portal:" + portal.PortalName);
}
}
- catch (Exception)
- {
- throw;
- }
-
return result;
}
}
diff --git a/Components/Checks/CheckSqlRisk.cs b/Components/Checks/CheckSqlRisk.cs
index 2ce0ac4..e989b1b 100644
--- a/Components/Checks/CheckSqlRisk.cs
+++ b/Components/Checks/CheckSqlRisk.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Data.SqlClient;
using System.IO;
-using System.Resources;
using DotNetNuke.Common;
using DotNetNuke.Data;
using DotNetNuke.Services.Localization;
@@ -13,6 +12,8 @@ public class CheckSqlRisk : IAuditCheck
{
public string Id => "CheckSqlRisk";
+ public bool LazyLoad => false;
+
private string LocalResourceFile
{
get { return "~/DesktopModules/DNNCorp/SecurityAnalyzer/App_LocalResources/view.ascx"; }
diff --git a/Components/Checks/CheckSuperuserOldPassword.cs b/Components/Checks/CheckSuperuserOldPassword.cs
index 754d809..fb6f3de 100644
--- a/Components/Checks/CheckSuperuserOldPassword.cs
+++ b/Components/Checks/CheckSuperuserOldPassword.cs
@@ -7,28 +7,22 @@ public class CheckSuperuserOldPassword : IAuditCheck
{
public string Id => "CheckSuperuserOldPassword";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
- try
+ var totalRecords = 0;
+ var superUsers = UserController.GetUsers(-1, 1, int.MaxValue, ref totalRecords, false, true);
+ result.Severity = SeverityEnum.Pass;
+ foreach (UserInfo user in superUsers)
{
- var totalRecords = 0;
-
- var superUsers = UserController.GetUsers(-1, 1, int.MaxValue, ref totalRecords, false, true);
- result.Severity = SeverityEnum.Pass;
- foreach (UserInfo user in superUsers)
+ if (DateTime.Now.AddMonths(-6) > user.Membership.LastPasswordChangeDate)
{
- if (DateTime.Now.AddMonths(-6) > user.Membership.LastPasswordChangeDate)
- {
- result.Severity = SeverityEnum.Warning;
- result.Notes.Add("Superuser:" + user.Username);
- }
+ result.Severity = SeverityEnum.Warning;
+ result.Notes.Add("Superuser:" + user.Username);
}
}
- catch (Exception)
- {
- throw;
- }
return result;
}
}
diff --git a/Components/Checks/CheckTelerikVulnerability.cs b/Components/Checks/CheckTelerikVulnerability.cs
index e495ec4..1f277d3 100644
--- a/Components/Checks/CheckTelerikVulnerability.cs
+++ b/Components/Checks/CheckTelerikVulnerability.cs
@@ -15,6 +15,8 @@ public class CheckTelerikVulnerability : IAuditCheck
{
public string Id => "CheckTelerikVulnerability";
+ public bool LazyLoad => false;
+
private string[] _configKeys = {
"Telerik.AsyncUpload.ConfigurationEncryptionKey",
"Telerik.Upload.ConfigurationHashKey",
diff --git a/Components/Checks/CheckTracing.cs b/Components/Checks/CheckTracing.cs
index d22ef7b..02e9762 100644
--- a/Components/Checks/CheckTracing.cs
+++ b/Components/Checks/CheckTracing.cs
@@ -7,6 +7,8 @@ public class CheckTracing : IAuditCheck
{
public string Id => "CheckTracing";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
diff --git a/Components/Checks/CheckUnexpectedExtensions.cs b/Components/Checks/CheckUnexpectedExtensions.cs
index 7e5bbfe..907c1c9 100644
--- a/Components/Checks/CheckUnexpectedExtensions.cs
+++ b/Components/Checks/CheckUnexpectedExtensions.cs
@@ -7,6 +7,8 @@ public class CheckUnexpectedExtensions : IAuditCheck
{
public string Id => "CheckUnexpectedExtensions";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
diff --git a/Components/Checks/CheckViewstatemac.cs b/Components/Checks/CheckViewstatemac.cs
index 41e6907..c02044b 100644
--- a/Components/Checks/CheckViewstatemac.cs
+++ b/Components/Checks/CheckViewstatemac.cs
@@ -8,6 +8,8 @@ public class CheckViewstatemac : IAuditCheck
{
public string Id => "CheckViewstatemac";
+ public bool LazyLoad => false;
+
public CheckResult Execute()
{
var result = new CheckResult(SeverityEnum.Unverified, Id);
diff --git a/Components/FeatureController.cs b/Components/FeatureController.cs
index 198c40c..0744d8d 100644
--- a/Components/FeatureController.cs
+++ b/Components/FeatureController.cs
@@ -8,7 +8,6 @@
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Security;
using DotNetNuke.Security.Permissions;
-using DotNetNuke.Services.Upgrade;
namespace DNN.Modules.SecurityAnalyzer.Components
{
diff --git a/Components/IAuditCheck.cs b/Components/IAuditCheck.cs
index 2f30a94..c48406f 100644
--- a/Components/IAuditCheck.cs
+++ b/Components/IAuditCheck.cs
@@ -3,6 +3,9 @@
public interface IAuditCheck
{
string Id { get; }
+
+ bool LazyLoad { get; }
+
CheckResult Execute();
}
}
\ No newline at end of file
diff --git a/Components/Utility.cs b/Components/Utility.cs
index f167a94..bba0f01 100644
--- a/Components/Utility.cs
+++ b/Components/Utility.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Configuration;
using System.Globalization;
using System.IO;
using System.Linq;
diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt
index 825d0e2..0640bd6 100644
--- a/ReleaseNotes.txt
+++ b/ReleaseNotes.txt
@@ -14,7 +14,7 @@