<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Felix Schuster</title>
    <description>The latest articles on Forem by Felix Schuster (@flxflx).</description>
    <link>https://forem.com/flxflx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F896260%2F6f367d43-063a-4c97-ab0c-20a92f0ee23a.jpg</url>
      <title>Forem: Felix Schuster</title>
      <link>https://forem.com/flxflx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/flxflx"/>
    <language>en</language>
    <item>
      <title>Setting up a "confidential" GitLab🦊🔒</title>
      <dc:creator>Felix Schuster</dc:creator>
      <pubDate>Sun, 20 Nov 2022 11:50:06 +0000</pubDate>
      <link>https://forem.com/flxflx/setting-up-a-confidential-gitlab-333h</link>
      <guid>https://forem.com/flxflx/setting-up-a-confidential-gitlab-333h</guid>
      <description>&lt;p&gt;Hey there. If you ever programmed something "sensitive" or, like me, are managing private meeting notes with Git, you probably know this uneasy feeling when pushing to GitHub. It's simply impossible to tell who may get access to your private repos. There could be malicious insiders leaking stuff or there could be bugs allowing other users to access data etc. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn045l52iyv7s4kck4uo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn045l52iyv7s4kck4uo.png" alt="GitLab cloud attack surface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This uneasy feeling is one of the primary reasons for people to use self-managed &lt;a href="https://about.gitlab.com/" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;. Especially companies concerned about leakage of IP like to run GitLab on-prem. However, maintaining on-prem infrastructure is expensive, tedious, and often not even an option. &lt;/p&gt;

&lt;h2&gt;
  
  
  Confidential computing to the rescue!
&lt;/h2&gt;

&lt;p&gt;Recent server CPUs from AMD and Intel come with so called &lt;em&gt;confidential computing&lt;/em&gt; features. With these, sensitive workloads can be kept encrypted during runtime in memory and are shielded from the rest of a system. Not even system administrators, cloud provider employees or privileged attackers can access workloads protected this way. And this property can even be verified remotely 🤯&lt;/p&gt;

&lt;p&gt;Confidential computing effectively lets you create your own runtime-encrypted and isolated "on-prem" on the public cloud. It's like having your cake and eating it 🍰&lt;/p&gt;

&lt;p&gt;If you want to learn more about confidential computing, I recently published a &lt;a href="https://content.edgeless.systems/hubfs/Confidential%20Computing%20Whitepaper.pdf" rel="noopener noreferrer"&gt;whitepaper&lt;/a&gt; on it. The &lt;a href="https://confidentialcomputing.io/" rel="noopener noreferrer"&gt;Confidential Computing Consortium&lt;/a&gt; also has some good resources. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to make GitLab🦊 "confidential"?
&lt;/h2&gt;

&lt;p&gt;Ok, now that we sort of know what confidential computing is - how do we apply it (correctly) to GitLab and the software it relies on, e.g., PostgreSQL, NGINX, and Redis?&lt;/p&gt;

&lt;p&gt;Easy! I recently &lt;a href="https://dev.to/edgelesssys/we-created-an-always-encrypted-kubernetes-1381"&gt;posted&lt;/a&gt; about our open-source project &lt;a href="https://github.com/edgelesssys/constellation" rel="noopener noreferrer"&gt;Constellation&lt;/a&gt;. Constellation is the first &lt;em&gt;confidential Kubernetes distribution&lt;/em&gt;. Think Rancher Kubernetes Engine (RKE) or RedHat OpenShift for confidential computing. &lt;/p&gt;

&lt;p&gt;Constellation encrypts and shields entire K8s clusters with the help of confidential computing. Basically, Constellation ensures that all data in a cluster is always encrypted (at runtime, at rest, and in transit) and that the cluster cannot be accessed from the infrastructure. &lt;/p&gt;

&lt;p&gt;So making GitLab "confidential" is as simple as running it with Constellation on confidential computing enabled hardware, which is available in Azure and GCP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running GitLab🦊 on Constellation💫
&lt;/h2&gt;

