<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LYFR</title>
		<description>Personal Blog</description>
		<link>https://www.lyfr.org/</link>
		<atom:link href="https://www.lyfr.org/ sitemap.xml" rel="self" type="application/rss+xml"/>
		<pubDate>Sun, 01 Mar 2026 12:24:19 +0000</pubDate>
		<lastBuildDate>Sun, 01 Mar 2026 12:24:19 +0000</lastBuildDate>
		<generator>Jekyll
		v4.4.1</generator>  <item>
			<title>Use KeePass to automatically open authenticated nsupdate</title>
				<description>&lt;p&gt;This is a quick guide on how to configure to open nsupdate with a configured tsigkey stored in KeePass.
&lt;a href=&quot;https://linux.die.net/man/1/nsupdate&quot;&gt;nsupdate&lt;/a&gt; is used to submit Dynamic DNS Update requests as defined in RFC2136 to a name
server. This is useful when administrating a dynamically managed DNS zones. To secure the process i.e. allow it to be done from an
administrators computer the transaction is a authenticated with the use of TSIG, however specifics about TSIG, nsupdate and DNS in
general are not the goal of this post.&lt;/p&gt;

&lt;p&gt;As I didn’t want my personalized TSIG key lying around in a directory somewhere on my computer I instead put it in KeePass. And as I
also didn’t want to copy it into the nsupdate interactive shell each time a created a quick URL Override for KeePass to do it for
me.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;First of you need a locally installed instance of nsupdate. On my Windows 10 I used Windows Subsystem for Linux (WSL) to install ns
update via APT &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt update; apt install -y dnsutils&lt;/code&gt;. Alternatively you can download the Bind9 package for Windows &lt;a href=&quot;https://www.isc.org/download/&quot;&gt;from
ISC&lt;/a&gt; and extract &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsupdate.exe&lt;/code&gt; from there.&lt;/p&gt;

&lt;h2 id=&quot;keepass-configuration&quot;&gt;KeePass configuration&lt;/h2&gt;

