From aa12e8ab653ea8dd5efdedc9539586a9770cb340 Mon Sep 17 00:00:00 2001 From: Mary Lincy Dcouto Date: Mon, 17 May 2021 17:34:40 +0530 Subject: [PATCH 01/10] removing file hash --- ZitiUpdateService/UpdateService.cs | 12 ------------ service/build.bat | 2 ++ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ZitiUpdateService/UpdateService.cs b/ZitiUpdateService/UpdateService.cs index f3b8d412..5f8c7fee 100644 --- a/ZitiUpdateService/UpdateService.cs +++ b/ZitiUpdateService/UpdateService.cs @@ -33,8 +33,6 @@ namespace ZitiUpdateService { public bool useGithubCheck { get; private set; } - private static string[] expected_hashes = new string[] { "39636E9F5E80308DE370C914CE8112876ECF4E0C", "51D52749DA021F095B021DF8C09BD62C55C36F1F" }; - private static string[] expected_subject = new string[] { @"CN=""NetFoundry, Inc."", O=""NetFoundry, Inc."", L=Herndon, S=Virginia, C=US", @"CN=NetFoundry Inc., O=NetFoundry Inc., L=Herndon, S=Virginia, C=US" }; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); @@ -660,16 +658,6 @@ namespace ZitiUpdateService { Logger.Info("the file downloaded uses a known subject. installation and can proceed. [subject:{0}]", subject); } - var hash = signer.GetCertHashString(); - if (!expected_hashes.Contains(hash)) { - Logger.Error("the file downloaded is signed by an unknown certificate! the installation will not proceed. [hash:{0}]", hash); - inUpdateCheck = false; - return; - - } else { - Logger.Info("the file downloaded is signed by a known certificate. installation and can proceed. [subject:{0}]", subject); - } - StopZiti(); StopUI().Wait(); diff --git a/service/build.bat b/service/build.bat index 34d01237..e1b6b27a 100644 --- a/service/build.bat +++ b/service/build.bat @@ -85,6 +85,8 @@ echo REMOVING old build folder if it exists at %TUNNELER_SDK_DIR%build rmdir /s /q %TUNNELER_SDK_DIR%build echo REMOVING ziti.dll at %SVC_ROOT_DIR%ziti.dll del /q %SVC_ROOT_DIR%ziti.dll +echo REMOVING wintun.dll at %SVC_ROOT_DIR%wintun.dll +del /q %SVC_ROOT_DIR%wintun.dll :QUICK From 1600a3fbfb631fefea257c4989d8ec97ef045000 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Mon, 17 May 2021 12:14:25 +0000 Subject: [PATCH 02/10] [ci skip] committing updated version related files --- service/ziti-tunnel/version.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index 7c838e31..abf93f35 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -21,8 +21,8 @@ package main const ( Version = "1.9.6" - Revision = "601ca5886780" - Branch = "main" + Revision = "aa12e8ab653e" + Branch = "release-next" BuildUser = "" - BuildDate = "2021-05-12 10:31:45" + BuildDate = "2021-05-17 12:08:29" ) From 155ca06eb2bd9a167fdadc5b1d7ec952659c8e60 Mon Sep 17 00:00:00 2001 From: Mary Lincy Dcouto Date: Thu, 20 May 2021 14:42:15 +0530 Subject: [PATCH 03/10] cleanup ziti network adapter profile, set the lower interface metric --- ZitiUpdateService/UpdateService.cs | 2 +- service/windns/windns.go | 20 ++++++++++++++++++++ service/ziti-tunnel/service/ipc.go | 4 ++-- service/ziti-tunnel/service/state.go | 3 +++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ZitiUpdateService/UpdateService.cs b/ZitiUpdateService/UpdateService.cs index 5f8c7fee..bfd6e615 100644 --- a/ZitiUpdateService/UpdateService.cs +++ b/ZitiUpdateService/UpdateService.cs @@ -193,7 +193,7 @@ namespace ZitiUpdateService { outputIpconfigInfo(destinationLocation); outputSystemInfo(destinationLocation); - // removing this as of 1.9.0+ since we use NRPT... outputDnsCache(destinationLocation); + outputDnsCache(destinationLocation); outputExternalIP(destinationLocation); outputTasklist(destinationLocation); outputRouteInfo(destinationLocation); diff --git a/service/windns/windns.go b/service/windns/windns.go index 23e63f74..0d38d8f6 100644 --- a/service/windns/windns.go +++ b/service/windns/windns.go @@ -288,3 +288,23 @@ func removeSingleNrtpRule(nrptRule string) { log.Errorf("ERROR removing the nrpt rules: %v", err) } } + +func CleanUpNetworkAdapterProfile() { + script := fmt.Sprintf(`$key="Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged\*" +Get-ItemProperty -Path $key | where {$_.FirstNetwork -match "ziti.*"} | Remove-Item + +$key="Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\*" +Get-ItemProperty -Path $key | where {$_.ProfileName -match "Ziti.*"} | Remove-Item`) + log.Debugf("Cleaning up the Network Adapter profiles with: %s", script) + + cmd := exec.Command("powershell", "-Command", script) + cmd.Stderr = os.Stdout + output := new(bytes.Buffer) + cmd.Stdout = output + + err := cmd.Run() + if err != nil { + log.Errorf("ERROR Cleaning up the Network Adapter profiles: %v", err) + } + +} \ No newline at end of file diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 1a64eea2..7126d5b4 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -65,6 +65,8 @@ var shutdown = make(chan bool, 8) //a channel informing go routines to exit func SubMain(ops chan string, changes chan<- svc.Status) error { log.Info("============================== service begins ==============================") windns.RemoveAllNrptRules() + // cleanup old ziti tun profiles + windns.CleanUpNetworkAdapterProfile() rts.LoadConfig() l := rts.state.LogLevel @@ -287,8 +289,6 @@ func initialize(cLogLevel int) error { return err } - cziti.SetInterfaceMetric(TunName, 255) - cziti.Start(rts, rts.state.TunIpv4, rts.state.TunIpv4Mask, cLogLevel) err = cziti.HookupTun(*t) if err != nil { diff --git a/service/ziti-tunnel/service/state.go b/service/ziti-tunnel/service/state.go index dbfb8fc1..82b36607 100644 --- a/service/ziti-tunnel/service/state.go +++ b/service/ziti-tunnel/service/state.go @@ -234,6 +234,9 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int, applyDns bool) (net. } //for windows 10+, could 'domains' be able to replace NRPT? dunno - didn't test it luid.SetDNS(windows.AF_INET, []net.IP{ip}, nil) + cziti.SetInterfaceMetric(TunName, 5) + } else { + cziti.SetInterfaceMetric(TunName, 255) } return ip, t.tun, nil From a089b193a6d4bcc8938bd95a8c28c1e152cfd2d7 Mon Sep 17 00:00:00 2001 From: Mary Lincy Dcouto Date: Thu, 20 May 2021 15:00:15 +0530 Subject: [PATCH 04/10] update release notes and build notes --- BUILDING.md | 8 ++++++++ release-notes.md | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 7b5a862d..b24b038e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -14,3 +14,11 @@ components: * A Windows service which runs as the local system account which creates the TUN as well as manages the Ziti connections * A Windows UWP UI application that allows the interactively logged on user to interact with the Windows service +Build steps + +* Set SVC_ROOT_DIR variable to the "\desktop-edge-win\service\" path +* Go to service directory: "cd %SVC_ROOT_DIR%" +* Run "build.bat clean|quick" (Use quick option, if you have already done a clean build, and you have the latest tsdk library in the _deps folder) +* Copy the WinSign.p12 file to the "\desktop-edge-win\Installer" path +* Build Installer: cd to the "\desktop-edge-win" path and execute "powershell -file Installer\build.ps1" +* If build is successful, the installer and sha file will be generated in "\desktop-edge-win\Installer\Output" diff --git a/release-notes.md b/release-notes.md index 0f38f7b0..5377c504 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,14 +1,14 @@ # Release 1.9.6 ## What's New -* none +* [#378](https://github.com/openziti/desktop-edge-win/issues/378) Cleanup old ziti network adapter profiles ## Other changes: -* updated installation config +* updated auto-installation config * renewed signing cert ## Bugs fixed: -* none +* set lower metric, if dns server property is set ## Dependency Updates * tsdk is updated to v0.15.6, c-sdk 0.22.5 From cc0b6cb68806a02214ff38091999847fc50540bc Mon Sep 17 00:00:00 2001 From: Mary Lincy Dcouto Date: Thu, 20 May 2021 17:31:09 +0530 Subject: [PATCH 05/10] updating the building.md file --- BUILDING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index b24b038e..d271fee7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -16,9 +16,9 @@ components: Build steps -* Set SVC_ROOT_DIR variable to the "\desktop-edge-win\service\" path +* Set PROJECT_ROOT= and SVC_ROOT_DIR=%PROJECT_ROOT%\desktop-edge-win\service\ path * Go to service directory: "cd %SVC_ROOT_DIR%" -* Run "build.bat clean|quick" (Use quick option, if you have already done a clean build, and you have the latest tsdk library in the _deps folder) -* Copy the WinSign.p12 file to the "\desktop-edge-win\Installer" path -* Build Installer: cd to the "\desktop-edge-win" path and execute "powershell -file Installer\build.ps1" -* If build is successful, the installer and sha file will be generated in "\desktop-edge-win\Installer\Output" +* Run "build.bat clean|quick" or quick.bat or clean.bat (Use quick, if you have already done a clean build, and you have the latest tsdk library in the _deps folder) +* Obtain WinSign.p12 file and copy it to the "%PROJECT_ROOT%\desktop-edge-win\Installer" path. This is the signing certificate and that it's necessary to build the installer with this. +* Build Installer: cd to the "%PROJECT_ROOT%\desktop-edge-win" path and execute "powershell -file Installer\build.ps1" +* If build is successful, the installer and sha file will be generated in "%PROJECT_ROOT%\desktop-edge-win\Installer\Output" From d7849e84cf63ac0b32c7b491b59ffca5e88815eb Mon Sep 17 00:00:00 2001 From: Mary Lincy Dcouto Date: Thu, 20 May 2021 17:53:55 +0530 Subject: [PATCH 06/10] adding debug statement and updating release notes --- release-notes.md | 4 +++- service/ziti-tunnel/service/state.go | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/release-notes.md b/release-notes.md index 5377c504..614de8d8 100644 --- a/release-notes.md +++ b/release-notes.md @@ -6,9 +6,11 @@ ## Other changes: * updated auto-installation config * renewed signing cert +* added dns cache output back to feedback.zip +* set lower metric, if dns server property is set ## Bugs fixed: -* set lower metric, if dns server property is set +* none ## Dependency Updates * tsdk is updated to v0.15.6, c-sdk 0.22.5 diff --git a/service/ziti-tunnel/service/state.go b/service/ziti-tunnel/service/state.go index 82b36607..0157a2c5 100644 --- a/service/ziti-tunnel/service/state.go +++ b/service/ziti-tunnel/service/state.go @@ -225,6 +225,7 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int, applyDns bool) (net. log.Info("routing applied") zitiPoliciesEffective := windns.IsNrptPoliciesEffective(ipv4) + interfaceMetric := 255 if applyDns || !zitiPoliciesEffective { if applyDns { log.Infof("DNS is applied to the TUN interface, because apply Dns flag in the config file is %t ", applyDns) @@ -234,10 +235,10 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int, applyDns bool) (net. } //for windows 10+, could 'domains' be able to replace NRPT? dunno - didn't test it luid.SetDNS(windows.AF_INET, []net.IP{ip}, nil) - cziti.SetInterfaceMetric(TunName, 5) - } else { - cziti.SetInterfaceMetric(TunName, 255) + interfaceMetric = 5 } + cziti.SetInterfaceMetric(TunName, interfaceMetric) + log.Debugf("Interface Metric of %s is set to %d", TunName, interfaceMetric) return ip, t.tun, nil } From 6bea451a7871ae156bdbb28a0b65052693cd2af1 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Thu, 20 May 2021 12:41:58 +0000 Subject: [PATCH 07/10] [ci skip] committing updated version related files --- service/ziti-tunnel/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index abf93f35..387371fb 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -21,8 +21,8 @@ package main const ( Version = "1.9.6" - Revision = "aa12e8ab653e" + Revision = "617e94d495de" Branch = "release-next" BuildUser = "" - BuildDate = "2021-05-17 12:08:29" + BuildDate = "2021-05-20 12:36:53" ) From 774fbb835e49dfd3511041b805b6f7de17c2846e Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Thu, 20 May 2021 12:54:13 +0000 Subject: [PATCH 08/10] [ci skip] committing updated version related files --- service/ziti-tunnel/version.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index 3c51684c..2a90e453 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -21,8 +21,8 @@ package main const ( Version = "1.9.6" - Revision = "5e93339120fc" - Branch = "main" + Revision = "a6187a5348b0" + Branch = "release-next" BuildUser = "" - BuildDate = "2021-05-13 10:30:25" + BuildDate = "2021-05-20 12:48:26" ) From 24724a5523005d4ebe29777753e57e98621bb02e Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Tue, 25 May 2021 16:41:25 +0100 Subject: [PATCH 09/10] Fix the label flowing off the page --- DesktopEdge/Views/Screens/IdentityDetails.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DesktopEdge/Views/Screens/IdentityDetails.xaml b/DesktopEdge/Views/Screens/IdentityDetails.xaml index 30fa1d48..b200cd09 100644 --- a/DesktopEdge/Views/Screens/IdentityDetails.xaml +++ b/DesktopEdge/Views/Screens/IdentityDetails.xaml @@ -47,7 +47,7 @@ - + From b3c81981731f980ce7b6fc50a6b5d755f3f5c516 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 25 May 2021 18:15:06 +0000 Subject: [PATCH 10/10] [ci skip] committing updated version related files --- service/ziti-tunnel/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index 2a90e453..0e57bdb7 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -21,8 +21,8 @@ package main const ( Version = "1.9.6" - Revision = "a6187a5348b0" + Revision = "fccaa5f5d3c2" Branch = "release-next" BuildUser = "" - BuildDate = "2021-05-20 12:48:26" + BuildDate = "2021-05-25 18:09:13" )