&lt;p&gt;The first step is to &lt;a href="https://docs.edgeless.systems/constellation/getting-started/install" rel="noopener noreferrer"&gt;download and install&lt;/a&gt; the Constellation CLI.&lt;/p&gt;

&lt;p&gt;Next, a Constellation cluster can be &lt;a href="https://docs.edgeless.systems/constellation/getting-started/first-steps" rel="noopener noreferrer"&gt;created in a few steps&lt;/a&gt;. In essence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;constellation config generate azure
constellation create &lt;span class="nt"&gt;--control-plane-nodes&lt;/span&gt; 1 &lt;span class="nt"&gt;--worker-nodes&lt;/span&gt; 2 &lt;span class="nt"&gt;-y&lt;/span&gt;
constellation init
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/constellation-admin.conf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now connect to the cluster with &lt;code&gt;kubectl&lt;/code&gt; or other tools using the auto-generated &lt;code&gt;constellation-admin.conf&lt;/code&gt;. The config ensures that the connection "confidential" and terminates inside the correct cluster. (No man-in-the-middle possible.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing GitLab (manually)
&lt;/h3&gt;

&lt;p&gt;We want our "confidential" GitLab to be accessible from the Internet under its own URL. For this, we need to install and configure &lt;a href="https://artifacthub.io/packages/helm/bitnami/external-dns" rel="noopener noreferrer"&gt;external-dns&lt;/a&gt; in our freshly created cluster.&lt;/p&gt;

&lt;p&gt;Further, we need to install Constellation's &lt;a href="https://docs.edgeless.systems/constellation/workflows/storage" rel="noopener noreferrer"&gt;CSI driver&lt;/a&gt; for Azure. The driver ensures that all data written to cloud storage from the cluster gets encrypted automatically. With the upcoming v2.3 release of Constellation, it will be installed by default.&lt;/p&gt;

&lt;p&gt;Finally, we can install GitLab via &lt;a href="https://docs.gitlab.com/charts/installation/" rel="noopener noreferrer"&gt;the official Helm chart&lt;/a&gt;, which also installs Redis, PostgreSQL, NGINX, and other components in the cluster. &lt;/p&gt;

&lt;h3&gt;
  
  
  Installing GitLab (automated)
&lt;/h3&gt;

&lt;p&gt;We also created a &lt;a href="https://github.com/edgelesssys/constellation-gitlab" rel="noopener noreferrer"&gt;custom Helm chart&lt;/a&gt; that installs and configures all of the above. This can be used as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GODADDY_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your creds here&amp;gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GODADDY_SECRET_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your creds here&amp;gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TARGET_DOMAIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your domain, e.g. gitlab.edgeless.systems&amp;gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TLS_ISSUER_EMAIL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your e-mail address&amp;gt;
helm dependency update ./gitlab
helm upgrade gitlab-infra ./gitlab &lt;span class="nt"&gt;--install&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; default &lt;span class="nt"&gt;--set&lt;/span&gt; infra.enabled&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="nv"&gt;apiKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GODADDY_API_KEY&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="nv"&gt;secretKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GODADDY_SECRET_KEY&lt;/span&gt;
helm upgrade gitlab-app ./gitlab &lt;span class="nt"&gt;--install&lt;/span&gt; &lt;span class="nt"&gt;--timeout&lt;/span&gt; 600s &lt;span class="nt"&gt;--set&lt;/span&gt; app.enabled&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; gitlab.global.hosts.domain&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGET_DOMAIN&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; gitlab.certmanager-issuer.email&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TLS_ISSUER_EMAIL&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; gitlab &lt;span class="nt"&gt;--create-namespace&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the above assumes you're using GoDaddy as your domain provider. It should be easy to adapt to other providers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live demo📺
&lt;/h2&gt;

&lt;p&gt;I deployed our confidential GitLab to &lt;a href="https://gitlab.edgeless.systems/" rel="noopener noreferrer"&gt;https://gitlab.edgeless.systems/&lt;/a&gt; and synced the Constellation repo from GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the security properties?
&lt;/h2&gt;

&lt;p&gt;Constellation ensures that the entire K8s cluster runs in runtime-encrypted and isolated Confidential VMs (CVMs) and that all data that leaves the CVMs remains encrypted. For example, if Redis or PostgreSQL write data to cloud storage that data is automatically encrypted. The corresponding cryptographic keys are all generated and managed within CVMs. We as DevOps engineers don't need to worry about these. Bottom line is that all data is always encrypted, even during runtime in memory.&lt;/p&gt;

&lt;p&gt;Constellation also verifies the integrity and authenticity of all CVMs and that they all are running the same "good" Constellation node image. This way, once &lt;code&gt;constellation init&lt;/code&gt; completes, you know that you are actually talking to an end-to-end confidential cluster via &lt;code&gt;kubectl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can learn more about these concepts in the Constellation &lt;a href="https://docs.edgeless.systems/constellation/overview/confidential-kubernetes" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about user connections?
&lt;/h3&gt;

&lt;p&gt;As I discussed already in a previous post on &lt;a href="https://dev.to/flxflx/rocketchat-constellation-most-secure-chat-server-ever--50oa"&gt;confidential Rocket.Chat&lt;/a&gt;, users of the service should also have means to verify that the service is confidential and that it is the right instance they're talking to. &lt;/p&gt;

&lt;p&gt;For browser-based connections, currently, the only way is to manually check the fingerprint of the TLS certificate. In the case of our demo instance of GitLab (&lt;a href="https://gitlab.edgeless.systems/" rel="noopener noreferrer"&gt;https://gitlab.edgeless.systems/&lt;/a&gt;) the SHA-256 fingerprint is &lt;code&gt;CB C2 F9 23 7B 46 66 FC 5B 88 70 D5 3C 73 24 98 B4 EC 1D 12 EC 38 85 8C FA A6 44 B2 43 73 34 18&lt;/code&gt;🧐&lt;/p&gt;

&lt;p&gt;For Git CLI-based connections, things are simpler. By adding the following entry to our &lt;code&gt;gitconfig&lt;/code&gt; file, we can ensure that Git always checks that the right certificate is present when talking to &lt;a href="https://gitlab.edgeless.systems/:" rel="noopener noreferrer"&gt;https://gitlab.edgeless.systems/:&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[http "https://gitlab.edgeless.systems/"]
    pinnedPubkey = sha256//aZTzzCepU+Sa34+xkqyFGiWXG+/yHtF6Q5AgMMAjHhs=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this in place, we know for sure that commands like &lt;code&gt;git clone https://gitlab.edgeless.systems/edgelesssys/constellation.git&lt;/code&gt; or a corresponding &lt;code&gt;git push&lt;/code&gt; will always go to the right confidential instance of GitLab and can't be diverted or intercepted by an attacker in control of the host of &lt;code&gt;gitlab.edgeless.systems&lt;/code&gt; or the corresponding DNS entries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F80mu4k0yk674toatpley.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F80mu4k0yk674toatpley.png" alt="Confidential Gitlab user"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;Hope you enjoyed the quick walkthrough. Personally, I have to admit that I love the idea of having a GitLab running on Azure, which can't be accessed from the infrastructure and keeps all of the data always encrypted. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgflip.com%2F71aym7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgflip.com%2F71aym7.jpg" alt="I don't always Git"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do you think? Any suggestions for apps we should make "confidential" next? &lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>devops</category>
      <category>opensource</category>
      <category>tooling</category>
    </item>
    <item>
      <title>How to set up "always encrypted" Rocket.Chat🚀 on Kubernetes</title>
      <dc:creator>Felix Schuster</dc:creator>
      <pubDate>Tue, 01 Nov 2022 13:01:03 +0000</pubDate>
      <link>https://forem.com/flxflx/rocketchat-constellation-most-secure-chat-server-ever--50oa</link>
      <guid>https://forem.com/flxflx/rocketchat-constellation-most-secure-chat-server-ever--50oa</guid>
      <description>&lt;p&gt;I recently &lt;a href="https://dev.to/edgelesssys/we-created-an-always-encrypted-kubernetes-1381"&gt;posted&lt;/a&gt; about the open-source release of our "always encrypted" K8s distro &lt;a href="https://github.com/edgelesssys/constellation" rel="noopener noreferrer"&gt;Constellation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This post is about running &lt;a href="https://www.rocket.chat/" rel="noopener noreferrer"&gt;Rocket.Chat&lt;/a&gt; on Constellation, which gives, well, "always encrypted" Rocket.Chat 🙂&lt;/p&gt;

&lt;p&gt;This is cool, because "always encrypted" Rocket.Chat shields the entire server-side of Rocket.Chat from the (cloud) infrastructure and ensures that all data is always encrypted - even during processing in memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Constellation💫?
&lt;/h2&gt;

&lt;p&gt;The idea of Constellation is to shield entire K8s clusters from the cloud infrastructure using Confidential VMs, which are available on recent AMD EPYC server CPUs. Constellation ensures that all data in the cluster is always encrypted (even during processing) and is inaccessible from the infrastructure. Based on the CPUs' remote attestation feature, Constellation makes this verifiable for the DevOps engineer. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Rocket.Chat🚀?
&lt;/h2&gt;

&lt;p&gt;Rocket.Chat is an open-source communications platform. In less fancy terms, it's a chat server with a web frontend. Think of it as a self-hosted alternative to Slack. It's website touts it as a "secure and compliant communications platform". &lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need "always encrypted"🔒 Rocket.Chat🚀?
&lt;/h2&gt;

&lt;p&gt;Rocket.Chat offers E2E encryption of messages but that comes with some &lt;a href="https://docs.rocket.chat/guides/user-guides/security-bundle/end-to-end-encryption" rel="noopener noreferrer"&gt;downsides for UX&lt;/a&gt; (e.g., no more search and user needs to manage the key manually) and also, conceptually, cannot protect metadata, server configurations, code etc. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9i62qwm930eibbccdgow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9i62qwm930eibbccdgow.png" alt="Infrastructure-based attack surface of Rocket.Chat"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consequently, different infrastructure-based attackers, for example someone with root access to a K8s node, can still learn and manipulate a lot. In fact, such an attacker could even inject malicious JS into client sessions and leak Rocket.Chat's E2E encryption keys or plaintext messages or just disable encryption. So it's probably fair to say that Rocket.Chat's E2E encryption mostly helps against passive attackers who are able to read or intercept some server-side data. &lt;/p&gt;

&lt;p&gt;If we want to protect against the active attackers from the picture above, we need "always encrypted" Rocket.Chat 💪&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Rocket.Chat🚀 on Constellation💫
&lt;/h2&gt;

&lt;p&gt;Running Rocket.Chat on Constellation turned out to be pretty straightforward. In the first step, I &lt;a href="https://docs.edgeless.systems/constellation/getting-started/first-steps" rel="noopener noreferrer"&gt;created&lt;/a&gt; a Constellation cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;constellation create &lt;span class="nt"&gt;--control-plane-nodes&lt;/span&gt; 1 &lt;span class="nt"&gt;--worker-nodes&lt;/span&gt; 2 &lt;span class="nt"&gt;-y&lt;/span&gt;
constellation init
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;KUBECONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/constellation-admin.conf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that I created my cluster on Azure. If you don't have an Azure or GCP subscription but want to try this out nonetheless, there is also &lt;a href="https://docs.edgeless.systems/constellation/getting-started/first-steps-local" rel="noopener noreferrer"&gt;MiniConstellation&lt;/a&gt;, which you can run locally and doesn't require confidential-computing hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Rocket.Chat
&lt;/h3&gt;

&lt;p&gt;My goal was to make Rocket.Chat available under its own URL with TLS. For this, I installed and configured the following components via Helm charts on my freshly created Constellation cluster:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://kubernetes.github.io/ingress-nginx/" rel="noopener noreferrer"&gt;NGINX Ingress Controller&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://artifacthub.io/packages/helm/cert-manager/cert-manager" rel="noopener noreferrer"&gt;cert-manager&lt;/a&gt; for managing the TLS certificate&lt;/li&gt;
&lt;li&gt;Constellation's &lt;a href="https://docs.edgeless.systems/constellation/workflows/storage" rel="noopener noreferrer"&gt;azuredisk-csi-driver&lt;/a&gt; to get encrypted persistent storage on Azure (note that this will be automatically installed with the upcoming Constellation 2.2 release)&lt;/li&gt;
&lt;li&gt;Finally, &lt;a href="https://docs.rocket.chat/quick-start/scaling-rocket.chat/automation-tools/kubernetes-using-helm" rel="noopener noreferrer"&gt;Rocket.Chat&lt;/a&gt; itself, which also brings MongoDB&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're not in the mood to do this manually, we also created a &lt;a href="https://github.com/edgelesssys/rocket-deployment/" rel="noopener noreferrer"&gt;combined Helm chart&lt;/a&gt;. The chart details how each component needs to be configured. After you set your desired hostname in the &lt;a href="https://github.com/edgelesssys/constellation-rocketchat/blob/025d9b934ec95a97f30f80fa71cda9a0c45eb541/rocketchat/values.yaml" rel="noopener noreferrer"&gt;values.yaml&lt;/a&gt;, the chart can be installed as follows (assuming GoDaddy as domain provider):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GODADDY_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your creds here&amp;gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GODADDY_SECRET_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your creds here&amp;gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MONGO_USER_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 32&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MONGO_ROOT_SECRET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 32&lt;span class="si"&gt;)&lt;/span&gt;
helm dependency update ./rocketchat
helm upgrade rocket-infra ./rocketchat &lt;span class="nt"&gt;--install&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; default &lt;span class="nt"&gt;--set&lt;/span&gt; infra.enabled&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="nv"&gt;apiKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GODADDY_API_KEY&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="nv"&gt;secretKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GODADDY_SECRET_KEY&lt;/span&gt;
helm upgrade rocket-app ./rocketchat &lt;span class="nt"&gt;--install&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; default &lt;span class="nt"&gt;--set&lt;/span&gt; app.enabled&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true &lt;/span&gt;rocketchat.mongodb.auth.password&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$MONGO_USER_SECRET&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt; rocketchat.mongodb.auth.rootPassword&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$MONGO_ROOT_SECRET&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done! 🏃‍♂️🏁&lt;/p&gt;

&lt;p&gt;The result is publicly accessible at &lt;a href="https://rocket.edgeless.systems/" rel="noopener noreferrer"&gt;https://rocket.edgeless.systems/&lt;/a&gt; Feel free to come over and say "hi" 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  What does this give us?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0z6t9vh37733rtl190z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0z6t9vh37733rtl190z.png" alt="Rocket.Chat running on Constellation"&gt;&lt;/a&gt;&lt;br&gt;
Running Rocket.Chat on Constellation ensures that our entire deployment, including MongoDB and all other components that we installed above, is shielded from the infrastructure and that all data is always encrypted.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does this mean?
&lt;/h3&gt;

&lt;p&gt;Constellation ensures that all K8s nodes run on AMD-based Confidential VMs (CVMs). CVMs are strongly isolated from the host and remain encrypted in memory at runtime. Constellation also ensures that all nodes run the same minimal &lt;a href="https://github.com/systemd/mkosi" rel="noopener noreferrer"&gt;mkosi&lt;/a&gt;-based node image. &lt;/p&gt;

&lt;h3&gt;
  
  
  How does Constellation ensure these properties?
&lt;/h3&gt;

&lt;p&gt;Constellation leverages the hardware-based "remote attestation" feature of CVMs. The Constellation CLI uses remote attestation to verify the first node in the cluster and to bootstrap a secure connection to the cluster. All subsequent nodes that are created in the cluster are verified by existing ones. During the verification process, it is checked if a "good" node image is running on "good" hardware with a "good" configuration. Constellation knows what a "good" node image is, because we sign and publish the measurements (i.e., hashes) of each node image we release.&lt;/p&gt;

&lt;p&gt;Once a node has been verified, it gets access to a Cilium/Wireguard-based VPN, which is shared by the nodes. A verified node also receives a key for storage encryption. Nodes ensure that all data they write to the network or to storage is encrypted. The K8s admin doesn't have to deal with key management. It all happens automatically.&lt;/p&gt;

&lt;p&gt;If we put all of this together, we get a K8s cluster that &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;keeps all data encrypted on the network, in storage, and in memory. &lt;/li&gt;
&lt;li&gt;is isolated from the underlying infrastructure (incl. hypervisor and host OS).&lt;/li&gt;
&lt;li&gt;is verified based on "remote attestation".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;a href="https://docs.edgeless.systems/constellation/overview/confidential-kubernetes" rel="noopener noreferrer"&gt;Constellation docs&lt;/a&gt; have more details on the architecture and security features.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about user connections?
&lt;/h3&gt;

&lt;p&gt;Users connect to Rocket.Chat via the browser, e.g., by browsing to &lt;a href="https://rocket.edgeless.systems/" rel="noopener noreferrer"&gt;https://rocket.edgeless.systems/&lt;/a&gt;. TLS connections to Rocket.Chat on Constellation terminate inside CVMs, so the encryption is end-to-end. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqlvstgusyr154iql0r8p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqlvstgusyr154iql0r8p.jpg" alt="Display TLS certificate in browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But how does the user know for sure? Unfortunately, there is no direct way for the user to tell. However, they can manually inspect the TLS certificate (by clicking on the lock symbol in the browser bar) and confirm with their peers if its the expected certificate. The SHA-256 fingerprint of the server I created is &lt;code&gt;CB 2C 2D 96 E6 B2 59 9D DC FD 99 C5 7A 80 58 60 3C A1 22 99 6D 28 BF FA AD 5B F0 52 EF F0 31 C5&lt;/code&gt;, btw. 🙂&lt;/p&gt;

&lt;p&gt;Ideally, a browser plugin would exist that would allow pin a certificate for a domain. Ideally, the plugin would also be able to verify hardware-based remote attestation statements. This is future work 🙂 Even without such a plugin, Rocket.Chat on Constellation protects against many types of infrastructure-based attackers and accidental data leaks. &lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;Hope you enjoyed this walkthrough. Personally, I'm super-excited by the possibilities that confidential computing and Constellation create. What do you think? Any other apps that you'd like to see become 🪄 "always encrypted"?&lt;/p&gt;

&lt;p&gt;If you're interested in learning more about confidential computing, I recently wrote a &lt;a href="https://content.edgeless.systems/hubfs/Confidential%20Computing%20Whitepaper.pdf" rel="noopener noreferrer"&gt;whitepaper&lt;/a&gt; on the core concepts.&lt;/p&gt;

&lt;p&gt;What are your thoughts about "always encrypted" Rocket.Chat, Constellation, or confidential computing in general?&lt;/p&gt;

</description>
      <category>security</category>
      <category>tutorial</category>
      <category>opensource</category>
      <category>tooling</category>
    </item>
    <item>
      <title>We built the first always (!) encrypted K8s 🔐</title>
      <dc:creator>Felix Schuster</dc:creator>
      <pubDate>Fri, 23 Sep 2022 15:28:55 +0000</pubDate>
      <link>https://forem.com/edgelesssys/we-created-an-always-encrypted-kubernetes-1381</link>
      <guid>https://forem.com/edgelesssys/we-created-an-always-encrypted-kubernetes-1381</guid>
      <description>&lt;p&gt;Hey there dev.to 👋 &lt;/p&gt;

&lt;p&gt;Wanted to share what my colleagues and I haven been working on for the last 1.5 years and &lt;a href="https://github.com/edgelesssys/constellation"&gt;open sourced&lt;/a&gt; last week. Would love to get your feedback.&lt;/p&gt;

&lt;p&gt;The project is called Constellation and it's a K8s distribution like Rancher or OpenShift. What makes Constellation special is that it's designed to shield entire K8s clusters from the cloud infrastructure (and cloud employees) and &lt;strong&gt;keep all data always encrypted - even at runtime&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DvQx97BE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ns94nifkfec1g0te12x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DvQx97BE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ns94nifkfec1g0te12x.png" alt="Constellation concept" width="880" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Foundations
&lt;/h2&gt;

&lt;p&gt;A key ingredient are AMD SEV-based Confidential VMs (CVMs), which are available in &lt;a href="https://learn.microsoft.com/en-us/azure/confidential-computing/confidential-vm-overview"&gt;Azure&lt;/a&gt; and &lt;a href="https://cloud.google.com/compute/confidential-vm/docs/about-cvm"&gt;GCP&lt;/a&gt;. CVMs protect workloads against a compromised host and malicious admins. For this, CVMs remain encrypted at runtime in memory, are strongly isolated, and have advanced remote attestation capabilities. This is also often referred to as &lt;em&gt;confidential computing&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Intel and Arm have announced similar features for their server CPUs and we plan to support these once they become available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;p&gt;We designed Constellation with two goals in mind: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It should provide the best possible security and essentially allow one to safely run a K8s cluster on potentially compromised infrastructure. Even privileged cloud provider employees shouldn't be able to access the data in a cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From a UX-perspective it should work like normal K8s.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Architecture &amp;amp; features
&lt;/h2&gt;

&lt;p&gt;Constellation consists of three main components: a CLI, a custom node image, and a set of containers/services.&lt;/p&gt;

&lt;h3&gt;
  
  
  CLI
&lt;/h3&gt;

&lt;p&gt;The CLI allows for the easy set up of a Constellation cluster in Azure or GCP (we're working on supporting more clouds). For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;constellation config generate azure
&lt;span class="nv"&gt;$ &lt;/span&gt;constellation create &lt;span class="nt"&gt;--control-plane-nodes&lt;/span&gt; 1 &lt;span class="nt"&gt;--worker-nodes&lt;/span&gt; 2 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;constellation init
&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The CLI automatically creates CVM-based nodes using Constellation's node image. The node image is based on Fedora CoreOS and is optimized for CVM remote attestation. &lt;/p&gt;
&lt;h3&gt;
  
  
  Cluster attestation/verification
&lt;/h3&gt;

&lt;p&gt;The first node in a cluster is verified 🔎 by the CLI directly. All others are verified by existing nodes. Thus, transitively, the users knows that only "good" nodes running "good" images are part of the cluster. &lt;/p&gt;

&lt;p&gt;How to know what a "good" node image is? We sign all node images (and also the CLI) and publish the corresponding signatures on the &lt;a href="https://docs.sigstore.dev/rekor/public-instance"&gt;Sigstore's public transparency log&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Network &amp;amp; cloud storage encryption
&lt;/h3&gt;

&lt;p&gt;After a node is verified, it receives cryptographic keys to talk securely to other nodes over the network and for encrypting data that is written to cloud storage. These keys are all managed by Constellation. For network encryption, Constellation relies on Cilium.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CVM runtime encryption, network encryption, and storage encryption together ensure that all data is always encrypted.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Check the &lt;a href="https://github.com/edgelesssys/constellation"&gt;📄README&lt;/a&gt; for a more comprehensive list of features and benchmark comparisons.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://asciinema.org/a/TnMDcICjOF61llQPBTsizormX" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ek7El05E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/a/523406.png" height="380" class="m-0" width="880"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://asciinema.org/a/TnMDcICjOF61llQPBTsizormX" rel="noopener noreferrer" class="c-link"&gt;
          Constellation Demo GCP - asciinema
        &lt;/a&gt;
      &lt;/h2&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--maY09fMR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/images/favicon-2d62dafa447cf018340b7121007568e3.png%3Fvsn%3Dd" width="32" height="32"&gt;
        asciinema.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  What is this good for?
&lt;/h2&gt;

&lt;p&gt;Fully encrypting and isolating a K8s cluster helps with the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⬆️ Increasing data security; preventing &lt;a href="https://twitter.com/gafnitav/status/1572229130141270018"&gt;data breaches&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🚛 Moving sensitive workloads from on-prem to the cloud&lt;/li&gt;
&lt;li&gt;⚖️ Meeting regulatory requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, in our native Germany and elsewhere, confidential computing and runtime encryption are already mandatory for certain eHealth applications.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>opensource</category>
      <category>security</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