&lt;p&gt;To change the default URL action for a URL scheme (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ftp://&lt;/code&gt;), got to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Tools&lt;/code&gt; -&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Options&lt;/code&gt; -&amp;gt; tab &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Integration&lt;/code&gt; -&amp;gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;URL Overrides&lt;/code&gt; and define a new URL scheme override.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;url-override.png&quot; alt=&quot;url override&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Scheme: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsupdate&lt;/code&gt;&lt;br /&gt;
URL override: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmd://C:\Windows\System32\wsl.exe -- nsupdate -v -y {S:hmac}{USERNAME}:{PASSWORD}&lt;/code&gt;&lt;br /&gt;
Or if you downloaded &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsupdate.exe&lt;/code&gt;:&lt;br /&gt;
URL override: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmd://C:\&amp;lt;path&amp;gt;\&amp;lt;to&amp;gt;\nsupdate.exe -v -y {S:hmac}{USERNAME}:{PASSWORD}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After creating the URL override you can trigger the shell from a entry with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nsupdate:///&lt;/code&gt; url entry. The entry uses the usernames
as key name and the password as the base64 encoded secret key as found in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.private&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;entry.png&quot; alt=&quot;entry&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you use a key algorithm other than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HMAC-MD5&lt;/code&gt; (and you should), then you need to also define the custom string field &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hmac&lt;/code&gt; for
the entry. This field is used to tell nsupdate what key algorithm is in use for the key.&lt;br /&gt;
&lt;strong&gt;Important this value has to end in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:&lt;/code&gt; es
it is seen as part of the key name.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;url-override.png&quot; alt=&quot;entry advanced&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Possible key algorithms:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hmac-md5&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hmac-sha1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hmac-sha256&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hmac-sha512&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
				<pubDate>Sat, 01 May 2021 00:00:00 +0000</pubDate>
				<link>https://www.lyfr.org/2021/05/01/use-keepass-to-automatically-open-authenticated-nsupdate/</link>
				<guid
				isPermaLink="true">https://www.lyfr.org/2021/05/01/use-keepass-to-automatically-open-authenticated-nsupdate/</guid>   <category>cryptography</category>  </item>  <item>
			<title>Dotnet project layout with MSBuild 15+</title>
				<description>&lt;p&gt;Recently I stumbled upon an article by &lt;a href=&quot;https://www.strathweb.com/&quot;&gt;Filip W.&lt;/a&gt;
in which he wrote about &lt;a href=&quot;https://www.strathweb.com/2018/07/solution-wide-nuget-package-version-handling-with-msbuild-15/&quot;&gt;Solution-wide Nuget package version handling with MsBuild 15+&lt;/a&gt;.
That inspired me to give it a try but with a bit more fine grained control,
by using multiple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Directory.Build.targets&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Directory.Build.props&lt;/code&gt; files.
Here is the result of that experiment; I omitted other files such as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;README.md&lt;/code&gt;
because they are not really relevant to the build process.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-file-tree&quot;&gt;/
├─ src/
│  ├─ Directory.Build.props
│  ├─ Directory.Build.targets
│  ├─ Project.Common/
│  │  └─ Project.Common.csproj
│  └─ Project/
│     └─ Project.csproj
│
├─ test/
│  ├─ Directory.Build.props
│  ├─ Directory.Build.targets
│  ├─ Project.Common.Tests/
│  │  └─ Project.Common.Tests.csproj
│  └─ Project.Tests/
│     └─ Project.Tests.csproj
│
├─ Directory.Build.props
├─ Directory.Build.targets
└─ Project.sln
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;directorybuildprops-and-directorybuildtargets-files&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Directory.Build.props&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Directory.Build.targets&lt;/code&gt; files.&lt;/h2&gt;

&lt;p&gt;The root Build.props only sets properties required for source link. Whereas the
root Build.targets specifies the package versions for the entire solution. It
also adds source link to all projects as all projects need to reference it for
the build process. Additionally target framework dependent package version can
be made in the global location.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/Directory.Build.props&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PublishRepositoryUrl&amp;gt;&lt;/span&gt;true&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PublishRepositoryUrl&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;AllowedOutputExtensionsInPackageBuildOutputFolder&amp;gt;&lt;/span&gt;$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb&lt;span class=&quot;nt&quot;&gt;&amp;lt;/AllowedOutputExtensionsInPackageBuildOutputFolder&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/Directory.Build.targets&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.SourceLink.GitLab&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;1.0.0-*&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;nt&quot;&gt;&amp;lt;PrivateAssets&amp;gt;&lt;/span&gt;all&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PrivateAssets&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;nt&quot;&gt;&amp;lt;IncludeAssets&amp;gt;&lt;/span&gt;runtime; build; native; contentfiles; analyzers&lt;span class=&quot;nt&quot;&gt;&amp;lt;/IncludeAssets&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageReference&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Buffers&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.5.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Memory&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.5.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.ValueTuple&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.5.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;(&apos;$(TargetFramework)&apos; == &apos;netstandard1.6&apos;) Or (&apos;$(TargetFramework)&apos; == &apos;netstandard1.3&apos;)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Threading.ThreadPool&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.3.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.Extensions.Logging.Abstractions&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;[1.1.*,2)&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&apos;$(TargetFramework)&apos; == &apos;netstandard2.0&apos;&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.Extensions.Logging.Abstractions&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2.2.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/src/Directory.Build.props&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;Import&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Project=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../Directory.Build.props&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;VersionPrefix&amp;gt;&lt;/span&gt;1.0.0&lt;span class=&quot;nt&quot;&gt;&amp;lt;/VersionPrefix&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageLicenseFile&amp;gt;&lt;/span&gt;LICENSE.txt&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageLicenseFile&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageProjectUrl&amp;gt;&lt;/span&gt;https://example.com/Project&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageProjectUrl&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;RepositoryUrl&amp;gt;&lt;/span&gt;https://example.com/Project.git&lt;span class=&quot;nt&quot;&gt;&amp;lt;/RepositoryUrl&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;RepositoryType&amp;gt;&lt;/span&gt;git&lt;span class=&quot;nt&quot;&gt;&amp;lt;/RepositoryType&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReleaseNotes&amp;gt;&lt;/span&gt;https://example.com/Project/blob/master/CHANGELOG.md&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageReleaseNotes&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;GenerateDocumentationFile&amp;gt;&lt;/span&gt;true&lt;span class=&quot;nt&quot;&gt;&amp;lt;/GenerateDocumentationFile&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;GeneratePackageOnBuild&amp;gt;&lt;/span&gt;true&lt;span class=&quot;nt&quot;&gt;&amp;lt;/GeneratePackageOnBuild&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/src/Directory.Build.targets&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;Import&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Project=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../Directory.Build.targets&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;None&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../../LICENSE.txt&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Visible=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Pack=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;PackagePath=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;$(PackageLicenseFile)&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;None&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../../THIRD-PARTY-NOTICES.txt&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Visible=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Pack=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;PackagePath=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;THIRD-PARTY-NOTICES.txt&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;None&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../../CHANGELOG.md&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Visible=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Pack=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;PackagePath=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;CHANGELOG.md&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;AssemblyAttribute&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Runtime.CompilerServices.InternalsVisibleTo&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;nt&quot;&gt;&amp;lt;_Parameter1&amp;gt;&lt;/span&gt;$(MSBuildProjectName).Tests&lt;span class=&quot;nt&quot;&gt;&amp;lt;/_Parameter1&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;/AssemblyAttribute&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;I haven’t really done anything with the Build.props in the test directory and
only listed it for completeness. In the Build.targets however I specified the
versions for the test-framework packages. As they are specific to the test
projects, so that they do not clutter up the root Build.targets.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/test/Directory.Build.props&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;Import&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Project=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../Directory.Build.props&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/test/Directory.Build.targets&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;Import&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Project=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;../Directory.Build.targets&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.NET.Test.Sdk&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;16.0.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;NUnit&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;3.11.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Update=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;NUnit3TestAdapter&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;3.13.*&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;project-files&quot;&gt;Project files&lt;/h2&gt;

&lt;p&gt;Because post of the includes and package config are defined in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.builds&lt;/code&gt; and
the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.targets&lt;/code&gt; files the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.csproj&lt;/code&gt; files are rather slim, only including the
name of the NuGet package to include.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Project.csproj&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Sdk=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.NET.Sdk&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;TargetFrameworks&amp;gt;&lt;/span&gt;netstandard1.3;netstandard1.6;netstandard2.0&lt;span class=&quot;nt&quot;&gt;&amp;lt;/TargetFrameworks&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;LangVersion&amp;gt;&lt;/span&gt;latest&lt;span class=&quot;nt&quot;&gt;&amp;lt;/LangVersion&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;Description&amp;gt;&amp;lt;/Description&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageId&amp;gt;&lt;/span&gt;Project&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageId&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Memory&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;(&apos;$(TargetFramework)&apos; == &apos;netstandard1.6&apos;) Or (&apos;$(TargetFramework)&apos; == &apos;netstandard1.3&apos;)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.ValueTuple&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Project.Common.csproj&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Sdk=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.NET.Sdk&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;TargetFrameworks&amp;gt;&lt;/span&gt;netstandard1.3;netstandard1.6;netstandard2.0&lt;span class=&quot;nt&quot;&gt;&amp;lt;/TargetFrameworks&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;LangVersion&amp;gt;&lt;/span&gt;latest&lt;span class=&quot;nt&quot;&gt;&amp;lt;/LangVersion&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;Description&amp;gt;&amp;lt;/Description&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageId&amp;gt;&lt;/span&gt;Project.Common&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PackageId&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Buffers&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Microsoft.Extensions.Logging.Abstractions&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;(&apos;$(TargetFramework)&apos; == &apos;netstandard1.6&apos;) Or (&apos;$(TargetFramework)&apos; == &apos;netstandard1.3&apos;)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Threading.ThreadPool&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Alternatively to specifically importing the targets/props in the parent
directory I could have also used the approach described in the &lt;a href=&quot;https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#use-case-multi-level-merging&quot;&gt;Microsoft documentation&lt;/a&gt;.
But in this case I think &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;Import Project=&quot;../Directory.Build.props&quot; /&amp;gt;&lt;/code&gt;
reads a bit better than: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;Import Project=&quot;$([MSBuild]::GetPathOfFileAbove(&apos;Directory.Build.props&apos;, &apos;$(MSBuildThisFileDirectory)../&apos;))&quot; /&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Of course this layout will not fit all cases of the get go.
But all in all I personally really like the way that the version
of a package is specified in a central place.
Combined with the Directory.Build.props I can save on some repettetive
work.&lt;/p&gt;
</description>
				<pubDate>Mon, 09 Dec 2019 00:00:00 +0000</pubDate>
				<link>https://www.lyfr.org/2019/12/09/dotnet-project-layout-with-msbuild-15/</link>
				<guid
				isPermaLink="true">https://www.lyfr.org/2019/12/09/dotnet-project-layout-with-msbuild-15/</guid>   <category>dotnet</category>  </item>  <item>
			<title>Configuring Debian 10 (Buster) as a Tor router</title>
				<description>&lt;p&gt;Recently I needed to route the traffic of a application through Tor, but said
did not support any kind of proxy. So I decided to simply rout all traffic
coming from the machine running the app through Tor. To accomplish this I used
&lt;a href=&quot;https://github.com/darkk/redsocks&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;redsocks&lt;/code&gt;&lt;/a&gt; a tool to redirect TCP
connections to a SOCKS/HTTPS proxy using iptables.&lt;/p&gt;

&lt;h2 id=&quot;setup&quot;&gt;Setup&lt;/h2&gt;

&lt;p&gt;The setup consists of 2 VMs one acting as the Tor router and the other running
the application to be tunnled through Tor.&lt;/p&gt;

&lt;h3 id=&quot;vm0&quot;&gt;VM0&lt;/h3&gt;

&lt;p&gt;The router vm named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rtr01&lt;/code&gt;, has 2 network interfaces &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth1&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt;
is connected to the Hypervisor via NAT or Bridge, this interface must be able
reach the internet to connect a Tor circuit.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth1&lt;/code&gt; is connected to a virtual switch without internet access.&lt;/p&gt;

&lt;p&gt;The router will be configured to act as default gateway for any connected
machine and relay the connection through a Tor circuit.&lt;/p&gt;

&lt;h3 id=&quot;vm1&quot;&gt;VM1&lt;/h3&gt;

&lt;p&gt;The application host vm named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;app01&lt;/code&gt;, has only 1 network interface &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt;.
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt; is connected to the same virtual switch as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth1&lt;/code&gt; of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vm0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The application host will be connected to the router and use it as default
gateway for connection to the internet, that will be relayed through a Tor
circuit.&lt;/p&gt;

&lt;h3 id=&quot;udpdns&quot;&gt;UDP/DNS&lt;/h3&gt;

&lt;p&gt;Whilst redsocks can be configured to relay UDP traffic for specific destination
addresses and ports this is as of writing  not supported by tor. This poses a
problem for DNS as it is typically &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UDP:53&lt;/code&gt;. The traditional approach of getting
DNS to work with redsocks is to use the redsocks internal UDP DNS server that
only returns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TURNCANATED&lt;/code&gt; which should trigger the resolution through TCP.
However I found this to be rather unreliable, therefore I opted to use simply
use the Tor built-in resolution of DNS.&lt;/p&gt;

&lt;h2 id=&quot;configuration&quot;&gt;Configuration&lt;/h2&gt;

&lt;h3 id=&quot;rtr01&quot;&gt;rtr01&lt;/h3&gt;

&lt;p&gt;The router should be a default fresh install of Debian 10. First off update and
install the required packages on the machine.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# apt-get update&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# apt-get dist-upgrade -y&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# apt-get install -y iptables redsocks tor iptables-persist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The installer should already have configured &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt; as the default interface
using DHCP. Next of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth1&lt;/code&gt; will be configured so that the machine can be reached
on the virtual switch.&lt;/p&gt;

&lt;h4 id=&quot;network&quot;&gt;Network&lt;/h4&gt;

&lt;p&gt;Network range: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.0.2.0/24&lt;/code&gt; &lt;a href=&quot;https://tools.ietf.org/html/rfc5737&quot;&gt;&lt;em&gt;TEST-NET-1&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/network/interfaces&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;network&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;interfaces&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;/*

&lt;span class=&quot;n&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lo&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;iface&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lo&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inet&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;loopback&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# The WAN network interface
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;allow&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;hotplug&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eth0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;iface&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eth0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inet&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dhcp&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# The LAN network interface
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;allow&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;hotplug&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eth1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;iface&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eth1&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inet&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;static&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;netmask&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;broadcast&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;tor&quot;&gt;Tor&lt;/h4&gt;

&lt;p&gt;The tor configuration is strait forward as only 2 settings are needed.&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Bind socks proxy on port 9050 of the LAN interface.
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SocksPort&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;127&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;:&lt;span class=&quot;m&quot;&gt;9050&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Bind dns on port 53 of the LAN interface.
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DNSPort&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;:&lt;span class=&quot;m&quot;&gt;53&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Tor needs to bind the DNS port to the LAN interface as iptables only redirects
the port.&lt;/em&gt;&lt;/p&gt;

&lt;h4 id=&quot;redsocks&quot;&gt;Redsocks&lt;/h4&gt;

&lt;p&gt;In the redsocks config only the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;base&lt;/code&gt; and a single &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;redsocks&lt;/code&gt; section are
required. The base section is the Debian default config. And the redsocks
section simply redirects all traffic from port 12345 to the Tor socks proxy on
port 9059.&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;base&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;log_debug&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;log_info&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;log&lt;/span&gt; = &lt;span class=&quot;s2&quot;&gt;&quot;syslog:daemon&quot;&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;daemon&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;redsocks&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;group&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;redsocks&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;redirector&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;iptables&lt;/span&gt;;
}

