From 6a14951b24ac39443e412d066d921afc87bed72c Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Sun, 8 Nov 2020 13:03:07 +1100 Subject: [PATCH] Adds PowerShell module for getting Lithnet local admin passwords and history Fixes an issue where the encryption certificate UI showed that read permissions were missing from a certificate --- .gitignore | 1 + .../Lithnet.AccessManager.Agent.Setup-x64.aip | 4 +- .../Lithnet.AccessManager.Agent.Setup-x86.aip | 4 +- .../Lithnet.AccessManager.Agent.csproj | 4 +- .../GetLithnetLocalAdminPasswordTests.cs | 40 +++++++ ...thnet.AccessManager.PowerShell.Test.csproj | 75 +++++++++++++ .../Properties/AssemblyInfo.cs | 18 +++ .../AssemblyResolver.cs | 34 ++++++ .../ExportLocalAdministrators.cs | 93 ---------------- .../GetLocalAdminPassword.cs | 85 ++++++++++++++ .../GetLocalAdminPasswordHistory.cs | 95 ++++++++++++++++ .../Lithnet.AccessManager.PowerShell.csproj | 92 ++++++++------- .../LithnetAccessManager.psd1 | Bin 0 -> 8040 bytes .../Properties/AssemblyInfo.cs | 36 ------ .../Lithnet.AccessManager.Server.Test.csproj | 8 +- .../Lithnet.AccessManager.Server.UI.csproj | 4 +- .../ViewModels/LapsConfigurationViewModel.cs | 7 +- .../ViewModels/X509Certificate2ViewModel.cs | 5 +- .../CertificatePermissionProvider.cs | 2 +- .../Lithnet.AccessManager.Service.Setup.aip | 105 +++++++++++++++++- .../Lithnet.AccessManager.Service.csproj | 2 +- .../dev-config/appsettings.json | 11 +- .../Lithnet.AccessManager.Test.csproj | 2 +- .../Lithnet.AccessManager.sln | 52 +++++++++ .../Lithnet.AccessManager.csproj | 4 +- .../action-core-build-service.bat | 33 ++++-- src/Lithnet.AccessManager/version.txt | 2 +- 27 files changed, 609 insertions(+), 209 deletions(-) create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/GetLithnetLocalAdminPasswordTests.cs create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Lithnet.AccessManager.PowerShell.Test.csproj create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Properties/AssemblyInfo.cs create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/AssemblyResolver.cs delete mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/ExportLocalAdministrators.cs create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPassword.cs create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPasswordHistory.cs create mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/LithnetAccessManager.psd1 delete mode 100644 src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Properties/AssemblyInfo.cs diff --git a/.gitignore b/.gitignore index b27d9d41..03cf6a31 100644 --- a/.gitignore +++ b/.gitignore @@ -270,6 +270,7 @@ output/ output-x64 output-x86 +output-ps setup-packages/ Prerequisites/ \ No newline at end of file diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x64.aip b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x64.aip index d7bc214c..6944ea1a 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x64.aip +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x64.aip @@ -9,10 +9,10 @@ - + - + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x86.aip b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x86.aip index 5c08ab57..1e835961 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x86.aip +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent.Setup/Lithnet.AccessManager.Agent.Setup-x86.aip @@ -9,10 +9,10 @@ - + - + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent/Lithnet.AccessManager.Agent.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent/Lithnet.AccessManager.Agent.csproj index 7ac94190..bc57ddda 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent/Lithnet.AccessManager.Agent.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Agent/Lithnet.AccessManager.Agent.csproj @@ -51,8 +51,8 @@ - - + + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/GetLithnetLocalAdminPasswordTests.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/GetLithnetLocalAdminPasswordTests.cs new file mode 100644 index 00000000..8a53e1aa --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/GetLithnetLocalAdminPasswordTests.cs @@ -0,0 +1,40 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Management.Automation; +using System.Linq; + +namespace Lithnet.AccessManager.PowerShell.Test +{ + [TestClass] + public class GetLithnetLocalAdminPasswordTests + { + [TestMethod] + public void GetLocalAdminPassword() + { + System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create(); + ps.AddCommand(new CmdletInfo("Get-LithnetLocalAdminPassword", typeof(GetLocalAdminPassword))); + ps.AddParameter("ComputerName", "IDMDEV1\\PC1"); + var output = ps.Invoke(); + + Assert.AreEqual(1, output.Count); + var result = output[0]; + + Assert.AreEqual("Password", result.Properties["Password"].Value); + } + + [TestMethod] + public void GetLocalAdminPasswordHistory() + { + System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create(); + ps.AddCommand(new CmdletInfo("Get-LithnetLocalAdminPasswordHistory", typeof(GetLocalAdminPasswordHistory))); + ps.AddParameter("ComputerName", "IDMDEV1\\PC1"); + var output = ps.Invoke(); + + Assert.AreEqual(3, output.Count); + + var passwords = output.Select(t => t.Properties["Password"].Value as string).ToList(); + + CollectionAssert.AreEquivalent(new[] { "History-1", "History-2", "History-3" }, passwords); + } + } +} diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Lithnet.AccessManager.PowerShell.Test.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Lithnet.AccessManager.PowerShell.Test.csproj new file mode 100644 index 00000000..27563ae7 --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Lithnet.AccessManager.PowerShell.Test.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA} + Library + Properties + Lithnet.AccessManager.PowerShell.Test + Lithnet.AccessManager.PowerShell.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + {c8e94e87-f4bc-4623-a72d-7df376a2daec} + Lithnet.AccessManager.PowerShell + + + + + 3.1.9 + + + 3.1.9 + + + 1.1.0 + + + 2.1.1 + + + 2.1.1 + + + + + \ No newline at end of file diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Properties/AssemblyInfo.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..855e152f --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Lithnet.AccessManager.PowerShell.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Lithnet.AccessManager.PowerShell.Test")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("22f8d82b-84b7-4d44-83ac-33bcb3b6eeba")] + +[assembly: AssemblyVersion("1.0.*")] diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/AssemblyResolver.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/AssemblyResolver.cs new file mode 100644 index 00000000..7247ed89 --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/AssemblyResolver.cs @@ -0,0 +1,34 @@ +using System; +using System.IO; +using System.Management.Automation; +using System.Reflection; + +namespace Lithnet.AccessManager.PowerShell +{ + public class AssemblyResolver : IModuleAssemblyInitializer, IModuleAssemblyCleanup + { + private static readonly string basePath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); + + public void OnImport() + { + AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; + } + + private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + { + string assyPath = Path.Combine(basePath, $"{args.Name}.dll"); + + if (File.Exists(assyPath)) + { + return Assembly.Load(assyPath); + } + + return null; + } + + public void OnRemove(PSModuleInfo psModuleInfo) + { + AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; + } + } +} diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/ExportLocalAdministrators.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/ExportLocalAdministrators.cs deleted file mode 100644 index 5a7c4498..00000000 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/ExportLocalAdministrators.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Management.Automation; -using System.Security.Cryptography.X509Certificates; -using System.Security.Principal; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; - -namespace Lithnet.AccessManager.PowerShell -{ - [Cmdlet(VerbsData.Export, "LocalAdministrators")] - public class ExportLocalAdministrators : Cmdlet - { - [Parameter(Mandatory = true)] - public string BaseOU { get; set; } - - [Parameter(Mandatory = true)] - public string OutputFile { get; set; } - - [Parameter(Mandatory = false)] - public SwitchParameter IncludeUnresolvedPrincipals { get; set; } - - [Parameter(Mandatory = false)] - public SwitchParameter IncludeLocalPrincipals { get; set; } - - [Parameter(Mandatory = false)] - public string JitGroupTemplate { get; set; } - - [Parameter(Mandatory = false)] - public string CsvFile { get; set; } - - [Parameter(Mandatory = false)] - public string[] PrincipalFilters { get; set; } - - [Parameter(Mandatory = false)] - public string[] ComputerFilters { get; set; } - - protected override void ProcessRecord() - { - var provider = this.GetAuthorizationImportRuleProvider(); - - List computerFilters = new List(); - List principalFilters = new List(); - - if (PrincipalFilters != null) - { - foreach (string item in PrincipalFilters) - { - principalFilters.Add(new Regex(item, RegexOptions.IgnoreCase)); - } - } - - if (ComputerFilters != null) - { - foreach (string item in ComputerFilters) - { - computerFilters.Add(new Regex(item, RegexOptions.IgnoreCase)); - } - } - - if (CsvFile != null) - { - var entry = provider.BuildPrincipalMap(this.BaseOU, this.CsvFile, principalFilters, computerFilters, !this.IncludeLocalPrincipals, !this.IncludeUnresolvedPrincipals, CancellationToken.None); - provider.WriteReport(entry, this.OutputFile); - } - else - { - var entry = provider.BuildPrincipalMap(this.BaseOU, principalFilters, computerFilters, !this.IncludeLocalPrincipals, !this.IncludeUnresolvedPrincipals, CancellationToken.None); - provider.WriteReport(entry, this.OutputFile); - } - } - - private AuthorizationRuleImportProvider GetAuthorizationImportRuleProvider() - { - var logFactory = LoggerFactory.Create(options => - { - }); - - ILocalSam localSam = new LocalSam(logFactory.CreateLogger()); - IDiscoveryServices discoveryServices = new DiscoveryServices(logFactory.CreateLogger()); - IDirectory directory = new ActiveDirectory(discoveryServices); - IComputerPrincipalProviderRpc rpcProvider = new ComputerPrincipalProviderRpc(localSam, directory, logFactory.CreateLogger()); - IComputerPrincipalProviderCsv csvProvider = new ComputerPrincipalProviderCsv(directory, logFactory.CreateLogger()); - - return new AuthorizationRuleImportProvider(logFactory.CreateLogger(), directory, csvProvider, rpcProvider); - } - } -} diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPassword.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPassword.cs new file mode 100644 index 00000000..989edbe6 --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPassword.cs @@ -0,0 +1,85 @@ +using System; +using System.Management.Automation; +using System.Security; +using System.Security.Cryptography.X509Certificates; +using System.ServiceModel.Channels; +using Microsoft.Extensions.Logging; + +namespace Lithnet.AccessManager.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "LocalAdminPassword")] + public class GetLocalAdminPassword : Cmdlet + { + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 1)] + [Parameter(Mandatory = true, ParameterSetName = "Default", Position = 1)] + public string ComputerName { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 2)] + public string PfxCertificateFile { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 3)] + public SecureString PfxCertificateFilePassword { get; set; } + + private ILoggerFactory logFactory; + private IDiscoveryServices discoveryServices; + private ICertificateProvider certificateProvider; + private IEncryptionProvider encryptionProvider; + private ILithnetAdminPasswordProvider adminPasswordProvider; + private IDirectory directory; + private X509Certificate2 certificate; + + protected override void BeginProcessing() + { + this.logFactory = Microsoft.Extensions.Logging.Abstractions.NullLoggerFactory.Instance; + this.discoveryServices = new DiscoveryServices(logFactory.CreateLogger()); + this.certificateProvider = new CertificateProvider(logFactory.CreateLogger(), discoveryServices); + this.encryptionProvider = new EncryptionProvider(); + this.adminPasswordProvider = new LithnetAdminPasswordProvider(logFactory.CreateLogger(), encryptionProvider, certificateProvider); + this.directory = new ActiveDirectory(discoveryServices); + + if (this.PfxCertificateFile != null) + { + this.certificate = new X509Certificate2(this.PfxCertificateFile, this.PfxCertificateFilePassword); + } + else + { + this.certificate = null; + } + } + + protected override void ProcessRecord() + { + IComputer computer = this.directory.GetComputer(this.ComputerName); + + var item = this.adminPasswordProvider.GetCurrentPassword(computer, null); + + if (item == null) + { + this.WriteVerbose("The computer did not have a Lithnet local admin password"); + return; + } + + + var decryptedData = this.encryptionProvider.Decrypt(item.EncryptedData, (thumbprint) => + { + if (certificate != null) + { + if (string.Equals(thumbprint, certificate.Thumbprint, System.StringComparison.OrdinalIgnoreCase)) + { + return certificate; + } + } + + return this.certificateProvider.FindDecryptionCertificate(thumbprint); + }); + + var result = new PSObject(); + result.Properties.Add(new PSNoteProperty("ComputerName", computer.MsDsPrincipalName)); + result.Properties.Add(new PSNoteProperty("Password", decryptedData)); + result.Properties.Add(new PSNoteProperty("Created", item.Created.ToLocalTime())); + result.Properties.Add(new PSNoteProperty("Retired", item.Retired?.ToLocalTime())); + + this.WriteObject(result); + } + } +} diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPasswordHistory.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPasswordHistory.cs new file mode 100644 index 00000000..4d246d64 --- /dev/null +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/GetLocalAdminPasswordHistory.cs @@ -0,0 +1,95 @@ +using System; +using System.Management.Automation; +using System.Security; +using System.Security.Cryptography.X509Certificates; +using System.ServiceModel.Channels; +using Microsoft.Extensions.Logging; +using Microsoft.PowerShell.Cmdletization.Xml; + +namespace Lithnet.AccessManager.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "LocalAdminPasswordHistory")] + public class GetLocalAdminPasswordHistory : Cmdlet + { + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 1)] + [Parameter(Mandatory = true, ParameterSetName = "Default", Position = 1)] + public string ComputerName { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 2)] + public string PfxCertificateFile { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "CertificateFile", Position = 3)] + public SecureString PfxCertificateFilePassword { get; set; } + + private ILoggerFactory logFactory; + private IDiscoveryServices discoveryServices; + private ICertificateProvider certificateProvider; + private IEncryptionProvider encryptionProvider; + private ILithnetAdminPasswordProvider adminPasswordProvider; + private IDirectory directory; + private X509Certificate2 certificate; + + protected override void BeginProcessing() + { + this.logFactory = Microsoft.Extensions.Logging.Abstractions.NullLoggerFactory.Instance; + this.discoveryServices = new DiscoveryServices(logFactory.CreateLogger()); + this.certificateProvider = new CertificateProvider(logFactory.CreateLogger(), discoveryServices); + this.encryptionProvider = new EncryptionProvider(); + this.adminPasswordProvider = new LithnetAdminPasswordProvider(logFactory.CreateLogger(), encryptionProvider, certificateProvider); + this.directory = new ActiveDirectory(discoveryServices); + + if (this.PfxCertificateFile != null) + { + this.certificate = new X509Certificate2(this.PfxCertificateFile, this.PfxCertificateFilePassword); + } + else + { + this.certificate = null; + } + } + + protected override void ProcessRecord() + { + IComputer computer = this.directory.GetComputer(this.ComputerName); + + var items = this.adminPasswordProvider.GetPasswordHistory(computer); + + if (items == null || items.Count == 0) + { + this.WriteVerbose("The computer did not have a Lithnet local admin password"); + return; + } + + foreach (var item in items) + { + try + { + var decryptedData = this.encryptionProvider.Decrypt(item.EncryptedData, (thumbprint) => + { + if (certificate != null) + { + if (string.Equals(thumbprint, certificate.Thumbprint, System.StringComparison.OrdinalIgnoreCase)) + { + return certificate; + } + } + + return this.certificateProvider.FindDecryptionCertificate(thumbprint); + }); + + var result = new PSObject(); + result.Properties.Add(new PSNoteProperty("ComputerName", computer.MsDsPrincipalName)); + result.Properties.Add(new PSNoteProperty("Password", decryptedData)); + result.Properties.Add(new PSNoteProperty("Created", item.Created.ToLocalTime())); + result.Properties.Add(new PSNoteProperty("Retired", item.Retired?.ToLocalTime())); + + this.WriteObject(result); + } + catch (Exception ex) + { + this.WriteError(new ErrorRecord(ex, "UnableToDecryptPassword", ErrorCategory.InvalidData, item)); + } + } + } + } +} diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Lithnet.AccessManager.PowerShell.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Lithnet.AccessManager.PowerShell.csproj index 9023f89f..b7ecb47c 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Lithnet.AccessManager.PowerShell.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Lithnet.AccessManager.PowerShell.csproj @@ -1,60 +1,68 @@ - - - + - Debug - AnyCPU - {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC} - Library - Properties - Lithnet.AccessManager.PowerShell - Lithnet.AccessManager.PowerShell - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net472 + Lithnet + Access Manager + Lithnet + Lithnet Access Manager + (c) 2020 Lithnet + https://github.com/lithnet/access-manager + false + AnyCPU + win-x64 + false + en + - - - + - - + + PreserveNewest + - - {71efa88b-171c-4554-9ce4-f7f89e609a96} - Lithnet.AccessManager - + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/LithnetAccessManager.psd1 b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/LithnetAccessManager.psd1 new file mode 100644 index 0000000000000000000000000000000000000000..c4a5bedc049b541f9c88f31c2cd0efcb7948f3a5 GIT binary patch literal 8040 zcmeI1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8R{EB{6OXco#x^$J zqH|C4s{7+x*>1TWInIexPRCQ#qL~f0V`VFQdvKe+$Kl-t*Wp1Tl`goMli+vn2#7yp zO>~?to)ZhBSUDI=pN##`)OW4c&7bNWnK{)JG|Zyk$Y;Puwo4$tJ)>-iEU#M=Up>w&+3bf+p-cBYUwx4Jp!ZSh znEi7rw%h)OPB!Q<*VM()%}}d5vi~qvh+W-NBdw=C3O8ajEjQ<>B#{GD`1g{KpVhpI zF~<3so%38b>&W}MtY*De!}paQxfAO@x_S>lynoGm%X{1DTxK1Mx!j7)wy$?#Tj~Zj zWo@FIogE#sb=BA7U#|dLlGclzVJ`KmxHvsA?zZZM73gEr>P572PTAAG&UQ%fbAA%j z-nFK6sa&m@70dTInzWy|K9X(eN)0JjX+}YpHi&y)+Y28_YfkXoQy_pZ{NAfkYO~K> z@$-EowUt_ixA1!*->}~RrF9jc;}AJXxsJ9Q-IQNSG>%1D=4 zo<8&IM)R3~Wle6=5|w$N{NL}TFj>DfCM<>>f({@xo?$dD6d9q)!Tr#c(hsB1S2VJ&LZ%4Vakhu)LJ*`XhSViJo z1vY|p%6&#Xo~aA&4Zq@*c4Ib8LHstj;EHm|NAGl{mfZhpwvgsjO|kcJO4Nj=tRQ`01hT zRPadJL)qT$WBVs~=hp>;U=#K?#!+0kYsUfWl1H2v?TD5Agla9@H5Tf2$qvWw(V6SG bDZg?OYPzK3-9j({7KYX4Nt}GR_%-rhllv&? literal 0 HcmV?d00001 diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Properties/AssemblyInfo.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Properties/AssemblyInfo.cs deleted file mode 100644 index e6252e71..00000000 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.PowerShell/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Lithnet.AccessManager.PowerShell")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Lithnet.AccessManager.PowerShell")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c8e94e87-f4bc-4623-a72d-7df376a2daec")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.Test/Lithnet.AccessManager.Server.Test.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.Test/Lithnet.AccessManager.Server.Test.csproj index 293976c7..ca47fbd7 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.Test/Lithnet.AccessManager.Server.Test.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.Test/Lithnet.AccessManager.Server.Test.csproj @@ -28,13 +28,13 @@ - - + + - - + + all diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/Lithnet.AccessManager.Server.UI.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/Lithnet.AccessManager.Server.UI.csproj index c3f369b9..7757c3a6 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/Lithnet.AccessManager.Server.UI.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/Lithnet.AccessManager.Server.UI.csproj @@ -64,8 +64,8 @@ - - + + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/LapsConfigurationViewModel.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/LapsConfigurationViewModel.cs index 89e1cb89..d28dbe70 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/LapsConfigurationViewModel.cs +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/LapsConfigurationViewModel.cs @@ -182,7 +182,7 @@ public async Task GenerateEncryptionCertificate() public bool CanRepermission => this.SelectedCertificate?.CanRepermission == true; - public async Task Repermission() + public void Repermission() { var cert = this.SelectedCertificate; @@ -191,7 +191,7 @@ public async Task Repermission() return; } - await cert.Repermission(); + cert.Repermission(); } public bool CanShowCertificateDialog => this.SelectedCertificate != null; @@ -348,8 +348,7 @@ private async Task RefreshAvailableCertificates() } var allCertificates = certificateProvider.GetEligiblePasswordEncryptionCertificates(false).OfType(); - this.certificateProvider.TryGetCertificateFromDirectory(out X509Certificate2 publishedCert, - this.SelectedForest.RootDomain.Name); + this.certificateProvider.TryGetCertificateFromDirectory(out X509Certificate2 publishedCert, this.SelectedForest.RootDomain.Name); bool foundPublished = false; diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/X509Certificate2ViewModel.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/X509Certificate2ViewModel.cs index 29674fa8..1111004d 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/X509Certificate2ViewModel.cs +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server.UI/ViewModels/X509Certificate2ViewModel.cs @@ -1,6 +1,7 @@ using System; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; +using System.Windows; using MahApps.Metro.Controls.Dialogs; using Microsoft.Extensions.Logging; using Stylet; @@ -48,7 +49,7 @@ public X509Certificate2ViewModel(X509Certificate2 model, ILogger !this.HasPermission; - public async Task Repermission() + public void Repermission() { try { @@ -57,7 +58,7 @@ public async Task Repermission() catch (Exception ex) { this.logger.LogError(EventIDs.UIConfigurationSaveError, ex, "Could not set permissions on the private key"); - await this.dialogCoordinator.ShowMessageAsync(this, "Error", $"Could not set permissions on the private key\r\n{ex.Message}"); + MessageBox.Show($"Could not set permissions on the private key\r\n{ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } this.CheckCertificatePermissions(); diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server/Providers/CertificatePermissionProvider.cs b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server/Providers/CertificatePermissionProvider.cs index 4ff05493..eea85fb8 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Server/Providers/CertificatePermissionProvider.cs +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Server/Providers/CertificatePermissionProvider.cs @@ -71,7 +71,7 @@ public void AddReadPermissionToServiceStore(IdentityReference identity, List - + - + @@ -42,6 +42,7 @@ + @@ -49,10 +50,13 @@ + + + @@ -87,6 +91,7 @@ + @@ -94,6 +99,7 @@ + @@ -102,7 +108,10 @@ + + + @@ -153,12 +162,14 @@ + + @@ -167,15 +178,19 @@ + + + + @@ -185,6 +200,7 @@ + @@ -224,10 +240,12 @@ + + @@ -238,6 +256,7 @@ + @@ -304,8 +323,10 @@ + + @@ -325,6 +346,7 @@ + @@ -343,6 +365,7 @@ + @@ -360,10 +383,12 @@ + + @@ -390,6 +415,7 @@ + @@ -399,6 +425,7 @@ + @@ -413,13 +440,20 @@ + + + + + + + @@ -925,13 +959,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -939,6 +1005,8 @@ + + @@ -1608,6 +1676,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1752,5 +1850,6 @@ + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/Lithnet.AccessManager.Service.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/Lithnet.AccessManager.Service.csproj index 58bee5e4..9e709a53 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/Lithnet.AccessManager.Service.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/Lithnet.AccessManager.Service.csproj @@ -87,7 +87,7 @@ - + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/dev-config/appsettings.json b/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/dev-config/appsettings.json index 2c462e83..69dd22fd 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/dev-config/appsettings.json +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Service/dev-config/appsettings.json @@ -1,6 +1,6 @@ { "Metadata": { - "Usn": 95, + "Usn": 96, "SchemaVersion": "1.0" }, "Licensing": { @@ -201,6 +201,15 @@ "Mode": 3 }, "Operation": 0 + }, + { + "Thumbprint": "33959858DFD3441D21221B01A5C2AF69860E9780", + "Data": "MIIRJwIBAzCCEOMGCSqGSIb3DQEHAaCCENQEghDQMIIQzDCCCoUGCSqGSIb3DQEHAaCCCnYEggpyMIIKbjCCCmoGCyqGSIb3DQEMCgECoIIJdjCCCXIwHAYKKoZIhvcNAQwBAzAOBAhtNWTyNK1hFgICB9AEgglQIeLrLXzrPOhsW3ZZCgtZuharMLYsfD8Wo364wlUuYLbnhni79PosabB6uyY+HsuYLnajwgyBNhlbiSae3326n8pg9ZAd7t/nsytFxFltg+Y0LKYr+4UKrAaym5yzfs4W78QxsWvb4phP1wgMherrd7jdBCyNOaavSZf3vBW7bLKYIHLR+knPlPy3tgD5B/fyrcTy3NB+Cmr+64mlzA/0yobXNOSeJb934gfkQZKOLhTSHSYo5WLWb0d3xtIWgEtEzhu1MAEw8LcV/5oolBJT0Bj54nxXcleZBGuOPHlDyspVxKZIdw7sLWfBMO7QGdI1s6Irf9JtJJVJIDlM2YuBQPgneGCrjRdKnGrx4eEpHWbHfpzOGm2PGwC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GTooIBjwIBBDCCAVEEgYwBAAAAS0RTSwIAAABnAQAADQAAAAMAAAD61vaIJ3qceb7X5H6Gn78GIAAAABwAAAAcAAAA+bkeygmEzCnO2hVp6+pqJyz5HJV/VOlpup9dw8K/PzlJAEQATQBEAEUAVgAxAC4ATABPAEMAQQBMAAAASQBEAE0ARABFAFYAMQAuAEwATwBDAEEATAAAADCBvwYJKwYBBAGCN0oBMIGxBgorBgEEAYI3SgEFMIGiMIGfMIGcDARTRERMDIGTTzpEQUQ6KEE7O0RDOzs7V0QpKEE7O0NDREM7OztEQSkoQTs7Q0NEQzs7O1MtMS01LTIxLTYzOTYyNDk3MS0yNjY3OTIzMTc0LTE1Mzk2MDMxOTAtMTEyMikoQTs7Q0NEQzs7O1MtMS01LTIxLTYzOTYyNDk3MS0yNjY3OTIzMTc0LTE1Mzk2MDMxOTAtNDM1OTkpMAsGCWCGSAFlAwQBLQQo53qxBHau83F5yombyZZ4it2lBaBL3u6E3GhDb3TBwWtdcZjZNk7aVzCCAT8GCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMPQ6RbByHJ5SlGC9GAgEQgIIBEGIU/+r00m4fcPV1fx6xO2wIe+2M3nWgD5pvgL5XxcCCEknj6rLLK3zciOG7fd2Llkik2hwBmP/IYVGv9Fp3lAi7qkiUI/TDjOqO5UuK3mSGzf3MERnnHa5g/O5wCayPmi4wXOarhF1LknQgiauxYSNM/tANWxnQJfOg7VU8M0kg7EtOOmU/2Jrc7/uwd3yKUXmS1b8UogXrDh3ErOYYHCydGYQtYPhgDX3bPWNHqNvLSqlaZGZPDoSKj69j+3a8sbFXtf2B+Fl0B/avw4nnj6hvuJFGcoxKZnhRQjTiYjT4Aes8TCaP2i+xlx+7pA7gB3bqCzoARzJxuRvBBP96PvWWg3LlKT1tdsHuRvjVp8wj", + "Mode": 3 + }, + "Operation": 0 } ], "EnableCertificateSynchronization": true, diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.Test/Lithnet.AccessManager.Test.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager.Test/Lithnet.AccessManager.Test.csproj index 84f42035..62712685 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.Test/Lithnet.AccessManager.Test.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.Test/Lithnet.AccessManager.Test.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager.sln b/src/Lithnet.AccessManager/Lithnet.AccessManager.sln index 3bb26946..ae8dcf44 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager.sln +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager.sln @@ -33,6 +33,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lithnet.AccessManager.Serve EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lithnet.AccessManager.Agent.Test", "Lithnet.AccessManager.Agent.Test\Lithnet.AccessManager.Agent.Test.csproj", "{1CD490CB-1E66-4AF6-9624-2EBFE61346C2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lithnet.AccessManager.PowerShell", "Lithnet.AccessManager.PowerShell\Lithnet.AccessManager.PowerShell.csproj", "{C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lithnet.AccessManager.PowerShell.Test", "Lithnet.AccessManager.PowerShell.Test\Lithnet.AccessManager.PowerShell.Test.csproj", "{22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Any CPU = All|Any CPU @@ -241,6 +245,54 @@ Global {1CD490CB-1E66-4AF6-9624-2EBFE61346C2}.Release|x64.Build.0 = Release|Any CPU {1CD490CB-1E66-4AF6-9624-2EBFE61346C2}.Release|x86.ActiveCfg = Release|Any CPU {1CD490CB-1E66-4AF6-9624-2EBFE61346C2}.Release|x86.Build.0 = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|Any CPU.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|Any CPU.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|x64.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|x64.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|x86.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.All|x86.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|x64.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|x64.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|x86.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Debug|x86.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|Any CPU.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|x64.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|x64.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|x86.ActiveCfg = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Dev|x86.Build.0 = Debug|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|Any CPU.Build.0 = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|x64.ActiveCfg = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|x64.Build.0 = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|x86.ActiveCfg = Release|Any CPU + {C8E94E87-F4BC-4623-A72D-7DF376A2DAEC}.Release|x86.Build.0 = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|Any CPU.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|Any CPU.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|x64.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|x64.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|x86.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.All|x86.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|x64.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|x64.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Debug|x86.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|Any CPU.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|x64.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|x64.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|x86.ActiveCfg = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Dev|x86.Build.0 = Debug|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|Any CPU.Build.0 = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|x64.ActiveCfg = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|x64.Build.0 = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|x86.ActiveCfg = Release|Any CPU + {22F8D82B-84B7-4D44-83AC-33BCB3B6EEBA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Lithnet.AccessManager/Lithnet.AccessManager/Lithnet.AccessManager.csproj b/src/Lithnet.AccessManager/Lithnet.AccessManager/Lithnet.AccessManager.csproj index bc20ee16..7f23a717 100644 --- a/src/Lithnet.AccessManager/Lithnet.AccessManager/Lithnet.AccessManager.csproj +++ b/src/Lithnet.AccessManager/Lithnet.AccessManager/Lithnet.AccessManager.csproj @@ -21,13 +21,13 @@ - + - + diff --git a/src/Lithnet.AccessManager/action-core-build-service.bat b/src/Lithnet.AccessManager/action-core-build-service.bat index be7b34e8..1ee81795 100644 --- a/src/Lithnet.AccessManager/action-core-build-service.bat +++ b/src/Lithnet.AccessManager/action-core-build-service.bat @@ -1,38 +1,51 @@ @echo off SETLOCAL SET solutiondir=D:\dev\git\lithnet\access-manager\src\Lithnet.AccessManager -SET outputdir=%solutiondir%\Lithnet.AccessManager.Service.Setup\output +SET outputdirservice=%solutiondir%\Lithnet.AccessManager.Service.Setup\output +SET outputdirps=%solutiondir%\Lithnet.AccessManager.Service.Setup\output-ps SET serviceProject=%solutiondir%\Lithnet.AccessManager.Service\Lithnet.AccessManager.Service.csproj SET uiProject=%solutiondir%\Lithnet.AccessManager.Server.UI\Lithnet.AccessManager.Server.UI.csproj +SET powerShellProject=%solutiondir%\Lithnet.AccessManager.PowerShell\Lithnet.AccessManager.PowerShell.csproj SET setupProject=%solutiondir%\Lithnet.AccessManager.Service.Setup\Lithnet.AccessManager.Service.Setup.aip -ECHO Clearing output directory "%outputdir%" -IF EXIST "%outputdir%" rd /s /q "%outputdir%" || exit /b %errorlevel% +ECHO Clearing output directory "%outputdirservice%" +IF EXIST "%outputdirservice%" rd /s /q "%outputdirservice%" || exit /b %errorlevel% if %errorlevel% neq 0 exit /b %errorlevel% -ECHO Creating output directory "%outputdir%" -md %outputdir% || exit /b %errorlevel% +ECHO Clearing output directory "%outputdirps%" +IF EXIST "%outputdirps%" rd /s /q "%outputdirps%" || exit /b %errorlevel% +if %errorlevel% neq 0 exit /b %errorlevel% + +ECHO Creating output directory "%outputdirservice%" +md %outputdirservice% || exit /b %errorlevel% + +ECHO Creating output directory "%outputdirps%" +md %outputdirps% || exit /b %errorlevel% if "%buildingbeta%" EQU "1" ( ECHO Writing license file -"D:\dev\git\lithnet\access-manager-enterprise\src\Lithnet.AccessManager.Enterprise.LicenseManager.Cli\bin\Debug\netcoreapp3.1\amsliccli" --subject "Beta program participant" --type BuiltIn --audiences * --units -1 --min-version %version% --max-version %version% --expire-in-days 90 --out-file "%outputdir%\license.dat" +"D:\dev\git\lithnet\access-manager-enterprise\src\Lithnet.AccessManager.Enterprise.LicenseManager.Cli\bin\Debug\netcoreapp3.1\amsliccli" --subject "Beta program participant" --type BuiltIn --audiences * --units -1 --min-version %version% --max-version %version% --expire-in-days 90 --out-file "%outputdirservice%\license.dat" if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% ) ECHO Building service project -dotnet publish "%serviceProject%" --runtime win8-x64 --output "%outputdir%" --framework netcoreapp3.1 --self-contained false /p:TreatWarningsAsErrors=true /warnaserror +dotnet publish "%serviceProject%" --runtime win8-x64 --output "%outputdirservice%" --framework netcoreapp3.1 --self-contained false /p:TreatWarningsAsErrors=true /warnaserror if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% ECHO Building UI project -dotnet publish "%uiproject%" --runtime win8-x64 --output "%outputdir%" --framework netcoreapp3.1 --self-contained false /p:TreatWarningsAsErrors=true /warnaserror +dotnet publish "%uiproject%" --runtime win8-x64 --output "%outputdirservice%" --framework netcoreapp3.1 --self-contained false /p:TreatWarningsAsErrors=true /warnaserror +if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% + +ECHO Building PowerShell project +dotnet publish "%powerShellProject%" --output "%outputdirps%" --runtime win-x64 --framework net472 --self-contained false --configuration Release /property:Version=%version% /property:FileVersion=%version% /p:TreatWarningsAsErrors=true /warnaserror if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% ECHO Signing Lithnet EXEs -"%SIGNTOOLPATH%\signtool.exe" sign /sha1 %CSCERTTHUMBPRINT% /d "Lithnet Access Manager" /t http://timestamp.digicert.com /fd sha256 /v "%outputdir%\Lithnet*.exe" +"%SIGNTOOLPATH%\signtool.exe" sign /sha1 %CSCERTTHUMBPRINT% /d "Lithnet Access Manager" /t http://timestamp.digicert.com /fd sha256 /v "%outputdirservice%\Lithnet*.exe" if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% ECHO Signing Lithnet DLLs -"%SIGNTOOLPATH%\signtool.exe" sign /sha1 %CSCERTTHUMBPRINT% /d "Lithnet Access Manager" /t http://timestamp.digicert.com /fd sha256 /v "%outputdir%\Lithnet*.dll" +"%SIGNTOOLPATH%\signtool.exe" sign /sha1 %CSCERTTHUMBPRINT% /d "Lithnet Access Manager" /t http://timestamp.digicert.com /fd sha256 /v "%outputdirservice%\Lithnet*.dll" if %errorlevel% neq 0 ECHO Build failed && exit /b %errorlevel% ECHO Building installer diff --git a/src/Lithnet.AccessManager/version.txt b/src/Lithnet.AccessManager/version.txt index 2c5464d7..6f67b25f 100644 --- a/src/Lithnet.AccessManager/version.txt +++ b/src/Lithnet.AccessManager/version.txt @@ -1 +1 @@ -7775 +7793