<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>X.509 on Digi Hunch</title><link>https://www.digihunch.com/tags/x.509/</link><description>Recent content in X.509 on Digi Hunch</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Mon, 12 May 2025 23:28:25 -0400</lastBuildDate><atom:link href="https://www.digihunch.com/tags/x.509/index.xml" rel="self" type="application/rss+xml"/><item><title>IAM Roles for any workload</title><link>https://www.digihunch.com/2024/07/iam-roles-for-any-workload/</link><pubDate>Sun, 14 Jul 2024 23:53:49 -0400</pubDate><guid>https://www.digihunch.com/2024/07/iam-roles-for-any-workload/</guid><description>&lt;img src="https://www.digihunch.com/wp-content/uploads/2025/04/feature-iam-role-anywhere.webp" alt="Featured image of post IAM Roles for any workload" /&gt;&lt;h2 class="wp-block-heading"&gt;Background&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;A few month back a client of mine wanted to use GitLab pipeline to deploy infrastructure on AWS with Terraform. The key question is how to authenticate the Terraform process running in the pipeline to AWS with temporary credential. Having &lt;a href="https://www.digihunch.com/2023/01/github-action-gotchas/"&gt;worked it out on GitHub&lt;/a&gt;, my proposal at time was to &lt;a href="https://docs.gitlab.com/ee/ci/cloud_services/aws/"&gt;add OIDC provider&lt;/a&gt; to represent the GitLab runner. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;After a few months, they told me that they are self-hosting their GitLab instance. The idea above was based on exposing an identity provider document on the public Internet, which the client is unable to do. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Now, I have an idea: IAM Roles Anywhere.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;IAM Role Introduction&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Many 101 tutorials asks beginners to create standalone IAM users (or group) with IAM policies directly attached. For programatic access they also include creating a pair of access key and secret access key and pass them along to an external application. The keys are long term credentials, and worse, never expires. The leakage of these long-term credentials had been such a headache that AWS strongly discourage the use of long term credentials. You can feel the discouragement when trying to create an access key through the web console, or by the banners on top of the &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html"&gt;documentation page&lt;/a&gt; about how to do so. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The recommendation is use temporary security credentials. In the context of AWS that means IAM roles. The users must assume an IAM role by issuing an API call, and the Security Token Service (STS) grants temporary credential in response.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="351px" viewBox="-0.5 -0.5 351 122" style="max-width:100%;max-height:122px;"&gt;&lt;defs&gt;&lt;/defs&gt;&lt;g&gt;&lt;g data-cell-id="0"&gt;&lt;g data-cell-id="1"&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-8"&gt;&lt;g&gt;&lt;rect x="0" y="0" width="350" height="120" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-1"&gt;&lt;g&gt;&lt;path d="M 320 76.55 C 320 78.52 318.4 80 316.39 80 L 275.69 80 C 273.24 80 272 78.23 272 76.73 L 272 23.42 C 272 21.21 273.91 20 275.64 20 L 316.61 20 C 318.37 20 320 21.41 320 23.36 Z" fill="#759c3e" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 295.89 56.07 C 287 56.07 278.95 49.27 278.95 39.5 C 278.95 30.98 286.32 23.48 296.19 23.48 C 304.93 23.48 313.05 30.44 313.05 39.71 C 313.05 48.35 305.84 56.07 295.89 56.07 Z" fill="#4f4f4f" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 290.59 67.19 L 289.18 67.19 C 289.18 66.44 288.94 65.57 287.89 65.1 C 287.29 64.88 286.32 64.7 285.21 65.03 C 284.66 65.21 284.16 65.6 284.03 66.33 C 283.83 67.41 284.66 67.82 285.47 68.06 C 287.2 68.52 287.94 68.57 288.78 68.88 C 289.71 69.2 290.7 69.74 291 70.92 C 291.25 72.24 290.73 73.18 290.02 73.74 C 289.29 74.34 288.02 74.8 286.34 74.74 C 284.99 74.68 283.8 74.23 283.11 73.54 C 282.51 72.94 282.12 72.18 282.12 71.01 L 283.51 71.01 C 283.56 72.22 284.17 72.91 285.07 73.32 C 286.09 73.71 287.44 73.72 288.38 73.32 C 288.99 73.06 289.55 72.54 289.54 71.68 C 289.52 70.86 288.97 70.36 287.76 70.05 C 286.65 69.75 285.55 69.68 284.52 69.32 C 283.44 68.93 282.23 68.21 282.53 66.33 C 282.71 65.16 283.64 64.33 285.11 63.98 C 286.46 63.7 287.91 63.83 288.89 64.34 C 289.87 64.87 290.54 65.81 290.59 67.19 Z M 300.45 65.04 L 296.82 65.04 L 296.82 74.38 L 295.34 74.38 L 295.34 65.04 L 291.64 65.04 L 291.64 63.82 L 300.45 63.82 Z M 309.41 67.19 L 308 67.19 C 308 66.44 307.76 65.55 306.71 65.07 C 306.12 64.85 305.15 64.67 304.03 65.01 C 303.48 65.19 302.98 65.57 302.85 66.3 C 302.65 67.4 303.48 67.8 304.3 68.04 C 306.02 68.51 306.75 68.54 307.61 68.85 C 308.53 69.17 309.52 69.71 309.8 70.89 C 310.07 72.22 309.55 73.15 308.85 73.72 C 308.11 74.31 306.84 74.77 305.16 74.71 C 303.81 74.67 302.62 74.2 301.93 73.51 C 301.33 72.93 300.94 72.18 300.94 71.01 L 302.34 71.01 C 302.38 72.22 303 72.88 303.89 73.29 C 304.91 73.69 306.26 73.71 307.2 73.3 C 307.81 73.05 308.38 72.52 308.36 71.65 C 308.35 70.84 307.78 70.35 306.59 70.03 C 305.47 69.72 304.38 69.65 303.34 69.29 C 302.26 68.91 301.05 68.18 301.35 66.32 C 301.54 65.13 302.46 64.31 303.94 63.95 C 305.29 63.67 306.73 63.82 307.7 64.33 C 308.69 64.85 309.36 65.81 309.41 67.19 Z M 298.93 42.57 L 298.93 29.55 L 295.42 29.55 L 295.42 39.21 L 288.94 39.21 L 288.94 42.57 Z M 295.95 52.7 C 288.61 52.7 282.46 46.9 282.46 39.65 C 282.46 32.29 288.96 26.83 296.13 26.83 C 303.15 26.83 309.52 32.51 309.52 39.77 C 309.52 47.09 303.15 52.7 295.95 52.7 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-2"&gt;&lt;g&gt;&lt;path d="M 56.16 79.58 L 48.37 75.17 L 43 78.24 L 30 70.84 L 30 56.08 L 37.43 51.83 L 37.43 32.71 L 59.71 20 L 82 32.69 L 82 58.05 L 64.07 68.25 L 64.07 75.04 Z" fill="#444444" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 59.71 44.44 L 79.65 33.11 L 59.79 21.87 L 39.94 33.11 Z M 42.35 63.72 L 31.21 57.4 L 31.21 70.11 L 42.35 76.5 Z M 42.92 62.75 L 54.06 56.35 L 42.92 50.03 L 31.78 56.35 Z M 54.7 62.3 L 54.7 57.48 L 43.56 63.79 L 43.56 76.5 L 48.17 73.87 L 48.17 65.98 Z M 58.9 63.12 L 58.9 45.9 L 39.04 34.57 L 39.04 50.92 L 42.99 48.66 L 55.91 56.02 L 55.91 61.62 L 56.08 61.54 Z M 64.06 66.51 L 80.46 57.16 L 80.46 34.49 L 60.6 45.82 L 60.6 64.07 L 64.06 66.03 Z M 55.92 69.87 L 62.05 66.39 L 55.99 62.9 L 49.93 66.39 Z M 55.51 77.8 L 55.51 70.84 L 49.37 67.35 L 49.37 74.32 Z M 56.63 77.8 L 62.78 74.32 L 62.78 67.35 L 56.63 70.84 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 87px; margin-left: 56px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;CLI&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="56" y="99" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;CLI&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-4"&gt;&lt;g&gt;&lt;path d="M 82 32.81 L 263.63 32.99" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 268.88 33 L 261.88 36.49 L 263.63 32.99 L 261.89 29.49 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-6"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 20px; margin-left: 163px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Request: AssumeRole*&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="163" y="23" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px" text-anchor="middle"&gt;Request: AssumeRole*&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-5"&gt;&lt;g&gt;&lt;path d="M 270 60 L 88.37 57.91" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 83.12 57.85 L 90.16 54.43 L 88.37 57.91 L 90.08 61.43 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="VRZMaZhQ_cbes_kdLvWi-7"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 90px; margin-left: 122px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Response:&lt;div&gt;&amp;#8211; AccessKeyId&lt;/div&gt;&lt;div&gt;&amp;#8211; SecretAccessKey&lt;/div&gt;&lt;div&gt;&amp;#8211; SessionToken&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="122" y="94" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px"&gt;Response:&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"&gt;&lt;/g&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This diagram has several variations. For example, the request can be AssumeRole, AssumeRoleWithSAML and AssumeRoleWithWebIdentity, depending on whether and how the user info is federated with external identity store. The returned response, a triplet of three values, makes the temporary credential that we should use in any secure environment. They must be renewed before expiry. This model works not only for human identity (e.g. SAML integration, OIDC integration, cross-account access) but also for workload identity (e.g. EC2 instance profile, Lambda execution role, ECS task role, etc). &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Another good example is &lt;a href="https://www.digihunch.com/2024/01/workload-identity-on-kubernetes-2-of-2-eks-and-rosa-on-aws/"&gt;IAM Role for Service Account (IRSA)&lt;/a&gt;, where a web identity represents a Kuberentes Service Account to gain role credential using the AssumeRoleWithWebIdentity API. In this post however, I&amp;#8217;d like to explore more about the IAM role for EC2 instance profile.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;The IMDS service &lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For EC2 instance, we all know that we can associate an IAM role as the instance profile and grant the process using AWS SDK running on the instance with permissions associated with the IAM role. At a lower level, this relies on the IMDS (Instance Metadata Service) running on the instance.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;If an EC2 instance&amp;#8217;s profile points to an IAM role, a process running on the instance using AWS SDK will also need to get the triplet from the STS. It is summarized in this diagram:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="531px" viewBox="-0.5 -0.5 531 141" style="max-width:100%;max-height:141px;"&gt;&lt;defs&gt;&lt;/defs&gt;&lt;g&gt;&lt;g data-cell-id="0"&gt;&lt;g data-cell-id="1"&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-1"&gt;&lt;g&gt;&lt;rect x="0" y="0" width="530" height="140" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-2"&gt;&lt;g&gt;&lt;rect x="10" y="10" width="330" height="100" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-3"&gt;&lt;g&gt;&lt;path d="M 518 101.55 C 518 103.52 516.4 105 514.39 105 L 473.69 105 C 471.24 105 470 103.23 470 101.73 L 470 48.42 C 470 46.21 471.91 45 473.64 45 L 514.61 45 C 516.37 45 518 46.41 518 48.36 Z" fill="#759c3e" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 493.89 81.07 C 485 81.07 476.95 74.27 476.95 64.5 C 476.95 55.98 484.32 48.48 494.19 48.48 C 502.93 48.48 511.05 55.44 511.05 64.71 C 511.05 73.35 503.84 81.07 493.89 81.07 Z" fill="#4f4f4f" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 488.59 92.19 L 487.18 92.19 C 487.18 91.44 486.94 90.57 485.89 90.1 C 485.29 89.88 484.32 89.7 483.21 90.03 C 482.66 90.21 482.16 90.6 482.03 91.33 C 481.83 92.41 482.66 92.82 483.47 93.06 C 485.2 93.52 485.94 93.57 486.78 93.88 C 487.71 94.2 488.7 94.74 489 95.92 C 489.25 97.24 488.73 98.18 488.02 98.74 C 487.29 99.34 486.02 99.8 484.34 99.74 C 482.99 99.68 481.8 99.23 481.11 98.54 C 480.51 97.94 480.12 97.18 480.12 96.01 L 481.51 96.01 C 481.56 97.22 482.17 97.91 483.07 98.32 C 484.09 98.71 485.44 98.72 486.38 98.32 C 486.99 98.06 487.55 97.54 487.54 96.68 C 487.52 95.86 486.97 95.36 485.76 95.05 C 484.65 94.75 483.55 94.68 482.52 94.32 C 481.44 93.93 480.23 93.21 480.53 91.33 C 480.71 90.16 481.64 89.33 483.11 88.98 C 484.46 88.7 485.91 88.83 486.89 89.34 C 487.87 89.87 488.54 90.81 488.59 92.19 Z M 498.45 90.04 L 494.82 90.04 L 494.82 99.38 L 493.34 99.38 L 493.34 90.04 L 489.64 90.04 L 489.64 88.82 L 498.45 88.82 Z M 507.41 92.19 L 506 92.19 C 506 91.44 505.76 90.55 504.71 90.07 C 504.12 89.85 503.15 89.67 502.03 90.01 C 501.48 90.19 500.98 90.57 500.85 91.3 C 500.65 92.4 501.48 92.8 502.3 93.04 C 504.02 93.51 504.75 93.54 505.61 93.85 C 506.53 94.17 507.52 94.71 507.8 95.89 C 508.07 97.22 507.55 98.15 506.85 98.72 C 506.11 99.31 504.84 99.77 503.16 99.71 C 501.81 99.67 500.62 99.2 499.93 98.51 C 499.33 97.93 498.94 97.18 498.94 96.01 L 500.34 96.01 C 500.38 97.22 501 97.88 501.89 98.29 C 502.91 98.69 504.26 98.71 505.2 98.3 C 505.81 98.05 506.38 97.52 506.36 96.65 C 506.35 95.84 505.78 95.35 504.59 95.03 C 503.47 94.72 502.38 94.65 501.34 94.29 C 500.26 93.91 499.05 93.18 499.35 91.32 C 499.54 90.13 500.46 89.31 501.94 88.95 C 503.29 88.67 504.73 88.82 505.7 89.33 C 506.69 89.85 507.36 90.81 507.41 92.19 Z M 496.93 67.57 L 496.93 54.55 L 493.42 54.55 L 493.42 64.21 L 486.94 64.21 L 486.94 67.57 Z M 493.95 77.7 C 486.61 77.7 480.46 71.9 480.46 64.65 C 480.46 57.29 486.96 51.83 494.13 51.83 C 501.15 51.83 507.52 57.51 507.52 64.77 C 507.52 72.09 501.15 77.7 493.95 77.7 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-4"&gt;&lt;g&gt;&lt;rect x="212.5" y="60" width="105" height="35" rx="5.25" ry="5.25" fill="#ffe6cc" stroke="#d79b00" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 103px; height: 1px; padding-top: 78px; margin-left: 214px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;IMDS v2&lt;div&gt;169.254.169.254&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="265" y="81" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;IMDS v2&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-5"&gt;&lt;g&gt;&lt;rect x="30" y="62.5" width="120" height="30" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 78px; margin-left: 31px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;AWS SDK&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="90" y="81" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;AWS SDK&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-6"&gt;&lt;g&gt;&lt;path d="M 149.88 74.26 L 206.76 75.35" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 212.01 75.45 L 204.95 78.81 L 206.76 75.35 L 205.08 71.82 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-7"&gt;&lt;g&gt;&lt;path d="M 211.87 84.5 L 156.37 84.95" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 151.12 84.99 L 158.09 81.43 L 156.37 84.95 L 158.15 88.43 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-8"&gt;&lt;g&gt;&lt;path d="M 317.29 70.78 L 463.63 70.03" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 468.88 70.01 L 461.9 73.54 L 463.63 70.03 L 461.86 66.54 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-9"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 58px; margin-left: 398px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Request: AssumeRole&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="398" y="61" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px" text-anchor="middle"&gt;Request: AssumeRole&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-10"&gt;&lt;g&gt;&lt;path d="M 470 80 L 322.29 81.53" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 317.04 81.58 L 324.01 78.01 L 322.29 81.53 L 324.08 85.01 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-11"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 112px; margin-left: 352px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Response:&lt;div&gt;&amp;#8211; AccessKeyId&lt;/div&gt;&lt;div&gt;&amp;#8211; SecretAccessKey&lt;/div&gt;&lt;div&gt;&amp;#8211; SessionToken&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="352" y="115" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px"&gt;Response:&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-12"&gt;&lt;g&gt;&lt;rect x="30" y="25" width="120" height="37.5" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;path d="M 42 25 L 42 62.5 M 138 25 L 138 62.5" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 94px; height: 1px; padding-top: 44px; margin-left: 43px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Application&lt;div&gt;Process&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="90" y="47" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;Application&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="mtzehsWG86ey03g9Zuuk-13"&gt;&lt;g&gt;&lt;path d="M 180 20 L 210 20 L 210 50 L 180 50 Z" fill="#ed7100" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 189.43 40.57 L 200.14 40.57 L 200.14 29.86 L 189.43 29.86 Z M 201 29.86 L 202.71 29.86 L 202.71 30.71 L 201 30.71 L 201 32.43 L 202.71 32.43 L 202.71 33.29 L 201 33.29 L 201 34.57 L 202.71 34.57 L 202.71 35.43 L 201 35.43 L 201 37.14 L 202.71 37.14 L 202.71 38 L 201 38 L 201 39.71 L 202.71 39.71 L 202.71 40.57 L 201 40.57 L 201 40.63 C 201 41.07 200.64 41.43 200.2 41.43 L 200.14 41.43 L 200.14 43.14 L 199.29 43.14 L 199.29 41.43 L 197.57 41.43 L 197.57 43.14 L 196.71 43.14 L 196.71 41.43 L 195.43 41.43 L 195.43 43.14 L 194.57 43.14 L 194.57 41.43 L 192.86 41.43 L 192.86 43.14 L 192 43.14 L 192 41.43 L 190.29 41.43 L 190.29 43.14 L 189.43 43.14 L 189.43 41.43 L 189.37 41.43 C 188.93 41.43 188.57 41.07 188.57 40.63 L 188.57 40.57 L 187.29 40.57 L 187.29 39.71 L 188.57 39.71 L 188.57 38 L 187.29 38 L 187.29 37.14 L 188.57 37.14 L 188.57 35.43 L 187.29 35.43 L 187.29 34.57 L 188.57 34.57 L 188.57 33.29 L 187.29 33.29 L 187.29 32.43 L 188.57 32.43 L 188.57 30.71 L 187.29 30.71 L 187.29 29.86 L 188.57 29.86 L 188.57 29.8 C 188.57 29.36 188.93 29 189.37 29 L 189.43 29 L 189.43 27.29 L 190.29 27.29 L 190.29 29 L 192 29 L 192 27.29 L 192.86 27.29 L 192.86 29 L 194.57 29 L 194.57 27.29 L 195.43 27.29 L 195.43 29 L 196.71 29 L 196.71 27.29 L 197.57 27.29 L 197.57 29 L 199.29 29 L 199.29 27.29 L 200.14 27.29 L 200.14 29 L 200.2 29 C 200.64 29 201 29.36 201 29.8 Z M 195.43 46.09 C 195.43 46.12 195.4 46.14 195.38 46.14 L 183.91 46.14 C 183.88 46.14 183.86 46.12 183.86 46.09 L 183.86 34.62 C 183.86 34.6 183.88 34.57 183.91 34.57 L 186.43 34.57 L 186.43 33.71 L 183.91 33.71 C 183.41 33.71 183 34.12 183 34.62 L 183 46.09 C 183 46.59 183.41 47 183.91 47 L 195.38 47 C 195.88 47 196.29 46.59 196.29 46.09 L 196.29 44 L 195.43 44 Z M 207 23.91 L 207 35.38 C 207 35.88 206.59 36.29 206.09 36.29 L 203.57 36.29 L 203.57 35.43 L 206.09 35.43 C 206.12 35.43 206.14 35.4 206.14 35.38 L 206.14 23.91 C 206.14 23.88 206.12 23.86 206.09 23.86 L 194.62 23.86 C 194.6 23.86 194.57 23.88 194.57 23.91 L 194.57 26.43 L 193.71 26.43 L 193.71 23.91 C 193.71 23.41 194.12 23 194.62 23 L 206.09 23 C 206.59 23 207 23.41 207 23.91 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 35px; margin-left: 212px;"&gt;&lt;div data-drawio-colors="color: #232F3E; " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(35, 47, 62); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;&lt;div&gt;&lt;span style="background-color: initial;"&gt;EC2 Instance&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="212" y="39" fill="#232F3E" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px"&gt;EC2 I&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"&gt;&lt;/g&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The IMDS is a service available on one of the link-local IP address (169.254.169.254) on the EC2 instance. Requests made to this IP address are not routed elsewhere. The Instance Metadata Service (IMDS) is a means for the cloud service provider&amp;#8217;s virtualization layer to share information with the processes on the operating system of a virtual machine. It responds with information related to the instance itself, such as the subnets, IAM role, instance ID, AMI ID, security group. The instance metadata also includes user data script for cloud init process to consume, and most relevantly, the role credential for the instance. This also requires that the IMDS service to have connectivity to the STS endpoint, either via interface endpoint or over the Internet. The AssumeRole calls are logged in CloudTrail.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;All major cloud vendors (AWS, Azure and GCP) uses the IMDS mechanism, and this mechanism obviously draws the attention of bad actors. I find some good articles on this &lt;a href="https://www.sans.org/blog/cloud-instance-metadata-services-imds-/"&gt;here&lt;/a&gt; and &lt;a href="https://www.tenable.com/blog/secure-your-aws-ec2-instance-metadata-service-imds"&gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;IAM Role for EC2 Workload&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For EC2 instances at AWS, the initial IMDS v1 was introduced in 2012 and allows a GET method to fetch instance metadata. The IMDS v1 is subject to attacks such as SSRF (Server-side request forgery). In 2019 AWS introduced IMDS v2 which tackles those &lt;a href="https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/"&gt;vulnerabilities&lt;/a&gt;. As of date, the recommendation is to use IMDSv2. Here is an example of how to fetch instance metadata, including the credential:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Grab a token&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TOKEN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;`&lt;/span&gt;curl -X PUT &lt;span style="color:#e6db74"&gt;&amp;#34;http://169.254.169.254/latest/api/token&amp;#34;&lt;/span&gt; -H &lt;span style="color:#e6db74"&gt;&amp;#34;X-aws-ec2-metadata-token-ttl-seconds: 21600&amp;#34;&lt;/span&gt;&lt;span style="color:#e6db74"&gt;`&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Get top-level instance metadata information&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl http://169.254.169.254/latest/meta-data/profile -H &lt;span style="color:#e6db74"&gt;&amp;#34;X-aws-ec2-metadata-token: &lt;/span&gt;$TOKEN&lt;span style="color:#e6db74"&gt;&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Get the name of the role&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -H &lt;span style="color:#e6db74"&gt;&amp;#34;X-aws-ec2-metadata-token: &lt;/span&gt;$TOKEN&lt;span style="color:#e6db74"&gt;&amp;#34;&lt;/span&gt; http://169.254.169.254/latest/meta-data/iam/security-credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Get the credential for the role session&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -H &lt;span style="color:#e6db74"&gt;&amp;#34;X-aws-ec2-metadata-token: &lt;/span&gt;$TOKEN&lt;span style="color:#e6db74"&gt;&amp;#34;&lt;/span&gt; http://169.254.169.254/latest/meta-data/iam/security-credentials/InstanceProfileRoleName&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;These commands emulate how the SDK library fetches the credentials to assume the instance profile role. You can also find similar commands on the &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials"&gt;documentation&lt;/a&gt;. However, there isn&amp;#8217;t much details about how the instance metadata service interacts with the STS service, except a general statement:&lt;/p&gt;&#10;&lt;blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;/p&gt;&#10;&lt;cite&gt;These security credentials are temporary and we rotate them automatically. We make new credentials available at least five minutes before the expiration of the old credentials.&lt;/cite&gt;&lt;/blockquote&gt;&#10;&lt;p class="wp-block-paragraph"&gt;When creating a new EC2 instance, make sure that the instance metadata option has http_endpoint enabled, to enable the IMDS service. Also set http_tokens to required, which would run IMDSv2 exclusively. With that setup, the application does not have to mana to use an &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/use-a-supported-sdk-version-for-imdsv2.html"&gt;SDK version&lt;/a&gt; that supports IMDSv2. Another metadata option is http_put_response_hop_limit, with default of 1. This limits the number of hops in the metadata request. If the process runs from a Docker container with bridge networking mode, set it to 2 or the process cannot even secure a token.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="581px" viewBox="-0.5 -0.5 581 161" style="max-width:100%;max-height:161px;"&gt;&lt;defs&gt;&lt;/defs&gt;&lt;g&gt;&lt;g data-cell-id="0"&gt;&lt;g data-cell-id="1"&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-1"&gt;&lt;g&gt;&lt;rect x="0" y="0" width="580" height="160" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-2"&gt;&lt;g&gt;&lt;rect x="10" y="10" width="360" height="138.75" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-14"&gt;&lt;g&gt;&lt;rect x="20" y="20" width="190" height="110" rx="16.5" ry="16.5" fill="#fff2cc" stroke="#d6b656" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-3"&gt;&lt;g&gt;&lt;path d="M 565.5 114.05 C 565.5 116.02 563.9 117.5 561.89 117.5 L 521.19 117.5 C 518.74 117.5 517.5 115.73 517.5 114.23 L 517.5 60.92 C 517.5 58.71 519.41 57.5 521.14 57.5 L 562.11 57.5 C 563.87 57.5 565.5 58.91 565.5 60.86 Z" fill="#759c3e" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 541.39 93.57 C 532.5 93.57 524.45 86.77 524.45 77 C 524.45 68.48 531.82 60.98 541.69 60.98 C 550.43 60.98 558.55 67.94 558.55 77.21 C 558.55 85.85 551.34 93.57 541.39 93.57 Z" fill="#4f4f4f" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 536.09 104.69 L 534.68 104.69 C 534.68 103.94 534.44 103.07 533.39 102.6 C 532.79 102.38 531.82 102.2 530.71 102.53 C 530.16 102.71 529.66 103.1 529.53 103.83 C 529.33 104.91 530.16 105.32 530.97 105.56 C 532.7 106.02 533.44 106.07 534.28 106.38 C 535.21 106.7 536.2 107.24 536.5 108.42 C 536.75 109.74 536.23 110.68 535.52 111.24 C 534.79 111.84 533.52 112.3 531.84 112.24 C 530.49 112.18 529.3 111.73 528.61 111.04 C 528.01 110.44 527.62 109.68 527.62 108.51 L 529.01 108.51 C 529.06 109.72 529.67 110.41 530.57 110.82 C 531.59 111.21 532.94 111.22 533.88 110.82 C 534.49 110.56 535.05 110.04 535.04 109.18 C 535.02 108.36 534.47 107.86 533.26 107.55 C 532.15 107.25 531.05 107.18 530.02 106.82 C 528.94 106.43 527.73 105.71 528.03 103.83 C 528.21 102.66 529.14 101.83 530.61 101.48 C 531.96 101.2 533.41 101.33 534.39 101.84 C 535.37 102.37 536.04 103.31 536.09 104.69 Z M 545.95 102.54 L 542.32 102.54 L 542.32 111.88 L 540.84 111.88 L 540.84 102.54 L 537.14 102.54 L 537.14 101.32 L 545.95 101.32 Z M 554.91 104.69 L 553.5 104.69 C 553.5 103.94 553.26 103.05 552.21 102.57 C 551.62 102.35 550.65 102.17 549.53 102.51 C 548.98 102.69 548.48 103.07 548.35 103.8 C 548.15 104.9 548.98 105.3 549.8 105.54 C 551.52 106.01 552.25 106.04 553.11 106.35 C 554.03 106.67 555.02 107.21 555.3 108.39 C 555.57 109.72 555.05 110.65 554.35 111.22 C 553.61 111.81 552.34 112.27 550.66 112.21 C 549.31 112.17 548.12 111.7 547.43 111.01 C 546.83 110.43 546.44 109.68 546.44 108.51 L 547.84 108.51 C 547.88 109.72 548.5 110.38 549.39 110.79 C 550.41 111.19 551.76 111.21 552.7 110.8 C 553.31 110.55 553.88 110.02 553.86 109.15 C 553.85 108.34 553.28 107.85 552.09 107.53 C 550.97 107.22 549.88 107.15 548.84 106.79 C 547.76 106.41 546.55 105.68 546.85 103.82 C 547.04 102.63 547.96 101.81 549.44 101.45 C 550.79 101.17 552.23 101.32 553.2 101.83 C 554.19 102.35 554.86 103.31 554.91 104.69 Z M 544.43 80.07 L 544.43 67.05 L 540.92 67.05 L 540.92 76.71 L 534.44 76.71 L 534.44 80.07 Z M 541.45 90.2 C 534.11 90.2 527.96 84.4 527.96 77.15 C 527.96 69.79 534.46 64.33 541.63 64.33 C 548.65 64.33 555.02 70.01 555.02 77.27 C 555.02 84.59 548.65 90.2 541.45 90.2 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-4"&gt;&lt;g&gt;&lt;rect x="260" y="72.5" width="105" height="35" rx="5.25" ry="5.25" fill="#ffe6cc" stroke="#d79b00" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 103px; height: 1px; padding-top: 90px; margin-left: 261px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;IMDS v2&lt;div&gt;169.254.169.254&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="313" y="94" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;IMDS v2&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-5"&gt;&lt;g&gt;&lt;rect x="30" y="87.5" width="120" height="30" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 103px; margin-left: 31px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;AWS SDK&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="90" y="106" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;AWS SDK&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-8"&gt;&lt;g&gt;&lt;path d="M 364.79 83.28 L 511.13 82.53" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 516.38 82.51 L 509.4 86.04 L 511.13 82.53 L 509.36 79.04 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-9"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 71px; margin-left: 445px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Request: AssumeRole&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="445" y="74" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px" text-anchor="middle"&gt;Request: AssumeRole&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-10"&gt;&lt;g&gt;&lt;path d="M 517.5 92.5 L 369.79 94.03" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 364.54 94.08 L 371.51 90.51 L 369.79 94.03 L 371.58 97.51 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-11"&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 124px; margin-left: 400px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;Response:&lt;div&gt;&amp;#8211; AccessKeyId&lt;/div&gt;&lt;div&gt;&amp;#8211; SecretAccessKey&lt;/div&gt;&lt;div&gt;&amp;#8211; SessionToken&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="400" y="128" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="11px"&gt;Response:&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-12"&gt;&lt;g&gt;&lt;rect x="30" y="50" width="120" height="37.5" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;path d="M 42 50 L 42 87.5 M 138 50 L 138 87.5" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 94px; height: 1px; padding-top: 69px; margin-left: 43px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Application&lt;div&gt;Process&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="90" y="72" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;Application&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-13"&gt;&lt;g&gt;&lt;path d="M 240 20 L 270 20 L 270 50 L 240 50 Z" fill="#ed7100" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;path d="M 249.43 40.57 L 260.14 40.57 L 260.14 29.86 L 249.43 29.86 Z M 261 29.86 L 262.71 29.86 L 262.71 30.71 L 261 30.71 L 261 32.43 L 262.71 32.43 L 262.71 33.29 L 261 33.29 L 261 34.57 L 262.71 34.57 L 262.71 35.43 L 261 35.43 L 261 37.14 L 262.71 37.14 L 262.71 38 L 261 38 L 261 39.71 L 262.71 39.71 L 262.71 40.57 L 261 40.57 L 261 40.63 C 261 41.07 260.64 41.43 260.2 41.43 L 260.14 41.43 L 260.14 43.14 L 259.29 43.14 L 259.29 41.43 L 257.57 41.43 L 257.57 43.14 L 256.71 43.14 L 256.71 41.43 L 255.43 41.43 L 255.43 43.14 L 254.57 43.14 L 254.57 41.43 L 252.86 41.43 L 252.86 43.14 L 252 43.14 L 252 41.43 L 250.29 41.43 L 250.29 43.14 L 249.43 43.14 L 249.43 41.43 L 249.37 41.43 C 248.93 41.43 248.57 41.07 248.57 40.63 L 248.57 40.57 L 247.29 40.57 L 247.29 39.71 L 248.57 39.71 L 248.57 38 L 247.29 38 L 247.29 37.14 L 248.57 37.14 L 248.57 35.43 L 247.29 35.43 L 247.29 34.57 L 248.57 34.57 L 248.57 33.29 L 247.29 33.29 L 247.29 32.43 L 248.57 32.43 L 248.57 30.71 L 247.29 30.71 L 247.29 29.86 L 248.57 29.86 L 248.57 29.8 C 248.57 29.36 248.93 29 249.37 29 L 249.43 29 L 249.43 27.29 L 250.29 27.29 L 250.29 29 L 252 29 L 252 27.29 L 252.86 27.29 L 252.86 29 L 254.57 29 L 254.57 27.29 L 255.43 27.29 L 255.43 29 L 256.71 29 L 256.71 27.29 L 257.57 27.29 L 257.57 29 L 259.29 29 L 259.29 27.29 L 260.14 27.29 L 260.14 29 L 260.2 29 C 260.64 29 261 29.36 261 29.8 Z M 255.43 46.09 C 255.43 46.12 255.4 46.14 255.38 46.14 L 243.91 46.14 C 243.88 46.14 243.86 46.12 243.86 46.09 L 243.86 34.62 C 243.86 34.6 243.88 34.57 243.91 34.57 L 246.43 34.57 L 246.43 33.71 L 243.91 33.71 C 243.41 33.71 243 34.12 243 34.62 L 243 46.09 C 243 46.59 243.41 47 243.91 47 L 255.38 47 C 255.88 47 256.29 46.59 256.29 46.09 L 256.29 44 L 255.43 44 Z M 267 23.91 L 267 35.38 C 267 35.88 266.59 36.29 266.09 36.29 L 263.57 36.29 L 263.57 35.43 L 266.09 35.43 C 266.12 35.43 266.14 35.4 266.14 35.38 L 266.14 23.91 C 266.14 23.88 266.12 23.86 266.09 23.86 L 254.62 23.86 C 254.6 23.86 254.57 23.88 254.57 23.91 L 254.57 26.43 L 253.71 26.43 L 253.71 23.91 C 253.71 23.41 254.12 23 254.62 23 L 266.09 23 C 266.59 23 267 23.41 267 23.91 Z" fill="#ffffff" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 1px; height: 1px; padding-top: 35px; margin-left: 272px;"&gt;&lt;div data-drawio-colors="color: #232F3E; " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(35, 47, 62); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;&lt;div&gt;&lt;span style="background-color: initial;"&gt;EC2 Instance&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="272" y="39" fill="#232F3E" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px"&gt;EC2 I&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-23"&gt;&lt;g&gt;&lt;path d="M 150 110 Q 160 170 171.64 113.74" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 172.7 108.59 L 174.71 116.16 L 171.64 113.74 L 167.86 114.74 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-24"&gt;&lt;g&gt;&lt;path d="M 238.45 107.5 Q 260 170 287.49 105.85" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 289.56 101.03 L 290.02 108.84 L 287.49 105.85 L 283.59 106.08 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-26"&gt;&lt;g&gt;&lt;rect x="180" y="87.5" width="50" height="22.5" fill="#75dfff" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-end; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 85px; margin-left: 181px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Bridge&lt;div&gt;Network&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="205" y="85" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;Bridge&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-22"&gt;&lt;g&gt;&lt;rect x="220" y="87.5" width="30" height="20" fill="none" stroke="none" pointer-events="all"&gt;&lt;/rect&gt;&lt;path d="M 225.13 105.54 L 225.13 100.05 L 235.79 100.05 L 235.79 102.79 L 241.32 102.79 L 241.32 103.58 L 247.24 103.58 L 247.24 101.23 L 241.32 101.23 L 241.32 102.01 L 236.58 102.01 L 236.58 98.09 L 244.08 98.09 L 244.08 98.87 L 248.82 98.87 L 248.82 96.52 L 244.08 96.52 L 244.08 97.3 L 235.79 97.3 L 235.79 99.26 L 225.13 99.26 L 225.13 96.13 L 232.63 96.13 L 232.63 93.38 L 236.58 93.38 L 236.58 94.56 L 242.5 94.56 L 242.5 91.42 L 236.58 91.42 L 236.58 92.6 L 231.84 92.6 L 231.84 95.34 L 225.13 95.34 L 225.13 89.85 L 250 89.85 L 250 105.54 L 239.74 105.54 L 239.74 107.5 L 238.95 107.5 L 238.95 105.54 L 238.16 105.54 L 238.16 107.5 L 237.37 107.5 L 237.37 105.54 L 236.58 105.54 L 236.58 107.5 L 235.79 107.5 L 235.79 105.54 L 235 105.54 L 235 107.5 L 234.21 107.5 L 234.21 105.54 L 233.42 105.54 L 233.42 107.5 L 232.63 107.5 L 232.63 105.54 L 231.84 105.54 L 231.84 107.5 L 231.05 107.5 L 231.05 105.54 L 230.26 105.54 L 230.26 107.5 L 229.47 107.5 L 229.47 105.54 L 228.68 105.54 L 228.68 107.5 L 227.89 107.5 L 227.89 105.54 Z M 222.76 107.5 L 222.76 88.68 L 220 88.68 L 220 87.5 L 223.95 87.5 L 223.95 107.5 Z" fill="#505050" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-16"&gt;&lt;g&gt;&lt;rect x="160" y="87.5" width="30" height="20" fill="none" stroke="none" pointer-events="all"&gt;&lt;/rect&gt;&lt;path d="M 165.13 105.54 L 165.13 100.05 L 175.79 100.05 L 175.79 102.79 L 181.32 102.79 L 181.32 103.58 L 187.24 103.58 L 187.24 101.23 L 181.32 101.23 L 181.32 102.01 L 176.58 102.01 L 176.58 98.09 L 184.08 98.09 L 184.08 98.87 L 188.82 98.87 L 188.82 96.52 L 184.08 96.52 L 184.08 97.3 L 175.79 97.3 L 175.79 99.26 L 165.13 99.26 L 165.13 96.13 L 172.63 96.13 L 172.63 93.38 L 176.58 93.38 L 176.58 94.56 L 182.5 94.56 L 182.5 91.42 L 176.58 91.42 L 176.58 92.6 L 171.84 92.6 L 171.84 95.34 L 165.13 95.34 L 165.13 89.85 L 190 89.85 L 190 105.54 L 179.74 105.54 L 179.74 107.5 L 178.95 107.5 L 178.95 105.54 L 178.16 105.54 L 178.16 107.5 L 177.37 107.5 L 177.37 105.54 L 176.58 105.54 L 176.58 107.5 L 175.79 107.5 L 175.79 105.54 L 175 105.54 L 175 107.5 L 174.21 107.5 L 174.21 105.54 L 173.42 105.54 L 173.42 107.5 L 172.63 107.5 L 172.63 105.54 L 171.84 105.54 L 171.84 107.5 L 171.05 107.5 L 171.05 105.54 L 170.26 105.54 L 170.26 107.5 L 169.47 107.5 L 169.47 105.54 L 168.68 105.54 L 168.68 107.5 L 167.89 107.5 L 167.89 105.54 Z M 162.76 107.5 L 162.76 88.68 L 160 88.68 L 160 87.5 L 163.95 87.5 L 163.95 107.5 Z" fill="#505050" stroke="none" pointer-events="all"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;g data-cell-id="rtsicqcqSDVIAgyO7OKc-28"&gt;&lt;g&gt;&lt;rect x="30" y="20" width="110" height="30" fill="none" stroke="none" pointer-events="all"&gt;&lt;/rect&gt;&lt;/g&gt;&lt;g&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 35px; margin-left: 31px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Docker Daemon&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="85" y="39" fill="rgb(0, 0, 0)" font-family="&amp;quot;Helvetica&amp;quot;" font-size="12px" text-anchor="middle"&gt;Docker Daemon&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"&gt;&lt;/g&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The diagram above illustrates this scenario with two hops.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;IAM Role Anywhere Concept&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;As this point, we know that the process of workload assuming an IAM role, is essentially using SDK to gain role credentials from instance metadata. In addition to using SDK and instance metadata, AWS also supports using X.509 certificate to gain role credentials. As a result, workload no longer needs AWS SDK, and it doesn&amp;#8217;t rely on instance metadata from an EC2 instance. This mechanism is known as IAM Role Anywhere, and it greatly expands the use cases for IAM Role. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;To make this work, we first have to provide a certificate authority (CA) to AWS as a trust anchor. It can be any X.509 CA including AWS Private CA. The IAM Roles Anywhere will allow any end-entity endorsed by this trust anchor, to assume an IAM role as specified. We also need to create a profile, in which we can add IAM policies directly, or link to an IAM roles with a trust policy for service principal &lt;code&gt;rolesanywhere.amazonaws.com&lt;/code&gt;. &lt;/p&gt;&#10;&lt;figure class="wp-block-image size-full"&gt;&lt;img loading="lazy" decoding="async" width="691" height="283" src="https://www.digihunch.com/wp-content/uploads/2024/07/iam-role-anywhere-diagram.webp" alt="" class="wp-image-12989" srcset="https://www.digihunch.com/wp-content/uploads/2024/07/iam-role-anywhere-diagram.webp 691w, https://www.digihunch.com/wp-content/uploads/2024/07/iam-role-anywhere-diagram-300x123.webp 300w" sizes="auto, (max-width: 691px) 100vw, 691px" /&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;To gain role credential, the requestor must provide both the private key, and its end-entity certificate. The certificate proofs the endorsement of the CA as Role&amp;#8217;s trust anchor specifies. The private key proofs the requestor&amp;#8217;s identity. The requestor uses the &lt;a href="https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html"&gt;aws_signing_helper&lt;/a&gt; utility to request role credentials. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The utility is compatible with the &lt;code&gt;credential_process&lt;/code&gt; feature in AWS config, which passes the returned role credentials to the AWS config profile for AWS CLI or SDK running on external virtual machine.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;IAM Role Anywhere Lab&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Let&amp;#8217;s tweak the three commands from this &lt;a href="https://www.digihunch.com/2021/08/creating-tls-certificate-kubernetes/"&gt;old post&lt;/a&gt; of mine to create the test materials: a self-signed CA and a certificate signed by the CA:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days &lt;span style="color:#ae81ff"&gt;356&lt;/span&gt; -nodes -subj &lt;span style="color:#e6db74"&gt;&amp;#39;/CN=Health Certificate Authority&amp;#39;&lt;/span&gt; -addext basicConstraints&lt;span style="color:#f92672"&gt;=&lt;/span&gt;critical,CA:TRUE,pathlen:1 -addext keyUsage&lt;span style="color:#f92672"&gt;=&lt;/span&gt;keyCertSign&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cat &amp;gt; ext.cnf &lt;span style="color:#e6db74"&gt;&amp;lt;&amp;lt;EOF&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;[v3_leaf]&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;keyUsage = digitalSignature&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;basicConstraints=CA:false&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;EOF&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -newkey rsa:4096 -keyout server.key -out server.csr -nodes -subj &lt;span style="color:#e6db74"&gt;&amp;#39;/CN=*.digihunch.com&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in server.csr -CA ca.crt -CAkey ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out server.crt -extfile ext.cnf -extensions v3_leaf&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;I tweak them to add the &lt;a href="https://www.digihunch.com/2024/02/public-key-infrastructure-1-of-3-basics/"&gt;X.509 extensions&lt;/a&gt; to meet the &lt;a href="https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html"&gt;requirement&lt;/a&gt; for signature validation. We need the following files from the output.&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;ca.crt -&amp;gt; the certificate of the CA. We provide this file as the trust anchor&lt;/li&gt;&#10;&lt;li&gt;server.crt -&amp;gt; the certificate of the server, we need it as the end-entity certificate&lt;/li&gt;&#10;&lt;li&gt;server.key -&amp;gt; we need to present this file to proof identity of the requestor&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;First, we go to AWS console and create a new trust anchor. Copy the content of ca.crt as the certificate. Then we can create a profile with an IAM role, with the trust policy looking like &lt;a href="https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html"&gt;this&lt;/a&gt; example. Then we can request the role credential with one command:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;aws_signing_helper credential-process --certificate server.crt --private-key server.key --trust-anchor-arn $TRUST_ANCHOR_ARN --profile-arn $PROFILE_ARN --role-arn $ROLE_ARN&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;Moreover, if the workload supports AWS SDK or can use CLI but not an EC2 instance, we can bake this in the AWS profile on the external machine:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[profile myprofile]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;output = json&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;credential_process = aws_signing_helper credential-process --certificate /path/server.crt --private-key /path/server.key --trust-anchor-arn $TRUST_ANCHOR_ARN --profile-arn $PROFILE_ARN --role-arn $ROLE_ARN&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;We can even configure this in any &lt;a href="https://aws.amazon.com/blogs/security/enable-external-pipeline-deployments-to-aws-cloud-by-using-iam-roles-anywhere/"&gt;pipeline&lt;/a&gt; as code to allow deployment from a non-AWS pipeline. &lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Summary&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In summary, apart from native AWS services, an IAM role can trust the following types of principals:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Native IAM identity such as an IAM user or an IAM group&lt;/li&gt;&#10;&lt;li&gt;Authenticated identity from SAML identity provider that IAM is configured to trust&lt;/li&gt;&#10;&lt;li&gt;Authenticated identity from OIDC identity provider that IAM is configured to trust&lt;/li&gt;&#10;&lt;li&gt;Validated identity endorsed by a Certificate Authority that IAM designate as a trust anchor&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The first type is rarely used because few organizations uses AWS IAM as their identity store. Most organizations have their identity store with federation capability via SAML. On the other hand, a lot of modern applications adopts identity stores with OIDC compliance. Now with IAM Role Anywhere, any entity with X.509 identity can also assume an IAM role. It works with any CI/CD pipeline, whether it is self-hosted. Also, it is now more important to keep the keys safe. &lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2024/05/managing-ec2-instances-across-aws-accounts-ssm/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Managing EC2 instances across accounts with Ansible&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2024/08/test-open-id-connect-flows-locally/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Test Open ID Connect Flows Locally&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Public Key Infrastructure 1 of 3 – Basics</title><link>https://www.digihunch.com/2024/02/public-key-infrastructure-1-of-3-basics/</link><pubDate>Tue, 20 Feb 2024 00:05:00 -0400</pubDate><guid>https://www.digihunch.com/2024/02/public-key-infrastructure-1-of-3-basics/</guid><description>&lt;img src="https://www.digihunch.com/wp-content/uploads/2025/04/feature-pki-2.webp" alt="Featured image of post Public Key Infrastructure 1 of 3 – Basics" /&gt;&lt;p class="wp-block-paragraph"&gt;In 2021, I wrote an &lt;a href="https://www.digihunch.com/2021/04/public-key-infrastructure-pki/"&gt;intro to Public Key Infrastructure (PKI)&lt;/a&gt;. Now that I have to host my own certificate authority, I decide to dive a little deeper into PKI in this series of posts. In software testing scenario, we need to issue (and recycle) a lot of certificates, and manage their lifecycle events such as (renewal, revocation). As a result, the corporate should establish its own private key infrastructure (PKI). This effort includes hosing their own Certificate Authority.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Concepts&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;IT professions often use the acronyms PKI and CA interchangeably in the context of implementation. However, strictly speaking, PKI is the entire framework (strategy, policy, etc) around managing certificate at corporate level, and CA is the specific entity that issues certificates. When it comes to architecting PKI, a key design decision is the hierarchy of CAs. Microsoft has a &lt;a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn786436(v=ws.11)#ca-hierarchy-options"&gt;good page&lt;/a&gt; explaining the common options. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In a single-tier CA hierarchy, the root CA is also issuing CA. The root CA as the anchor of trust of the PKI also issues certificates to the end entities. Obviously, this does not scale. It is only for sandbox testing, and not suitable for any environment that needs to scale. It also carries significant risk because the private key at the anchor of trust has to remain online.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With a two-tier CA hierarchy, the root CA only issues certificates to its subordinate CAs. Therefore the root CA can go offline. As a result, the subordinate CAs issue certificates to end entities. Since the root CA can remain offline (except for issuing certificates for new CAs), the chance compromise is reduced significantly. This option also scales better with multiple issuing CAs. If one of them gets compromised, then only the end entities of the compromised CA are impacted. The root CA still needs to be online from time to time. Apart from granting new subordinate CA, the team may also need root CA online to sign CRLs, which is a management overhead.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="511px" viewBox="-0.5 -0.5 511 701" style="max-width:100%;max-height:701px;"&gt;&lt;defs&gt;&lt;style type="text/css"&gt;@import url(https://fonts.googleapis.com/css2?family=Architects+Daughter:wght@400;500);&amp;#xa;&lt;/style&gt;&lt;/defs&gt;&lt;g&gt;&lt;rect x="0" y="0" width="510" height="700" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/&gt;&lt;rect x="90" y="20" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 29.03 L 111.87 26.77 L 95.28 26.77 L 95.28 29.03 Z M 90 72.69 L 90 22.94 C 90 21.27 91.51 20 92.92 20 L 114.19 20 C 115.61 20 117.15 21.19 117.15 23.03 L 117.15 50.85 L 110.21 50.85 L 103.57 57.48 L 103.57 57.63 L 95.28 57.63 L 95.28 59.89 L 103.57 59.89 L 103.57 64.41 L 95.28 64.41 L 95.28 66.67 L 103.57 66.67 L 103.57 72.69 Z M 105.84 59.14 L 105.84 58.39 L 111.11 53.12 L 111.87 53.12 L 111.87 59.14 Z M 105.84 72.69 L 105.84 60.64 L 113.38 60.64 L 113.38 53.12 L 131.48 53.12 L 131.48 58.9 C 130.57 58.39 129.26 57.91 127.74 57.94 C 123.97 57.94 120.18 60.95 120.18 65.48 C 120.15 67.92 121.29 69.67 122.35 70.81 L 121.36 72.69 Z M 127.74 70.42 C 130.67 70.42 132.67 68.12 132.67 65.48 C 132.67 62.99 130.64 60.64 127.74 60.64 C 125.01 60.64 122.87 62.92 122.87 65.48 C 122.87 68.59 125.42 70.42 127.74 70.42 Z M 127.74 69.23 C 125.84 69.23 124.09 67.68 124.09 65.48 C 124.09 63.64 125.66 61.85 127.74 61.85 C 130.04 61.85 131.48 63.73 131.48 65.48 C 131.48 67.58 129.86 69.23 127.74 69.23 Z M 127.74 68.47 C 129.44 68.47 130.72 67.16 130.72 65.48 C 130.72 64.13 129.63 62.59 127.74 62.59 C 126.48 62.59 124.84 63.58 124.84 65.48 C 124.84 67.09 126.1 68.47 127.74 68.47 Z M 120.7 77.43 L 124.4 70.51 C 122.83 69.39 121.82 67.67 121.82 65.48 C 121.82 62.09 124.72 59.52 127.74 59.52 C 131.52 59.52 133.89 62.55 133.89 65.48 C 133.9 67.77 132.75 69.27 131.49 70.36 L 136 76.9 L 132.45 76.08 L 130.5 78.79 L 127.74 71.71 L 125.9 79 L 123.85 76.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 86px; margin-left: 113px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Root CA &amp;amp;&lt;br /&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="113" y="98" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Root CA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="170" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 179.03 L 111.87 176.77 L 95.28 176.77 L 95.28 179.03 Z M 90 222.69 L 90 172.94 C 90 171.27 91.51 170 92.92 170 L 114.19 170 C 115.61 170 117.15 171.19 117.15 173.03 L 117.15 200.85 L 110.21 200.85 L 103.57 207.48 L 103.57 207.63 L 95.28 207.63 L 95.28 209.89 L 103.57 209.89 L 103.57 214.41 L 95.28 214.41 L 95.28 216.67 L 103.57 216.67 L 103.57 222.69 Z M 105.84 209.14 L 105.84 208.39 L 111.11 203.12 L 111.87 203.12 L 111.87 209.14 Z M 105.84 222.69 L 105.84 210.64 L 113.38 210.64 L 113.38 203.12 L 131.48 203.12 L 131.48 208.9 C 130.57 208.39 129.26 207.91 127.74 207.94 C 123.97 207.94 120.18 210.95 120.18 215.48 C 120.15 217.92 121.29 219.67 122.35 220.81 L 121.36 222.69 Z M 127.74 220.42 C 130.67 220.42 132.67 218.12 132.67 215.48 C 132.67 212.99 130.64 210.64 127.74 210.64 C 125.01 210.64 122.87 212.92 122.87 215.48 C 122.87 218.59 125.42 220.42 127.74 220.42 Z M 127.74 219.23 C 125.84 219.23 124.09 217.68 124.09 215.48 C 124.09 213.64 125.66 211.85 127.74 211.85 C 130.04 211.85 131.48 213.73 131.48 215.48 C 131.48 217.58 129.86 219.23 127.74 219.23 Z M 127.74 218.47 C 129.44 218.47 130.72 217.16 130.72 215.48 C 130.72 214.13 129.63 212.59 127.74 212.59 C 126.48 212.59 124.84 213.58 124.84 215.48 C 124.84 217.09 126.1 218.47 127.74 218.47 Z M 120.7 227.43 L 124.4 220.51 C 122.83 219.39 121.82 217.67 121.82 215.48 C 121.82 212.09 124.72 209.52 127.74 209.52 C 131.52 209.52 133.89 212.55 133.89 215.48 C 133.9 217.77 132.75 219.27 131.49 220.36 L 136 226.9 L 132.45 226.08 L 130.5 228.79 L 127.74 221.71 L 125.9 229 L 123.85 226.89 Z" fill="#505050" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 1px; height: 1px; padding-top: 200px; margin-left: 88px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Root CA&lt;br /&gt;(Offline)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="88" y="203" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Root CA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="270" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 279.03 L 111.87 276.77 L 95.28 276.77 L 95.28 279.03 Z M 90 322.69 L 90 272.94 C 90 271.27 91.51 270 92.92 270 L 114.19 270 C 115.61 270 117.15 271.19 117.15 273.03 L 117.15 300.85 L 110.21 300.85 L 103.57 307.48 L 103.57 307.63 L 95.28 307.63 L 95.28 309.89 L 103.57 309.89 L 103.57 314.41 L 95.28 314.41 L 95.28 316.67 L 103.57 316.67 L 103.57 322.69 Z M 105.84 309.14 L 105.84 308.39 L 111.11 303.12 L 111.87 303.12 L 111.87 309.14 Z M 105.84 322.69 L 105.84 310.64 L 113.38 310.64 L 113.38 303.12 L 131.48 303.12 L 131.48 308.9 C 130.57 308.39 129.26 307.91 127.74 307.94 C 123.97 307.94 120.18 310.95 120.18 315.48 C 120.15 317.92 121.29 319.67 122.35 320.81 L 121.36 322.69 Z M 127.74 320.42 C 130.67 320.42 132.67 318.12 132.67 315.48 C 132.67 312.99 130.64 310.64 127.74 310.64 C 125.01 310.64 122.87 312.92 122.87 315.48 C 122.87 318.59 125.42 320.42 127.74 320.42 Z M 127.74 319.23 C 125.84 319.23 124.09 317.68 124.09 315.48 C 124.09 313.64 125.66 311.85 127.74 311.85 C 130.04 311.85 131.48 313.73 131.48 315.48 C 131.48 317.58 129.86 319.23 127.74 319.23 Z M 127.74 318.47 C 129.44 318.47 130.72 317.16 130.72 315.48 C 130.72 314.13 129.63 312.59 127.74 312.59 C 126.48 312.59 124.84 313.58 124.84 315.48 C 124.84 317.09 126.1 318.47 127.74 318.47 Z M 120.7 327.43 L 124.4 320.51 C 122.83 319.39 121.82 317.67 121.82 315.48 C 121.82 312.09 124.72 309.52 127.74 309.52 C 131.52 309.52 133.89 312.55 133.89 315.48 C 133.9 317.77 132.75 319.27 131.49 320.36 L 136 326.9 L 132.45 326.08 L 130.5 328.79 L 127.74 321.71 L 125.9 329 L 123.85 326.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 336px; margin-left: 113px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="113" y="348" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="170" y="270" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 191.87 279.03 L 191.87 276.77 L 175.28 276.77 L 175.28 279.03 Z M 170 322.69 L 170 272.94 C 170 271.27 171.51 270 172.92 270 L 194.19 270 C 195.61 270 197.15 271.19 197.15 273.03 L 197.15 300.85 L 190.21 300.85 L 183.57 307.48 L 183.57 307.63 L 175.28 307.63 L 175.28 309.89 L 183.57 309.89 L 183.57 314.41 L 175.28 314.41 L 175.28 316.67 L 183.57 316.67 L 183.57 322.69 Z M 185.84 309.14 L 185.84 308.39 L 191.11 303.12 L 191.87 303.12 L 191.87 309.14 Z M 185.84 322.69 L 185.84 310.64 L 193.38 310.64 L 193.38 303.12 L 211.48 303.12 L 211.48 308.9 C 210.57 308.39 209.26 307.91 207.74 307.94 C 203.97 307.94 200.18 310.95 200.18 315.48 C 200.15 317.92 201.29 319.67 202.35 320.81 L 201.36 322.69 Z M 207.74 320.42 C 210.67 320.42 212.67 318.12 212.67 315.48 C 212.67 312.99 210.64 310.64 207.74 310.64 C 205.01 310.64 202.87 312.92 202.87 315.48 C 202.87 318.59 205.42 320.42 207.74 320.42 Z M 207.74 319.23 C 205.84 319.23 204.09 317.68 204.09 315.48 C 204.09 313.64 205.66 311.85 207.74 311.85 C 210.04 311.85 211.48 313.73 211.48 315.48 C 211.48 317.58 209.86 319.23 207.74 319.23 Z M 207.74 318.47 C 209.44 318.47 210.72 317.16 210.72 315.48 C 210.72 314.13 209.63 312.59 207.74 312.59 C 206.48 312.59 204.84 313.58 204.84 315.48 C 204.84 317.09 206.1 318.47 207.74 318.47 Z M 200.7 327.43 L 204.4 320.51 C 202.83 319.39 201.82 317.67 201.82 315.48 C 201.82 312.09 204.72 309.52 207.74 309.52 C 211.52 309.52 213.89 312.55 213.89 315.48 C 213.9 317.77 212.75 319.27 211.49 320.36 L 216 326.9 L 212.45 326.08 L 210.5 328.79 L 207.74 321.71 L 205.9 329 L 203.85 326.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 336px; margin-left: 193px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="193" y="348" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="250" y="270" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 271.87 279.03 L 271.87 276.77 L 255.28 276.77 L 255.28 279.03 Z M 250 322.69 L 250 272.94 C 250 271.27 251.51 270 252.92 270 L 274.19 270 C 275.61 270 277.15 271.19 277.15 273.03 L 277.15 300.85 L 270.21 300.85 L 263.57 307.48 L 263.57 307.63 L 255.28 307.63 L 255.28 309.89 L 263.57 309.89 L 263.57 314.41 L 255.28 314.41 L 255.28 316.67 L 263.57 316.67 L 263.57 322.69 Z M 265.84 309.14 L 265.84 308.39 L 271.11 303.12 L 271.87 303.12 L 271.87 309.14 Z M 265.84 322.69 L 265.84 310.64 L 273.38 310.64 L 273.38 303.12 L 291.48 303.12 L 291.48 308.9 C 290.57 308.39 289.26 307.91 287.74 307.94 C 283.97 307.94 280.18 310.95 280.18 315.48 C 280.15 317.92 281.29 319.67 282.35 320.81 L 281.36 322.69 Z M 287.74 320.42 C 290.67 320.42 292.67 318.12 292.67 315.48 C 292.67 312.99 290.64 310.64 287.74 310.64 C 285.01 310.64 282.87 312.92 282.87 315.48 C 282.87 318.59 285.42 320.42 287.74 320.42 Z M 287.74 319.23 C 285.84 319.23 284.09 317.68 284.09 315.48 C 284.09 313.64 285.66 311.85 287.74 311.85 C 290.04 311.85 291.48 313.73 291.48 315.48 C 291.48 317.58 289.86 319.23 287.74 319.23 Z M 287.74 318.47 C 289.44 318.47 290.72 317.16 290.72 315.48 C 290.72 314.13 289.63 312.59 287.74 312.59 C 286.48 312.59 284.84 313.58 284.84 315.48 C 284.84 317.09 286.1 318.47 287.74 318.47 Z M 280.7 327.43 L 284.4 320.51 C 282.83 319.39 281.82 317.67 281.82 315.48 C 281.82 312.09 284.72 309.52 287.74 309.52 C 291.52 309.52 293.89 312.55 293.89 315.48 C 293.9 317.77 292.75 319.27 291.49 320.36 L 296 326.9 L 292.45 326.08 L 290.5 328.79 L 287.74 321.71 L 285.9 329 L 283.85 326.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 336px; margin-left: 273px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="273" y="348" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="410" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 419.03 L 111.87 416.77 L 95.28 416.77 L 95.28 419.03 Z M 90 462.69 L 90 412.94 C 90 411.27 91.51 410 92.92 410 L 114.19 410 C 115.61 410 117.15 411.19 117.15 413.03 L 117.15 440.85 L 110.21 440.85 L 103.57 447.48 L 103.57 447.63 L 95.28 447.63 L 95.28 449.89 L 103.57 449.89 L 103.57 454.41 L 95.28 454.41 L 95.28 456.67 L 103.57 456.67 L 103.57 462.69 Z M 105.84 449.14 L 105.84 448.39 L 111.11 443.12 L 111.87 443.12 L 111.87 449.14 Z M 105.84 462.69 L 105.84 450.64 L 113.38 450.64 L 113.38 443.12 L 131.48 443.12 L 131.48 448.9 C 130.57 448.39 129.26 447.91 127.74 447.94 C 123.97 447.94 120.18 450.95 120.18 455.48 C 120.15 457.92 121.29 459.67 122.35 460.81 L 121.36 462.69 Z M 127.74 460.42 C 130.67 460.42 132.67 458.12 132.67 455.48 C 132.67 452.99 130.64 450.64 127.74 450.64 C 125.01 450.64 122.87 452.92 122.87 455.48 C 122.87 458.59 125.42 460.42 127.74 460.42 Z M 127.74 459.23 C 125.84 459.23 124.09 457.68 124.09 455.48 C 124.09 453.64 125.66 451.85 127.74 451.85 C 130.04 451.85 131.48 453.73 131.48 455.48 C 131.48 457.58 129.86 459.23 127.74 459.23 Z M 127.74 458.47 C 129.44 458.47 130.72 457.16 130.72 455.48 C 130.72 454.13 129.63 452.59 127.74 452.59 C 126.48 452.59 124.84 453.58 124.84 455.48 C 124.84 457.09 126.1 458.47 127.74 458.47 Z M 120.7 467.43 L 124.4 460.51 C 122.83 459.39 121.82 457.67 121.82 455.48 C 121.82 452.09 124.72 449.52 127.74 449.52 C 131.52 449.52 133.89 452.55 133.89 455.48 C 133.9 457.77 132.75 459.27 131.49 460.36 L 136 466.9 L 132.45 466.08 L 130.5 468.79 L 127.74 461.71 L 125.9 469 L 123.85 466.89 Z" fill="#505050" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 1px; height: 1px; padding-top: 440px; margin-left: 88px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Root CA&lt;br /&gt;(Offline)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="88" y="443" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Root CA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="610" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 619.03 L 111.87 616.77 L 95.28 616.77 L 95.28 619.03 Z M 90 662.69 L 90 612.94 C 90 611.27 91.51 610 92.92 610 L 114.19 610 C 115.61 610 117.15 611.19 117.15 613.03 L 117.15 640.85 L 110.21 640.85 L 103.57 647.48 L 103.57 647.63 L 95.28 647.63 L 95.28 649.89 L 103.57 649.89 L 103.57 654.41 L 95.28 654.41 L 95.28 656.67 L 103.57 656.67 L 103.57 662.69 Z M 105.84 649.14 L 105.84 648.39 L 111.11 643.12 L 111.87 643.12 L 111.87 649.14 Z M 105.84 662.69 L 105.84 650.64 L 113.38 650.64 L 113.38 643.12 L 131.48 643.12 L 131.48 648.9 C 130.57 648.39 129.26 647.91 127.74 647.94 C 123.97 647.94 120.18 650.95 120.18 655.48 C 120.15 657.92 121.29 659.67 122.35 660.81 L 121.36 662.69 Z M 127.74 660.42 C 130.67 660.42 132.67 658.12 132.67 655.48 C 132.67 652.99 130.64 650.64 127.74 650.64 C 125.01 650.64 122.87 652.92 122.87 655.48 C 122.87 658.59 125.42 660.42 127.74 660.42 Z M 127.74 659.23 C 125.84 659.23 124.09 657.68 124.09 655.48 C 124.09 653.64 125.66 651.85 127.74 651.85 C 130.04 651.85 131.48 653.73 131.48 655.48 C 131.48 657.58 129.86 659.23 127.74 659.23 Z M 127.74 658.47 C 129.44 658.47 130.72 657.16 130.72 655.48 C 130.72 654.13 129.63 652.59 127.74 652.59 C 126.48 652.59 124.84 653.58 124.84 655.48 C 124.84 657.09 126.1 658.47 127.74 658.47 Z M 120.7 667.43 L 124.4 660.51 C 122.83 659.39 121.82 657.67 121.82 655.48 C 121.82 652.09 124.72 649.52 127.74 649.52 C 131.52 649.52 133.89 652.55 133.89 655.48 C 133.9 657.77 132.75 659.27 131.49 660.36 L 136 666.9 L 132.45 666.08 L 130.5 668.79 L 127.74 661.71 L 125.9 669 L 123.85 666.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 676px; margin-left: 113px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="113" y="688" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="170" y="610" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 191.87 619.03 L 191.87 616.77 L 175.28 616.77 L 175.28 619.03 Z M 170 662.69 L 170 612.94 C 170 611.27 171.51 610 172.92 610 L 194.19 610 C 195.61 610 197.15 611.19 197.15 613.03 L 197.15 640.85 L 190.21 640.85 L 183.57 647.48 L 183.57 647.63 L 175.28 647.63 L 175.28 649.89 L 183.57 649.89 L 183.57 654.41 L 175.28 654.41 L 175.28 656.67 L 183.57 656.67 L 183.57 662.69 Z M 185.84 649.14 L 185.84 648.39 L 191.11 643.12 L 191.87 643.12 L 191.87 649.14 Z M 185.84 662.69 L 185.84 650.64 L 193.38 650.64 L 193.38 643.12 L 211.48 643.12 L 211.48 648.9 C 210.57 648.39 209.26 647.91 207.74 647.94 C 203.97 647.94 200.18 650.95 200.18 655.48 C 200.15 657.92 201.29 659.67 202.35 660.81 L 201.36 662.69 Z M 207.74 660.42 C 210.67 660.42 212.67 658.12 212.67 655.48 C 212.67 652.99 210.64 650.64 207.74 650.64 C 205.01 650.64 202.87 652.92 202.87 655.48 C 202.87 658.59 205.42 660.42 207.74 660.42 Z M 207.74 659.23 C 205.84 659.23 204.09 657.68 204.09 655.48 C 204.09 653.64 205.66 651.85 207.74 651.85 C 210.04 651.85 211.48 653.73 211.48 655.48 C 211.48 657.58 209.86 659.23 207.74 659.23 Z M 207.74 658.47 C 209.44 658.47 210.72 657.16 210.72 655.48 C 210.72 654.13 209.63 652.59 207.74 652.59 C 206.48 652.59 204.84 653.58 204.84 655.48 C 204.84 657.09 206.1 658.47 207.74 658.47 Z M 200.7 667.43 L 204.4 660.51 C 202.83 659.39 201.82 657.67 201.82 655.48 C 201.82 652.09 204.72 649.52 207.74 649.52 C 211.52 649.52 213.89 652.55 213.89 655.48 C 213.9 657.77 212.75 659.27 211.49 660.36 L 216 666.9 L 212.45 666.08 L 210.5 668.79 L 207.74 661.71 L 205.9 669 L 203.85 666.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 676px; margin-left: 193px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="193" y="688" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="296" y="610" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 317.87 619.03 L 317.87 616.77 L 301.28 616.77 L 301.28 619.03 Z M 296 662.69 L 296 612.94 C 296 611.27 297.51 610 298.92 610 L 320.19 610 C 321.61 610 323.15 611.19 323.15 613.03 L 323.15 640.85 L 316.21 640.85 L 309.57 647.48 L 309.57 647.63 L 301.28 647.63 L 301.28 649.89 L 309.57 649.89 L 309.57 654.41 L 301.28 654.41 L 301.28 656.67 L 309.57 656.67 L 309.57 662.69 Z M 311.84 649.14 L 311.84 648.39 L 317.11 643.12 L 317.87 643.12 L 317.87 649.14 Z M 311.84 662.69 L 311.84 650.64 L 319.38 650.64 L 319.38 643.12 L 337.48 643.12 L 337.48 648.9 C 336.57 648.39 335.26 647.91 333.74 647.94 C 329.97 647.94 326.18 650.95 326.18 655.48 C 326.15 657.92 327.29 659.67 328.35 660.81 L 327.36 662.69 Z M 333.74 660.42 C 336.67 660.42 338.67 658.12 338.67 655.48 C 338.67 652.99 336.64 650.64 333.74 650.64 C 331.01 650.64 328.87 652.92 328.87 655.48 C 328.87 658.59 331.42 660.42 333.74 660.42 Z M 333.74 659.23 C 331.84 659.23 330.09 657.68 330.09 655.48 C 330.09 653.64 331.66 651.85 333.74 651.85 C 336.04 651.85 337.48 653.73 337.48 655.48 C 337.48 657.58 335.86 659.23 333.74 659.23 Z M 333.74 658.47 C 335.44 658.47 336.72 657.16 336.72 655.48 C 336.72 654.13 335.63 652.59 333.74 652.59 C 332.48 652.59 330.84 653.58 330.84 655.48 C 330.84 657.09 332.1 658.47 333.74 658.47 Z M 326.7 667.43 L 330.4 660.51 C 328.83 659.39 327.82 657.67 327.82 655.48 C 327.82 652.09 330.72 649.52 333.74 649.52 C 337.52 649.52 339.89 652.55 339.89 655.48 C 339.9 657.77 338.75 659.27 337.49 660.36 L 342 666.9 L 338.45 666.08 L 336.5 668.79 L 333.74 661.71 L 331.9 669 L 329.85 666.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 676px; margin-left: 319px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="319" y="688" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="510" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 111.87 519.03 L 111.87 516.77 L 95.28 516.77 L 95.28 519.03 Z M 90 562.69 L 90 512.94 C 90 511.27 91.51 510 92.92 510 L 114.19 510 C 115.61 510 117.15 511.19 117.15 513.03 L 117.15 540.85 L 110.21 540.85 L 103.57 547.48 L 103.57 547.63 L 95.28 547.63 L 95.28 549.89 L 103.57 549.89 L 103.57 554.41 L 95.28 554.41 L 95.28 556.67 L 103.57 556.67 L 103.57 562.69 Z M 105.84 549.14 L 105.84 548.39 L 111.11 543.12 L 111.87 543.12 L 111.87 549.14 Z M 105.84 562.69 L 105.84 550.64 L 113.38 550.64 L 113.38 543.12 L 131.48 543.12 L 131.48 548.9 C 130.57 548.39 129.26 547.91 127.74 547.94 C 123.97 547.94 120.18 550.95 120.18 555.48 C 120.15 557.92 121.29 559.67 122.35 560.81 L 121.36 562.69 Z M 127.74 560.42 C 130.67 560.42 132.67 558.12 132.67 555.48 C 132.67 552.99 130.64 550.64 127.74 550.64 C 125.01 550.64 122.87 552.92 122.87 555.48 C 122.87 558.59 125.42 560.42 127.74 560.42 Z M 127.74 559.23 C 125.84 559.23 124.09 557.68 124.09 555.48 C 124.09 553.64 125.66 551.85 127.74 551.85 C 130.04 551.85 131.48 553.73 131.48 555.48 C 131.48 557.58 129.86 559.23 127.74 559.23 Z M 127.74 558.47 C 129.44 558.47 130.72 557.16 130.72 555.48 C 130.72 554.13 129.63 552.59 127.74 552.59 C 126.48 552.59 124.84 553.58 124.84 555.48 C 124.84 557.09 126.1 558.47 127.74 558.47 Z M 120.7 567.43 L 124.4 560.51 C 122.83 559.39 121.82 557.67 121.82 555.48 C 121.82 552.09 124.72 549.52 127.74 549.52 C 131.52 549.52 133.89 552.55 133.89 555.48 C 133.9 557.77 132.75 559.27 131.49 560.36 L 136 566.9 L 132.45 566.08 L 130.5 568.79 L 127.74 561.71 L 125.9 569 L 123.85 566.89 Z" fill="#505050" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 1px; height: 1px; padding-top: 540px; margin-left: 88px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Intermediate CA&lt;br /&gt;(Offline)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="88" y="543" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Intermed&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="296" y="510" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 317.87 519.03 L 317.87 516.77 L 301.28 516.77 L 301.28 519.03 Z M 296 562.69 L 296 512.94 C 296 511.27 297.51 510 298.92 510 L 320.19 510 C 321.61 510 323.15 511.19 323.15 513.03 L 323.15 540.85 L 316.21 540.85 L 309.57 547.48 L 309.57 547.63 L 301.28 547.63 L 301.28 549.89 L 309.57 549.89 L 309.57 554.41 L 301.28 554.41 L 301.28 556.67 L 309.57 556.67 L 309.57 562.69 Z M 311.84 549.14 L 311.84 548.39 L 317.11 543.12 L 317.87 543.12 L 317.87 549.14 Z M 311.84 562.69 L 311.84 550.64 L 319.38 550.64 L 319.38 543.12 L 337.48 543.12 L 337.48 548.9 C 336.57 548.39 335.26 547.91 333.74 547.94 C 329.97 547.94 326.18 550.95 326.18 555.48 C 326.15 557.92 327.29 559.67 328.35 560.81 L 327.36 562.69 Z M 333.74 560.42 C 336.67 560.42 338.67 558.12 338.67 555.48 C 338.67 552.99 336.64 550.64 333.74 550.64 C 331.01 550.64 328.87 552.92 328.87 555.48 C 328.87 558.59 331.42 560.42 333.74 560.42 Z M 333.74 559.23 C 331.84 559.23 330.09 557.68 330.09 555.48 C 330.09 553.64 331.66 551.85 333.74 551.85 C 336.04 551.85 337.48 553.73 337.48 555.48 C 337.48 557.58 335.86 559.23 333.74 559.23 Z M 333.74 558.47 C 335.44 558.47 336.72 557.16 336.72 555.48 C 336.72 554.13 335.63 552.59 333.74 552.59 C 332.48 552.59 330.84 553.58 330.84 555.48 C 330.84 557.09 332.1 558.47 333.74 558.47 Z M 326.7 567.43 L 330.4 560.51 C 328.83 559.39 327.82 557.67 327.82 555.48 C 327.82 552.09 330.72 549.52 333.74 549.52 C 337.52 549.52 339.89 552.55 339.89 555.48 C 339.9 557.77 338.75 559.27 337.49 560.36 L 342 566.9 L 338.45 566.08 L 336.5 568.79 L 333.74 561.71 L 331.9 569 L 329.85 566.89 Z" fill="#505050" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-end; width: 1px; height: 1px; padding-top: 540px; margin-left: 294px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Intermediate CA&lt;br /&gt;(Offline)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="294" y="543" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Intermed&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="366" y="610" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 387.87 619.03 L 387.87 616.77 L 371.28 616.77 L 371.28 619.03 Z M 366 662.69 L 366 612.94 C 366 611.27 367.51 610 368.92 610 L 390.19 610 C 391.61 610 393.15 611.19 393.15 613.03 L 393.15 640.85 L 386.21 640.85 L 379.57 647.48 L 379.57 647.63 L 371.28 647.63 L 371.28 649.89 L 379.57 649.89 L 379.57 654.41 L 371.28 654.41 L 371.28 656.67 L 379.57 656.67 L 379.57 662.69 Z M 381.84 649.14 L 381.84 648.39 L 387.11 643.12 L 387.87 643.12 L 387.87 649.14 Z M 381.84 662.69 L 381.84 650.64 L 389.38 650.64 L 389.38 643.12 L 407.48 643.12 L 407.48 648.9 C 406.57 648.39 405.26 647.91 403.74 647.94 C 399.97 647.94 396.18 650.95 396.18 655.48 C 396.15 657.92 397.29 659.67 398.35 660.81 L 397.36 662.69 Z M 403.74 660.42 C 406.67 660.42 408.67 658.12 408.67 655.48 C 408.67 652.99 406.64 650.64 403.74 650.64 C 401.01 650.64 398.87 652.92 398.87 655.48 C 398.87 658.59 401.42 660.42 403.74 660.42 Z M 403.74 659.23 C 401.84 659.23 400.09 657.68 400.09 655.48 C 400.09 653.64 401.66 651.85 403.74 651.85 C 406.04 651.85 407.48 653.73 407.48 655.48 C 407.48 657.58 405.86 659.23 403.74 659.23 Z M 403.74 658.47 C 405.44 658.47 406.72 657.16 406.72 655.48 C 406.72 654.13 405.63 652.59 403.74 652.59 C 402.48 652.59 400.84 653.58 400.84 655.48 C 400.84 657.09 402.1 658.47 403.74 658.47 Z M 396.7 667.43 L 400.4 660.51 C 398.83 659.39 397.82 657.67 397.82 655.48 C 397.82 652.09 400.72 649.52 403.74 649.52 C 407.52 649.52 409.89 652.55 409.89 655.48 C 409.9 657.77 408.75 659.27 407.49 660.36 L 412 666.9 L 408.45 666.08 L 406.5 668.79 L 403.74 661.71 L 401.9 669 L 399.85 666.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 676px; margin-left: 389px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="389" y="688" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="446" y="610" width="46" height="59" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 467.87 619.03 L 467.87 616.77 L 451.28 616.77 L 451.28 619.03 Z M 446 662.69 L 446 612.94 C 446 611.27 447.51 610 448.92 610 L 470.19 610 C 471.61 610 473.15 611.19 473.15 613.03 L 473.15 640.85 L 466.21 640.85 L 459.57 647.48 L 459.57 647.63 L 451.28 647.63 L 451.28 649.89 L 459.57 649.89 L 459.57 654.41 L 451.28 654.41 L 451.28 656.67 L 459.57 656.67 L 459.57 662.69 Z M 461.84 649.14 L 461.84 648.39 L 467.11 643.12 L 467.87 643.12 L 467.87 649.14 Z M 461.84 662.69 L 461.84 650.64 L 469.38 650.64 L 469.38 643.12 L 487.48 643.12 L 487.48 648.9 C 486.57 648.39 485.26 647.91 483.74 647.94 C 479.97 647.94 476.18 650.95 476.18 655.48 C 476.15 657.92 477.29 659.67 478.35 660.81 L 477.36 662.69 Z M 483.74 660.42 C 486.67 660.42 488.67 658.12 488.67 655.48 C 488.67 652.99 486.64 650.64 483.74 650.64 C 481.01 650.64 478.87 652.92 478.87 655.48 C 478.87 658.59 481.42 660.42 483.74 660.42 Z M 483.74 659.23 C 481.84 659.23 480.09 657.68 480.09 655.48 C 480.09 653.64 481.66 651.85 483.74 651.85 C 486.04 651.85 487.48 653.73 487.48 655.48 C 487.48 657.58 485.86 659.23 483.74 659.23 Z M 483.74 658.47 C 485.44 658.47 486.72 657.16 486.72 655.48 C 486.72 654.13 485.63 652.59 483.74 652.59 C 482.48 652.59 480.84 653.58 480.84 655.48 C 480.84 657.09 482.1 658.47 483.74 658.47 Z M 476.7 667.43 L 480.4 660.51 C 478.83 659.39 477.82 657.67 477.82 655.48 C 477.82 652.09 480.72 649.52 483.74 649.52 C 487.52 649.52 489.89 652.55 489.89 655.48 C 489.9 657.77 488.75 659.27 487.49 660.36 L 492 666.9 L 488.45 666.08 L 486.5 668.79 L 483.74 661.71 L 481.9 669 L 479.85 666.89 Z" fill="#0050ef" stroke="#001dbc" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 676px; margin-left: 469px;"&gt;&lt;div data-drawio-colors="color: #000000; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;"&gt;Issuing CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="469" y="688" fill="#000000" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Issuing&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 113 469 L 113 503.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 113 508.88 L 109.5 501.88 L 113 503.63 L 116.5 501.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 136 439.56 L 319 440 L 319 503.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 319 508.88 L 315.5 501.88 L 319 503.63 L 322.5 501.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 113 569 L 113 603.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 113 608.88 L 109.5 601.88 L 113 603.63 L 116.5 601.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 319 569 L 319 603.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 319 608.88 L 315.5 601.88 L 319 603.63 L 322.5 601.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 339.65 569 L 364.7 604.78" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 367.71 609.08 L 360.83 605.36 L 364.7 604.78 L 366.56 601.34 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 342 554.83 L 440.7 620.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 445.07 623.55 L 437.3 622.58 L 440.7 620.63 L 441.19 616.75 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 136 568.25 L 166.02 605.78" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 169.3 609.88 L 162.2 606.6 L 166.02 605.78 L 167.66 602.22 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 113 229 L 113 263.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 113 268.88 L 109.5 261.88 L 113 263.63 L 116.5 261.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 136 228.25 L 166.02 265.78" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 169.3 269.88 L 162.2 266.6 L 166.02 265.78 L 167.66 262.22 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 136 213.88 L 244.6 281.75" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 249.05 284.53 L 241.26 283.79 L 244.6 281.75 L 244.97 277.85 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;rect x="362" y="49" width="130" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 64px; margin-left: 363px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;"&gt;Single-Tier&lt;br /&gt;CA Model&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="427" y="69" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px" text-anchor="middle" font-weight="bold"&gt;Single-Tier&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="350" y="229" width="130" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 244px; margin-left: 351px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;"&gt;Two-Tier &lt;br /&gt;CA Model&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="415" y="249" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px" text-anchor="middle" font-weight="bold"&gt;Two-Tier&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="360" y="510" width="130" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 128px; height: 1px; padding-top: 525px; margin-left: 361px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;"&gt;Three-Tier &lt;br /&gt;CA Model&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="425" y="530" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px" text-anchor="middle" font-weight="bold"&gt;Three-Tier&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The two-tier hierarchy introduces another problem. The root CA also needs to restrict the certificates that its subordinate CAs can issue. For example, one issuing CA can only issue certificates in the *.dev.digihunch.com domain, and another CA can only issue *.ops.digihunch.com. No subordinate CA shall issue &amp;#8220;rogue&amp;#8221; certificate beyond their authorized scope. In order to enforce issue boundaries on issuing CAs, RFC 5280 defines multiple ways to express constraints, such as basic constraints (including path length), name constraints, policy constraints, and EKU.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In a three-tier CA hierarchy, the top-level is still a root CA that stays offline. One level below, is a layer of CAs that also stay offline and we refer to them as intermediate CAs. Going down one more level down, there are the issuing CAs for end-entity certificates. Oftentimes, we use the intermediate CAs as policy CAs where we introduce restrictions to the subordinates. In this model, the root CA can remain offline nearly all the time because we can issue CRLs at the intermediate level. This is more flexible, but also more management overhead.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Implementation Options&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The two-tier hierarchy is good in most scenarios but the three-tier hierarchy is also common for large organizations. The next consideration is implementation strategy. Take two-tier model for example. We can think about these options:&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;Implement a self-managed PKI, with an internal root CA. The internal subordinate CAs are the issuing CAs. They are chained to the internal root CA.&lt;/li&gt;&#10;&lt;li&gt;Implement a self-managed PKI, with its certificate purchased from a commercial CA. The internal subordinate CAs are the issuing CAs. They are chained to the external root CA, as the TPP (trusted third party). The external CA may or may not be a public root CA.&lt;/li&gt;&#10;&lt;li&gt;Purchase certificates from a commercial CA that are chained to a public root CA&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Option 3 essentially delegates the PKI to a commercial provider. This is usually not a favourable option due to the hefty charge and minimal control. In option 2, when the third party is a public root CA, you can have all your certificates with public trust, although this is a pricey option too. Even if the third-party isn&amp;#8217;t a public root CA, there is still a benefit of delegating the management of Root CA to commercial provider.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Option 1 is for use cases where we need a lot of certificates quick, for example, in agile development iterations. The certificates do not need trust beyond the organization, and the risk of root CA being compromised is manageable. In this option all CAs are private CAs. Option 2 on the other hand, is flexible in terms of trust boundary. You can just rely on the commercial provider as a TTP. If the TPP supports public root CA, you can issue certificates for public facing workload. In other words, you can choose either a private CA or a public CA. When we work with a private CA, we have to import the certificate to the trust stores of the organization.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="571px" viewBox="-0.5 -0.5 571 231" style="max-width:100%;max-height:231px;"&gt;&lt;defs&gt;&lt;style type="text/css"&gt;@import url(https://fonts.googleapis.com/css2?family=Architects+Daughter:wght@400;500);&amp;#xa;&lt;/style&gt;&lt;/defs&gt;&lt;g&gt;&lt;rect x="0" y="0" width="570" height="230" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/&gt;&lt;rect x="30" y="30" width="290" height="140" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-end; width: 288px; height: 1px; padding-top: 37px; margin-left: 30px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="318" y="49" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;CA&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="130" y="40" width="80" height="30" rx="4.5" ry="4.5" fill="#f9f7ed" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 47px; margin-left: 131px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;CAS&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="170" y="59" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;CAS&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="135" y="120" width="70" height="40" rx="6" ry="6" fill="#eeeeee" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 68px; height: 1px; padding-top: 127px; margin-left: 136px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RA&lt;br /&gt;region-2&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="170" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="40" y="120" width="70" height="40" rx="6" ry="6" fill="#eeeeee" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 68px; height: 1px; padding-top: 127px; margin-left: 41px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RA&lt;br /&gt;region-1&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="75" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="230" y="120" width="75" height="40" rx="6" ry="6" fill="#eeeeee" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 73px; height: 1px; padding-top: 127px; margin-left: 231px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RA&lt;br /&gt;region-3&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="268" y="139" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RA&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 150 70 L 75 120" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 190 70 L 267.5 120" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 170 120 L 170 70" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;rect x="370" y="30" width="180" height="80" fill="#cce5ff" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 178px; height: 1px; padding-top: 70px; margin-left: 372px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Certificate Authority Service:&lt;br /&gt;&amp;#8211; Holds the CA keys and certs&lt;br style="border-color: var(--border-color);" /&gt;&amp;#8211; signs CSRs from RAs&lt;br /&gt;&amp;#8211; trusts the RAs implicitly&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="372" y="74" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"&gt;Certificate Authority Service:&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="370" y="130" width="180" height="80" fill="#cce5ff" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 178px; height: 1px; padding-top: 170px; margin-left: 372px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Registration Authority:&lt;br /&gt;&amp;#8211; Authenticates requests&lt;br style="border-color: var(--border-color);" /&gt;&amp;#8211; Relays CSRs and Certs&lt;br style="border-color: var(--border-color);" /&gt;&amp;#8211; Connect to CAS&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="372" y="174" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"&gt;Registration Authority:&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="50" y="180" width="50" height="30" fill="#ffff88" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 195px; margin-left: 51px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;local&lt;br /&gt;clients&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="75" y="199" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;local&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="145" y="180" width="50" height="30" fill="#ffff88" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 195px; margin-left: 146px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;local&lt;br /&gt;clients&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="170" y="199" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;local&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="242.5" y="180" width="50" height="30" fill="#ffff88" stroke="#36393d" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 195px; margin-left: 244px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;local&lt;br /&gt;clients&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="268" y="199" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;local&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 170 180 L 170 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 75 180 L 75 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;path d="M 267.5 180 L 267.5 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Some PKI topologies splits a CA into two sub-components: the Certificate Authority Service (CAS, or simply CA) and the Registration Authority (RA), as the diagram above shows. With many locations, each location has an RA that communicates with a with a central CAS. The RAs receive requests from local clients and are responsible for authenticating these requests and pass the validated ones along to the CAS. The validation can take place in ACME protocol. The CAS implicitly trusts RAs and will sign the validated requests from RAs before sending them via API calls. The RA then relays the certificates back to the local requestors. This topology is more scalable with the CAS focusing only on signing and the RAs on validation and passing the requests along. Large organizations may have their central CAS hosted on-prem, and remote RAs in the CSP regions.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Components for X.509 Certificate&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;X.509 is the standard for digital certificate. The X.509 standard has the following most important fields:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Subject: The name of the subject (e.g. a user, service, device), commonly represented as X.500 formate distinguished name (DN). For website, the value can be CN=digihunch.com&lt;/li&gt;&#10;&lt;li&gt;Serial Number: A unique identifier for each certificate that a CA issues.&lt;/li&gt;&#10;&lt;li&gt;Issuer: DN of the CA. For a self-signed root CA, the issuer is the subject. They are different otherwise, such as in subordinate CA certificates and end entity certificates.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;These fields were introduced in version 1. In addition, X.509 version 3 certificates introduces extensions that provide additional functionality and features to the certificate. Each extension comes in two flavours: critical and non-critical. A certificate-using system MUST reject the certificate if it encounters a critical extension it does not recognize or a critical extension that contains information that it cannot process. A non-critical extension MAY be ignored if it is not recognized, but MUST be processed if it is recognized.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="851px" viewBox="-0.5 -0.5 851 411" style="max-width:100%;max-height:411px;"&gt;&lt;defs&gt;&lt;style type="text/css"&gt;@import url(https://fonts.googleapis.com/css2?family=Architects+Daughter:wght@400;500);&amp;#xa;&lt;/style&gt;&lt;/defs&gt;&lt;g&gt;&lt;rect x="0" y="0" width="850" height="410" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/&gt;&lt;path d="M 90 40 L 90 10 L 550 10 L 550 40" fill="#cce5ff" stroke="#36393d" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;path d="M 90 40 L 90 400 L 550 400 L 550 40" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 40 L 550 40" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 70 L 550 70" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 100 L 550 100" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 130 L 550 130" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 160 L 550 160" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 190 L 550 190" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 220 L 550 220" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 250 L 550 250" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 280 L 550 280" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 310 L 550 310" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 340 L 550 340" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 90 370 L 550 370" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;g fill="rgb(0, 0, 0)" font-family="Helvetica" text-anchor="middle" font-size="16px"&gt;&lt;text x="319.5" y="31.5"&gt;X.509 Certificate&lt;/text&gt;&lt;/g&gt;&lt;rect x="90" y="40" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 40 M 550 40 M 550 70 M 90 70" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 55px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Version&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="60" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Version&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="70" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 70 M 550 70 M 550 100 M 90 100" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 85px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Certificate Serial Number&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="90" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Certificate Serial Number&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="100" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 100 M 550 100 M 550 130 M 90 130" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 115px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Certificate Algorithm Identifier for Certificate Issuer&amp;#8217;s Signature&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="120" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Certificate Algorithm Identifier for Certificate Issuer&amp;#8217;s&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="130" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 130 M 550 130 M 550 160 M 90 160" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 145px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Issuer&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="150" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Issuer&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="160" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 160 M 550 160 M 550 190 M 90 190" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 175px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Validity Period&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="180" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Validity Period&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="190" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 190 M 550 190 M 550 220 M 90 220" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 205px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Subject&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="210" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Subject&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="220" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 220 M 550 220 M 550 250 M 90 250" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 235px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Subject Public-Key Information (Algorithm Identifier and Value)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="240" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Subject Public-Key Information (Algorithm Identifier and&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="250" width="460" height="30" fill="#eeeeee" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 250 M 550 250 M 550 280 M 90 280" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 265px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Issuer Unique Identifier&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="270" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Issuer Unique Identifier&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="280" width="460" height="30" fill="#eeeeee" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 280 M 550 280 M 550 310 M 90 310" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 295px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Subject Unique Identifier&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="300" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Subject Unique Identifier&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="310" width="460" height="30" fill="#eeeeee" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 310 M 550 310 M 550 340 M 90 340" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 325px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Extensions&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="330" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Extensions&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="340" width="460" height="30" fill="#f9f7ed" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 340 M 550 340 M 550 370 M 90 370" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 355px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Certificate Authority&amp;#8217;s Digital Signature&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="360" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Certificate Authority&amp;#8217;s Digital Signature&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="90" y="370" width="460" height="30" fill="#eeeeee" stroke="none" pointer-events="all"/&gt;&lt;path d="M 90 370 M 550 370 M 550 400 M 90 400" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 458px; height: 1px; padding-top: 385px; margin-left: 92px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Extension Fields &amp;#8230;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="92" y="390" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Extension Fields &amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 80 250 L 75 250 Q 70 250 70 260 L 70 285 Q 70 295 65 295 L 62.5 295 Q 60 295 65 295 L 67.5 295 Q 70 295 70 305 L 70 330 Q 70 340 75 340 L 80 340" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;rect x="0" y="280" width="60" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 295px; margin-left: 1px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Optional&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="30" y="300" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="15px" text-anchor="middle"&gt;Optional&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 70 385 L 90 385" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/&gt;&lt;rect x="0" y="370" width="60" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 385px; margin-left: 1px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 15px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Optional&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="30" y="390" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="15px" text-anchor="middle"&gt;Optional&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="100" width="250" height="300" fill="#eeeeee" stroke="none" pointer-events="none"/&gt;&lt;path d="M 590 100 L 840 100 L 840 400 L 590 400 L 590 100" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 130 L 840 130" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 160 L 840 160" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 190 L 840 190" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 220 L 840 220" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 250 L 840 250" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 280 L 840 280" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 310 L 840 310" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 340 L 840 340" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;path d="M 590 370 L 840 370" fill="none" stroke="#36393d" stroke-miterlimit="10" pointer-events="none"/&gt;&lt;rect x="590" y="100" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 100 M 840 100 M 840 130 M 590 130" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 115px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Subject Alternative Name (SAN)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="120" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Subject Alternative Name (SAN)&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="130" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 130 M 840 130 M 840 160 M 590 160" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 145px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Key Usage&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="150" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Key Usage&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="160" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 160 M 840 160 M 840 190 M 590 190" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 175px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Basic Constraints&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="180" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Basic Constraints&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="190" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 190 M 840 190 M 840 220 M 590 220" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 205px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Name Constraints&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="210" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Name Constraints&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="220" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 220 M 840 220 M 840 250 M 590 250" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 235px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;CRL distribution Points (CDP)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="240" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;CRL distribution Points (CDP)&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="250" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 250 M 840 250 M 840 280 M 590 280" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 265px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Authority Information Access (AIA)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="270" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Authority Information Access (A&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="280" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 280 M 840 280 M 840 310 M 590 310" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 295px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Subject Key Identification (SKI)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="300" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Subject Key Identification (SKI)&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="310" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 310 M 840 310 M 840 340 M 590 340" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 325px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Authority Key Identification (AKI)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="330" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Authority Key Identification (A&amp;#8230;&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="340" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 340 M 840 340 M 840 370 M 590 370" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 355px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Extended Key Usage (EKU)&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="360" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Extended Key Usage (EKU)&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="370" width="250" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;path d="M 590 370 M 840 370 M 840 400 M 590 400" fill="none" stroke="#36393d" stroke-linecap="square" stroke-miterlimit="10" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 248px; height: 1px; padding-top: 385px; margin-left: 592px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 26px; overflow: hidden;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Certificate Policies&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="592" y="390" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px"&gt;Certificate Policies&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="590" y="70" width="160" height="30" fill="none" stroke="none" pointer-events="all"/&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 158px; height: 1px; padding-top: 85px; margin-left: 591px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 16px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Common Extensions&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="670" y="90" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="16px" text-anchor="middle"&gt;Common Extensions&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 550 385 L 590 100.99" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/&gt;&lt;path d="M 550 385 L 589 397.99" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Here are some common extensions that a lot of implementations use:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Subject Alternative Name (SAN): only used in end entity certificates, not in CA certificates. The format of SAN is flexible and it does not have to be X.500 DN. For website certificate, we often place alternative DNS names here.&lt;/li&gt;&#10;&lt;li&gt;Key Usage: The intended scope of usage for a private key is specified through the Key Usage and Extended Key Usage (EKU) extensions in the associated certificate. Example: &amp;#8220;Certificate Sign, CRL Sign&amp;#8221;&lt;/li&gt;&#10;&lt;li&gt;Basic Constraints: Used to distinguish between end-entity cert and CA cert. You should also specify path length. The value can be: &amp;#8220;CA:TRUE, pathlen:1&amp;#8221;. If the path length constraint is 0, the CA may have one more level of subordinate CA. But these subordinate CAs must have path length of 0 on their own certs, and cannot extend one more level as their own subordinates. Those subordinate CAs can only issue end-entity certificates. If the path length value is none, then there is no restriction on the levels of subordinate CAs.&lt;/li&gt;&#10;&lt;li&gt;Name Constraints: for CA certs only, defined in RFC5280, to limit the scope to certain names on the certificate that the CA issues. Client must verify that a certificate is allowed to be signed by CA.&lt;/li&gt;&#10;&lt;li&gt;CDP (CRL distribution points): URL(s) where the application or service can retrieve the certificate revocation list (CRL).&lt;/li&gt;&#10;&lt;li&gt;AIA (Authority Information Access): URL(s) where the application or service can retrieve the revocation list for CA&amp;#8217;s certificate&lt;/li&gt;&#10;&lt;li&gt;SKI (Subject Key Identifier): the SHA-1 hash of the subject&amp;#8217;s public key&lt;/li&gt;&#10;&lt;li&gt;AKI (Authority Key Identifier): the SHA-1 hash of the issuer&amp;#8217;s public key&lt;/li&gt;&#10;&lt;li&gt;EKU (Extended Key Usage, also Enhanced Key Usage): an object identifier (OID) for each application or service a certificate can be used for. It needs to align with Key Usage&lt;/li&gt;&#10;&lt;li&gt;Certificate Policy: reference to the certification practice statement (CPS) of the issuer. During exchange, any relying party can access the assurance level associated with the certificate, and decide on the level of trust to put in the certificate.&lt;/li&gt;&#10;&lt;li&gt;Policy Constraints: for path validation, it can be used to prohibit policy mapping or to require that each certificate in a path contain an acceptable policy identifier.&lt;/li&gt;&#10;&lt;li&gt;Policy Mappings: in CA certificates to restrict the certificates that the CA can issue.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This isn&amp;#8217;t a complete list. Plus, X.509 V3 also supports custom extensions. &lt;a href="https://en.wikipedia.org/wiki/X.509#Sample_X.509_certificates"&gt;Here&lt;/a&gt; is a sample certificate. In real life, the way each implementation uses these extensions may vary slightly, so interoperability issues between PKIs exist. When designing your own PKI, it is important to examine the usage of extensions to comply with the standard. For example, Microsoft has the following &lt;a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn786428(v=ws.11)#constraining-ca-certificates"&gt;recommendations&lt;/a&gt; to restrict certificates: &lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;For subordinate CA certificates, the Basic Constraints extension should be present and marked as critical&lt;/li&gt;&#10;&lt;li&gt;The cA field should be set to TRUE&lt;/li&gt;&#10;&lt;li&gt;The pathLenConstraint field should be set to the minimum value required to enable the business scenario (i.e. 0 if that CA will issue certificates only to End Entities)&lt;/li&gt;&#10;&lt;li&gt;The EKU extension should be present and contain the minimum set of EKU object identifiers (OIDs) to enable the business scenario. Furthermore, the anyExtendedKeyUsage OID (2.5.29.37.0) should not be specified.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Summary&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This post discussed the basic concepts in public key infrastructure. In the next post, I&amp;#8217;ll cover the automation of certificate issuance.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2024/01/workload-identity-on-kubernetes-2-of-2-eks-and-rosa-on-aws/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Workload Identity on Kubernetes 2 of 2 – EKS&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2024/03/public-key-infrastructure-2-of-3-certificate-automation/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Public Key Infrastructure 2 of 3 – Certificate Automation&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>DICOM testing over TLS</title><link>https://www.digihunch.com/2023/02/dicom-testing-with-tls/</link><pubDate>Sat, 18 Feb 2023 01:05:00 -0400</pubDate><guid>https://www.digihunch.com/2023/02/dicom-testing-with-tls/</guid><description>&lt;img src="https://www.digihunch.com/wp-content/uploads/2025/04/dicom-testing-feature.webp" alt="Featured image of post DICOM testing over TLS" /&gt;&lt;p class="wp-block-paragraph"&gt;I have two open-source projects to deploy a medical imaging application on different platforms. In both of them, I define DICOM validation scenario, and provide steps to test DICOM traffic with TLS. The steps have been working well, until a recent change in Envoy broke the testing, and led me to revisit the test scenario. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In a nutshell, I changed from &lt;code&gt;dcm4che&lt;/code&gt; to &lt;code&gt;dcmtk&lt;/code&gt; binary builds. I&amp;#8217;ve also expanded the test case from a self-signed server certificate to one involving a self-signed CA. Although this test is about TLS for DICOM traffic, the principles apply to any traffic at TCP level. If you just need instruction for DICOM validation on &lt;a href="https://github.com/digihunch/orthweb"&gt;Orthweb&lt;/a&gt; or &lt;a href="https://github.com/digihunch/korthweb"&gt;Korthweb&lt;/a&gt; projects, skip the Background section. &lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-background"&gt;Background&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;To test DICOM traffic with command line tool, I was investigating between &lt;code&gt;dcm4che&lt;/code&gt; and &lt;code&gt;dcmtk&lt;/code&gt;. Both are open-source projects with builds for multiple platforms. My DICOM test is as simple as a C-Echo command and a C-Store command using the tool, with TLS enabled. Once they work, other DICOM commands usually work as well. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I have been primarily using &lt;code&gt;dcm4che&lt;/code&gt; as I was familiar with its previous version from my old job. For example, I can issue a C-ECHO with TLS using storescu command:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./storescu -c ORTHANC@ec2-54-243-91-148.compute-1.amazonaws.com:11112 --tls12 --tls-aes --trust-store server.truststore --trust-store-pass Password123!&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;To turn that test into a C-Store test, simply add a DCM file as input:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;./storescu -c ORTHANC@ec2-54-243-91-148.compute-1.amazonaws.com:11112 --tls12 --tls-aes --trust-store server.truststore --trust-store-pass Password123! MY.DCM&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The C-Store output tracks each DIMSE command and return codes. Note that in the command, we specify &amp;#8211;tls12 as the version, and with &amp;#8211;tls-aes switch we enabled AES or 3DES encryption. We also specified a file for trust store and password to the trust store. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This is when I first frowned over &lt;code&gt;dcm4che&lt;/code&gt;. The &lt;code&gt;dcm4che&lt;/code&gt; utility is a Java-based program we have to take an extra step of turning certificate into Java trust store. &lt;a href="https://www.digihunch.com/2018/11/the-java-confusions/"&gt;Different JVM versions&lt;/a&gt; may also cause different behaviours in the test. What later prompted me to switch to &lt;code&gt;dcmtk&lt;/code&gt; is that with &lt;code&gt;dcm4che&lt;/code&gt; I came across a weird &lt;a href="https://github.com/digihunch/orthweb/issues/14#issuecomment-1320768544"&gt;error&lt;/a&gt; since Envoy proxy version 1.23, which impacted both Orthweb (Envoy proxy) and Korthweb (Istio Ingress).&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Moreover, &lt;code&gt;dcmtk&lt;/code&gt; is available as a &lt;a href="https://formulae.brew.sh/formula/dcmtk#default"&gt;HomeBrew package&lt;/a&gt;, &lt;a href="https://packages.ubuntu.com/search?keywords=dcmtk"&gt;Ubuntu package&lt;/a&gt;, and &lt;a href="https://packages.debian.org/buster/dcmtk"&gt;Debian package&lt;/a&gt;. &lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;The test case, data and the tool&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;We can install dcmtk utility simply with &lt;code&gt;brew install dcmtk&lt;/code&gt;, and then we need its &lt;code&gt;echoscu&lt;/code&gt; and &lt;code&gt;storescu&lt;/code&gt; commands with correct TLS options. The DICOM data I used for testing is a CT exam available for download &lt;a href="https://download.digihunch.com/dicom_data/covid_study.zip"&gt;here&lt;/a&gt;. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Before mocking with &lt;code&gt;dcmtk&lt;/code&gt;&amp;#8216;s TLS options, we first need to understand what would be a good test. Previously I have used a single self-signed certificate on server. It is an over-simplified scenario that is far from a real-life certificate chain, and also does not test client certificate. If I also self-sign the client certificate, the client and server certificates are signed by entirely different parties and have no trust relationship, making it an invalid test case for client certificate.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For a full-blown testing with TLS, we should have two levels of CA as below:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="646px" viewBox="-0.5 -0.5 646 421" style="max-width:100%;max-height:421px;"&gt;&lt;defs&gt;&lt;/defs&gt;&lt;g&gt;&lt;rect x="0" y="0" width="645" height="420" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;rect x="345" y="300" width="280" height="100" rx="15" ry="15" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 278px; height: 1px; padding-top: 307px; margin-left: 346px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Server&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="485" y="319" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Server&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="505" y="350" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 365px; margin-left: 506px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="560" y="369" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="360" y="325" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 332px; margin-left: 361px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="428" y="344" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="375" y="350" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 365px; margin-left: 376px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="430" y="369" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="345" y="130" width="280" height="100" rx="15" ry="15" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 278px; height: 1px; padding-top: 137px; margin-left: 346px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Client&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="485" y="149" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;Client&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="505" y="180" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 195px; margin-left: 506px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="560" y="199" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="360" y="155" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 162px; margin-left: 361px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="428" y="174" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="375" y="180" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 195px; margin-left: 376px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="430" y="199" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="25" y="180" width="240" height="130" rx="19.5" ry="19.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 238px; height: 1px; padding-top: 245px; margin-left: 27px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Intermediate CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="27" y="249" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"&gt;Intermediate CA&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="132.5" y="270" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 285px; margin-left: 134px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="188" y="289" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="120" y="195" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 202px; margin-left: 121px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="188" y="214" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="135" y="220" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 235px; margin-left: 136px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="190" y="239" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="25" y="20" width="240" height="130" rx="19.5" ry="19.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 238px; height: 1px; padding-top: 85px; margin-left: 27px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Root CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="27" y="89" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"&gt;Root CA&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="132.5" y="110" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 125px; margin-left: 134px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="188" y="129" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="120" y="35" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 42px; margin-left: 121px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="188" y="54" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="135" y="60" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 75px; margin-left: 136px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="190" y="79" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 187.5 300 L 188 358 L 353.63 357.52" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 358.88 357.5 L 351.89 361.02 L 353.63 357.52 L 351.87 354.02 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 359px; margin-left: 281px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="281" y="363" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 242.5 285 L 428 285 L 427.55 226.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 427.51 221.12 L 431.06 228.09 L 427.55 226.37 L 424.06 228.14 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 285px; margin-left: 306px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="306" y="288" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 187.5 140 L 187.5 188.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 187.5 193.88 L 184 186.88 L 187.5 188.63 L 191 186.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 163px; margin-left: 187px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="187" y="166" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 242.5 125 L 285 125 L 285 68 L 261.37 67.61" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 256.12 67.52 L 263.18 64.14 L 261.37 67.61 L 263.06 71.13 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 91px; margin-left: 296px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;self-sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="296" y="94" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;self-sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"&gt;&lt;/g&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The chart represents a typical hierarchy of three-level certificate authorities. Sometimes we need simplicity in our testing, and it is reasonable to simplify the diagram to the following, with one CA that issues certificate for both client and server:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="601px" viewBox="-0.5 -0.5 601 301" style="max-width:100%;max-height:301px;"&gt;&lt;defs&gt;&lt;/defs&gt;&lt;g&gt;&lt;rect x="0" y="0" width="600" height="300" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"&gt;&lt;/rect&gt;&lt;rect x="290" y="180" width="280" height="90" rx="13.5" ry="13.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-end; width: 278px; height: 1px; padding-top: 187px; margin-left: 290px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Server&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="568" y="199" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Server&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="450" y="220" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 235px; margin-left: 451px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="505" y="239" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="305" y="195" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 202px; margin-left: 306px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="373" y="214" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="320" y="220" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 235px; margin-left: 321px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="375" y="239" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="290" y="40" width="280" height="90" rx="13.5" ry="13.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-end; width: 278px; height: 1px; padding-top: 47px; margin-left: 290px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: right;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Client&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="568" y="59" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="end"&gt;Client&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="450" y="80" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 95px; margin-left: 451px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="505" y="99" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="305" y="55" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 62px; margin-left: 306px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="373" y="74" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="320" y="80" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 95px; margin-left: 321px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="375" y="99" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="20" y="50" width="190" height="130" rx="19.5" ry="19.5" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-end; justify-content: unsafe flex-start; width: 188px; height: 1px; padding-top: 177px; margin-left: 22px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;Test CA&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="22" y="177" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px"&gt;Test CA&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="77.5" y="140" width="110" height="30" fill="#f5f5f5" stroke="#666666" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 155px; margin-left: 79px;"&gt;&lt;div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Private Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="133" y="159" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Private Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="65" y="65" width="135" height="65" fill="#fff2cc" stroke="#d6b656" stroke-width="3" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe center; width: 133px; height: 1px; padding-top: 72px; margin-left: 66px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;X509 Certificate&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="133" y="84" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;X509 Certificate&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;rect x="80" y="90" width="110" height="30" fill="#d5e8d4" stroke="#82b366" pointer-events="all"&gt;&lt;/rect&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 105px; margin-left: 81px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"&gt;RSA Public Key&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="135" y="109" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle"&gt;RSA Public Key&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 132.5 170 L 133 228 L 298.63 227.52" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 303.88 227.5 L 296.89 231.02 L 298.63 227.52 L 296.87 224.02 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 229px; margin-left: 226px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="226" y="233" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 190 160 L 373 160 L 372.58 126.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 372.51 121.12 L 376.1 128.07 L 372.58 126.37 L 369.1 128.16 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 160px; margin-left: 247px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="247" y="163" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;path d="M 187.5 147.5 L 230 148 L 230 98 L 206.37 97.61" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"&gt;&lt;/path&gt;&lt;path d="M 201.12 97.52 L 208.18 94.14 L 206.37 97.61 L 208.06 101.13 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"&gt;&lt;/path&gt;&lt;g transform="translate(-0.5 -0.5)"&gt;&lt;switch&gt;&lt;foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 118px; margin-left: 241px;"&gt;&lt;div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;"&gt;&lt;div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"&gt;self-sign&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;text x="241" y="121" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"&gt;self-sign&lt;/text&gt;&lt;/switch&gt;&lt;/g&gt;&lt;/g&gt;&lt;switch&gt;&lt;g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"&gt;&lt;/g&gt;&lt;a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank" rel="noopener"&gt;&lt;text text-anchor="middle" font-size="10px" x="50%" y="100%"&gt;Text is not SVG &amp;#8211; cannot display&lt;/text&gt;&lt;/a&gt;&lt;/switch&gt;&lt;/svg&gt;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Our DICOM validation testing will be based on both approaches depending on the project and deployment option. For Orthweb project and the Helm-chart driven option in Korthweb, we have one level of CA. For the GitOps and manual option in Korthweb, we have two levels of CA. When configuring testing, it is important to have the diagram above in mind.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In addition, we should also be aware of the limitation of the testing. As a personal project I will not pay for the certificates. I have to self-sign the certificate of the CA so there is no way to derive trust on this CA from another level. As a result, we must tell the client and server to trust the CA. The steps to create the needed certificates are: &lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;Generate a key pair for Test CA. Generate the certificate for Test CA by self-signing its own public key&lt;/li&gt;&#10;&lt;li&gt;Generate a key pair for the (DICOM) server. Generate the certificate for the server by signing its public key with Test CA&amp;#8217;s private key&lt;/li&gt;&#10;&lt;li&gt;Generate a key pair for the (DICOM) client. Generate the certificate for the client by signing its public key with Test CA&amp;#8217;s private key&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Because the client now also has its certificate, we can test with and without client certificate, using the following &lt;code&gt;dcmtck&lt;/code&gt; switches:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;&lt;strong&gt;-d&lt;/strong&gt; (shorthand for &amp;#8211;debug): print out detailed DICOM communication log. For succinct output, use -v (shorthand for &amp;#8211;verbose) instead.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;+tla&lt;/strong&gt; (shorthand for &amp;#8211;anonymous-tls): enable anonymous TLS (without client certificate)&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;+tls&lt;/strong&gt; (shorthand for &amp;#8211;enable-tls): enable full TLS (with client certificate), followed by client key and certificate files&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;-rc&lt;/strong&gt; (shorthand for &amp;#8211;require-peer-cert): &amp;#8211;require-peer-cert, require peer (server) certificate&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;+cf&lt;/strong&gt; (shorhand for &amp;#8211;add-cert-file): &amp;#8211;add-cert-file, add server certificate so client can trust it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For C-ECHO, the testing commands with and without client certificate look like:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echoscu -aet TESTER -aec ORTHANC -d +tla -rc +cf ca.crt ec2-3-98-241-51.ca-central-1.compute.amazonaws.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echoscu -aet TESTER -aec ORTHANC -d +tls client.key client.crt -rc +cf ca.crt ec2-3-98-241-51.ca-central-1.compute.amazonaws.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;For C-STORE, the testing commands with and without client certificate look like:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ storescu -aet TESTER -aec ORTHANC -d +tla -rc +cf ca.crt ec2-3-98-241-51.ca-central-1.compute.amazonaws.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt; DICOM_Images/COVID/56364823.dcm&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ storescu -aet TESTER -aec ORTHANC -d +tls client.key client.crt -rc +cf ca.crt ec2-3-98-241-51.ca-central-1.compute.amazonaws.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt; DICOM_Images/COVID/56364823.dcm&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;As to how to create the certificates, in the post &lt;em&gt;&lt;a href="https://www.digihunch.com/2021/08/creating-tls-certificate-kubernetes/"&gt;Creating X.509 TLS certificate in Kubernetes&lt;/a&gt;&lt;/em&gt;, I discussed different ways to create certificates for testing, including using openssl. In the next two sections, I will discuss them in further details.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Orthweb Test&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The orthweb project runs Docker containers on an EC2 instance. In the &lt;a href="https://github.com/digihunch/orthweb/blob/e13c590121b6d1bd22ec6092f4f6542c9680d4fc/terraform/modules/ec2/userdata1.sh"&gt;cloud-init script&lt;/a&gt; of the EC2 instance, we self-sign a test CA with openssl. Then we create key and certificate for server and client respectively:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;IssuerComName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;issuer.orthweb.digihunch.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ClientComName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;dcmclient.orthweb.digihunch.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ServerComName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ca-central-1.compute.amazonaws.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 req -x509 -sha256 -newkey rsa:4096 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;$IssuerComName/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;info@www.digihunch.com -keyout /tmp/ca.key -out /tmp/ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 req -new -newkey rsa:4096 -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;$ServerComName/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;orthweb@www.digihunch.com -addext extendedKeyUsage&lt;span style="color:#f92672"&gt;=&lt;/span&gt;serverAuth -addext subjectAltName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;DNS:orthweb.digihunch.com,DNS:$IssuerComName -keyout /tmp/server.key -out /tmp/server.csr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in /tmp/server.csr -CA /tmp/ca.crt -CAkey /tmp/ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out /tmp/server.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 req -new -newkey rsa:4096 -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;$ClientComName/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;orthweb@www.digihunch.com -keyout /tmp/client.key -out /tmp/client.csr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in /tmp/client.csr -CA /tmp/ca.crt -CAkey /tmp/ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out /tmp/client.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;When simulating DICOM activities from the client side, we supply the three files (&lt;code&gt;ca.key&lt;/code&gt;, &lt;code&gt;client.crt&lt;/code&gt; and &lt;code&gt;client.key&lt;/code&gt;) to the &lt;code&gt;echoscu&lt;/code&gt; and &lt;code&gt;storescu&lt;/code&gt; executables, to issue DIMSE commands on top of TLS from client side, as shown in the previous section. &lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Korthweb Test&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Currently, the Korthweb project deploys to Kubernetes cluster in three approaches, including two types of ingress controllers: Istio CRD (manual and GitOps deployment options) and Traefik CRD (Helm Chart driven deployment options). With both approaches, it is fairly straightforward to validate the HTTPS port. We export the CA certificate and run a curl command such as:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -HHost:web.orthweb.com -k -X GET https://web.orthweb.com:443/app/explorer.html -u admin:orthanc --cacert ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;Note that by default, the &lt;code&gt;curl&lt;/code&gt; command adds SNI (server name indication) extension by default to its TLS &lt;code&gt;ClientHello&lt;/code&gt; Message (even without -HHost switch). It acts like a &lt;a href="https://www.ssllabs.com/ssltest/clients.html"&gt;modern browser&lt;/a&gt;. &lt;/p&gt;&#10;&lt;figure class="wp-block-image size-full"&gt;&lt;img loading="lazy" decoding="async" width="1024" height="465" src="https://www.digihunch.com/wp-content/uploads/2023/02/dicom-wireshark.webp" alt="" class="wp-image-12895" srcset="https://www.digihunch.com/wp-content/uploads/2023/02/dicom-wireshark.webp 1024w, https://www.digihunch.com/wp-content/uploads/2023/02/dicom-wireshark-300x136.webp 300w, https://www.digihunch.com/wp-content/uploads/2023/02/dicom-wireshark-768x349.webp 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;On the ingress controller side, most ingress controllers use SNI to drive request routing (because Host field in payload is encrypted). For example, Traefik Proxy has &lt;a href="https://traefik.io/blog/announcing-traefik-proxy-2-7/"&gt;HostSNI&lt;/a&gt; matching rule. With Istio, the &lt;a href="https://istio.io/latest/docs/reference/config/networking/gateway/#Port"&gt;document&lt;/a&gt; states that: TLS implies the connection will be routed based on the SNI header to the destination. With DICOM traffic the Ingress also expects the client to make use of SNI extension in the TLS ClientHello message. The ingress supports multiple sites so the SNI even has an impact of which TLS certificate the ingress serves to the client. We can use openssl to examine which certificate an ingress serves. For example:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl s_client -showcerts -connect dicom.orthweb.com:11112 -servername dicom.orthweb.com &amp;lt; /dev/null&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl s_client -showcerts -connect dicom.orthweb.com:11112 &amp;lt; /dev/null&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The second command without &lt;code&gt;-servername&lt;/code&gt; switch constructs an ClientHello message without SNI. The ingress may not have a clue of what certificate to serve, depending on its own implementation of TLS protocol. We can also force TLS version with a switch such as &lt;code&gt;-tls1_2&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;When it comes to open-source DICOM client, neither &lt;code&gt;dcm4che&lt;/code&gt; or &lt;code&gt;dcmtk&lt;/code&gt; puts SNI in the TLS request. This created some limitation with my testing. Luckily I do not have multiple routing destinations for now so I only need to direct all DICOM traffic to a service. When I use &lt;a href="https://github.com/digihunch/korthweb/blob/13984a4057eb8b68bc7d15626635e171fdb0f69f/manual/orthanc.yaml#L187"&gt;Istio ingress&lt;/a&gt;, I was able to set hosts to &amp;#8220;*&amp;#8221; so the Ingress does not care missing SNI extension in the client request. With Traefik proxy, I had to set &lt;a href="https://github.com/digihunch/korthweb/blob/27a1a6e2f80b811c0ac593c95f912987a888ca03/helm/orthanc/templates/ingressroute.yaml#L11"&gt;sniStrict&lt;/a&gt; to false, and also forgo client certificate check. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The workaround is different per ingress implementation. Even worse, depending on what the available workaround can achieve, the testing steps vary as well. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For example, I perform DICOM validation (Istio ingress) with the steps below:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: generate client key pair&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -newkey rsa:4096 -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;dcmclient.bhs.orthweb.com/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;dcmclient@www.digihunch.com -keyout bhs.client.key -out bhs.client.csr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: export intermediate CA credentials&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl -n bhs-orthweb get secret int-ca-secret -o jsonpath&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;{.data.tls\.key}&amp;#39;&lt;/span&gt; | base64 -d &amp;gt; bhs.int.ca.key&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl -n bhs-orthweb get secret int-ca-secret -o jsonpath&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;{.data.tls\.crt}&amp;#39;&lt;/span&gt; | base64 -d &amp;gt; bhs.int.ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: get intermediate CA to sign client cert &lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in bhs.client.csr -CA bhs.int.ca.crt -CAkey bhs.int.ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out bhs.client.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: validate web request (without client certificate)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -HHost:web.bhs.orthweb.com -k -X GET https://web.bhs.orthweb.com:443/app/explorer.html -u admin:orthanc --cacert bhs.int.ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: validate DICOM c-echo request (with client certificate)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echoscu -aet TESTER -aec ORTHANC -d +tls bhs.client.key bhs.client.crt -rc +cf bhs.int.ca.crt dicom.bhs.orthweb.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# bhs: validate DICOM c-store request (with client certificate)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;storescu -aet TESTER -aec ORTHANC -d +tls bhs.client.key bhs.client.crt -rc +cf bhs.int.ca.crt dicom.bhs.orthweb.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt; DICOM_CT/0001.dcm&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;On the other hand, for Traefik ingress, I have to use anonymous TLS without client certificate:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echoscu -aet TESTER -aec ORTHANC -d +tla -ic dicom.orthweb.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;storescu -aet TESTER -aec ORTHANC -d +tla -ic dicom.orthweb.com &lt;span style="color:#ae81ff"&gt;11112&lt;/span&gt; DICOM_CT/123.dcm&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The complexities with different test paths are consequences of the missing SNI capability in both DICOM toolkits. Unfortunately, the developers of the two DICOM tools are not aware of these consequences. I tried to contact &lt;code&gt;dcmtk&lt;/code&gt; about this and will see what happens.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;TLS profile&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Another setting to pay close attention to is the security profile for TLS communication. These profiles defines the behaviours of &lt;code&gt;dcmtk&lt;/code&gt; when it establishes TLS connection. The dcmtk has the following security profiles:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;&amp;#8211;profile-&lt;strong&gt;bcp195-nd&lt;/strong&gt; (+py default): Non-downgrading BCP 195 TLS Profile&lt;/li&gt;&#10;&lt;li&gt;&amp;#8211;profile-&lt;strong&gt;bcp195&lt;/strong&gt; (+px): BCP 195 TLS Profile&lt;/li&gt;&#10;&lt;li&gt;&amp;#8211;profile-&lt;strong&gt;bcp195-ex&lt;/strong&gt; (+pz): Extended BCP 195 TLS Profile&lt;/li&gt;&#10;&lt;li&gt;&amp;#8211;profile-&lt;strong&gt;aes&lt;/strong&gt; (+pa): AES TLS Secure Transport Connection Profile (retired)&lt;/li&gt;&#10;&lt;li&gt;&amp;#8211;profile-&lt;strong&gt;null&lt;/strong&gt; (+pn): Authenticated unencrypted communication (retired, was used in IHE ATNA)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The two at the bottom have been &lt;a href="https://www.dicomstandard.org/news/supplements/view/tls-security-profiles"&gt;retired&lt;/a&gt;. The current profiles are all based on &lt;a href="https://datatracker.ietf.org/doc/bcp195/"&gt;BCP195&lt;/a&gt;. BCP (best current practice) are sub-series of the corresponding RFC document series. The current revision of DICOM standard discusses bcp195-nd, bcp195 and bcp195-ex profiles in DICOM standard &lt;a href="https://dicom.nema.org/MEDICAL/Dicom/2022d/output/pdf/part15.pdf"&gt;chapter PS 3.15&lt;/a&gt; (B.9-B.11). For example, bcp195-nd requires that:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Implementation shall not negotiate TLS 1.0 or 1.1&lt;/li&gt;&#10;&lt;li&gt;Client and server shall prefer strict TLS configuration (as opposed to startTLS)&lt;/li&gt;&#10;&lt;li&gt;Ciphers that should be supported.&lt;/li&gt;&#10;&lt;li&gt;Recommend port 2762&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;These BCP profiles were incorporated into DICOM standard since 2018 and are all based on &lt;a href="https://www.rfc-editor.org/bcp/bcp195.txt"&gt;BCP195&lt;/a&gt;. BCP 195 states in section 3.6&lt;/p&gt;&#10;&lt;blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;/p&gt;&#10;&lt;cite&gt;3.6. Server Name Indication&lt;br&gt;TLS implementations MUST support the Server Name Indication (SNI)&lt;br&gt;extension defined in Section 3 of [RFC6066] for those higher-level&lt;br&gt;protocols that would benefit from it, including HTTPS. However, the&lt;br&gt;actual use of SNI in particular circumstances is a matter of local&lt;br&gt;policy.&lt;br&gt;Rationale: SNI supports deployment of multiple TLS-protected virtual&lt;br&gt;servers on a single address, and therefore enables fine-grained&lt;br&gt;security for these virtual servers, by allowing each one to have its&lt;br&gt;own certificate.&lt;/cite&gt;&lt;/blockquote&gt;&#10;&lt;p class="wp-block-paragraph"&gt;So technically, missing SNI is considered incompliant.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Summary&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I find myself switching between &lt;code&gt;dcmtk&lt;/code&gt; and &lt;code&gt;dcm4che&lt;/code&gt; back and forth in the past. This time, I spent some time hoping to settle with the better tool this time. The effort is insightful but not fruitful. It is unfortunate to realize that neither supports SNI so I had to compromise the feature of my deployment. Hopefully one of those tools will catch up.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2023/01/github-action-gotchas/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;GitHub Action Gotchas&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2023/03/a-taste-of-iot-device-tracking/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;A taste of IoT device tracking&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Creating X.509 TLS certificate for workload on Kubernetes</title><link>https://www.digihunch.com/2021/08/creating-tls-certificate-kubernetes/</link><pubDate>Sun, 29 Aug 2021 23:19:00 -0400</pubDate><guid>https://www.digihunch.com/2021/08/creating-tls-certificate-kubernetes/</guid><description>&lt;img src="https://www.digihunch.com/wp-content/uploads/2025/04/feature-k8s-x509.webp" alt="Featured image of post Creating X.509 TLS certificate for workload on Kubernetes" /&gt;&lt;p class="wp-block-paragraph"&gt;In deployment automation, I often had to create self-signed X.509 certificate for testing TLS traffic into Kubernetes. Sometimes self-signed, sometimes signed by a CA. This post summarized the approaches I&amp;#8217;ve taken.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading" id="create-self-signed-certificate-with-openssl"&gt;Create self-signed certificate with OpenSSL&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Traditionally, this is done in three OpenSSL commands:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days &lt;span style="color:#ae81ff"&gt;356&lt;/span&gt; -nodes -subj &lt;span style="color:#e6db74"&gt;&amp;#39;/CN=Health Certificate Authority&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -newkey rsa:4096 -keyout server.key -out server.csr -nodes -subj &lt;span style="color:#e6db74"&gt;&amp;#39;/CN=*.orthweb.com&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in server.csr -CA ca.crt -CAkey ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out server.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;I have an older post to cover the basics of cryptography in TLS certificate and PKI. In the three commands above, the first produces a private key and self-signed certificate for a CA. The second creates a private key and a CSR for the web site. The third one uses the CA&amp;#8217;s signing private key to sign the CSR from the website. The output is the certificate for the website. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Workloads running in Kubernetes typically consume certificates stored in Kubernetes Secret. The cons of this approach is that it usually requires an extra step to import the certificate files into Kubernetes Secret. For example:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl create -n orthweb secret generic orthweb-cred --from-file&lt;span style="color:#f92672"&gt;=&lt;/span&gt;tls.key&lt;span style="color:#f92672"&gt;=&lt;/span&gt;server.key --from-file&lt;span style="color:#f92672"&gt;=&lt;/span&gt;tls.crt&lt;span style="color:#f92672"&gt;=&lt;/span&gt;server.crt --from-file&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ca.crt&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;Note, people use the term self-signed certificate loosely. It sometimes means literally a certificate that is self-signed, like the one generated above. Sometimes, I had to self-sign a CA, then use the CA to sign one certificate for the server and one for the client. Because the application being tested requires that the client and server&amp;#8217;s certificates both under the same CA. This would involve a few more commands, for example:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Self-sign a CA&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -x509 -sha256 -newkey rsa:4096 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;issuer.digihunch.com/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;info@www.digihunch.com -keyout /tmp/ca.key -out /tmp/ca.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Generate a CSR for server&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -newkey rsa:4096 -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;server.digihunch.com/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;orthweb@www.digihunch.com -addext extendedKeyUsage&lt;span style="color:#f92672"&gt;=&lt;/span&gt;serverAuth -addext subjectAltName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;DNS:orthweb.digihunch.com,DNS:server2.digihunch.com -keyout /tmp/server.key -out /tmp/server.csr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Use the self-signed CA to issue a certificate to the server&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;3650&lt;/span&gt; -in /tmp/server.csr -CA /tmp/ca.crt -CAkey /tmp/ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out /tmp/server.crt -extfile &amp;lt;&lt;span style="color:#f92672"&gt;(&lt;/span&gt;echo subjectAltName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;DNS:orthweb.digihunch.com,DNS:server2.digihunch.com&lt;span style="color:#f92672"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Generate a CSR for clietn&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl req -new -newkey rsa:4096 -nodes -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;client.digihunch.com/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;client@www.digihunch.com -keyout /tmp/client.key -out /tmp/client.csr&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Use the self-signed CA to issue a certificate to the client&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl x509 -req -sha256 -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -in /tmp/client.csr -CA /tmp/ca.crt -CAkey /tmp/ca.key -set_serial &lt;span style="color:#ae81ff"&gt;01&lt;/span&gt; -out /tmp/client.crt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;In the example above, it is important to note that even though the server&amp;#8217;s CSR contains subject alternative name (SAN), I still have to specify the SAN again when signing the certificate for the server. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Similar to OpenSSL there are other toolkits such as CFSSL that supports specifying configuration files. However, the steps in Shell command are generally not always easy to automate.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading" id="create-self-signed-certificate-with-helm"&gt;Create self-signed certificate with Helm&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Moving to the context of workload deployment in Kubernetes, running openSSL command isn&amp;#8217;t always a viable option. For example, generating a certificate in the middle of deployment using a Helm Chart. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In &lt;a href="https://www.digihunch.com/2021/07/helm-configuration-management-for-kubernetes-resources/"&gt;Helm&lt;/a&gt;, template functions is for this purpose. In my Korthweb &lt;a href="https://github.com/digihunch/korthweb/blob/6480dad21490c0bfae27316093e533d68ecf04a2/orthanc/templates/tls-secrets.yaml#L4"&gt;project&lt;/a&gt; I used genSignedCert to create self-signed certificate and then store the key, certificate and CA certificate as Kubernetes Secret:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;{{&lt;/span&gt;- $dbtlscert :&lt;span style="color:#f92672"&gt;=&lt;/span&gt; genSignedCert .Values.dbtls.certCommonName nil &lt;span style="color:#f92672"&gt;(&lt;/span&gt;list .Values.dbtls.certCommonName&lt;span style="color:#f92672"&gt;)&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; $ca &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;apiVersion: v1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kind: Secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;metadata:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name: &lt;span style="color:#f92672"&gt;{{&lt;/span&gt; .Values.dbtls.certCommonName | quote &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; namespace: &lt;span style="color:#f92672"&gt;{{&lt;/span&gt; $.Release.Namespace | quote &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;type: kubernetes.io/tls&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;data:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tls.crt: &lt;span style="color:#f92672"&gt;{{&lt;/span&gt; $dbtlscert.Cert | b64enc | quote &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tls.key: &lt;span style="color:#f92672"&gt;{{&lt;/span&gt; $dbtlscert.Key | b64enc | quote &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ca.crt: &lt;span style="color:#f92672"&gt;{{&lt;/span&gt; $ca.Cert | b64enc | quote &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;{{&lt;/span&gt;- end &lt;span style="color:#f92672"&gt;}}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The cons of this approach is that the syntax is not straightforward. As indicated in Helm &lt;a href="https://helm.sh/docs/topics/charts/#templates-and-values"&gt;documentation&lt;/a&gt;: Helm Chart templates are written in the&amp;nbsp;&lt;a href="https://golang.org/pkg/text/template/" target="_blank" rel="noreferrer noopener"&gt;Go template language&lt;/a&gt;, with the addition of 50 or so add-on template functions&amp;nbsp;&lt;a href="https://github.com/Masterminds/sprig" target="_blank" rel="noreferrer noopener"&gt;from the Sprig library&lt;/a&gt;&amp;nbsp;and a few other&amp;nbsp;&lt;a href="https://helm.sh/docs/howto/charts_tips_and_tricks/"&gt;specialized functions&lt;/a&gt;. While we talk about the &amp;#8220;&lt;a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#helm"&gt;Helm template language&lt;/a&gt;&amp;#8221; as if it is Helm-specific, it is actually a combination of the Go template language, some extra functions, and a variety of wrappers to expose certain objects to the templates. Many resources on Go templates may be helpful as you learn about templating.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading" id="create-self-signed-certificate-with-cert-manager"&gt;Create self-signed certificate with Cert-Manager&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The &lt;a href="https://cert-manager.io/docs/"&gt;Cert Manager&lt;/a&gt; project is very popular to produce X.509 certificates directly in Kubernetes secret. We can install cert manager using Helm:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl create namespace cert-manager&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm repo add jetstack https://charts.jetstack.io&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v1.0.3 --set installCRDs&lt;span style="color:#f92672"&gt;=&lt;/span&gt;true&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl get pods -n cert-manager&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl get crd | grep cert-manager.io&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;Alternatively, FluxCD&amp;#8217;s documentation on &lt;a href="https://fluxcd.io/docs/components/kustomize/kustomization/#kustomization-dependencies"&gt;Kustomization dependency&lt;/a&gt; uses Cert Manager as an example. It is a good way of installing cert-manager if you have GitOps pattern.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Creating self-signed certificate for website is fairly simple. It starts with &lt;a href="https://cert-manager.io/docs/configuration/selfsigned/#bootstrapping-ca-issuers"&gt;bootstrapping&lt;/a&gt; a CA issuer. Take the manifest below as an example. When creating the first certificate, make sure to specify isCA=true, so it stores the signing private key along with its own certificate in the ca-secret. Then use the newly created CA as issuer to create the X.509 certificate for the website.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ClusterIssuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;selfsigned-issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;selfSigned&lt;/span&gt;: {}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Certificate&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;my-ca&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;namespace&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;isCA&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;commonName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;my-ca&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;secretName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ca-secret&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;privateKey&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;algorithm&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ECDSA&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;size&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;256&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;issuerRef&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;selfsigned-issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ClusterIssuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;group&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;my-ca-issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;namespace&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ca&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;secretName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ca-secret&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Certificate&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb-cert&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;namespace&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;commonName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb.com&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;secretName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;orthweb-secret&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;duration&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;2160h&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;renewBefore&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;72h&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;subject&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;organizations&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;digihunch&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;dnsNames&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;web.orthweb.com&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;dcm.orthweb.com&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;privateKey&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;algorithm&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ECDSA&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;size&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;256&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;issuerRef&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;my-ca-issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Issuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;group&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The site certificate is directly stored in Kubernetes Secret as specified in the secretName field. To fetch the certificate text, we need to decode the secret entry, for example:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl -n orthweb get secret orthweb-secret -o jsonpath&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;{.data.ca\.crt}&amp;#39;&lt;/span&gt; | base64 -d&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;Note that the example above uses ECDSA algorithm with size 256 for private key and certificate. It requires that the TLS client to support ECDSA algorithm as well. For more supportability, you can use RSA algorithm (2048 or 4096 size).&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In addition to creating self-signed certificate, Cert Manager supports a number of other issuer types. For example, the support of &lt;a href="https://cert-manager.io/docs/configuration/acme/"&gt;ACME&lt;/a&gt; issuer type enables integration with Let&amp;#8217;s Encrypt. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Cert Manager can secure Kubernetes Ingress resources with a sub-component called &lt;strong&gt;ingress-shim&lt;/strong&gt;. It is configured via annotation on the &lt;a href="https://cert-manager.io/docs/usage/ingress/"&gt;Ingress&lt;/a&gt; resource.&lt;/p&gt;&#10;&lt;figure class="wp-block-image is-resized"&gt;&lt;img decoding="async" src="https://cert-manager.io/images/high-level-overview.svg" alt="High level overview diagram explaining cert-manager architecture" style="width:752px;height:432px"/&gt;&lt;figcaption class="wp-element-caption"&gt;Cert Manager&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;h2 class="wp-block-heading" id="create-ca-signed-certificate-manually"&gt;Create CA-signed certificate manually&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For a certificate signed by a CA, there are may paid options, from manual, to self-help, to automated. The classic manual way is using OpenSSL, generating key, CSR. The CA takes CSR to sign a X.509 certificate returned to the website administration.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Many CA websites charges for a fee and makes it easy. For example, this site currently uses certificate from SSLs.com. Apart from the fee-for-cert option, there is a website named &amp;#8220;&lt;a href="https://www.sslforfree.com/"&gt;SSL for free&lt;/a&gt;&amp;#8220;, a CA with free option for 90-day single-domain, non-wildcard certificate and we can request it simply on their website, with proof of domain ownership. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The other popular free option is Let&amp;#8217;s Encrypt, which also employs &lt;a href="https://www.digihunch.com/2021/04/public-key-infrastructure-pki/"&gt;ACME&lt;/a&gt; protocol. The protocol requires ACME challenges to be satisfied in order to proof domain ownership. There are a few types of &lt;a href="https://letsencrypt.org/docs/challenge-types/"&gt;challenges&lt;/a&gt;: &lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;HTTP-01 challenge &lt;/li&gt;&#10;&lt;li&gt;DNS-01 challenge&lt;/li&gt;&#10;&lt;li&gt;TLS-SNI-01 challenge&lt;/li&gt;&#10;&lt;li&gt;TLS-ALPN-01 challenge&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I have used the HTTP-01 and DNS-01 challenges. The DNS-01 challenge requires adding TXT records to DNS configuration. The HTTP-01 challenge requires adding a DNS A-record to resolve to the server, then two URIs with pre-defined value.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;When I first set up this site I used certbot (the client program for letsencrypt) to create certificate every 90 days from the wordpress server, following &lt;a href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-lets-encrypt-certificates-with-wordpress"&gt;this&lt;/a&gt; guide, including solving DNS-01 challenges.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading" id="create-ca-signed-certificate-automatically-with-cert-manager-and-letsencrypt"&gt;Create CA-signed certificate automatically with cert manager and letsencrypt&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With Kubernetes, &lt;a href="https://cert-manager.io/docs/"&gt;cert-manager&lt;/a&gt; has the ability to integrate with let&amp;#8217;s encrypt for full automation. &lt;a href="https://medium.com/@rd.petrusek/kubernetes-istio-cert-manager-and-lets-encrypt-c3e0822a3aaf"&gt;Here&lt;/a&gt; is a good blog post on this. &lt;span style="text-decoration: underline;"&gt;Domain verification is still required&lt;/span&gt; but it can be done automatically. We first need to register an A record that resolves host name to the Ingress IP to enable this automation. The domain ownership validation may use the ACME protocol. This should also work on private networks with private DNS and ACME protocol using a private boulder server.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Take domain name demo1.digihunch.com for example, if ingress exposes a public IP address which the domain name resolves to, then we can configure certificate with the following manifest:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;IngressClass&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;istio&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;controller&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;istio.io/ingress-controller&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ClusterIssuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;letsencrypt&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;acme&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;privateKeySecretRef&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;letsencrypt&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;server&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;https://acme-staging-v02.api.letsencrypt.org/directory&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;solvers&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;http01&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;ingress&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;class&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;istio&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;---&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;apiVersion&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;cert-manager.io/v1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Certificate&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;metadata&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;demo&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;spec&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;dnsNames&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#ae81ff"&gt;demo1.digihunch.com&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;issuerRef&lt;/span&gt;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;kind&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;ClusterIssuer&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;letsencrypt&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;secretName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;demo-tls&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;This example uses Istio as ingress controller but the method works regardless of the controller technology behind Ingress. In the ClusterIssuer object, we&amp;#8217;re telling it to use the staging server from letsencrypt. We also specify http01 as challenge type, and that the ingress type is istio. In the Certificate object, we provided dnsName and specified ClusterIssuser. We also tell it to store the credentials to a secret named &lt;em&gt;demo-tls&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;When we apply the resources above, the ClusterIssuer connects to letsencrypt server via ACME protocol. Since the DNS name already resolves to the Public IP that the ingress is hosting, the ClusterIssuer configures the required Ingress, Services and Pods accordingly so the &lt;a href="https://letsencrypt.org/docs/challenge-types/#http-01-challenge"&gt;token&lt;/a&gt; to satisfy the challenge is presented at the designated URI. Instead of a staging server, we can also use production ACME server for production deployment. Note that the production ACME endpoint has a stricter rate limit.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;When the ACME validation is in progress, it is important to ensure that port 80 is open and there is no other mechanism (such as routing rule, authorization requirement, mandatory redirect to 443) that blocks access from letsencrypt server.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading" id="bottom-line"&gt;Bottom line&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Cert Manager is deployed in Kubernetes, supporting a variety of issuer types. As a Kubernetes-native tool, it is a no-brainer for Kubernetes workload for X.509 certificate. Compared with using template function in Helm, it is not dependent on template function and the syntax is consistent (YAML). Compared with OpenSSL or other binary tools, it is easy to integrate with the platform.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2021/08/docker-desktop-a-single-node-kubernetes-cluster/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Single-node Kubernetes cluster – docker desktop&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2021/09/log-shipping-in-kubernetes-with-efk/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Log Shipping in Kubernetes with EFK stack&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Secure web application deployment</title><link>https://www.digihunch.com/2021/05/secure-web-application-deployment/</link><pubDate>Sun, 16 May 2021 15:19:41 -0400</pubDate><guid>https://www.digihunch.com/2021/05/secure-web-application-deployment/</guid><description>&lt;p class="wp-block-paragraph"&gt;In Nov 2020, I created &lt;a href="https://github.com/digihunch/orthweb/tree/2181001e29b0da5fd55f51a6dc2a522d3f83aee6" class="rank-math-link"&gt;OrthWeb&lt;/a&gt; project, a deployment of Orthanc&amp;#8217;s server. Orthanc is a DICOM viewer and repo shipped in Docker container. In the &lt;a href="https://www.digihunch.com/2020/11/medical-imaging-web-server-deployment-pipeline/" class="rank-math-link"&gt;deployment project&lt;/a&gt;, I use Terraform to provision infrastructure, including a managed PostgreSQL instance, an EC2 instance for docker runtime, and the init script to bring up the web service. I whipped up the project for a demo, and skipped some security configurations. For example, the password was stored in clear text in Terraform configuration. The web certificate is stored in the repository. I recently had some time to fix that. My effort leads up to the conclusion that this requires a better platform (i.e. managed Kubernetes cluster). So I wanted to note down how I got there.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Secret store&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In AWS, both parameter store and secret manager can act as secret store. Secrets manager comes at higher cost but some additional features, such as built-in password generator, secret rotation, and cross-account access. We use Secret Manager but we generate password within Terraform because we need to specify password during database provisioning. Secret store requires certain special characters to be eliminated. Terraform can specify the special characters allowed. For EC2 instance to pull from secret manager, the following entities are needed:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;A secret store&lt;/li&gt;&#10;&lt;li&gt;A VPC endpoint to expose secret store to subnet via private route. &lt;/li&gt;&#10;&lt;li&gt;The VPC endpoint needs its own security group&lt;/li&gt;&#10;&lt;li&gt;The instance profile of the EC2 instance must contain an IAM role to get secret value&lt;/li&gt;&#10;&lt;li&gt;The security group of EC2 instance needs to allow traffic to secret store&lt;/li&gt;&#10;&lt;li&gt;The script from EC2 instance uses VPC endpoint&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This is a common pattern for interaction between computing object and VPC endpoint. The details are in compute.tf, network.tf, secgrp.tf and secret.tf. The secret name needs to be partially randomized to avoid naming conflict with deactivated secrets.&lt;/p&gt;&#10;&lt;div class="wp-block-image"&gt;&#10;&lt;figure class="aligncenter size-large"&gt;&lt;img loading="lazy" decoding="async" width="623" height="323" src="https://www.digihunch.com/wp-content/uploads/2021/05/secmgr.png" alt="" class="wp-image-2250"/&gt;&lt;/figure&gt;&#10;&lt;/div&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Passing Secret to container&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Here is an example CLI command to pull secret:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ aws secretsmanager get-secret-value --secret-id DatabaseCreds51c1db4172ae9c54 --query SecretString --output text --endpoint-url https://vpce-0897b168cf1c60df2-khx32o7f.secretsmanager.us-east-1.vpce.amazonaws.com | jq -r .password&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The connection is made via private network route (whether the instance is in public or private subnet). Traffic is encrypted in TLS. Once in the operating system, the secret is available as standard output and can be stored to file, or saved in environment variable. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;My first attempted approach is docker&amp;#8217;s secret store and config so that I do not have to store secret in plain text on the file system. I eventually give up this approach due to several hiccups. First, secret and config are part of Docker swarm service. So it requires initializing docker swarm before I could port in the secret, with the following command:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker swarm init&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echo mdbuser123 | docker secret create db_un -&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echo m1p@ssw0rd | docker secret create db_pw -&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echo 10.2.32.41 | docker config create db_ep -&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The content of the secret and config are presented as files to the container file system at different locations, as can be verified this way:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker service create --name&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;redis&amp;#34;&lt;/span&gt; --secret&lt;span style="color:#f92672"&gt;=&lt;/span&gt;db_un --secret&lt;span style="color:#f92672"&gt;=&lt;/span&gt;db_pw --config&lt;span style="color:#f92672"&gt;=&lt;/span&gt;db_ep redis:alpine&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker container ls&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker exec -it c8ed2a278ca8 sh&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# cat /db_ep&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# cat /run/secrets/db_un&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# cat /run/secrets/db_pw&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;This is a great way to pass secret and config to container applications. However, since the values are stored as content of file, the main application must be able to load file content as its own configuration value. In my specific scenario, the application expects explicit value in its &lt;a href="https://orthanc.uclouvain.be/book/users/configuration.html" class="rank-math-link"&gt;configuration file&lt;/a&gt;, or environment variable.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;On the other hand, Docker &lt;a href="https://techbeacon.com/devops/how-keep-your-container-secrets-secure" class="rank-math-link"&gt;document&lt;/a&gt; states that docker secrets do not set environment variables directly. this was a conscous decision, because env var can unintentionally be leaked between containers. In other word I could present secrets as files but the application cannot use it. There is potentially a workaround &lt;a href="https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab" class="rank-math-link"&gt;here&lt;/a&gt; which is great function wise but an additional layer of complexity.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Moreover, I later discovered that this isn&amp;#8217;t even a viable approach if I use docker compose. This is because I must declare those entries from secret store or config store as &lt;a href="https://docs.docker.com/compose/compose-file/compose-file-v3/#configs" class="rank-math-link"&gt;external&lt;/a&gt;, and external secrets are not even available to containers created by docker-compose. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With reluctance, I store the config and secret keys and values to a file, and use the &lt;a href="https://docs.docker.com/compose/environment-variables/#the-env-file" class="rank-math-link"&gt;env_file&lt;/a&gt; section in docker compose to import them as environment variables. The application can pick up environment variables as configuration values.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;X509 Certificate&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;We use a self-signed X509 certificate, along with the private key. The &lt;a href="https://orthanc.uclouvain.be/book/faq/https.html#securing-orthanc-using-self-signed-certificate" class="rank-math-link"&gt;creation&lt;/a&gt; is straightforward. However, when I tested on Mac, the browser does not load the page for &lt;a href="https://support.apple.com/en-us/HT210176" class="rank-math-link"&gt;this&lt;/a&gt; reason. Since macOS 10.15, the certificate requires several extensions: ExtendedKeyUsage, Subject alternative names and DNS name. The native openssl from the operating system is outdated (v 1.0.2) and I had to install openssl11 package and create it as follows:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;openssl11 req -x509 -nodes -days &lt;span style="color:#ae81ff"&gt;365&lt;/span&gt; -newkey rsa:2048 -keyout /tmp/private.key -out /tmp/certificate.crt -subj /C&lt;span style="color:#f92672"&gt;=&lt;/span&gt;CA/ST&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Ontario/L&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Waterloo/O&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Digihunch/OU&lt;span style="color:#f92672"&gt;=&lt;/span&gt;Imaging/CN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;digihunch.com/emailAddress&lt;span style="color:#f92672"&gt;=&lt;/span&gt;info@3.237.97.93 -addext extendedKeyUsage&lt;span style="color:#f92672"&gt;=&lt;/span&gt;serverAuth -addext subjectAltName&lt;span style="color:#f92672"&gt;=&lt;/span&gt;DNS:orthweb.digihunch.com,DNS:digihunch.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The Mac uses libreSSL backed openSSL utility and can achieve the same with slightly different command line argument.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Next Step&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The limitation with passing secret concerns me and I&amp;#8217;m looking to move to managed Kubernetes platform where &lt;a href="https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables" class="rank-math-link"&gt;secrets&lt;/a&gt; can be ported to environment variable of Pods. We can also consider &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html" class="rank-math-link"&gt;ECS&lt;/a&gt; in AWS which allows to inject sensitive data from secret manager to container. &lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2021/04/preparing-certified-kubernetes-administrator-exam/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Certified Kubernetes Administrator (CKA) Exam&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2021/05/getting-started-with-github-actions/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Getting started with GitHub Actions&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Public Key Infrastructure (PKI) – Introduction</title><link>https://www.digihunch.com/2021/04/public-key-infrastructure-pki/</link><pubDate>Thu, 08 Apr 2021 22:07:00 -0400</pubDate><guid>https://www.digihunch.com/2021/04/public-key-infrastructure-pki/</guid><description>&lt;p class="wp-block-paragraph"&gt;A public-key infrastructure (PKI) is a set of roles, policies, hardware, software and procedures needed to create, manage, distribute, use, store and revoke digital certificates and manage public-key encryption. The algorithms are based on Publick-key cryptography. The format of the digital certificate is defined in X.509 standard.&amp;nbsp;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Certificate Authority&lt;/strong&gt; &amp;#8211; CA digitally signs and publishes the public key to user. Website requesting certificates start with a key pair. It then converts public key into CSR (certificate signing request), including the identity. Once the identity of requestor is validated, CA will sign the public key of requestor, using its own private key. The output of this is the certificate.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Registration Authority&lt;/strong&gt; &amp;#8211; CA may delegate some roles to registration authority (RA). RA is responsible for accepting requests for certificates and authenticating the entity making the request. However, RAs do not have the signing authority of a CA. Note that Microsoft may have referred to a subordinate CA as an RA, which is incorrect according to X.509 PKI standards.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-validation-types"&gt;Validation types&lt;/h3&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Domain Validation: domain ownerships is usually verified via DNS record.&lt;/li&gt;&#10;&lt;li&gt;Organization Validation: the organization name and address are verified and put into the certificate.&lt;/li&gt;&#10;&lt;li&gt;Extended Validation: verifies existence and location of the legal entity, as well as domain ownership. EV cannot be issued as a wildcard certificate.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 class="wp-block-heading" id="h-private-certificate-authorities"&gt;Private Certificate Authorities&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;You can create private CA and use it to sign certificates. Your user need to manually install and trust your private CA so that all certificates issued from the CA will inherit that trust. For revocation, you will also need to maintain an HTTP server for the certificate revocation list, or an OCSP responder.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-certificate-revocation-list-crl"&gt;Certificate Revocation List (CRL)&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;SSL certificates include information on how to access a certificate revocation list. Client will download and check this list to make sure the certificate has not been revoked. This mechanism has largely been replaced by OCSP responders.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-online-certificate-status-protocol-ocsp"&gt;Online Certificate Status Protocol (OCSP)&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The OCSP protocol is a replacement for CRLs, with the benefit of being more real-time and requiring less bandwidth. The general operation is similar: clients are to query to OCSP responder to check if a certificate has been revoked.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-commercial-vs-non-profit-ca"&gt;Commercial vs non-profit CA&lt;/h3&gt;&#10;&lt;figure class="wp-block-table is-style-stripes"&gt;&lt;table class="has-background" style="background-color:#e7f5fe"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Commercial (e.g. SSLs.com)&lt;/td&gt;&lt;td&gt;Non-profit (e.g. Let&amp;#8217;s Encrypt)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Validation&lt;/td&gt;&lt;td&gt;DV, OV and EV&lt;/td&gt;&lt;td&gt;DV only&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Wildcard&lt;/td&gt;&lt;td&gt;Supported&lt;/td&gt;&lt;td&gt;Supported (using DNS-01 challenge via ACME v2)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cost&lt;/td&gt;&lt;td&gt;Not Free&lt;/td&gt;&lt;td&gt;Free&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Expiration&lt;/td&gt;&lt;td&gt;1-3 years&lt;/td&gt;&lt;td&gt;90 days&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&#10;&lt;h3 class="wp-block-heading" id="h-acme-protocol"&gt;ACME protocol&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Traditionally, there are several command-line utilities such as openssl, cfssl, or keytool (Java) to manage certificate related tasks. The process are mostly manual. The Internet Security Research Group (ISRG) developed the ACME (Automated Certificate management Environment) protocol.&amp;nbsp;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In this protocol, there is a certificate management agent (client) on the given web server. The agent generates a key pair and shares it with the CA at the outset of the validation process. Once validation is finished and the agent is verified as the proven owner of the key pair. It can use its key to digitally sign the CSRs it generates and sends to the CA via HTTPS requests. The CA uses the CSR, along with its associated public key, to issue the certificate and send it back to the agent. The agent downloads and installs it, then notifies the designated contact.&amp;nbsp;The agent can be automated to check in with the CA at given intervals to rotate certificates and keys.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Let&amp;#8217;s encrypt adopts ACME protocol by using &lt;a class="rank-math-link" href="https://github.com/letsencrypt/boulder"&gt;Boulder&lt;/a&gt; on the server side, and the most commonly used client is &lt;a class="rank-math-link" href="https://github.com/certbot/certbot"&gt;certbot&lt;/a&gt;. Smallstep also introduced ACME support in step CA in 2019.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading"&gt;Lets Encrypt&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I have used let&amp;#8217;s encrypt several times because it is free and easy to manage with &lt;strong&gt;certbot&lt;/strong&gt;, which can be installed using &lt;code&gt;brew&lt;/code&gt; on Mac. Here&amp;#8217;s how I quickly generate certificate manually:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DOMAIN&lt;span style="color:#f92672"&gt;=&lt;/span&gt;orthwebdemo.digihunch.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;echo $DOMAIN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo certbot -d $DOMAIN --manual --preferred-challenges dns certonly&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# get ready to change txt record&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls /etc/letsencrypt/live/orthwebdemo.digihunch.com/&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The &lt;code&gt;--manual&lt;/code&gt; switch starts interactive prompts, which includes configuring TXT record and wait for the update.&lt;/p&gt;&#10;&lt;h3 class="wp-block-heading" id="h-open-source-implementations"&gt;Open source implementations&lt;/h3&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Here is a list of open-source implementations of PKI management:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;&lt;a href="https://wiki.openssl.org/index.php/Main_Page" class="rank-math-link"&gt;OpenSSL&lt;/a&gt;: classic tool for PKI management. The Mac/BSD implementation and GNU implementation are slightly different.&lt;/li&gt;&#10;&lt;li&gt;Keytool: Java&amp;#8217;s Key and Certificate Management Tool that supports formats used in &lt;a href="https://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html" class="rank-math-link"&gt;Java&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;Cfssl: introduced by &lt;a href="https://blog.cloudflare.com/introducing-cfssl/" class="rank-math-link"&gt;CloudFlare&lt;/a&gt; to simplify the &lt;a href="https://blog.cloudflare.com/how-to-build-your-own-public-key-infrastructure/" class="rank-math-link"&gt;PKI management&lt;/a&gt; process. On Ubuntu, the apt package name is golang-cfssl&lt;/li&gt;&#10;&lt;li&gt;Hashicorp Vault: CA, secret management and encryption.&lt;/li&gt;&#10;&lt;li&gt;Boulder: implemented in Go based on ACME protocol. Let&amp;#8217;s Encrypt uses Boulder on the server side. &lt;/li&gt;&#10;&lt;li&gt;EJBCA: a full-featured, enterprise-grade implementation in Java, managed by Swedish company PrimeKey Solutions AB.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 class="wp-block-heading" id="h-managed-ca-as-service"&gt;Managed CA as service&lt;/h3&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;AWS Certificate Manager: [Update] as of Sep 2022, the managed CA capability was spun off as a new service called &lt;a href="https://aws.amazon.com/about-aws/whats-new/2022/09/aws-certificate-manager-private-certificate-authority-now-aws-private-ca/"&gt;AWS Private Certificate Authority&lt;/a&gt;, to distinguish from the certificate management capability. &lt;/li&gt;&#10;&lt;li&gt;EJBCA Enterprise, as Azure Market place&lt;/li&gt;&#10;&lt;li&gt;Google Cloud Certificate Authority Service API&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2021/03/intro-to-data-analytics-platform/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Intro to Data Analytics Platform on Azure&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2021/04/preparing-certified-kubernetes-administrator-exam/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Certified Kubernetes Administrator (CKA) Exam&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Cryptography Basics 1 of 2</title><link>https://www.digihunch.com/2019/07/practical-cryptography-for-it-professional/</link><pubDate>Wed, 10 Jul 2019 20:07:18 -0400</pubDate><guid>https://www.digihunch.com/2019/07/practical-cryptography-for-it-professional/</guid><description>&lt;p class="wp-block-paragraph"&gt;I have been dabbling with OpenSSL commands to achieve what I needed during IT implementation, but I decided to spent some time to overcome the conceptual hurdles around cryptography. In this domain, following other people&amp;#8217;s instructions through the project does not produce much learning value when too many concepts cloud around. Let&amp;#8217;s take the bull by the horn.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This article is purely conceptual. There are already lots of step-by-step guideline about acquiring a website certificate. The intention is to elucidate the core concepts on IT cryptography, and then connect the dots to form the big picture in cryptography.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;First, let&amp;#8217;s distinguish three basic concepts: encoding, hashing and encryption. They are in essence all mathematical functions, but one does not need to understand the underlying algorithm in order to understand what they are.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Encoding&lt;/strong&gt; &amp;#8211; Transform data into a format so it is readable by external system. Encoding is about interoperability. It is not about security whatsoever. Example: ASCII, BASE64, UNICODE.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Hashing&lt;/strong&gt; &amp;#8211; Mathematic algorithms to generate digest of content. A digest is usually fixed-size, non-reversible and deterministic. You cannot restore content from its digest (non-reversible, one-way calculation). Two different contents results guarantees different digests (deterministic). Digest as a result of hashing is mostly about data integrity. For example, in file download you can calculate MD5 hash and compare the result against the digest given by the source. Another common use, is to hash all password in database. In that sense, hashing has to do with security. Popular algorithms are MD5 and SHA-256.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Encryption&lt;/strong&gt; &amp;#8211; Mathematic algorithms that only succeeds if correct parameter (key) is provided. The function is deterministic and reversible (two-way). The parameter (key) used for calculation (encryption) and reverse calculation (decryption) can either be the same or different. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Cryptography involves all three concepts, but it mainly addresses issues around encryption. We break down encryption into two categories, symmetric key encryption (aka private key encryption) and asymmetric key encryption (aka public key encryption).&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Symmetric Key Encryption&lt;/strong&gt;: using the same key (shared secret) for encryption and decryption. Both parties need to keep it secret. Popular algorithm is AES.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Asymmetric Key Encryption&lt;/strong&gt;: involves a pair of public key and private key. Public key is given out to external systems. Private key is kept secret. Popular algorithm is RSA. You can run some experiments on &lt;a href="https://www.devglan.com/online-tools/rsa-encryption-decryption"&gt;this page&lt;/a&gt;, and I&amp;#8217;ve made some additional notes (all based on RSA algorithm):&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&lt;li&gt;Public Key and Private Key are NOT interchangeable. The size of an RSA private key is usually much larger than its public key;&lt;/li&gt;&lt;li&gt;You can encrypt with either key, and decrypt with the other, so long as you specify the key type at the time of encryption or decryption;&lt;/li&gt;&lt;li&gt;You can generate public key from private key (ssh-keygen -y); but not the other way round;&lt;/li&gt;&lt;li&gt;Using a wrong key to encrypt or decrypt leads to failure, instead of wrong result.&lt;/li&gt;&lt;/ol&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Obviously symmetric key encryption is the original form of encryption and requires both parties to keep the key secret, permanently. This is not realistic in real life between organizations. This challenge leads to the adoption of asymmetric key where the public key can be published, for external party to encrypt outgoing messages, whereas the private key is kept secret within the owner, only to decrypt incoming messages. &lt;/p&gt;&#10;&lt;figure class="wp-block-image"&gt;&lt;img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Public_key_encryption.svg/1024px-Public_key_encryption.svg.png" alt=""/&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Knowing this distinction, we can introduce two concepts that are built on top of asymmetric key encryption.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Digital Signature&lt;/strong&gt;: if an entity signs a document digitally. The digital signature is the digest of the document (hash of the content) encrypted with the signer&amp;#8217;s private key.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Digital Certificate&lt;/strong&gt;: contains owner&amp;#8217;s public key and digital signature of issuer (digest of owner&amp;#8217;s public key encrypted by issuer&amp;#8217;s private key). Client (e.g. browser with CA&amp;#8217;s public key preloaded) should not trust the owner&amp;#8217;s public key until it compares its digest against decryption result of digital signature (using CA&amp;#8217;s public key).&amp;nbsp;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The key difference here is that a digital certificate involves third party. Digital signature by itself cannot address impersonation, which is addressed by digital certificate issued by third party (certified authority). This requires digital certificate must follow some standard, and the most prevalent one is:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;X.509&lt;/strong&gt;: a standard format for digital certificates. It contains:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&lt;li&gt;a public key&lt;/li&gt;&lt;li&gt;an identity (a hostname, or&amp;nbsp; an organization, or an individual)&lt;/li&gt;&lt;li&gt;a signature (either signed by CA or self-signed)&lt;/li&gt;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Since the advent of certificate, there are tons of global organizations that need to manage keys and certificates. When we create a secure connection now, we only need to get a certificate from an intermediate CA, thanks to existing &lt;a href="https://knowledge.digicert.com/solution/SO16297.html"&gt;certificate chain&lt;/a&gt;. It involves lots of work for large organizations to maintain keys and certificates, which requires:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;Public Key Infrastructure (PKI)&lt;/strong&gt;: the IT infrastructure to create, manage, distribute, use, store and revoke digital certificates and public keys.&amp;nbsp;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;One of the important technique to manage keys and certificates is the encoding. Keys and certificates are usually wrapped with different encoding formats based on what need to be done on them. Here is a summary of encoding formats&lt;/p&gt;&#10;&lt;figure class="wp-block-table aligncenter is-style-stripes"&gt;&lt;table class="has-background" style="background-color:#e7f5fe"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Format&lt;/td&gt;&lt;td&gt;Encoding&lt;/td&gt;&lt;td&gt;what is stored&lt;/td&gt;&lt;td&gt;Possible Suffix&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;PEM&lt;/td&gt;&lt;td&gt;DER file (binary content) encoded in Base64. Certificate files typically include clear text statement &amp;#8220;BEGIN CERTIFICATE&amp;#8221; and &amp;#8220;END CERTIFICATE&amp;#8221;&lt;/td&gt;&lt;td&gt;single certificate, certificate chains or private keys&lt;/td&gt;&lt;td&gt;.pem, .crt, .cer, .key&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DER&lt;/td&gt;&lt;td&gt;Binary format in early days; it&amp;#8217;s complex and don&amp;#8217;t use unless with a specific purpose.&lt;/td&gt;&lt;td&gt;single certificate, certificate chains, or private keys&lt;/td&gt;&lt;td&gt;.der, .cer&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;PKCS#7&lt;/td&gt;&lt;td&gt;Base64 encoded ASCII file, typically include clear text statement &amp;#8220;BEGIN PKCS7&amp;#8221; and &amp;#8220;END PKCS7&amp;#8221;&lt;/td&gt;&lt;td&gt;only certificates or certificate chains; no private keys&lt;/td&gt;&lt;td&gt;.p7b .p7s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;PKCS#8&lt;/td&gt;&lt;td&gt;Similar to PEM as base64 encoded format but for storing private key only, can be password protected&lt;/td&gt;&lt;td&gt;Private key&lt;/td&gt;&lt;td&gt;.key&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;PKCS#12&lt;/td&gt;&lt;td&gt;a binary format, heavily used by Microsoft products&lt;/td&gt;&lt;td&gt;certificate, certificate chains or private keys; public private key pair&lt;/td&gt;&lt;td&gt;.pfx .p12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;OpenSSH&lt;/td&gt;&lt;td&gt;used by OpenSSH to store public keys (as specified in RFC4253)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;.pub&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Note: above are just encoding formats. Just by file extension you cannot tell whether the file is a key or a X.509 certificate. When you are configuring certificates, you may come across the following file extensions as well:&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;.key&lt;/strong&gt; this extension can indicate any kind of key, but usually it is a private key (used along with .crt file) &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;.csr&lt;/strong&gt; certificate signing request, including a public key and an identity required by CA. CA needs this file to issue a certificate. CSR could be encoded in Base-64 or DER&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;.cer or .crt&lt;/strong&gt; a certificate, usually in X.509 v3 (public key + identity + signature), the encoding could be PEM or DER. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;&lt;strong&gt;.jks&lt;/strong&gt; -&amp;gt; java key store file type. It can be either a key store (private key along with certificate) or trust store (certificate) for Java application. Refer to the section for Java applications.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In the &lt;a href="https://www.digihunch.com/2019/09/cryptographic-concepts-for-busy-it-professionals-2-of-2/"&gt;next article&lt;/a&gt;, we will examine some use case involving the concepts introduced in this post.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt; &lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2019/06/git-explained-2-of-2/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Git Explained 2 of 2&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2019/07/storage-nitty-gritty-3-of-5-nas-and-object-storage/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Storage Nitty-Gritty 3 of 5 – NAS and Object Storage&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item></channel></rss>