&lt;span class=&quot;n&quot;&gt;redsocks&lt;/span&gt; {
        // &lt;span class=&quot;n&quot;&gt;Must&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bind&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;LAN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;iptables&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;only&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;redirects&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ports&lt;/span&gt;.
        &lt;span class=&quot;n&quot;&gt;local_ip&lt;/span&gt; = &lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;42&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;local_port&lt;/span&gt; = &lt;span class=&quot;m&quot;&gt;12345&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;ip&lt;/span&gt; = &lt;span class=&quot;m&quot;&gt;127&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;port&lt;/span&gt; = &lt;span class=&quot;m&quot;&gt;9050&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;type&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;socks5&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;iptables&quot;&gt;iptables&lt;/h4&gt;

&lt;p&gt;First of create a new chain for redsocks, dropping reserved addresses and
redirecting everything else to redsocks/tor. Unfortunately redoscks currently
&lt;a href=&quot;https://github.com/darkk/redsocks/issues/89&quot;&gt;does not support IPv6&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# iptables -t nat -N REDSOCKS&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 0.0.0.0/8 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 10.0.0.0/8 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 127.0.0.0/8 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 169.254.0.0/16 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 172.16.0.0/12 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 192.168.0.0/16 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 224.0.0.0/4 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -d 240.0.0.0/4 -j RETURN&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# iptables -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To redirect all TCP connection coming in on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth1&lt;/code&gt; to Tor the following
PREROUTING rule is applied.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# iptables -A PREROUTING -s 192.0.2.0/24 -p tcp -j REDSOCKS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Redirect DNS requests to TOR.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# iptables -A PREROUTING -s 192.0.2.0/24 -p udp --dport 53 -j REDIRECT --to-ports 53&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally safe the ruleset.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# iptables-save &amp;gt; /etc/iptables/rules.v4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;afterword&quot;&gt;Afterword&lt;/h2&gt;

&lt;p&gt;One disadvantage of this approach is that there is no way for a client to
instruct Tor to establish a new circuit in case the current one is compromised,
this could however be remedied by periodically switching the circuit.&lt;/p&gt;
</description>
				<pubDate>Mon, 09 Dec 2019 00:00:00 +0000</pubDate>
				<link>https://www.lyfr.org/2019/12/09/debian-as-tor-router/</link>
				<guid
				isPermaLink="true">https://www.lyfr.org/2019/12/09/debian-as-tor-router/</guid>   <category>debian</category>  </item>  <item>
			<title>Analyse des Netzwerkverkehrs der RWE Smarthome Zentraleinheit V1</title>
				<description>&lt;p&gt;Bei der RWE Smarthome Zentraleinheit V1 handelt es sich uim eine von RWE vertriebene
Hausautomatisierungs Lösung. Die Zentraleinheit kommuniziert mit den verschiedenen
Geräten über 868.3 MHz. Die Steuerung von verschiedenen Ereignissen findet intern
statt. Die Zentraleinheit kann auf intern, von Geräten oder per Zeitsteuerung,
extern, über eine Weboberfläche &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://home.innogy-smarthome.de&lt;/code&gt; angestoßene,
ausgelöste Ereignisse reagieren. Die Zentraleinheit kann eigenständig ohne Internet
agieren, dabei allerdings nicht länger auf externe Ereignisse reagieren.
Die Einheit besitzt ebenso einen physikalischen Schalter zum Deaktivieren der
Internetverbindung, allerdings unterbindet dieser lediglich auf Softwareebene die
Verbindung zu den RWE Kontrollservern.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Frontalansicht der Zentraleinheit:&lt;/em&gt;&lt;br /&gt;
&lt;img src=&quot;front-min.jpg&quot; alt=&quot;Zentraleinheit Frontalansicht&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Seitenansicht der Zentraleinheit mit Anschlüssen:&lt;/em&gt;&lt;br /&gt;
&lt;img src=&quot;connections-min.jpg&quot; alt=&quot;Zentraleinheit Seitenansicht&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;kommunikations-endpunkte&quot;&gt;Kommunikations Endpunkte&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;5.189.146.13	0.rwesmarthome.pool.ntp.org
95.81.173.155	0.rwesmarthome.pool.ntp.org
91.121.7.182	0.rwesmarthome.pool.ntp.org
198.60.22.240	0.rwesmarthome.pool.ntp.org
52.239.212.164	blob.ams20prdstr08a.store.core.windows.net
193.25.80.70	services.rwe-smarthome.de
193.25.80.73	relay.rwe-smarthome.de
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;Bei dem Endpunkt &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;blob.ams20prdstr08a.store.core.windows.net&lt;/code&gt; handelt es
sich um einen Microsoft Azure data-store, dieser wurde zm Download des
Firmwareupdates verwendet. Im normalen Betriebsmodus is der Verwendungszweck
nicht eindeutig iden­ti­fi­zier­bar.
&lt;img src=&quot;firmware_download.png&quot; alt=&quot;Firmware download&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Die Endpunkte &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.rwesmarthome.pool.ntp.org&lt;/code&gt; werden wie aus dem
aufgelösten Namen bereits hervorgeht für NTP Auflösung verwendet.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Die Endpunkte &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;services.rwe-smarthome.de&lt;/code&gt; und &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;relay.rwe-smarthome.de&lt;/code&gt;
dienen vermutlich zur Kontrolle der Zentraleinheit über die Kontrollserver von RWE.&lt;/p&gt;

&lt;h2 id=&quot;verwendete-protokolle&quot;&gt;Verwendete Protokolle&lt;/h2&gt;

&lt;p&gt;Bei einem mitschnitt des Netzwerkverkehrs der Zentraleinheit während
eines Firmwareupdates und anschließendem normalen Betriebs tauchten
folgende Protokolle auf:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;NTP&lt;/li&gt;
  &lt;li&gt;MDNS&lt;/li&gt;
  &lt;li&gt;DNS&lt;/li&gt;
  &lt;li&gt;Bootstrap Protocol&lt;/li&gt;
  &lt;li&gt;SSL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;protocols.png&quot; alt=&quot;Protocols&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Für den zur Verfügung gestellten Dienst werden Primär die Endpunkte 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;services.rwe-smarthome.de&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;relay.rwe-smarthome.de&lt;/code&gt; und 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;blob.ams20prdstr08a.store.core.windows.net&lt;/code&gt; verwendet. Alle
Verbindungen zu diesen Endpunkten sind mit einer Form von SSL gesichert.
Allerdings verwenden alle Verbindungen lediglich 3DES.
Da auch Verbindungen zu Microsoft Servern keine bessere Cipher Suite
verwenden ist davon auszugehen das die Firmware selbst entweder keine
besseren Cipher Suites auswählt oder gar Unterstützt.&lt;/p&gt;

&lt;h3 id=&quot;blobams20prdstr08astorecorewindowsnet&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;blob.ams20prdstr08a.store.core.windows.net&lt;/code&gt;&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Zertifizierungsstelle: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Microsoft IT TLS CA 2&lt;/code&gt; und &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Baltimore CyberTrust Root&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Zertifikat ausgestellt an: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.blob.core.windows.net&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Verwendete Cipher Suite: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;/code&gt;&lt;br /&gt;
  Verwendung vom 3DES macht die Chipher anfällig gegen einen Angriff
  mit Sweet32. Ebenso ist die eigentliche Schlüssellänge aufgrund von
  Parity Bits reduziert.&lt;/li&gt;
  &lt;li&gt;Verwendete SSL-Version: TLS 1.0&lt;br /&gt;
  Die Verwendete SSL-Version ist veraltet und es existieren
  bekannte Angriffe, und sollte nicht länger verwendet werden.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;handshake_core.windows.net.png&quot; alt=&quot;TLS Handshake für blob.ams20prdstr08a.store.core.windows.net&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;servicesrwe-smarthomede&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;services.rwe-smarthome.de&lt;/code&gt;&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Zertifizierungsstellen: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHMPROD-CA-E&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Zertifikat ausgestellt an: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;services.rwe-smarthome.de&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Verwendete Cipher Suite: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;/code&gt;&lt;br /&gt;
  Verwendung vom 3DES macht die Chipher anfällig gegen einen Angriff
  mit Sweet32. Ebenso ist die eigentliche Schlüssellänge aufgrund von
  Parity Bits reduziert.&lt;/li&gt;
  &lt;li&gt;Verwendete SSL-Version: TLS 1.0&lt;br /&gt;
  Bewertung: Die Verwendete SSL-Version ist veraltet und es existieren
  bekannte Angriffe, und sollte nicht länger verwendet werden.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;handshake_services.rwe-smarthome.de.png&quot; alt=&quot;TLS Handshake für services.rwe-smarthome.de&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;relayrwe-smarthomede&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;relay.rwe-smarthome.de&lt;/code&gt;&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Zertifizierungsstellen: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHMPROD-CA-E&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Zertifikat ausgestellt an: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;relay.rwe-smarthome.de&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Verwendete Cipher Suite: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;/code&gt;&lt;br /&gt;
  Verwendung vom 3DES macht die Chipher anfällig gegen einen Angriff
  mit Sweet32. Ebenso ist die eigentliche Schlüssellänge aufgrund von
  Parity Bits reduziert.&lt;/li&gt;
  &lt;li&gt;Verwendete SSL-Version: TLS 1.0&lt;br /&gt;
  Die Verwendete SSL-Version ist veraltet und es existieren
  bekannte Angriffe, und sollte nicht länger verwendet werden.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;handshake_relay.rwe-smarthome.de.png&quot; alt=&quot;TLS Handshake für relay.rwe-smarthome.de&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Durchgeführt im Rahmen der Veranstaltung Praktikum IT-Sicherheit der Hochschule Trier.&lt;/p&gt;
</description>
				<pubDate>Tue, 07 May 2019 00:00:00 +0000</pubDate>
				<link>https://www.lyfr.org/2019/05/07/analyse-rwe-smarthome-zentraleinheit-v1/</link>
				<guid
				isPermaLink="true">https://www.lyfr.org/2019/05/07/analyse-rwe-smarthome-zentraleinheit-v1/</guid>   <category>cryptography</category>  </item>  <item>
			<title>Continuous deployment of a ASP.NET core website</title>
				<description>&lt;p&gt;This guide will elaborate on how to automatically deploy a ASP.NET core website
to a Linux host using GitLab and gitlab-ci-multirunner.&lt;br /&gt;
Dotnet website files located in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/www&lt;/code&gt; may be different for your
deployment, adjust accordingly. This guide assumes your website is already
ready to be deployed, that you have a basic understanding of Linux and are
comfortable with the console. You will need to substitute some variables in the
templates and file names marked by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;name-of-variable&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;dependencies&quot;&gt;Dependencies&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;A Linux host with root access&lt;/li&gt;
  &lt;li&gt;Dotnet version required to run the website installed on the host. (Assumes
an existing symlink to dotnet in /usr/local/bin/dotnet, adjust accordingly)&lt;/li&gt;
  &lt;li&gt;A GitLab repository&lt;/li&gt;
  &lt;li&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gitlab-ci-multi-runner&lt;/code&gt; package installed on the host. (With Debian
stretch the runner package is part of the regular repository in systemd unit)&lt;/li&gt;
  &lt;li&gt;The GitLab runner configured to the GitLab instance with the shell runner.
It is adviced to make the runner specific to the website repository and give
it a unique tag.
A good unique tag would be the domain that the website will be reachable from.&lt;/li&gt;
  &lt;li&gt;Nginx or other web server. If you wish to use another web server besides
Nginx adjust the permissions in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers&lt;/code&gt; and commands in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gitlab-ci.yml&lt;/code&gt;
accordingly.&lt;/li&gt;
  &lt;li&gt;Sudo installed on the host.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;configuration&quot;&gt;Configuration&lt;/h2&gt;

&lt;h3 id=&quot;preparing-the-host&quot;&gt;Preparing the host&lt;/h3&gt;

&lt;p&gt;First create a systemd unit to control your website on the Linux host from the
template below.&lt;br /&gt;
&lt;strong&gt;If you have dotnet installed through a package manager remember to adjust the
dotnet path in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStart&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-systemd highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;example website

&lt;span class=&quot;k&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;WorkingDirectory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/var/www

&lt;span class=&quot;c&quot;&gt;# Make sure the web server user owns the files for the website&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/bin/chown www-data:www-data -R /var/www/
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/local/bin/dotnet /var/www/&amp;lt;name.of.website&amp;gt;.dll

&lt;span class=&quot;c&quot;&gt;# Automatically restart the website if it crashes&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;always
&lt;span class=&quot;nt&quot;&gt;RestartSec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;10
&lt;span class=&quot;nt&quot;&gt;SyslogIdentifier&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;dotnet-website
&lt;span class=&quot;nt&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;www-data
&lt;span class=&quot;c&quot;&gt;# Only run the start command as www-data&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;PermissionsStartOnly&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;true

&lt;span class=&quot;c&quot;&gt;# We want asp.net to run with the production settings&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;ASPNETCORE_ENVIRONMENT=Production

&lt;span class=&quot;k&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;multi-user.target
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we need to adjust the permissions of the gitlab-runner user to allow him to
control the files needed by the website and hand permission back to the web
server user after the deployment. The handing back of the permissions is done
in the systemd unit. For that we need to adjust &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers&lt;/code&gt; to allow for no
password execution of specific commands, simply add the line below to the
sudoers file. With that the basic setup of the host is complete, below is an
example Nginx config.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gitlab-runner &lt;span class=&quot;nv&quot;&gt;ALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;NOPASSWD: /bin/systemctl stop &amp;lt;name-of-service&amp;gt;, /bin/systemctl start &amp;lt;name-of-service&amp;gt;, /bin/systemctl stop nginx, /bin/systemctl start nginx, /bin/chown gitlab-runner&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;:gitlab-runner &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; /var/www
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;An example Nginx config to proxy requests to the running dotnet instance.&lt;/p&gt;

&lt;div class=&quot;language-nginx highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_redirect&lt;/span&gt;      &lt;span class=&quot;no&quot;&gt;off&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;Host&lt;/span&gt;                    &lt;span class=&quot;nv&quot;&gt;$host&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;X-Real-IP&lt;/span&gt;               &lt;span class=&quot;nv&quot;&gt;$remote_addr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;X-Forwarded-For&lt;/span&gt;         &lt;span class=&quot;nv&quot;&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;X-Forwarded-Protocol&lt;/span&gt;    &lt;span class=&quot;nv&quot;&gt;$scheme&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;X-Url-Scheme&lt;/span&gt;            &lt;span class=&quot;nv&quot;&gt;$scheme&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_set_header&lt;/span&gt;    &lt;span class=&quot;s&quot;&gt;X-Forwarded-Port&lt;/span&gt;        &lt;span class=&quot;nv&quot;&gt;$server_port&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;proxy_pass&lt;/span&gt;          &lt;span class=&quot;s&quot;&gt;http://[::1]:5000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;the-gitlab-ci-script&quot;&gt;The GitLab CI script&lt;/h3&gt;

&lt;p&gt;After the host is configured all that is left to do is to tell the GitLab
server to execute the CI build on any build server and the on the deployment
server. For that we can use .gitlab-ci.yml. The script below assumes the usage
of Nginx and the dotnet standard repository layout. The script will build the
website on any runner (shared included) with the dotnet tag. After that the
build files will be uploaded to the GitLab server, then the specific runner,
our host, will pick up the next stage. But only on the master branch as we
don’t want to publish the website on every commit. The runner will then stop
the web server, dotnet and update the permissions of the old files, delete the
old files and move the new files in place and restart all stopped services.
The script need to be located at the root of the repository.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;stages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;release&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;dotnet&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;publish&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--output&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$(pwd)/src/&amp;lt;Name-of-Project&amp;gt;/bin/Release/Publish/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-c&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Release&apos;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;tags&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;dotnet&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;artifacts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;expire_in&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;7d&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./src/&amp;lt;Name-of-Project&amp;gt;/bin/*&quot;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;release&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;release&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/systemctl&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;nginx&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/systemctl&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;name-of-service&amp;gt;&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/chown&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;gitlab-runner:gitlab-runner&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-R&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/var/www&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;rm&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-rf&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/var/www/*&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;mv&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;./src/&amp;lt;Name-of-Project&amp;gt;/bin/Release/Publish/*&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/var/www/&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/systemctl&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;name-of-service&amp;gt;&apos;&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/bin/systemctl&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;nginx&apos;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;tags&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;lt;unique-tag-of-build-server&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;master&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;afterword&quot;&gt;Afterword&lt;/h2&gt;

&lt;p&gt;The great thing about using the GitLab runner is that if for whatever reason
one of your changes to the website breaks it, you can simply roll back to any
older version by executing that pipeline again. Another thing that can be done
is to make the server host multiple websites at once, which can a bit of a
security risk because the build server need to be allow to control all website
files. Which could be misused to disable other websites hosted on the server,
which is only a concern if users are allowed to freely edit the CI script in
gitlab.&lt;/p&gt;

&lt;h3 id=&quot;shared-hosting&quot;&gt;Shared hosting&lt;/h3&gt;

&lt;p&gt;If you want to make the host a shared host, than you need to tell dotnet to
listen on a different port per installation. That can be achieved multiple
ways, in this guide we will use command line arguments. For that we need to
firstly tell dotnet to use command line arguments by telling WebHost to use a
IConfigurationRoot created by the command line arguments. After that the
website can be configured from the command line, mainly the listen address can
be specified in the service file. It is important where the argument is added,
in case of dotnet it need to be after the path to the website dll. Now to
change the listen address append &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--urls &quot;http://[::1]:5001&quot;&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExecStart&lt;/code&gt;.
This causes dotnet to only listen on IPv6 localhost and port 5001, multiple
listen addresses an be specified by separating them with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;;&lt;/code&gt;. It is also
required to adapt the proxy address accordingly, that is left for the reader to
do as an exercise. Another thing that need to be adapted is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers&lt;/code&gt; to
allow for the new commands needed to start/stop multiple services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding IConfigurationRoot&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IWebHost&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;BuildWebHost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;IConfigurationRoot&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ConfigurationBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;AddCommandLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;WebHost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CreateDefaultBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;UseConfiguration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UseStartup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Startup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;;()&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
				<pubDate>Tue, 08 Aug 2017 00:00:00 +0000</pubDate>
				<link>https://www.lyfr.org/2017/08/08/continuous-deployment-of-a-aspnet-core-website/</link>
				<guid
				isPermaLink="true">https://www.lyfr.org/2017/08/08/continuous-deployment-of-a-aspnet-core-website/</guid>   <category>website</category>  <category>aspnet</category>  <category>cicd</category>  </item>   <item>
			<title>Flatcar Nomad Cluster Virtual Environment</title>
				<description>Flatcar Nomad Cluster Virtual Environment</description>
				<link>https://www.lyfr.orghttps://gitlab.lyfr.org/lyfr.org/fncve</link>
				<pubDate>Thu, 01 Jan 1970 00:33:45 +0000</pubDate>
		 <category>Linux</category>  <category>Flatcar</category>  <category>Nomad</category>  <category>Terraform</category>  <category>Proxmox</category>  </item>
		 <item>
			<title>GIP SARL - Cyber Defense as a Service</title>
				<description>GIP SARL - Cyber Defense as a Service</description>
				<link>https://www.lyfr.orghttps://web.archive.org/web/20240914235744/https://g-i-p.tech/cdaas.html</link>
				<pubDate>Thu, 01 Jan 1970 00:33:42 +0000</pubDate>
		 <category>SIEM</category>  <category>Wazuh</category>  <category>OpenSearch</category>  </item>
		 <item>
			<title>A TSIG DNS record manager daemon</title>
				<description>A TSIG DNS record manager daemon</description>
				<link>https://www.lyfr.orghttps://gitlab.lyfr.org/nunction/dynamic-network-update-agent</link>
				<pubDate>Thu, 01 Jan 1970 00:33:39 +0000</pubDate>
		 <category>C#</category>  <category>Service</category>  </item>
		 <item>
			<title>ESignboard - An E-Ink display manager</title>
				<description>ESignboard - An E-Ink display manager</description>
				<link>https://www.lyfr.orghttps://gitlab.lyfr.org/esignboard</link>
				<pubDate>Thu, 01 Jan 1970 00:33:38 +0000</pubDate>
		 <category>C#</category>  <category>Service</category>  </item>
		 <item>
			<title>XMPP - TeamSpeak bidirectional bridge</title>
				<description>XMPP - TeamSpeak bidirectional bridge</description>
				<link>https://www.lyfr.org</link>
				<pubDate>Thu, 01 Jan 1970 00:33:37 +0000</pubDate>
		 <category>XMPP</category>  <category>C#</category>  <category>API</category>  <category>Service</category>  </item>
		 <item>
			<title>Manga Lector - A Manga reader with integrated downloader</title>
				<description>Manga Lector - A Manga reader with integrated downloader</description>
				<link>https://www.lyfr.org</link>
				<pubDate>Thu, 01 Jan 1970 00:33:35 +0000</pubDate>
		 <category>C#</category>  <category>Desktop</category>  <category>GUI</category>  </item>
		 </channel>
</rss>
