Skip to content

Commit

Permalink
Changes method/property accessibilities to internal
Browse files Browse the repository at this point in the history
Changes some method/property accessibilities to internal
  • Loading branch information
HotCakeX committed Dec 21, 2024
1 parent 2f2bf84 commit 2fb5443
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace HardenWindowsSecurity;

public static class NetConnectionProfiles
internal static class NetConnectionProfiles
{
/// <summary>
/// This method outputs a list of all network connection profiles.
/// The output is precisely the same as the output of the Get-NetConnectionProfile cmdlet in PowerShell.
/// </summary>
/// <returns></returns>
public static List<ManagementObject> Get()
internal static List<ManagementObject> Get()
{
// Create a list to store the profiles
List<ManagementObject> profiles = [];
Expand Down Expand Up @@ -60,7 +60,7 @@ public static List<ManagementObject> Get()
/// PS Example: [HardenWindowsSecurity.NetConnectionProfiles]::Set((3, 22), $null, [HardenWindowsSecurity.NetConnectionProfiles+NetworkCategory]::public)
/// PS Example: [HardenWindowsSecurity.NetConnectionProfiles]::Set($null, ('Ethernet', 'Wi-Fi'), [HardenWindowsSecurity.NetConnectionProfiles+NetworkCategory]::private)
/// <returns>True if successful, otherwise false.</returns>
public static bool Set(NetworkCategory networkCategory, int[]? interfaceIndices = null, string[]? interfaceAliases = null)
internal static bool Set(NetworkCategory networkCategory, int[]? interfaceIndices = null, string[]? interfaceAliases = null)
{
try
{
Expand Down Expand Up @@ -115,21 +115,21 @@ private static void UpdateNetworkCategory(ManagementScope scope, string queryStr
}

// The following enums are used to represent the properties of the MSFT_NetConnectionProfile class
public enum NetworkCategory : uint
internal enum NetworkCategory : uint
{
Public = 0,
Private = 1,
DomainAuthenticated = 2
}

public enum DomainAuthenticationKind : uint
internal enum DomainAuthenticationKind : uint
{
None = 0,
Ldap = 1,
Tls = 2
}

public enum IPv4Connectivity : uint
internal enum IPv4Connectivity : uint
{
Disconnected = 0,
NoTraffic = 1,
Expand All @@ -138,7 +138,7 @@ public enum IPv4Connectivity : uint
Internet = 4
}

public enum IPv6Connectivity : uint
internal enum IPv6Connectivity : uint
{
Disconnected = 0,
NoTraffic = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private static string[] ParseCsvLine(string line)

// method to process a category based on the CSV data
// The method used to verify the hardening category, which can be 'Group Policy' or 'Registry Keys'
public static List<IndividualResult> ProcessCategory(ComplianceCategories catName, string method)
internal static List<IndividualResult> ProcessCategory(ComplianceCategories catName, string method)
{
// Create a list to store the results
List<IndividualResult> output = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
namespace HardenWindowsSecurity;

// Represents a record in the security policy
public sealed class SecurityPolicyRecord
internal sealed class SecurityPolicyRecord
{
public required ComplianceCategories Category { get; set; }
public string? Section { get; set; }
public string? Path { get; set; }
public string? Value { get; set; }
public string? Name { get; set; }
internal required ComplianceCategories Category { get; set; }
internal string? Section { get; set; }
internal string? Path { get; set; }
internal string? Value { get; set; }
internal string? Name { get; set; }
}

// Processes the CSV file "SecurityPoliciesVerification.csv" containing security policy records
public static class SecurityPolicyCsvProcessor
internal static class SecurityPolicyCsvProcessor
{
// Reads and processes the CSV file, returning a list of SecurityPolicyRecord objects
public static List<SecurityPolicyRecord> ProcessSecurityPolicyCsvFile(string csvFilePath)
internal static List<SecurityPolicyRecord> ProcessSecurityPolicyCsvFile(string csvFilePath)
{
List<SecurityPolicyRecord> securityPolicyRecordsOutput = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public sealed class CiPolicyInfo
public bool IsOnDisk { get; set; } // Indicates if the policy is present on disk
public bool IsEnforced { get; set; } // Indicates if the policy is enforced
public bool IsAuthorized { get; set; } // Indicates if the policy is authorized
public List<string>? PolicyOptions { get; set; }// List of options or settings related to the policy
internal List<string>? PolicyOptions { get; set; }// List of options or settings related to the policy
}

0 comments on commit 2fb5443

Please sign in to comment.