<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Matthew Venne on Medium]]></title>
        <description><![CDATA[Stories by Matthew Venne on Medium]]></description>
        <link>https://medium.com/@matthewvenne?source=rss-ab5501fa9c31------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DRiy6BzYZlBtxTeIxAcraw@2x.jpeg</url>
            <title>Stories by Matthew Venne on Medium</title>
            <link>https://medium.com/@matthewvenne?source=rss-ab5501fa9c31------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:49:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@matthewvenne/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[FIPS 140: The Best Explanation Ever (Hopefully)]]></title>
            <link>https://itnext.io/fips-140-the-best-explanation-ever-hopefully-71d3683d82ed?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/71d3683d82ed</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[fedramp]]></category>
            <category><![CDATA[fips140]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Thu, 01 May 2025 02:32:57 GMT</pubDate>
            <atom:updated>2025-05-01T12:58:26.963Z</atom:updated>
            <content:encoded><![CDATA[<p>Cryptography = modern cyber security. Full stop. It is at the core of everyone’s lives from buying a latte with Apple/Google Pay, messaging our friends, and even just checking the online news. Without cryptography, the modern world simply would not exist in its current state. But why is it that we trust cryptography so much? Our confidence in cryptography is anchored not in blind optimism, but in decades of applied-mathematics research distilled into rigorous, standardized validation. However, achieving this widespread confidence required overcoming significant historical challenges. In the late 1980s and early 1990s — when the modern internet was just taking shape —the cryptographic digital world was at a bit of a crossroads.</p><p>NIST answered that crossroads by invoking its new mandate under the Computer Security Act of 1987 to publish <strong>FIPS 140–1</strong> in January 1994. The standard replaced an aging, DES-only rule with clear evaluation guidelines, giving agencies a single yardstick for the wildly varied crypto hardware and software flooding the market. It also created the Cryptographic Algorithm Validation Program (CAVP) and the Cryptographic Module Validation Program (CMVP) so accredited independent labs — not vendors — could certify compliance, bringing real, testable assurance to federal procurements. In short, FIPS 140–1 turned a “Wild West” of ad-hoc implementations into an orderly, trusted ecosystem that the private sector soon embraced as well. Over the years, this standard has been updated with the latest version FIPS 140–3 being published in 2019.</p><p>Since its publication, many organizations and nations across the world have relied on FIPS 140 to define the standards for cryptography. This is certainly true with the US Government —who mandates that all Federal Data must be encrypted, both in transit and at rest, using FIPS-validated cryptography. This mandate extends to all Cloud Services Providers who seek a FedRAMP authorization. In fact, the US government considers that any data that is NOT encrypted using FIPS-validated cryptography to be “unencrypted” — a position that has led to much strife for the private sector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQP5wRcD2yB2UmaaFbe7hQ.png" /><figcaption><a href="https://csrc.nist.gov/projects/cryptographic-module-validation-program">On CMVP Home Page</a></figcaption></figure><p>So what does it take for cryptography to be FIPS-validated?</p><h4>Cryptographic algorithms</h4><p>The first program created by NIST is the<a href="https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program"> CAVP — where NIST publishes the approved cryptographic algorithms.</a> Simply put: this is the authoritative list of algorithms that have been approved by NIST — and by extension, for use in US government systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IZ67obR4G3z0oZfRDutFA.png" /></figure><p>I won’t cover the exact details of the algorithm approval process — however, I will say that whether or not an algorithm is added is largely a risk-based decision. <strong>NIST does not test every algorithm under the sun, nor is it their goal to. </strong>Like any organization, they have limited resources and must make decisions on how to allocate those resources — they have to draw the line somewhere. If they have approved an algorithm with no known weaknesses they typically do not explore alternatives.</p><p><a href="https://www.techtarget.com/searchsecurity/definition/Rijndael">Consider AES (Advanced Encryption Standard): NIST’s preferred algorithm for all symmetric encryption</a>. ChaCha20-POLY1305 is a potential alternative that is widely used in the private sector — known for its strong security and efficiency on ARM-architecture devices (like mobile phones). However, there is zero chance that it will ever be approved by NIST simply because AES is sufficient (also, many ARM chip manufactures have added AES acceleration capabilities to the hardware, largely closing the efficiency gap on ARM devices compared to standard x86 architecture.) It is incumbent upon the vendor to implement approved cryptography — not for the government to accommodate the vendor.</p><p>The same goes for ED25519 — an excellent asymmetric encryption algorithm comparable to RSA and EC/DSA. It is irrelevant to NIST that a more performant alternative exists.</p><p>Historically, NIST has shown reluctance to adopt new cryptographic algorithms simply for marginal gains in performance or to broaden implementation options. Instead, the organization requires a deeply compelling rationale before researching and standardizing new cryptography. Quantum computing, however, introduces a threat rooted in the fundamental laws of physics — offering precisely the type of existential risk that justifies NIST’s groundbreaking efforts in Post-Quantum Cryptography standardization. <a href="https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards">NIST released their first standard of PQC algorithms in August 2024.</a></p><h4>Cryptographic Modules</h4><p>The real difficulty usually lies not in deploying approved algorithms, but in sourcing and integrating cryptographic modules that have been validated under the CMVP. This is because the cryptographic module is the specific piece of hardware or software that actually performs the cryptography. To satisfy CMVP requirements you can either run the gauntlet yourself — submitting your module to an accredited lab, enduring thorough testing, and waiting for NIST/CSE to issue a brand-new certificate — or you can shortcut the process by integrating a third-party module that already carries a valid FIPS 140 certificate. The latter is faster and cheaper, but it locks you into that vendor’s hardware, firmware version, and security policy; any deviation can land you back on the full validation path.</p><p>Whichever route you go, your compliance hinges on running the module only within the “operational environments” listed on its certificate — ­that means the exact OS, patch level, processor, and compiler options that were validated. Any tweak — a firmware upgrade, kernel flag, or even migrating the module to new hardware — is considered a “change” that must be controlled through the security policy, logged, and often re-validated before the module may legally operate in FIPS mode.</p><h4>Operational Environments</h4><p>Within CMVP, a module’s NIST-approved security policy is authoritative — the first and decisive document auditors consult to confirm the module is being deployed in a compliant fashion. Perhaps the most scrutinized section is the list of Operational Environments, where the Vendor lists the precise configurations that testing of the module was performed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9wBVdVMUkef4sVb7sRLiDg.png" /><figcaption>OpenSSL 3.0 Operational Environments. <a href="https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4985.pdf">CMVP </a>#4985</figcaption></figure><p>Strictly speaking, if the configuration you want to use is NOT listed in the operational environments, it will NOT be considered validated. In practice though, there is typically some lee-way provided by auditors on the specificity. Additionally, the CMVP does allow for the vendor to “affirm” that certain configurations, while not explicitly tested, are considered to be compliant. Coincidentally, in my opinion too many vendors exclude Vendor-Affirmed OEs, thus exposing their customers to compliance findings (remember: the government’s stance is NO FIPS = UNENCRYPTED). You can ask the vendor for a one-off affirmation covering your unique operational environment, but there’s a real risk the sign-off won’t meet CMVP requirements — and finding someone at the vendor who genuinely understands the module’s FIPS intricacies can be a monumental challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YF93uuGGtWrNs3vsePRJmg.png" /><figcaption>Google Boring Crypto, Vendor Affirmed Operational Environments. <a href="https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4953.pdf">CMVP # </a>4953</figcaption></figure><p>In addition to Operational Environment requirementsm the validation of the module only extends to the specific version tested; any patch would effectively changing the version and require re-validation. Because of this lock-in, a critical CVE inside a FIPS-validated module can leave organizations caught between security and compliance: any patch would change the validated bits, void the certificate, and force a costly re-validation. When Heartbleed hit in 2014, the dilemma became so severe that some U.S. public-sector teams actually weighed keeping their vulnerable OpenSSL builds rather than risk breaking FIPS compliance.</p><blockquote>Note: Last year the FedRAMP PMO published much-needed updated guidance on FIPS compliance, allowing agencies and CSPs to follow the “update” track; they could patch vulnerable modules provided they tracked it on the Plan of Actions and Milestones (POAM). I agree 100% with this decision. However, <strong>in my opinion</strong>, this undermines the entire principle of validation. If a module is only validated when the specifically tested version is used in the environments specifically listed by the vendor in the security policy, any deviation from that, by definition, is insecure.</blockquote><blockquote>Ontologically, a FIPS-validated module is more than a blob of versioned bits; it is an object that acquires a special state of being the moment an accredited lab attests, “this artifact satisfies the standard.” Once we allow that object to morph through untested (yet merited) patching, the line that distinguishes a “validated module” from an ordinary module evaporates, and the certificate risks becoming a hollow label rather than a standard to follow. If that boundary no longer anchors reality, the very point of invoking FIPS — its role as a shared ontology of “trusted cryptographic primitives” that underpins procurement, interagency interoperability, and risk calculations — starts to unravel.</blockquote><h4>Cryptographic Boundary</h4><p>After Heartbleed, cryptographic module providers began to re-consider their architectural strategy so that patching a module would not necessitate re-validation. Their strategy was to begin carefully picking <a href="https://csrc.nist.gov/glossary/term/cryptographic_boundary">the cryptographic boundary</a> — the perimeter that establishes the physical and/or logical bounds of a cryptographic module and contains all the hardware, software, and/or firmware components of a cryptographic module. In other words, the module is only the code that handles the cryptographic algorithm/processes— the actual functions for performing AES-GCM-256, RSA, SHA2, etc. The libraries that called those functions did not necessarily have to be scope, provided they were sufficiently discrete. You could then patch the libraries as needed, as long as the fundamental code that defined the algorithms was left untouched.</p><p>This led to vendors carving out a <strong>slim, self-contained “core”</strong> that stayed inside the validated boundary while letting the broader library evolve outside it. OpenSSL pioneered this with its FIPS Object Module — and, in OpenSSL 3.0, a standalone <em>FIPS provider</em> shared library — so teams can patch TLS parsing or ASN.1 code without ever touching the validated binary. Google adopted the same pattern in BoringCrypto (a heavily modified fork of OpenSSL, post-Heartbleed): all approved algorithms are compiled into a single static object, while the surrounding logic around TLS, etc. remains freely patch-able since it is outside of the cryptographic boundary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8Hs3TjHeBV9Bz-vuxppyA.png" /><figcaption>Cryptographic Boundary of OpenSSL 3.0. <a href="https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4985.pdf">CMVP </a>#4985</figcaption></figure><h4>Modes of Operation</h4><p>Once you’ve locked in the exact module version, operating system, and hardware, there’s still one more checkbox: engaging the module’s elusive <strong>“FIPS mode.”</strong> Every validated module’s security policy lists which operating states are permitted and which are strictly forbidden, making this mode the last gate to full compliance.</p><p>So what is “FIPS mode” — sometimes listed as “Approved mode” in a module’s security policy — really about? Details vary by module, but historically it mean booting the host OS with FIPS settings enabled. But what does this actually accomplish? The standard sound-bite is that FIPS mode blocks non-approved algorithms. But that’s only half the picture: some validated modules still expose unapproved ciphers, and it’s up to administrators to lock those down through system configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-gCGpibMxVqQz8bO28ykg.png" /><figcaption>Unlike many other validated modules, Google’s Boring Crypto does technically support the usage un-approved algorithms. However, their usage is considered outside of “Approved mode”.</figcaption></figure><p>Yet controlling which ciphers are callable is only part of the story. FIPS mode also reaches deep into the operating system’s <strong><em>entropy</em></strong> plumbing — the very source of the keys those ciphers rely on.</p><h4>Entropy?</h4><p>The “entropy” we chase in cryptography has nothing to do with the heat-loss principle from the Second Law of Thermodynamics; we’ve simply borrowed the word because both ideas revolve around turning order into unpredictability. At its core, cryptography takes neatly arranged bits — plain-text, keys, headers — and scrambles them into patterns that look indistinguishable from random noise.</p><p>But computers are deterministic machines: given the same inputs, they will always produce the same outputs. To create the illusion of true randomness, an operating system must harvest and inject unpredictable signals (i.e., entropy) from various sources. A popular technique is to capture high-resolution timestamps from events like keystrokes or mouse movements; with the clock ticking in micro- or even nanoseconds, the trailing digits vary unpredictably enough to look like genuine randomness. There are a whole assortment of methods of entropy accumulation from calculating minor temperature fluctuations in the server room, disk IO events, to even entirely software-based solutions like Jittery RNG.</p><p>All harvested randomness ultimately lands in a kernel entropy pool that feeds the operating system’s random-bit generator (often called a Pseudo Random Number/Bit Generator). Linux offers two implementations. By default (since kernel 4.8) it uses the high-performance CRNG built on ChaCha20, prized for speed and back-tracking resistance. But ChaCha20 is <strong>not</strong> on the FIPS 140 approved list, so when a system boots in FIPS mode the kernel automatically swaps in its older, hash-based DRBG instead. The result: slightly slower output, but full compliance with the standard.</p><p>Because nearly all cryptographic modules draw their entropy from the kernel, many people assume that if the host OS isn’t running in FIPS mode the entire stack is automatically non-compliant — but is that actually true?</p><h4>Kernel-Independence?</h4><p>Contrary to popular belief, you don’t always need a FIPS-mode kernel to achieve compliance — many modern cryptographic modules are fully self-contained and kernel-agnostic. That capability has driven interest in minimal, security-hardened host images like AWS Bottlerocket (which also offers a FIPS mode) while equally lean platforms such as Google’s Container-Optimized OS remain compliant without it. By shifting validation from the operating system to the module itself — complete with its own approved DRBG and entropy source — organizations can meet FIPS requirements more flexibly and with less operational overhead.</p><p>Kernel independence can be achieved by including a separate, internal DBRG (usually AES-CTR, or Hash-based), within the cryptographic boundary. This DBRG can pull its entropy from the kernel’s /dev/random (which is sourced from the ChaCha20 based CRNG). This is actually compliant — FIPS only cares about the <em>approved</em> DRBG running inside the module; the entropy that feeds it is allowed to come from an external mechanism** so long as the module monitors that input and documents its provenance. This design keeps keys and IVs under the control of a fully validated generator while letting vendors piggy-back on whatever randomness they can get their hands on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSF9V7rarOVXMFvUtoXKiA.png" /><figcaption>From Official CMVP Implementation Guidance — clearly stating that modules with their own internal DBRG that uses an external entropy source is approved provided that it can generate at least 112 bits of entropy.</figcaption></figure><p>**we will come back to external entropy sources in a bit..</p><p>To get a better sense of what this looks like in practice, we are going to examine Google’s BoringCrypto, a well-known validated module that is fully kernel independent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*VmzooBNqVMEVCpY2T9MucQ.png" /></figure><ol><li>The host kernel’s ChaCha20-based CRNG gathers raw noise from hardware and timing sources, then exposes conditioned randomness through /dev/random and /dev/urandom (or directly via getrandom()).</li><li>BoringCrypto, sitting inside its own validated boundary, pulls a minimum 384-bit seed from those devices (treated as an <em>external</em> non-deterministic random number generator — NDRNG).**</li><li>An internal <strong>AES-CTR DRBG</strong> — approved under SP 800–90A, NIST’s guidelines for DBRGs— stretches that seed, runs its own health tests, and supplies all keys, IVs, and nonces to the module’s cryptographic algorithms.</li><li>Because the DRBG and algorithms are wholly inside the boundary, the module remains FIPS-compliant even if the host OS itself is not running in FIPS mode.</li></ol><p>Other kernel independent modules are:</p><ul><li>OpenSSL 3.0 FIPS Provider — it includes its own internal DRBG just like Boring Crypto. The fact that OpenSSL 3.0 is kernel independent is not well-known however. In my opinion several forces combine to keep this detail buried:</li></ul><ol><li><strong>Legacy mental model ≈ “FIPS mode = FIPS everywhere.”</strong><br> For two decades Red Hat, SUSE and Ubuntu taught admins that the <em>way</em> to get a validated OpenSSL was to boot the whole OS with a fips=1 flag and install a special package set. People naturally equated the kernel switch with the crypto itself, so the idea that the <em>same provider</em> can work fine on an ordinary kernel never took root.</li><li><strong>Packaging hides the boundary lines.</strong><br>Most users rely on their distribution’s FIPS packages — RPMs or DEBs that bundle the provider, loader and policy scripts — instead of building modules from source. Because the docs tell you to “enable the OS’s FIPS mode” rather than explicitly load the provider’s shared object, people naturally focus on the operating-system wrapper. In reality, they install straight from their vendor’s standard repositories and follow whatever the vendor recommends — often without questioning it — simply because they don’t have time to dig deeper, even when that advice may no longer be 100% accurate.</li><li><strong>Security policies are dense and “optional reading.”</strong><br> The OpenSSL 3 FIPS security policy explicitly states that its Approved mode starts after self-tests pass — nothing about host FIPS flags — but the document is 80 pages of CMVP boilerplate few engineers study unless they’re in an audit.</li><li><strong>Fear of mis-configuration.</strong><br> Security teams would rather impose a coarse, system-wide control (boot in FIPS mode, block non-validated libs) than rely on every developer to load the correct provider. The stricter setting becomes the “safe default,” and people assume it’s mandatory.</li></ol><ul><li>AWS LC is another kernel-independent, which is a fork of Boring Crypto. However, for each of the 3 different flavors of LC that are current validated (don’t ask me to distinguish which is which), AWS did not affirm any additional environments other than what was tested. Boring Crypto continue to affirm any distro of Linux (kernel version 4–6) as compliant.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*As24Kh-PbGqZeXYlg-CGIw.png" /><figcaption>Technically, <a href="https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4631.pdf">CMVP #463</a>1 lists the above as Vendor affirmed, however listing two operating systems that were EOL several years BEFORE the module was validated, is effectively useless.</figcaption></figure><blockquote>Note: It is important to read the security policy of the module you are planning on using. Several kernel-independent modules still use language “when operating in FIPS mode”, but the policy describes FIPS mode for this particular module as only requiring the Self Tests pass successful. Other modules use a more friendly term “Approved mode” for this same scenario. Additionally, even when a module requires operation in “FIPS mode”, this FIPS mode may not be referring to the operating system, but instead to some configuration within the module itself.</blockquote><blockquote>Additional note: the host OS’s FIPS mode status would affect the compliance of applications that use the kernel crypto APIs — however, while many applications do not rely on those, a few common examples would be: LUKS transparent disk encryption, IPSec VPNs, filesystem integrity solutions like dm-verity and more.</blockquote><h4>What the “entropy caveat” means</h4><p>The last and final kernel-independent module we will be exploring is Chainguard’s version of OpenSSL, because they actually addressed the mis-understood “entropy caveat” that is found in many kernel-independent validated modules.</p><p>When a module’s security policy or certificate states <strong>“No assurance of the minimum strength of generated SSPs (e.g., keys)”</strong> it is invoking the <strong>entropy caveat</strong> defined in CMVP Implementation Guidance <strong>IG 9.3.A</strong>. <br> The caveat is triggered whenever the module’s internal, SP 800–90A-approved DRBG is <strong>seeded from an external, non-deterministic RNG (NDRNG)</strong> — for example, the host’s /dev/random or /dev/urandom—that <strong>has not itself been validated against SP 800-90B</strong>. In that situation the lab cannot quantify how much unpredictability actually reaches the DRBG, so CMVP requires the warning line. <a href="https://csrc.nist.gov/csrc/media/Projects/cryptographic-module-validation-program/documents/fips%20140-3/FIPS%20140-3%20IG.pdf">CMVP Implementation Guidance</a></p><p>Chainguard addressed this by including their own software-based entropy source, Jitter RNG inside the cryptographic boundary to seed the module’s internal DRBG. Because the entropy source IS inside the cryptographic boundary, NIST can test and validate the strength of the sensitive security parameters (e.g., keys) used by the module. In this case, the module’s CMVP security policy would NOT have the “entropy caveat” since NIST has assurance over the strength of the entropy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdKIV8OL1xbBA4qAtQJcEQ.png" /><figcaption>Chainguard did get a bit unlucky here because their module received validation (July 11, 2024), prior to their Jitter RNG implementation receiving <a href="https://csrc.nist.gov/projects/cryptographic-module-validation-program/entropy-validations/certificate/191">their ESV certification</a> on September 11, 2024. So their module still has the caveat. They would have to submit a delta validation request or under go full validation to have it removed.</figcaption></figure><h4>Does the caveat always mean “weak keys”?</h4><p>No. The wording says only that CMVP offers <strong>no formal assurance</strong> of the key strength; it does <strong>not</strong> assert that the keys are weak in practice. In many environments the host OS’s RNG (e.g., Linux’s ChaCha20-based CRNG) delivers plenty of entropy, but because it was not tested under the 90B framework the lab cannot make a quantified claim, so the caveat is mandatory.</p><h4>Why the caveat doesn’t invalidate the validation</h4><p>FIPS 140 validation is <strong>module-centric</strong>: if all requirements inside the cryptographic boundary (algorithms, DRBG, self-tests, role separation, etc.) are met, the module is validated — even when its seed comes from an un-evaluated NDRNG. The caveat merely informs operators and auditors that they must accept an un-quantified entropy assumption or provide their own evidence. The module’s compliance status remains intact.</p><p>The above could be confusing so here’s the TL;DR:</p><ol><li>FIPS 140 requires you to use an SP 800–90A Approved DRBG (Deterministic Random Bit Generator).</li><li>Many people assume this DRBG must come directly from kernel.</li><li>Modern linux by default does NOT offer DBRG by default, it offers a CRNG (Cryptographic Random Number Generator) (backed by ChaCha20) which is more performant but obviously not compliant.</li><li>Booting a host OS into FIPS mode forces the OS to use the older DRBG</li><li>However, since about 2015 when SP 800–90A was published, pretty much every module that is validated has it’s own approved internal DRBG, it does not use the CRNG directly.</li><li>The module’s in house DRBG does need entropy from the kernel however, but FIPS 140–2 and 140–3 allow for the use the entropy from sources external to the module. Provided the 3 occur:</li></ol><ul><li>The module gets the entropy from the source directly (either by pull or push).</li><li>The module performs health tests on the quality of the entropy.</li><li>There is at least 112 bits of entropy provided.</li></ul><ol><li>Quick recap: CRNG is effectively used as an entropy source for the DRBG and has no effect on module validation status.</li><li>However, SP 800–90B allow a path for entropy sources to be assessed and validated independently (they receive an ESV cert — opposed to CMVP). This is what Chainguard did with Jitter RNG. However, this has NO effect on validation. You can continue to use external entropy sources like the host OS CRNG but since that component is outside of the cryptographic boundary, NIST cannot give 100% assurance on the strength of the keys. This is why many modules have the statement: No assurance of the minimum strength of generated SSPs (e.g., keys). The module is perfectly still validated, and the risk is actually minimal in practice, since the CRNG is universally considered more performant than the DRBG.</li></ol><p>The path to FIPS validation can seem like just another bureaucratic hurdle — but at its core, it’s really about trust, discipline, and practical security. Sure, the standard might feel rigid, yet every test and cryptographic boundary reflects decades of lessons learned about keeping data safe. As we’ve seen, there’s also hidden flexibility, like kernel-independent modules and clever entropy solutions. In the end, cryptography isn’t just math — it’s an assurance we rely on every single day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71d3683d82ed" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/fips-140-the-best-explanation-ever-hopefully-71d3683d82ed">FIPS 140: The Best Explanation Ever (Hopefully)</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Containers: The Best Explanation Ever (Hopefully)]]></title>
            <link>https://itnext.io/containers-the-best-explanation-ever-hopefully-0e82ab49507f?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e82ab49507f</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[containerization]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Sun, 06 Apr 2025 19:20:45 GMT</pubDate>
            <atom:updated>2025-04-15T12:37:54.725Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Containers Exist</h3><p>There’s a paradox today: Containers are more widespread and essential than ever, yet many engineers and cybersecurity professionals still have significant gaps in understanding exactly what containers are and how they work. Before containers, reliably deploying software across different environments (e.g., developer laptops, test servers, production) was notoriously challenging. Servers often had varying libraries, versions, and dependencies, leading to the infamous “It worked on my machine!” problem. Deployment relied on complex scripts, virtual machines (VMs), or manual dependency installations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1tyJqpcyLqgngOyFt6GMg.png" /></figure><p>Tooling like Chef and Puppet attempted to simplify deployments by automating the configuration and management of servers, yet they fell short because they still depended heavily on the state of the underlying operating system and often required manual intervention. These tools scripted the process of installation and configuration, but each script had to account for the endless variations across different environments. As a result, deployments were still error-prone, inconsistent, and difficult to reproduce precisely. Containers, in contrast, encapsulate the entire application environment, removing the variability and state-dependent challenges that configuration management tools struggled with.</p><p>Containers emerged as a powerful solution, providing consistency, portability, and efficiency by encapsulating applications and their dependencies into a single, lightweight, reproducible unit. Docker popularized this technology, making containers accessible, portable, and user-friendly.</p><h3>What Exactly Are Containers?</h3><p>Containers are lightweight, isolated processes that run on top of the host operating system, but each container operates as if it has its own dedicated environment. Unlike traditional virtual machines (VMs) — which emulate hardware and require a full guest operating system — containers share the host OS kernel. This fundamental difference makes containers much more efficient and faster to start than VMs, as they only need to include the necessary binaries, libraries, and runtime components rather than a complete OS.</p><p>Under the hood, containers typically rely on Linux kernel features like namespaces (for resource isolation) and cgroups (for resource limits) to provide separation between containers and the host. In practice, this means processes in one container cannot see or interfere with processes or files in another container. They act as if they have their own, self-contained operating environment, even though they use the same kernel.</p><p>To build a container, you define a set of instructions in a Dockerfile (or a similar build file for other container technologies). This file specifies everything the container needs to run the application: the base OS layer (e.g., Alpine, Ubuntu), additional system libraries, environment variables, and ultimately the commands to install or copy application code. When Docker (or another container runtime) processes the Dockerfile, it generates a container image composed of layered filesystems. Each instruction in the Dockerfile adds a new layer. These layers make it possible to version, cache, and share parts of the image efficiently across multiple containers.</p><p>Below is a simple Dockerfile example illustrating how each instruction creates a new layer. Layers can be cached and shared among images that use the same base or run similar steps:</p><pre># Use a minimal base image (establishes the first layer)<br>FROM alpine:3.14<br><br># Update package manager and install Python (adds another layer)<br>RUN apk update &amp;&amp; apk add python3<br><br># Copy local application code into the container (another layer)<br>COPY . /app<br><br># Set the working directory<br>WORKDIR /app<br><br># Expose a port (mainly metadata, but can still create a layer)<br>EXPOSE 8080<br><br># Define the default command to run the application<br>CMD [&quot;python3&quot;, &quot;app.py&quot;]</pre><p>In this Dockerfile:</p><ul><li><strong>FROM alpine:3.14</strong>: Pulls a lightweight Linux OS, creating the base layer.</li><li><strong>RUN apk update &amp;&amp; apk add python3</strong>: Installs Python in a new layer.</li><li><strong>COPY . /app</strong>: Adds your application files in yet another layer.</li><li><strong>WORKDIR /app</strong>, <strong>EXPOSE 8080</strong>, and <strong>CMD</strong> define container behavior; instructions also form new layers or metadata.</li></ul><p>When multiple containers run on the same host using the same base image or even similar build steps, Docker only needs to download and store those identical layers once on disk. Because these layers are shared, Docker relies on a copy-on-write (CoW) mechanism to handle modifications: if a container process attempts to write to a file that exists in a read-only shared layer, Docker creates a writable copy of that file in the container’s own writable layer. This preserves the original shared layer while allowing each container to make independent changes without affecting others. As a result, Docker’s layering model optimizes disk usage, reduces build times, and ensures containers remain isolated even if they share common base layers. But before we look at container layers — let’s look at container images first.What Is a Container Image?</p><p>A <strong>container image</strong> is a packaged snapshot of an application and everything it needs to run (like libraries, runtime, system tools, and settings). You can think of it as a “ready-to-go” artifact for deploying your app:</p><ul><li><strong>Layers</strong>: Container images are built in layers — each instruction in a Dockerfile (or other container build system) creates a new layer. This gives you caching benefits and smaller artifacts, since layers can be shared across images.</li><li><strong>Portability</strong>: Once you build an image, you can run it in different environments (development, staging, production) without having to reinstall or reconfigure its dependencies.</li></ul><p>Because the image is self-contained and includes all dependencies, you can rely on that image to run your application consistently, whether you’re deploying locally on your laptop or remotely on a cloud platform.</p><h4>What Are Container Registries?</h4><p>A <strong>container registry</strong> is a service that stores, manages, and distributes container images. You might use a public registry like <a href="https://hub.docker.com/">Docker Hub</a> or a private registry hosted on your own infrastructure.</p><ul><li><strong>Storage</strong>: Registries provide a place to store images that you or your organization create.</li><li><strong>Distribution</strong>: When someone wants to run your container image, the runtime (e.g., Docker or Kubernetes) can pull the image from the registry.</li><li><strong>Access Control</strong>: Registries often offer authentication and permissions, so you can control who can push or pull images.</li></ul><p><strong>Examples of popular container registries</strong> include Docker Hub, GitHub Container Registry, Google Container Registry (GCR), Amazon Elastic Container Registry (ECR), and Microsoft Azure Container Registry (ACR).</p><h4>Is a Container Repository the same thing?</h4><p>While often used interchangeably, container repositories and container registries are NOT actually the same thing. A repository is a collection of related container images (usually with different tags or versions). Each repository belongs to a registry.</p><p>Example:</p><ul><li>In gcr.io/my-project/my-app:latest:</li><li>gcr.io is the <strong>registry</strong></li><li>my-project/my-app is the <strong>repository</strong></li><li>latest is the <strong>image tag</strong></li></ul><p>Think of a registry as an entirely library of container images, and repository is just a single bookshelf in that library, where each bookshelf is dedicated to a single title. Each book has different editions: illustrated, unabridged, different languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*wCT39_Kb-Xl6PtMkb_YpaQ.png" /><figcaption>Generated by ChatGPT 4o</figcaption></figure><h4>One Repo per Micro-service</h4><p>Just like you wouldn’t put Charles Darwin’s <strong><em>Origin of Species </em></strong>on same bookshelf as Moby Dick, you shouldn’t put images from multiple micro-services in a single repository (they could go in a single registry). Consider an app that consists of 3 images, each hosting an individual microservice: apiserver, messagequeue, batchprocessing. Each component would get it’s own repository in your registry. This provides 3 main benefits:</p><ol><li>Clarity and organization — clearly structures and organizes your application images.</li><li>Access Control — some registries allow you to control access at repository-level, allowing least-privilege.</li><li>Reporting — some tooling container scanners may produce reports that group your image scans by repository.</li></ol><pre>               +--------------------------------------------+<br>               |               registry.com                 |<br>               |                                            |<br>               |   +-------------------------------------+  |<br>               |   |  repository: apiserver              |  |<br>               |   |-------------------------------------|  |<br>               |   |   - apiserver:v1.0                  |  |<br>               |   |   - apiserver:v1.1                  |  |<br>               |   |   - apiserver:latest                |  |<br>               |   +-------------------------------------+  |<br>               |    Example: registry.com/apiserver:v1.0    |<br>               |   +-------------------------------------+  |<br>               |   |  repository: messagequeue            | |<br>               |   |-------------------------------------|  |<br>               |   |   - messagequeue:v2.0                | |<br>               |   |   - messagequeue:v2.1                | |<br>               |   |   - messagequeue:latest              | |<br>               |   +-------------------------------------+  |<br>               |   Example: registry.com/messagequeue:v2.0  |<br>               |   +-------------------------------------+  |<br>               |   |  repository: batchprocessing         | |<br>               |   |-------------------------------------|  |<br>               |   |   - batchprocessing:v3.0             | |<br>               |   |   - batchprocessing:v3.1             | |<br>               |   |   - batchprocessing:latest           | |<br>               |   +-------------------------------------+  |<br>               |Example: registry.com/batchprocessing:v3.1  |<br>               +--------------------------------------------+</pre><h4>Tagging Basics</h4><p>Every container image can have one or more <em>tags</em>. A tag is a human-friendly label that can be used to reference a specific image version. It’s a shorthand that points to a particular image digest (the unique identifier that’s generated by the contents of the image).</p><p>A common practice is to tag images using semantic versioning (e.g., 1.0.0), or perhaps using branch names or commit hashes (e.g., latest, main, or abc1234).</p><h4>Why Use Tags?</h4><ul><li><strong>Versioning</strong>: You can maintain multiple versions of your container image, such as 1.0, 2.0, etc.</li><li><strong>Continuous Deployment</strong>: When your continuous integration (CI) pipeline finishes building an image, you can push a new tag reflecting the build number or commit hash, making it clear which build is in each environment.</li><li><strong>Rollbacks</strong>: If something breaks in production, you can re-deploy using a specific tag corresponding to a known working version.</li></ul><h4>The Importance of Immutable Tags</h4><p>A tag, by default, is just a pointer. Technically, you <em>could</em> push a new image using the same tag (e.g., reusing 1.0.0), overwriting the old image. However, this introduces big risks:</p><ol><li><strong>Reproducibility Issues</strong>: If v1.0.0 is different from what it was last week, then “version 1.0.0” doesn’t actually mean anything consistent. Every time you pull the tag, you might get different content.</li><li><strong>Debugging and Auditing</strong>: When diagnosing an issue, you need to know <em>exactly</em> which version of the code or dependencies was used. If the tag changes under the hood, you lose this traceability.</li></ol><h4>Immutable Tagging Strategy</h4><p>A more reliable approach is to treat tags as <strong>immutable</strong>. Once a tag is pushed, never overwrite it; if changes are needed, create a new tag. For example, myapp:1.0.0 is always the same image. If you need an updated version, push myapp:1.0.1 or myapp:2.0.0—whatever makes sense in your versioning scheme. Some container registries support enforcing tag immutability - when it is supported, it is recommended to enable it.</p><h4>SHA Digests</h4><p>Underneath the tag, there’s a cryptographic <strong>digest</strong> that uniquely identifies the image content (often a SHA-256 hash). Even if two images share the same tag, if they have different digests, you know they’re different images. Many registries let you pull by digest directly (e.g., myapp@sha256:ab123...), which is the most reliable way to always get the exact same artifact.</p><h4>How These Concepts Fit Together</h4><ol><li><strong>Build an Image</strong>: You have a Dockerfile, you run docker build, and it produces an image. The image can be labeled with a tag, like myapp:1.0.</li><li><strong>Push to Registry</strong>: Next, you push that image to your chosen container registry:</li></ol><pre>docker tag myapp:latest myregistry.io/myapp:1.0 <br>docker push myregistry.io/myapp:1.0</pre><ol><li><strong>Pull and Run</strong>: Anyone with access to your registry can then pull and run:</li></ol><pre>docker pull myregistry.io/myapp:1.0 <br>docker run myregistry.io/myapp:1.0</pre><ul><li>Because the image is “snapshotted,” they’ll run that exact code, with identical dependencies and file contents.</li><li><strong>Immutable Guarantee</strong>: If you treat your tags as immutable, then myapp:1.0 in your registry will always be the same image for everyone who needs it, no matter where or when they pull it.</li></ul><h3>Why This Matters for Teams and Organizations</h3><ul><li><strong>Consistency Across Environments</strong>: The same exact image can be pulled by development, QA, staging, and production environments. No “it worked on my machine” mysteries — everyone uses the same snapshot.</li><li><strong>Audit Trails</strong>: If something goes wrong in production, you can trace exactly which image was used and understand its contents at that point in time.</li><li><strong>Scalability and Speed</strong>: Storing images on a registry that’s accessible from multiple servers lets your organization deploy or scale your containers quickly; each server that needs to run the container will pull the same image snapshot.</li></ul><h4><strong>What Does It Mean for a Container Image to Have an OS?</strong></h4><p>When you pull a container image (e.g., `ubuntu:20.04` or `alpine:3.16`), you’re actually getting more than just your application’s files. At a high level, you’re getting:</p><p>1. <strong>A Minimal Operating System Userspace</strong>: Tools, libraries, and commands typically included with that OS (e.g., Ubuntu, Debian, Alpine, CentOS).</p><p>2. <strong>Your Application Files</strong>: Code, configurations, and any additional packages needed to run your app.</p><p>Remember, containers <strong>**share the host’s kernel**</strong> — they do not bring their own kernel. However, they can bring their own <strong>userspace </strong>elements (for instance, the `ls`, `bash`, or `apt-get` commands from a particular Linux distribution). Effectively, the container image includes an OS-like environment, while it relies on the host system’s actual kernel calls to run.</p><h4><strong>Linux Distributions in Container Builds</strong></h4><p>In the container world, a <strong>Linux distribution</strong> (like Ubuntu, Debian, or Alpine) is often used as a <em>base image</em>. Common distributions in container images include:</p><p>- <strong>Ubuntu</strong> (e.g., ubuntu:20.04): Well-known, full-featured, tends to have a larger footprint.</p><p>- <strong>Debian</strong> (e.g., debian:bullseye): Stable, widely used in servers, also has more packages by default.</p><p>- <strong>Alpine</strong> (e.g., alpine:3.16): Very small, minimal libraries, uses musl instead of glibc, popular for creating lightweight images.</p><h4><strong>Why Use a Distro-Based Image?</strong></h4><p>1. <strong>Familiar Tooling</strong>: Developers can use the same commands (e.g., apt-get, yum, or apk) that they’re used to in a full-blown Linux environment.</p><p>2. <strong>Easier Transitions</strong>: It’s simpler to translate your current app’s build steps into a container form. If your app expects certain libraries or a script that uses system packages, you can install them with standard package managers.</p><p>3. <strong>Pre-Configured Environments</strong>: Some distro-based images come pre-loaded with commonly needed libraries, so you don’t have to start from scratch installing every dependency.</p><p>This approach can lower the barrier to entry. You can quickly build and run an app inside a container — especially if you’re new to containerization or if your application relies on multiple system packages.</p><h4><strong>Building Images From Scratch</strong></h4><p>On the other end of the spectrum, you can build container images that literally contain <em>*only your application code and minimal dependencies*</em>. This is often referred to as building an image <strong>“from scratch”</strong>.</p><p>In Docker terms, you might see a `FROM scratch` statement in a Dockerfile, which indicates there is <em>*no base image*</em> — you are providing only what is necessary for your app to run. For instance, you might copy in a statically compiled binary that has no external dependencies, so the entire container might just be that single binary plus essential metadata.</p><h4><strong>Benefits of Scratch Images</strong></h4><p>1. <strong>Minimal Attack Surface</strong>: Fewer tools and libraries installed means there are fewer potential vulnerabilities. Attackers can’t exploit packages that don’t exist in the image.</p><p>2. <strong>Smaller Footprint</strong>: Reduced disk usage, faster downloads, and quicker deployments.</p><p>3. <strong>Simpler Compliance</strong>: With fewer moving parts, it’s often easier to pass security checks and audits — only the dependencies you explicitly included are present.</p><h4><strong>Trade-offs</strong></h4><p>- <strong>Extra Work to Build</strong>: You have to bring your own libraries if your app needs them. For example, a static binary might remove the need for dynamic libraries (like `glibc`), but you have to ensure your binary is compiled accordingly.</p><ul><li><strong>Less Familiar Environment</strong>: You won’t have a shell, package manager, or other common tools unless you manually add them. This can make debugging inside the container more difficult.</li></ul><h4><strong>Security Considerations</strong></h4><p><strong>Distro-Based Images</strong>: Have a larger footprint, so it’s crucial to keep packages updated. Use the latest official images and frequently patch dependencies.</p><p><strong>Scratch or Minimal Base</strong>: By stripping away unnecessary packages, you reduce your exposure to potential vulnerabilities. Regularly scan your images to ensure they are free of known issues.</p><h4><strong>Key Takeaways</strong></h4><p>1. <strong>OS in a Container?</strong>: Containers share the host kernel. An “OS-based” container simply includes a Linux userland environment.</p><p>2. <strong>Distro-Based Builds</strong>: Great for ease of development and maintainability; you can leverage existing package managers and libraries to build and run your app.</p><p>3. <strong>Scratch Builds</strong>: Provide minimal, ultra-light images and reduce the security surface area, but require more effort to assemble and troubleshoot.</p><p>4. <strong>Choose Based on Use Case</strong>: Use a full-featured base for faster iteration and convenience, or go minimal/scratch to optimize performance and security when the environment is well-understood.</p><p>By understanding these differences, teams can make more informed choices about which type of container image best suits their application’s needs — balancing ease of use, compatibility, size, and security.</p><h3>Understanding Container Layers</h3><p>Now that we have a better idea of container images, let’s go back to container layers. Docker containers leverage a layered filesystem (OverlayFS), where each image is composed of multiple layers:</p><pre>Docker Host OS Filesystem (/)<br>│<br>├── bin/                 # Host OS binaries (cat, ls)<br>├── lib/                 # Host OS libraries (openssl, libc)<br>├── usr/<br>├── var/<br>    └─docker/<br>    ├── overlay2/<br>    │   ├── layerA/         # Shared Base Layer (e.g., Ubuntu)<br>    │   │   ├── bin/<br>    │   │   │   └── cat<br>    │   │   └── lib/<br>    │   │       └── libssl.so<br>    │   ├── layerB/         # App-specific Layer (additional files)<br>    │   │   └── app/<br>    │   │       └── myapp<br>    │   ├── layerC/         # Container-specific Writable Layer<br>    │   │   └── changes/<br>    │   └── layerX/         # Another app-specific Layer<br>    │       └── app/<br>    │           └── otherapp<br>    │<br>    └── containers/<br>        ├── container_1/<br>        │   └── mount (OverlayFS: layerC + layerB + layerA)<br>        └── container_2/<br>            └── mount (OverlayFS: writable_layer + layerX + layerA)</pre><pre>─────────────────────────────────────────────────────────────<br>Container 1 Root (`/`) → OverlayFS merged view:<br>/<br>├── bin/<br>│   └── cat        ← from layerA (actual full path is /var/docker/overlay2/layerA/bin/cat - which is different from /bin/cat provided by host)<br>├── lib/<br>│   └── libssl.so  ← from layerA<br>└── app/<br>    └── myapp      ← from layerB<br>─────────────────────────────────────────────────────────────<br>Container 2 Root (`/`) → OverlayFS merged view:<br>/<br>├── bin/<br>│   └── cat        ← from layerA<br>├── lib/<br>│   └── libssl.so  ← from layerA<br>└── app/<br>    └── otherapp   ← from layerX<br>─────────────────────────────────────────────────────────────</pre><blockquote>Isolation Boundary (OverlayFS, similar to chroot) Containers see only the merged, concatenated layers above. They DO NOT see the Host OS files below this boundary.</blockquote><pre>─────────────────────────────────────────────────────────────<br>Host OS Filesystem:<br>/<br>├── bin/<br>│   └── cat       (Host version)<br>└── lib/<br>    └── libssl.so (Host version)</pre><h4>Diagram Recap</h4><h4>Container Host OS</h4><ul><li>Container images and their layers reside in directories managed by container runtime (default: /var/lib/docker/overlay2/).</li><li>OverlayFS merges these layers into a unified filesystem.</li></ul><h4>Container Isolation (Similar to chroot)</h4><ul><li>Each container sees only its merged layers, not the host OS (unless explicitly mounted).</li><li>When a container runs commands like cat or openssl, it uses the versions shipped with its own image.</li></ul><h4>Key Points</h4><ul><li>A container image is essentially a set of files on disk (grouped in layers).</li><li>Container processes use those image files exclusively by default. (No access to data on host — host data is outside of container’s own root (/) directory)</li><li>Images can share layers for optimized disk usage efficiency.</li><li>OverlayFS layers are transparent to the container, presenting a single filesystem.</li><li>Copy-on-write ensures when a container writes to a file that exists in a shared layer, the container gets a dynamically-generated isolated copy of that file, so other containers that use the same shared layer are unaffected.</li></ul><h3>Mounting Volumes &amp; Persistent Storage</h3><p>By default, containers are ephemeral. Remember, if a container image writes data, it only writes to an isolated dynamically generated file. That isolated copy of the file is deleted once that container process terminates. To utilize persistent storage, containers can leverage volume mounts on their host.</p><pre>Docker Host OS Filesystem (/)<br>│<br>├── bin/                 # Host OS binaries (cat, ls)<br>├── lib/                 # Host OS libraries (openssl, libc)<br>├── usr/<br>├── mnt/<br>│   └── ebs_volume/      # Mounted AWS EBS volume on host<br>│       └── data/<br>│           └── db.sqlite<br>├── var/<br>│   └── log/             # Host directory for volume mounting<br>    │  └── messages.log<br>    └── docker/<br>    ├──── overlay2/<br>    │     ├── layerA/         # Shared Base Layer (e.g., Ubuntu)<br>    │     │   ├── bin/<br>    │     │   │   └── cat<br>    │     │   └── lib/<br>    │     │       └── libssl.so<br>    │     ├── layerB/         # App-specific Layer (additional files)<br>    │     │   └── app/<br>    │     │       └── myapp<br>    │     ├── layerC/         # Container-specific Writable Layer<br>    │     │   └── changes/<br>    │     └── layerX/         # Another app-specific Layer<br>    │       └── app/<br>    │           └── otherapp<br>    │<br>    └── containers/<br>        ├── container_1/<br>        │   └── mount (OverlayFS: layerC + layerB + layerA)<br>        └── container_2/<br>            └── mount (OverlayFS: writable_layer + layerX + layerA)</pre><pre>─────────────────────────────────────────────────────────────────────<br>Container 1 Root (`/`) → OverlayFS merged view:<br>/<br>├── bin/<br>│   └── cat           ← from layerA<br>├── lib/<br>│   └── libssl.so     ← from layerA<br>├── app/<br>│   └── myapp         ← from layerB<br>└── var/<br>    └── log/          ← volume-mounted from Host `/var/log`<br>        └── messages.log<br>────────────────────────────────────────────────────────────────────<br>Container 2 Root (`/`) → OverlayFS merged view:<br>/<br>├── bin/<br>│   └── cat           ← from layerA<br>├── lib/<br>│   └── libssl.so     ← from layerA<br>├── app/<br>│   └── otherapp      ← from layerX<br>└── data/             ← volume-mounted from Host `/mnt/ebs_volume/data`<br>    └── db.sqlite<br>────────────────────────────────────────────────────────────────────</pre><h4><strong>Host Volume Mount Example:</strong></h4><ul><li>Container directory: /var/log → maps directly to Host OS directory: /var/log</li><li>Files created or edited in /var/log from within the container directly affect /var/log on the host filesystem. This setup is common for logging agents that need to read or aggregate host log files. One thing to note, while the data on the host will persist if the container exits, if the host itself terminates, the data could be lost - therefore, it is not advisable to write business critical data directly to host volume mounts.</li><li><a href="https://github.com/splunk/splunk-connect-for-kubernetes/blob/develop/manifests/splunk-kubernetes-logging/daemonset.yaml">This is common in logging applications that leverage fluentbit.</a></li></ul><h4><strong>External (EBS) Volume Mount Example:</strong></h4><p>Container directory: /data→ maps directly to Host OS mounted EBS volume directory: /mnt/ebs_volume/data</p><ul><li>A second approach is to attach an external storage resource, like an AWS EBS block device, to the host. After mounting it on the host (for example, at /mnt/ebs_volume), you can map that location into your container so the container’s /data directory points to the EBS volume on the host.</li><li>Because the data is stored on the external block device, it persists beyond the lifecycle of any single container. Even if the container is removed or replaced, the data remains intact on the EBS volume, allowing reliable, long-term storage or easy backup. This pattern is common for databases or any application requiring durable storage beyond the container’s lifetime.</li><li>It’s important to note that external volume is separate from the boot disk (i.e., root volume) of the host. Therefore if the host terminates, the disk can persist and be attached to another host. (This also applies to containers that terminate on a host — the volume is already mounted to the host, so new containers on same host can consume them)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*zaWSrJMn3H7R9C4D5XDFyA.png" /><figcaption>This pattern is common when container hosts leverage auto-scaling through their cloud provider. The orchestration of detaching and re-attaching volumes between hosts is typically handled by container orchestration systems, such as Kubernetes (<a href="https://kubernetes.io/blog/2019/01/15/container-storage-interface-ga/">using it’s Container Storage Interface — CSI</a>).</figcaption></figure><blockquote>Isolation Boundary (OverlayFS, similar to chroot) Containers see only their merged, concatenated layers plus explicitly mounted volumes. They DO NOT see or interact with other parts of the Host OS filesystem unless explicitly mounted.</blockquote><pre>Host OS Filesystem (actual root `/`):<br>/<br>├── bin/<br>│   └── cat       (Host version)<br>├── lib/<br>│   └── libssl.so (Host version)<br>├── var/<br>│   └── log/<br>│       └── messages.log<br>└── mnt/<br>    └── ebs_volume/<br>        └── data/<br>            └── db.sqlite<br>─────────────────────────────────────────────────────────────────────</pre><h3>What about the Kernel?</h3><p>Every process on a computer (container or otherwise) must have access to a kernel otherwise it simply will not run — after all, the kernel is what brokers software’s access to the underlying hardware (CPU, Disk, Network Interface, Memory, etc). As mentioned before, container images DO NOT ship with a kernel — this is what makes them fundamentally different from Virtual Machines; instead, containers just leverage the existing kernel on their host — like any other process.</p><p>Therefore, when a container needs to do anything such as open a network connection, write to disk, store something in memory, the container performs a system call (syscall) to the kernel. Syscalls use special CPU instructions that transfer execution to the kernel at a controlled entry point. This is how most normal day‐to‐day interactions with the kernel happen, whether a container or not.</p><p>Fundamentally, running container is no different from how the kernel schedules and executes other processes; a containerized process is just a regular Linux process. The primary difference is that containers use features like Linux namespaces, cgroups, and overlay filesystems (e.g., OverlayFS) to isolate the containerized processes from the rest of the system. But there’s no “special type” of process just because it’s running in a container; it’s still a standard Linux process using the same kernel.</p><p>In fact, cgroups, namespaces, and OverlayFS are native Linux features — they can be leveraged on non-containerized process as well. Here’s a brief outline of cgroups and namespace, since most folks are not familiar with them.</p><h4>Control Groups (cgroups)</h4><p><strong>What They Do: </strong>Limit, account for, and isolate resource usage (CPU, memory, block I/O, etc.)</p><p>Tools like systemd-run, cgcreate, cgexec, and configuration under /sys/fs/cgroup (depending on the cgroup version) let you manage resource constraints directly for any process.</p><pre># Create a new cgroup<br>sudo cgcreate -g memory,cpu:/myGroup  </pre><pre># Limit memory usage to 512 MB<br>echo 536870912 | sudo tee /sys/fs/cgroup/memory/myGroup/memory.limit_in_bytes  </pre><pre># Run a process inside this cgroup<br>sudo cgexec -g memory,cpu:myGroup /usr/bin/my_app</pre><h4>Namespaces</h4><p><strong>What They Do: </strong>Partition kernel resources so a process sees only its “slice” of the system (mount points, PIDs, network interfaces, etc.)</p><p>The unshare utility can “unshare” (create a new) mount namespace, PID namespace, network namespace, etc., for a single process, isolating it from the rest of the system.</p><pre># Unshare a new PID namespace and run a shell<br>sudo unshare --pid --fork /bin/bash</pre><pre># Inside this shell, ps will only list processes in the new PID namespace<br>ps aux</pre><h4>Why Containers Uses Them</h4><p>Container runtimes automate the creation and management of cgroups, namespaces, overlay filesystems, etc., to package an application “as if” it’s running in its own OS, while sharing the host kernel in reality.</p><h4>Non-containerized Use Cases</h4><ul><li>Systemd: On many Linux distributions, systemd uses cgroups under the hood to manage and track services.</li><li>Custom “Jails”: Administrators or devs might create per-user or per-service namespaces and cgroups for isolation and resource control, without using Docker.</li></ul><h4>What about directories like /proc /sys /dev?</h4><p>Container images generally do not ship with a real /proc or /dev filesystem “baked in.” Instead, the container runtime (e.g., Docker or Containerd) automatically mounts special filesystems like /proc, /sys, and /dev when the container starts.</p><h4>Here’s what that looks like in practice</h4><ul><li>/proc is a virtual filesystem provided by the kernel, so containers inherit a view of /proc that Docker sets up at runtime (using a bind mount from the host’s procfs). You won’t find a “real” /proc folder in the image layers.</li><li>/dev typically gets mounted as tmpfs or bind-mounted from the host. It is not stored in the image layers, either.</li><li>/sys: Another virtual filesystem (sysfs) that’s mounted at container startup. Like /proc and /dev, the image might have an empty placeholder directory for /sys which the container runtime replaces with the host’s sysfs view.</li></ul><p>If you inspect an image’s filesystem tar layers (for example, with docker save and tar -x), you may see empty directories for /proc or /dev, but those are placeholders. When you actually start the container, the container runtime handles the mount points so that the processes inside the container see the expected virtual filesystems.</p><pre>+------------------------------------+<br>           |           Host OS (Linux)          |<br>           |  (includes kernel, /proc, /sys,    |<br>           |   /dev mounted by the kernel)      |<br>           +-----------------+------------------+<br>                             |<br>                             |  (Docker Daemon /<br>                             |   Container Runtime)<br>                             |<br>            +----------------v-----------------+<br>            |           Docker Engine          |<br>            +----------------+-----------------+<br>                             |<br>       +---------------------v---------------------+<br>       |                Container                 |<br>       |   (Root filesystem from Docker image)    |<br>       | ---------------------------------------- |<br>       |   /   (image filesystem)                 |<br>       |   ├── /bin       (from image layers)     |<br>       |   ├── /etc       (from image layers)     |<br>       |   ├── /lib       (from image layers)     |<br>       |   ├── /proc  -&gt;  (mount from host)       |<br>       |   ├── /sys   -&gt;  (mount from host)       |<br>       |   └── /dev   -&gt;  (mount from host)       |<br>       +------------------------------------------+</pre><h3>Container Orchestration</h3><p>As your container usage grows, manually managing hundreds or thousands of containers across multiple servers becomes unfeasible. Container orchestration platforms automate the deployment, scaling, networking, and management of containerized applications.</p><h4><strong>Popular Tools</strong></h4><ul><li><strong>Kubernetes</strong>: A leading open-source orchestrator originally built by Google.</li><li><strong>Docker Swarm</strong>: A native Docker solution for orchestrating containers, simpler than Kubernetes but less feature-rich.</li><li><strong>Amazon ECS</strong> and <strong>AWS Fargate</strong>: Managed services on AWS for running and scaling containerized workloads.</li><li><strong>Google Cloud Run</strong> — a server-less managed service for running containers on Google Cloud.</li><li><strong>HashiCorp Nomad</strong>: A flexible orchestrator that can run containers alongside other workload types.</li></ul><h4><strong>Key Features</strong>:</h4><ol><li><strong>Scheduling</strong>: Automatically deciding which node runs which container based on resources and constraints.</li><li><strong>Load Balancing &amp; Service Discovery</strong>: Routing traffic to the correct container instance, dynamically updating routes/internal DNS when containers scale up or down.</li><li><strong>Self-Healing</strong>: If a container or node goes down, the orchestrator replaces it automatically.</li><li><strong>Rolling Updates &amp; Rollbacks</strong>: Seamlessly update containers to newer versions with minimal downtime, revert if errors occur.</li></ol><h4><strong>Why It Matters</strong></h4><p>Orchestrators handle the complexity of running containers at scale, enabling teams to deliver and manage microservices more effectively.</p><h3>Conclusion</h3><p>This is just scratching the surface when it comes to containers. There are so many other topics we haven’t covered</p><ol><li><strong>Container Vulnerability Scanning</strong></li></ol><ul><li><strong>What It Is</strong>: Automated tools analyze your container images to identify known vulnerabilities in libraries, frameworks, and system packages.</li><li><strong>Examples of Tools</strong>: <a href="https://github.com/aquasecurity/trivy">Trivy</a>, Clair, Snyk, and Grype.</li><li><strong>Why It Matters</strong>: Early detection of vulnerabilities helps you patch or update critical components before shipping your containers to production.</li></ul><p>2.<strong> Container Hardening</strong></p><ul><li><strong>Unique Attack Surfaces</strong>: Because containers share the host kernel, any misconfiguration in the container could potentially compromise the host.</li><li><strong>Best Practices</strong>: Adhering to standards like STIG or CIS Benchmarks can guide you in removing unnecessary packages, dropping privileges, and using read-only filesystems.</li><li><strong>Why It Matters</strong>: Hardening ensures that even if an attacker gains a foothold in the container, the impact is minimized and doesn’t spread to the host or other containers.</li></ul><p>3.<strong> Container Runtime Security</strong></p><ul><li><strong>Different Security Posture</strong>: Traditional endpoint security tools can struggle with the ephemeral nature of containers. Processes spawn quickly and may exit within seconds, making legacy agents less effective.</li><li><strong>Solutions</strong>: Tools like Falco (which uses eBPF) and container-native security platforms monitor system calls, network behavior, and more, specifically tailored for container runtime environments.</li><li><strong>Why It Matters</strong>: Detecting malicious or anomalous activity in real time is essential for stopping attacks before they escalate.</li></ul><p>4. <strong>Container Networking</strong></p><ul><li><strong>Networking Models</strong>: Containers often use overlay networks, service meshes, or other virtual networks that abstract away typical host-based interfaces.</li><li><strong>Configuration</strong>: In Kubernetes, for example, every pod gets its own IP, which influences how services discover and communicate with one another.</li><li><strong>Why It Matters</strong>: Understanding how packets flow between containers, pods, and services is crucial to troubleshooting performance issues and securing traffic inside a containerized environment.</li></ul><p>By diving deeper into these topics — vulnerability scanning, hardening, runtime security, and networking — you’ll be better equipped to build robust, secure, and highly scalable containerized applications. As containers continue to evolve, keeping up with best practices and security benchmarks will help ensure that your deployments remain resilient and ready for production at any scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e82ab49507f" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/containers-the-best-explanation-ever-hopefully-0e82ab49507f">Containers: The Best Explanation Ever (Hopefully)</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Won’t My Phone Connect to Public WiFi?]]></title>
            <link>https://itnext.io/why-wont-my-phone-connect-to-public-wifi-37f0d812f2c3?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/37f0d812f2c3</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[remote-work]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Thu, 23 May 2024 12:13:50 GMT</pubDate>
            <atom:updated>2024-05-27T23:22:32.059Z</atom:updated>
            <content:encoded><![CDATA[<h3>DHCP, DNS, &amp; Caching: Why Won’t My Phone Connect to Public WiFi?</h3><h4>Understanding Captive Portals and an Ingenious Way to Trigger Them</h4><p>We’ve all had this issue before. We’re at a cafe or airport, and no matter what we do, we just can’t seem to connect to the Public WiFi. We know there is one of those web pages that pops up to accept terms of service, pay for access, or something else — but it just won’t appear!</p><p>Today we’re going to take deep dive into what is going under the hood, and introduce an ingenious free way to get connected fast.</p><h4>When You Connect to a Router</h4><p>After the connection is made to a router, your device updates its local route table. Without this connection, the route table looks like this first example below. Pretty basic. The entries basically mean I only know how to route Addresses that look like 127.x.x.x (loopback — basically the computer knows how to talk to itself) or 224.0.0.x (multi-cast — which is a method for sending data to multiple servers simultaneously)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrvOb7YTowvNNgG_SWqUXg.png" /><figcaption>My laptop’s routing table without a connection to WiFi.</figcaption></figure><p>This is what my routing table looks like after connecting to WiFi. Let’s just focus in on that first entry, “default” (sometimes, you see this route listed as 0.0.0.0/0). This entry is the whole point of connecting to WiFi, it says: this is where you send the request if you want to get to the internet. It’s called the default route because the route used if there is not a more specific route for your destination IP (the IP you are trying to connect to) in the table — i.e., it’s the route that is used by default.</p><p>Notice that the Gateway is different as well. The Gateway is the IP address of the router — it’s basically saying, for any internet traffic, send to this router. Finally, the Netif column. We’ll see that it says en0 as opposed to lo0. This is the name of the Network Interface used by my laptop to designate my WiFi adapter. That whole entry is basically, saying: if you want to get to the internet, send to this router through this interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5_KJBDo9GUNGn6Atog7aRA.png" /><figcaption>My laptop’s routing table after connecting to WiFi.</figcaption></figure><p>So if I need to send my request to the IP address of router, how does my laptop know how to route the request to the router? Notice the route 192.168.1.1/32 — this is CIDR notation for 192.168.1.1 which is the IP of the gateway. Notice that the gateway for this entry says “link#15”. This is a special type of address called a link-local address (169.254.x.x). It’s the IP address of the actual connection between your laptop and the router.</p><h4>But what if there’s a captive portal?</h4><p>Captive portal is the term used for those web pages that pop up to accept terms of service etc. It is essentially a man-in-the-middle response from your router. For example you browse some random page, since all of your web traffic is send to the router, it can intercept the request and see that you haven’t authenticated (for our purposes here, authenticate means accept the terms, pay the WiFi fee, etc) with the captive portal. Please note there is a little more going on under the hood here, but we’ll get to that later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*1gPXlu8Gvpen49Ykvcld8Q.png" /></figure><h4><strong>Why did you say http and not https?</strong></h4><p>This is the beginning of the issues for why the captive portal can be difficult to trigger. The router will typically ONLY respond (technically, either a 301 or 302 Redirect) with the captive portal if the request is over http, not https. This is because you will get SSL certificate errors since the router does not have the certificate from the web page you are trying to access - Remember the domain of the URL in your browser must match the Subject or Subject Alternative Name in the certificate returned by the web server. For more info on SSL here’s s<a href="https://medium.com/itnext/sni-from-a-to-z-72deffe942e1">hameless plug to a blog I wrote about SSL</a>. These SSL errors will typically break the redirect response issued by the router. So nowadays, https requests are typically dropped by the router if there has been no captive portal authentication.</p><p>But this is problematic for 2 reasons:</p><ol><li>Today, almost every website uses SSL to encrypt traffic, so there aren’t many options to use simple http.</li><li>Most modern browsers use something called HSTS. <a href="https://medium.com/p/ca9bbd57df15">Another shameless plug</a> to learn more about HSTS. So even if you try to use http, your browser will force you to use https.</li></ol><h4>So if I can’t use plain http how do I trigger the portal?</h4><p>The answer: IT’S ALWAYS DNS! Prior to the actual redirect, the router is capturing your DNS traffic and using it to fool your browser. Let’s take a step back and see how.</p><p>Routers are essentially hosting their own private network. For your device to be a part of that private network, they need an IP address on that network. Your device gets that IP address from the router through the Dynamic Host Configuration Protocol (DHCP).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*XjkGQaGKP0pg7zsBVtuoGA.png" /></figure><p>Typically, this IP is random from a predefined range, but it is possible to always give a certain device the same IP address every time. But DHCP does not just issue IP addresses. DHCP can also include other information about the network your device is joining through <a href="https://efficientip.com/glossary/dhcp-option/">DHCP Options</a>. Some options include:</p><ol><li>Subnet mask</li><li>Default Gateway</li><li>Lease time</li><li>Client Hostname</li><li>DNS servers</li></ol><p>So when your device connects, the router will give it not only an IP address, but also tell your device where to send its DNS queries. Most routers host recursive DNS resolvers, so typically the DHCP options specify the router itself for DNS queries. <a href="https://medium.com/itnext/dns-the-best-explanation-ever-hopefully-13cea019b72b">Last shameless plug if you want to learn more about DNS.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*2ggnVAtrMPblPMaMJaMejw.png" /><figcaption>This DNS query is usually triggered automatically from your browser. But the router fools your browser into sending the web request to itself, where it can issue the redirect to the captive portal page.</figcaption></figure><p>However, DNS caching complicates this. Every device that issues a DNS query, remembers the answer for a predefined length of time called a Time to Live (TTL). So if I try to browse a website, and my local DNS cache still has an IP address in it for that domain, no DNS query is sent to the router. No DNS Query, no Captive Portal.</p><h4>So how can we make this work?</h4><p>What if there were a website that worked on plain HTTP, did not support HSTS, and could magically force a DNS query no matter what? NeverSSL.com to rescue. Created by AWS Distinguished Engineer and VP Colm MacCarthaigh.</p><p>The key to the DNS cache breaking is some ingenious javascript. He builds in a 301 Redirect into all requests to <a href="http://neverssl.com/">http://neverssl.com</a>. The redirect appends a 3 random adjectives and 1 random noun from the list below to the front of the domain. neverssl.com could redirect to cooluniquetreasure.neverssl.com. So even if your laptop still had neverssl.com in your DNS cache, the random subdomain is pretty much guaranteed to not be cached; thus a DNS query will be sent to the router, and trigger the captive portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8e3kgrXFx_R0Tv6_wBVquQ.png" /></figure><p>It’s important to note this can work offline via browser caching. While the page may not fully display offline, the above JavaScript may potentially be cached on your laptop from previous visits to neverssl.com. If this is cached, the browser will execute the JS, generating the random subdomain and triggering the redirect. Even if the page doesn’t fully load, the resultant DNS query will force the captive portal to appear.</p><p>Side note: browser caching is another reason why Captive Portals may not appear. If your browser has enough content cached locally, it may not send an http request. Remember, no http, no captive portal. Colm uses a slick way make browsing caching work in our favor.</p><p>Ironically, NeverSSL does now support SSL since some browsers force HTTPS no matter what. This will help cache the content locally but obviously would still cause issues with triggering the portal.</p><p>There are other sites that folks use to trigger the captive portal. A few others are http://example.com and http://alwayshttp.com. However, there is an off chance they won’t work since your browser may still have the content cache from previous visits — DNS caching is possible but all of those domains use very small TTLs so that is unlikely. The random domain JavaScript magic of neverssl.com has never let me down — it breaks through HTTP and DNS caching.</p><p>I’ll always appreciate Colm building and hosting this (on his personal AWS account) since it helped me understand what is going on under the hood.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37f0d812f2c3" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/why-wont-my-phone-connect-to-public-wifi-37f0d812f2c3">Why Won’t My Phone Connect to Public WiFi?</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VPN is dead? Long live the Jump Host?]]></title>
            <link>https://itnext.io/vpn-is-dead-long-live-the-jump-host-bf3683cc684d?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf3683cc684d</guid>
            <category><![CDATA[federal-government]]></category>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Mon, 20 May 2024 23:41:45 GMT</pubDate>
            <atom:updated>2024-05-29T20:10:55.483Z</atom:updated>
            <content:encoded><![CDATA[<h4>Digesting the Supplemental Guidance for Proper Subnetting in FedRAMP</h4><p>In June of 2022, the FedRAMP PMO released <a href="https://www.fedramp.gov/assets/resources/documents/FedRAMP_subnets_white_paper.pdf">a white paper</a> providing some guidance expanding on the requirements of SC-7, which defines how a CSP should architect the network of their backend. This was primarily a response to two factors: 1) increased prominence of container-based systems such as Kubernetes 2) increased prominence of IaaS providers such AWS, Azure, GCP. Both systems introduce environmental elasticity which can muddy the waters around subnetting. While it was released two years ago, the white paper still plays a critical role in how the PMO expects systems to be configured.</p><h3>FedRAMP SC-7</h3><blockquote>a. Monitor and control communications at the external managed interfaces to the system and at key internal managed interfaces within the system;</blockquote><blockquote><strong>b.</strong> <strong>Implement subnetworks for publicly accessible system components that are [Selection: physically; logically] separated from internal organizational networks; and</strong></blockquote><blockquote>c. Connect to external networks or systems only through managed interfaces consisting of boundary protection devices arranged in accordance with an organizational security and privacy architecture.</blockquote><p>Let’s focus in on SC-7b and more specifically the term “publicly accessible”. The white paper defines any system that is directly accessible from outside of the boundary as publicly accessible (the white paper calls this the “First Compute Instance”). In practicality, this means the very first system that is accessed is publicly accessible — whether that access is via web console sessions, SSH sessions, RDP sessions, FTP sessions, etc. This applies to both data plane (i.e., application traffic or what PMO calls “Operational” traffic) as well as management plane (i.e., administrative traffic or privileged access). The management plane would include access to internal security components such as vulnerability scanners, SIEMs, XDR, etc. The PMO is clear when it states that any network device (e.g., firewalls, gateways, load balancers, and proxy servers) that is traversed by traffic is NOT to be considered the first compute instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*A1hXVr2E1fpk4Nd8MRUoSQ.png" /><figcaption>This diagram from the white paper illustrates an example architecture. Aside: I will assume the PMO means “jump host” when it says, “bastion host”, as the definition of bastion host can vary widely across organizations. <a href="https://web.archive.org/web/20200105033819/http:/www.vtcif.telstra.com.au/pub/docs/security/ThinkingFirewalls/ThinkingFirewalls.html">The original definition</a> of the term meant any publicly accessibly server that had increased security hardening compared to other internal hosts. After all, the term “bastion” implies fortification. Those bastion hosts can run other processes such as DNS, web services, load balancing, etc. Nowadays, it is a bit of a dated term and in conflict with Zero Trust principles, all servers should be hardened and protected equally, not just those that are publicly accessible. For these reasons, jump host and bastion host are typically used interchangeably, but it’s important to note that may not be the case for all parties.</figcaption></figure><p>The last statement is critical since this would preclude VPN gateways from being the first compute instance while jump hosts would be considered the first compute instance. Here is an example of 2 Traffic Flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*baLf-s1x_O6ixatx1AEwkA.png" /><figcaption>The top is using a traditional Client VPN flow where a user establishes an encrypted tunnel (either TLS or IPSec) between their device and the VPN Gateway and then access the internal web portals and administrative ports directly as if they were inside the private network. The bottom is using a jump host flow where the user RDPs to a jump host hosted in the authorization boundary and then accesses the internal web portals and administrative ports from the jump host. <em>Please note: this flow is similar to using a Virtual Desktop interface (VDI). For the purposes of this article, please consider any discussion around jump hosts to apply equally to VDIs unless directly specified.</em></figcaption></figure><p>Both are perfectly valid patterns for controlling administrative access. However, each pattern has its own risk profile; in turn, each risk profile has downstream ramifications in the world of FedRAMP primarily around the authorization boundary, which is defined as:</p><blockquote>1. Description of a cloud system’s internal components and connections to external services and systems.</blockquote><blockquote>2. Accounting for the flow of all federal information and metadata through the system.</blockquote><blockquote>3. Illustration of a CSP’s scope of control over the system as well as any system components or services that are leveraged from external services or controlled by the customer.</blockquote><p>It all comes down to whether federal data is “leaving the authorization boundary”. Any system where Federal data/metadata would land would be considered as part of the boundary — and thus must be beholden to the same security procedures and configurations outlined in the CSP’s System Security Plan (SSP). To put it another way: the security posture of every device in the system which processes or stores Federal data or Federal metadata must be monitored and managed IN BOUNDARY. The term “metadata” tends to be a cover-all for everything; HTTP headers, vulnerability scans, administrative group names, resource names, certificates, etc. would all be beholden to these rules.</p><p>As stated before, the key is to prevent the exfiltration of federal data and metadata. In a jump host scenario, all jump hosts are configured with the same malware detection software, scanned for vulnerabilities using the in-boundary scanner, and logs shipped to the in-boundary SIEM. Therefore, all that privileged security information STAYS in boundary. When an administrative user must access any of this security information, they must do so from a jump host, so even at the physical layer the data does not leave the boundary.** This is why the jump host can be considered the first compute instance when accessing the management plane.</p><blockquote>**An astute security professional would point out that federal data would still leave the boundary since via the RDP protocol — since that data is technically visible on their device via the RDP window. However, this risk of data exfiltration can be mitigated by disabling the local redirection of folders and clipboards to prevent the administrator from copying information to their device directly or via Copy/Paste. Digital Rights Management solutions on endpoints can prevent screenshots, and for the most sensitive data, there’s always a SCIF (Secure Compartmentalized Information Facility), where administrators are not allowed to have outside devices like cell phones, preventing photos. However, requiring all administrators from FedRAMP authorized CSPs to work from a SCIF would be overkill. SCIFs are typically reserved for highly sensitive data related to National Defense (e.g., DoD IL-6).</blockquote><p>For VPNs, this is very different. Once users have established the tunnel with their device and the VPN gateway, they can access the security tools directly as if they were already on a jump host. When they connect to the web portal of the SIEM — the web page containing federal data/metadata is downloaded directly onto the administrator’s device. This means that the administrator’s device is now considered “IN BOUNDARY” and therefore must be managed and monitored by in-boundary systems — which is simply not feasible from a technical perspective.</p><p>For this reason, the PMO has all but explicitly precluded the use of VPNs for administrative access and states that jump hosts/VDIs are the only acceptable way to grant administrative access to a FedRAMP authorized system.</p><h4>So are VPN’s dead?</h4><p>In the world of FedRAMP, that is still yet to be determined, and it’s not looking good. One source of hope is SC-7 (7), which dictates the requirements for Split Tunneling which is strictly a VPN-construct — why have the control at all if the technology is not allowed?</p><p>This is not to say that the there are no threats when using a VPN over a jump host. These threats include:</p><blockquote>1. An administrative device with patch-able vulnerabilities.</blockquote><blockquote>2. Lack of encryption on administrator device.</blockquote><blockquote>3. Administrator device compromised by malware.</blockquote><blockquote>4. Administrative device capable of leaking sensitive information.</blockquote><blockquote>5. Administrator accessing malicious domains.</blockquote><blockquote>6. Administrator device being accessed by unauthorized user.</blockquote><blockquote>7. Untrusted software running on administrator device.</blockquote><blockquote>8. Lack of visibility of the above configuration data from within the boundary.</blockquote><p>Typically, these threats would be mitigated by mechanisms from within the boundary (vulnerability scanning, malware protection, privileged access, configuration management etc.). Most organizations secure their user devices using their unified endpoint management (UEM) solution. However, UEMs typically can only control items 1–7; the administrator device configuration state is not typically visible in the system boundary which is useful for correlation with other security events during an incident. Fortunately, SSO providers like DUO and Okta provide device security posture assurance each time a device connects. This data is captured each time a user authenticates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*k4quYBky7GcXZ17zMpvQRg.png" /><figcaption>This is an example of a log-in event from Okta where the above information is captured. One can infer the installation of security agents (e.g., CASB, AV, SWG) by seeing that the device is “Managed” by the UEM. In this example, the device is not “managed” and therefore, could be blocked by policy, despite having the other require configurations in place. This log-in event can be consumed by the SIEM, then correlated with other security events.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jGjT8fvGeNfLpwKAmzZdjA.png" /><figcaption>Here are is example of a device assurance policy for MacOS Devices — similar ones exist for other major OSes. This is where we enforce whether a device is secure.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JMy0sUPRS79o2rUsOok0A.png" /><figcaption>Here is an example of an event from a managed Windows device. Notice that Okta can pull in additional security posture information from Windows Security Center. This information can be used to in authentication policies to enforce a higher device security posture.</figcaption></figure><blockquote>Side note: Both Okta and DUO support the ability to check devices for specific security agents and to deny access if a device is compromised by malware. In my opinion DUO is more robust in both of these areas, but Okta is closing fast!</blockquote><p>The above scenario is in-line with the Security Service Edge (SSE) architectural pattern which combines these 3 solutions:</p><h4>Zero-Trust Network Access (ZTNA)</h4><ul><li>Micro-segmentation of user access</li><li>Strong user authentication (phishing-resistant MFA — i.e., certificate-based Smart Card, FIDO2)</li><li>Device authentication and assurance</li></ul><h4>Secure Web Gateway (SWG)</h4><ul><li>Monitor user web traffic</li><li>Block network traffic to malicious domains and IPs.</li></ul><h4>Cloud Access Security Broker (CASB)</h4><ul><li>Prevent data exfiltration.</li><li>Prevent proliferation of malware</li></ul><p>By combining these technologies, any threats associated with an “in-boundary” administrator laptop can be mitigated, allowing for an improved user experience without a detriment to security. The SSE pattern is a newer paradigm that requires evaluation by the PMO; however, it is my opinion that when configured properly, it can adequately address the security concerns of using not using a jump host to access the management plane of federal systems.</p><h4>How does this affect integrating with other Cloud Service providers e.g., IaaS and SaaS?</h4><p>One of the benefits of a service getting a FedRAMP authorization, is that it can be leveraged by other CSPs seeking an authorization. Common examples of authorized solutions that are leveraged by other CSPs:</p><blockquote>1. IaaS — e.g., AWS, GCP, Azure</blockquote><blockquote>2. IDaaS — Okta and DUO</blockquote><blockquote>3. DBaaS — Mongo DB Atlas</blockquote><blockquote>4. Privileged Access — Zscaler Private Access and Prisma Cloud Remote Access</blockquote><blockquote>5. SIEM — Splunk Cloud</blockquote><blockquote>6. Vulnerability Scanning — Tenable VM (formerly Tenable IO).</blockquote><blockquote>Side note: I’m a big fan of how Zscaler Private Access handles web applications — with a client-less VPN flow, to create what I call, Virtual Private Applications (VPAs). Create public CNAME for your app pointing to Zscaler’s cloud and then browse the app and Zscaler will authenticate the user at the edge using OAuth2/OIDC prior to forwarding your request to the application server. <a href="https://medium.com/itnext/deep-dive-on-cisa-bod-23-02-54ca61e6d181">I’ve blogged about this scenario before using AWS Native Services.</a></blockquote><p>However, the management consoles (and APIs) for these providers are all publicly accessible web applications — they still require user authentication but at network layer, neither jump host nor VPN are needed. Does the PMO require you to access the consoles for these services exclusively from a jump host? But how do you enforce that? Some services support source IP-based conditions for authentication/authorization (e.g., Okta, Splunk, AWS), but not all of them. Given the brittleness of jump hosts, it would be necessary to account for “break-glass” scenarios where the jump host is inaccessible.</p><p>Additionally, the public nature of IaaS APIs introduces an interesting wrinkle for privileged access. Solutions such as GCP’s Identity Aware Proxy, AWS Systems Manager, and Azure VM Run Command provide API-driven privileged access to underlying hosts. Are jump hosts required to utilize those services?</p><p>It’s interesting to point out that Zscaler and Prisma Cloud are two of the more authorized services in FedRAMP — Zscaler has 27 Authorizations and 65 Reuses (Moderate and High combined), Prisma Cloud has 27 Authorizations and 72 Reuses (Moderate only, High in progress). Also, Zscaler is JAB authorized, Prisma only has Agency-based Authorizations. This is rhetorical, but are Zscaler and Palo Alto strictly using jump hosts to access their backend, and not “dog-fooding” with their own VPN technology? Also, since Zscaler Private Access and Prisma Cloud are authorized, CSPs should be able leverage them for within their solution. If a 3PAO audit concluded that a CSP was not allowed to utilize those services it raises the question: why were they authorized in first place? Clearly either an agency or the JAB concluded that the threats associated with using a VPN over a jump host could adequately be mitigated, so one would hope the others would follow suit.</p><p>In conclusion, the subnetting guidance the FedRAMP PMO released has been critical to auditors and CSPs in understanding how their networking will be assessed. However, it’s important to point out that compliance must continuously evolve to incorporate the state-of-the-art best practices. That is the only way we can finally rid the world of the belief that <strong><em>compliance does not equal security.</em></strong></p><p><em>The above arguments have been submitted to the PMO for review. Will update if/when I receive a response.</em></p><p><em>Matthew is Managing Director at stackArmor — a leading cloud security and compliance accelerator. All opinions expressed are his own.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf3683cc684d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/vpn-is-dead-long-live-the-jump-host-bf3683cc684d">VPN is dead? Long live the Jump Host?</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding AI Risk Management — Securing Cloud Services with OWASP LLM Top 10]]></title>
            <link>https://itnext.io/understanding-ai-risk-management-securing-cloud-services-with-owasp-llm-top-10-0a8d2c4e34e5?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a8d2c4e34e5</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 21:16:20 GMT</pubDate>
            <atom:updated>2024-01-04T21:47:52.668Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Understanding AI Risk Management — Securing Cloud Services with OWASP LLM Top 10</strong></h3><h4>Using Examples from Amazon Bedrock</h4><p>Welcome back to the era of GenAI, where the world remains captivated by the boundless potential of artificial intelligence. However, the proliferation of AI does not preclude us from considering the new risks it poses. As you may recall, I have been supporting numerous initiatives around AI Risk Management as part of our ATO for AI offering and <a href="https://itnext.io/understanding-risk-assessment-standards-for-deploying-safe-secure-ai-systems-53e4a66b8fc1">recently explored the ethical risks surrounding AI using the IEEE CertifAIEd framework</a>. As part of the NIST AI RMF, we need to continue to adopt new and emerging risk management practices unique to AI systems. Today, we’re going to be exploring the other type of risks: the security vulnerability vectors that are unique to AI systems. Today we will be examining the most common of those vectors, called the OWASP LLM Top 10 and how to protect yourself while building solutions using AWS Native AI services.</p><h4><strong>What is the OWASP LLM Top 10?</strong></h4><p>Most InfoSec professionals are familiar with the OWASP Top 10 for Web Vulnerabilities — <a href="https://medium.com/itnext/using-custom-labels-to-maximize-protection-with-aws-waf-2b2532e8b51f">I blogged previously about how you can leverage AWS WAF to protect your web apps from these exploits</a>. The OWASP LLM Top 10 is a new set of terms and vectors describing the most common attack vectors that are unique to LLMs. However, most of the vectors are extrapolations of best security practices found in the Web Vulnerability Top 10 — sanitizing inputs and outputs, least privilege, etc. By understanding these new attack vectors, developers can take proactive steps to protect their AI systems, whether they are built on AWS or any other platform.</p><p><em>Disclaimer: Though I tried to be as thorough as possible, the suggested mitigations below should not be considered exhaustive — they are just examples to provide guidance. It is important to perform threat modeling of your LLM application to identify the threat vectors unique to your system. For practical purposes, I have used AWS AI services like Amazon Bedrock to demonstrate applicability of the various threats and their mitigations.</em></p><h4>1. Prompt Injection</h4><blockquote>This manipulates a large language model (LLM) through crafty inputs, causing unintended actions by the LLM. Direct injections overwrite system prompts, while indirect ones manipulate inputs from external sources.</blockquote><p>Prompt injection exploits can be broken down into two sub-categories:</p><ol><li>Direct — a malicious user crafts specific inputs to circumvent guardrails to obtain “root” access to the LLM — also known as “jail-breaking” or D.A.N. mode.</li><li>Indirect — when downstream external data sources introduce malicious prompt to an LLM — resulting in a “confused deputy”.</li></ol><p><strong><em>Potential Impact:</em></strong></p><p>Successful prompt injection can result in manipulation of the LLM to imitate a potentially harmful identity or interact with user plugins. This could result in leaking sensitive data, privilege escalation (unauthorized use of plugins), or even social engineering. Essentially, the compromised LLM becomes a malicious insider along side the actual attacker.</p><p><strong><em>Mitigations:</em></strong></p><ol><li><a href="https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html">All Amazon Bedrock inputs and outputs are reviewed via automation for malicious use.</a> Humans do not view these inputs or outputs. They are non-blocking however and are just used to identify customers who may be misusing Bedrock.</li><li><a href="https://aws.amazon.com/blogs/aws/guardrails-for-amazon-bedrock-helps-implement-safeguards-customized-to-your-use-cases-and-responsible-ai-policies-preview/">Explore Guardrails for Bedrock to block malicious prompts and responses.</a> It is currently in Preview. Planning to incorporate PII filtering in future.</li><li><a href="https://docs.aws.amazon.com/bedrock/latest/userguide/logging-using-cloudtrail.html">Enable Cloud Trail Data Events for Bedrock</a>. You can then have human-review of the user provided prompts (if acceptable with your customers) or feed them into automation to identify customers who are misusing your application and take appropriate action.</li><li>Use tools like <a href="https://github.com/azshue/AutoPoison">AutoPoison</a> to test against malicious inputs.</li><li>Do not pass raw user input directly to LLM — utilize prompt engineering and instruction tuning to add context and instructions transparently to act as a security guardrail. <a href="https://arxiv.org/abs/2306.17194">A great white-paper for more research on this topic.</a></li></ol><pre>from langchain import PromptTemplate<br><br>prompt_template = PromptTemplate.from_template(<br>    template=&quot;You are personal assistant for an executive.  <br>You do not respond to any requests to perform malicious acts such as <br>- illicit image generation, making bombs, planning an insurrection.  <br><br>If you receive any of these requests - <br>you respond with &#39;I am unable to comply for ethical reasons&#39;<br><br>Respond to the following question: {question}.  <br>)</pre><p><em>Note: Malicious input filtering is automatically incorporated using Pre-processing Advanced Prompts in Amazon Bedrock Agents. However, you should test out the default template to ensure that it adequately accounts for your specific threat models.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*vi0m9kuLCjUTcCXQdjW0GQ.png" /></figure><p>5. <a href="https://www.researchsquare.com/article/rs-2873090/v1">Utilize the Self-Reminder model.</a></p><p>6. When using RAG, provide a similarity_score_threshold. When using document-based searches like Amazon Kendra, you can hard-code responses to requests that do not match any documents in your index. Malicious requests are typically not going to be found in enterprise data stores used in RAG — therefore, searches for them will come back empty or with low similarity.</p><pre>##Example 1<br>retriever = db.as_retriever(<br>    search_type=&quot;similarity_score_threshold&quot;, <br>    search_kwargs={&quot;score_threshold&quot;: 0.5}<br>)<br><br>##Example 2<br><br>.......<br><br>llm_jurassic = Bedrock(<br>    client=bedrock_client,<br>    model_id=&quot;ai21.j2-ultra-v1&quot;,<br>    endpoint_url=&quot;https://bedrock-runtime.&quot; + REGION_NAME + &quot;.amazonaws.com&quot;,<br>    model_kwargs={&quot;temperature&quot;: 0.2, &quot;maxTokens&quot;: 1200, &quot;numResults&quot;: 1}<br>)<br><br>qnachain = ConversationalRetrievalChain.from_llm(<br>    llm=llm_jurassic,<br>    condense_question_llm=llm_jurassic,<br>    retriever=retriever,<br>    return_source_documents=True,<br>    condense_question_prompt=question_generator_chain_prompt,<br>    combine_docs_chain_kwargs={&quot;prompt&quot;: combine_docs_chain_prompt}<br>)<br><br>.......<br><br>llm_result = qnachain(input_variables)<br><br>.......<br><br>if(len(llm_result[&#39;source_documents&#39;]) &gt; 0):<br>    response_text = llm_result[&quot;answer&quot;].strip() <br>else:<br>    response_text = &quot;I don&#39;t know, no source documents matched your question&quot;</pre><h4>2. Insecure Output Handling</h4><blockquote>This vulnerability occurs when an LLM output is accepted without scrutiny, exposing backend systems. Misuse may lead to severe consequences like XSS, CSRF, SSRF, privilege escalation, or remote code execution.</blockquote><p>Insecure Output Handling is the result of inadequate validation, sanitation, and management of outputs generated by LLMs before they are sent downstream for further consumption or processing. This vulnerability arises because LLM-generated content can be influenced by user input, effectively granting indirect access to additional functionality.</p><p><strong><em>Potential Impact:</em></strong></p><p>Exploiting Insecure Output Handling can lead to security risks such as XSS and CSRF in web browsers, as well as SSRF, privilege escalation, or remote code execution in back-end systems. This vulnerability can be exacerbated by over-privileged LLM access, susceptibility to indirect prompt injection attacks, and insufficient input validation third-party plugins.</p><p><strong><em>Mitigations:</em></strong></p><p>Utilize a zero-trust approach and treat the LLM as an insider threat.</p><ol><li>Apply proper input validation on responses coming from the model to backend functions. OWASP recommends following their own ASVS guidelines— such as encoding all output text to prevent it from being executed automatically by JavaScript or Markdown.</li><li>If you are hosting a HTTP service that ingests output from an LLM. directly, implement AWS WAF to detect malicious requests in the application layer. If your HTTP service does not utilize an AWS WAF supported service such as ALB or API Gateway, implement application-layer protection utilizing a virtual appliance like Palo Alto NGFW or other mechanism.</li><li>If using Agents for Bedrock, consider enabling a Lambda parser for each of the templates to have more control over the logical processing.</li></ol><h4>3. Training Data Poisoning</h4><blockquote>This occurs when LLM training data is tampered, introducing vulnerabilities or biases that compromise security, effectiveness, or ethical behavior. Sources include Common Crawl, WebText, OpenWebText, &amp; books.</blockquote><p>Data poisoning is essentially an ‘integrity attack’ due to its disruptive influence on the fundamental capacity of our AI model to generate precise predictions. Introducing external data increases the risk of training data poisoning due to the limited control that model developers have over it.</p><p><strong><em>Potential Impact:</em></strong></p><p>Poisoned information may result in false, biased or inappropriate content be presented to users or create other risks like performance degradation, downstream software exploitation.</p><p><strong><em>Mitigations:</em></strong></p><ol><li>Verify supply chain of all training data used in embedding or fine-tuning.</li><li>Enable audit logging on all sources of training or RAG. For example: if using Amazon S3 (Bedrock Knowledge Bases or Amazon Kendra), enable Cloud Trail Data events for write events.</li><li>Enable strict access control on data sources. This includes using dedicated Service Roles for crawling data in Kendra or Bedrock Knowledge bases — with IAM Policies only allowing access to required sources.</li><li>Only use data that has been properly prepped via automation. Your data preparation process should include processes to identify and exclude anomalous data. AWS SageMaker Data Wrangler can greatly accelerate the data preparation process. Finalized data can be exported to S3 for consumption.</li><li>Test and document model performance prior to release. Include human review of responses made during testing.</li><li>Tools like <a href="https://github.com/azshue/AutoPoison">Autopoison</a> can also be used here for adversarial training to minimize impact of data poisoning.</li></ol><h4>4. Model Denial of Service</h4><blockquote>Attackers cause resource-heavy operations on LLMs, leading to service degradation or high costs. The vulnerability is magnified due to the resource-intensive nature of LLMs and unpredictability of user inputs.</blockquote><p>Model Denial of Service is similar to a network-based DoS attack — where repeated or very large requests can overwhelm LLM-based systems.</p><p><strong><em>Potential Impact:</em></strong></p><p>This can result in either completely disabling a service or runaway costs when using AWS services that charge for each request made such as Amazon Bedrock, Amazon Kendra, Amazon Bedrock Knowledge bases using OpenSearch Serverless (since it could potentially scale the required OCUs).</p><p><strong><em>Mitigations</em></strong>:</p><ul><li>Utilize maximum token limits which is supported by Langchain.</li></ul><pre>from langchain.llms.bedrock import Bedrock<br>import boto3<br><br>bedrock_client=boto3.client(&#39;bedrock-runtime&#39;)<br><br>#print(&#39;Initalizing Anthropic Claude v2.1&#39;)<br>llm_anthropic_claude21 = Bedrock(<br>    client=bedrock_client,<br>    model_id=&quot;anthropic.claude-v2:1&quot;,<br>    endpoint_url=&quot;https://bedrock-runtime.&quot; + REGION_NAME + &quot;.amazonaws.com&quot;,<br>    model_kwargs={&quot;temperature&quot;: 0.25, &quot;max_tokens_to_sample&quot;: 1000}<br>)</pre><ul><li>Implement a caching layer in your LLM client — this can prevent common queries from being repeatedly processed by your LLM. This is also supported by Langchain. Proper research should be done when selecting and deploying any caching solution. Langchain supports SQLLite, InMemory and GPTCache currently.</li></ul><pre>from langchain.cache import SQLiteCache<br><br>set_llm_cache(SQLiteCache(database_path=&quot;.langchain.db&quot;))</pre><ul><li>If feasible, proxy your Bedrock model with API Gateway and Lambda — then enabling AWS WAF with rate limiting, source IP restriction, or other relevant rules. Note: <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html">All Amazon Bedrock models have rate-limits specific to each model.</a> <em>Side note: would love to see AWS implement resource policies on Bedrock models/agents to more easily incorporate customized security.</em></li><li>Monitor usage closely using AWS CloudWatch with Anomaly Detection and create alarms.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkznKyCBVaBlzqTXHoOk8w.png" /></figure><h4>5. Supply Chain Vulnerabilities</h4><blockquote>LLM application lifecycle can be compromised by vulnerable components or services, leading to security attacks. Using third-party datasets, pre- trained models, and plugins can add vulnerabilities.</blockquote><p>Vulnerabilities within the supply chain of LLMs can pose significant risks, potentially compromising the integrity of training data, machine learning models, and deployment platforms. Such vulnerabilities may result in biased outcomes, security breaches, or even catastrophic system failures. While conventional security concerns often center on software components, Machine Learning introduces a distinct dimension by incorporating pre-trained models and training data supplied by third parties, making them susceptible to tampering and poisoning attacks. This highlights the need for robust security measures in the context of machine learning supply chains.</p><p><strong><em>Potential Impact:</em></strong></p><p>Using third-party software or components does not absolve anyone from responsibility when those third-party components introduce risk. Understanding the risks introduced by third-party components is critical for implementing proper security. This is true in standard software and AI-based systems.</p><p><strong><em>Mitigations:</em></strong></p><ol><li>Vet any third party provider and request all relevant xBOMs (bill of materials) — i.e., HBOM, SBOM, SaaS-BOM, ML-BOM for transparency into how the model was built. All of the foundation models in Bedrock have vendor provided Service Cards.</li><li>Follow all SDLC best practices — patching, SBOMs, code and model signing, etc.</li><li>Only enable the approved Bedrock LLMs.</li><li><a href="https://aws.amazon.com/blogs/machine-learning/introducing-aws-ai-service-cards-a-new-resource-to-enhance-transparency-and-advance-responsible-ai/">Review and document AWS Service Cards</a> for all AWS AI Services utilized by your stack. Document any relevant risks or limitations. Note: currently only Service Cards exist for non-LLM AI Services.</li><li>If developing your own LLM using AWS SageMaker, generate ML-BOMs or model cards for your LLM to track the lifecycle of your model.</li></ol><p><a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html">Amazon SageMaker Model Cards</a></p><h4>6. Sensitive Information Disclosure</h4><blockquote>LLMs may inadvertently reveal confidential data in its responses, leading to unauthorized data access, privacy violations, and security breaches. Its crucial to implement data sanitization and strict user policies to mitigate this.</blockquote><p>Data privacy is a critical concern when dealing with AI and machine learning systems. Ensure that data stored and processed by AWS AI services comply with data privacy regulations and use encryption and access controls to protect sensitive information.</p><p><strong><em>Potential Impact:</em></strong></p><p>Anytime sensitive data is leaked, whether through LLMs or other software solutions, it has the potential to harm any of the parties involved.</p><p><strong><em>Mitigations:</em></strong></p><ol><li>Do not use sensitive data to fine-tune models unless it is explicitly necessary. Currently, LLMs do not have the capability to incorporate access control to any data once it has been trained into it.</li><li>Limit sensitive data to RAG systems that support user-based access control.<a href="https://docs.aws.amazon.com/kendra/latest/dg/create-index-access-control.html"> Amazon Kendra supports token-based user access when searching documents. </a>This can ensure only information the user has access to are used when generating responses.</li><li>If using Amazon Lex and you do not wish store user utterances (e.g., a system used by children), enable “childDirected” — COPPA compliance — to not store any user utterances in the logs.</li><li>If you are logging utterances and LLM queries in CloudWatch, consider enabling CloudWatch Log Data Protection which automatically masks identified sensitive data in the log streams.</li><li>Limit access to data stores and vector databases. Remember vectorization/embedding is not encryption! Vectorized data can be susceptible to analytical attacks to potentially reverse engineer the original data.</li><li>If using Agents with Bedrock, consider enabling a Post-Processing template to add more logic in crafting your final response to the user. This can act as a final safeguard for stripping unnecessary/sensitive information.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WkXdGFX_et39iCyV2tn8Dw.png" /></figure><h4>7. Insecure Plugin Design</h4><blockquote>LLM plugins can have insecure inputs and insufficient access control. This lack of application control makes them easier to exploit and can result in consequences like remote code execution.</blockquote><p>Plugins are essentially a tool belt of processes that can be invoked by a model using agents, often transparently to the user, that help respond to complex queries more accurately.</p><p><strong><em>Potential Impact:</em></strong></p><p>Plugins can be exploited to extend the reach of a malicious attack. Any plugin accessible by a model agent is susceptible to mis-use — opening you up to remote code execution, data leakage, or privilege escalation.</p><p><strong><em>Mitigations:</em></strong></p><ol><li>Parameterize inputs to plugins as much as possible — similar to protecting against SQLi and XSS.</li><li>Sanitize and validate any input/output provided to/from a plugin — especially, if third-party. This can be done manually in the agent used to invoke your model or in Amazon Bedrock Agents using Advanced Prompt Parsing. Follow OWASP ASVS guidelines.</li></ol><h4>8. Excessive Agency</h4><blockquote>LLM-based systems may undertake actions leading to unintended consequences. The issue arises from excessive functionality, permissions, or autonomy granted to the LLM-based systems.</blockquote><p>The entire value proposition of using AI to streamline production with minimal human interaction. The more you want to off-load to the AI, the more access it requires. This is a balancing act and will certainly become more complicated and more difficult to control as the capabilities of AI grow in the coming years.</p><p><strong><em>Potential Impact:</em></strong></p><p>Excessive agency can result in a wide range of impacts depending on how the AI implementation — more specifically what tools and data sets it has access to.</p><p><strong><em>Mitigations:</em></strong></p><p>Incorporate least privilege at all layers.</p><ul><li>Only grant access to RAG systems or Knowledge Bases required for the specific process that is calling it.</li><li>Do not rely on your LLM for authorization, enforce authentication and authorization on all APIs accessed by LLM — third-party and internal.</li><li>Avoid open-ended/general purpose functions.</li><li>In Amazon Lex, avoid relying on the FallbackIntent. Codify all approved intents directly.</li><li>When using Agents for Bedrock, create dedicated API schemas for each Action Group. Create dedicated Lambda functions with dedicated roles for each Action Group.</li><li>Use adequate descriptions in your API schema so your agent can properly identify the proper method to pass the lambda function.</li><li>Only add tools and plugins that are necessary and</li><li>Limit what tools your LLM can access. This includes specifying only the required Lambda functions in your Agents service role. Your lambda function should also include execution logic for specific paths. Consider the following example from <a href="https://aws.amazon.com/blogs/aws/preview-enable-foundation-models-to-complete-tasks-with-agents-for-amazon-bedrock/">this AWS blog post</a>:</li></ul><pre>def lambda_handler(event, context):<br>    responses = []<br> <br>    for prediction in event[&#39;actionGroups&#39;]:<br>        response_code = ...<br>        action = prediction[&#39;actionGroup&#39;]<br>        api_path = prediction[&#39;apiPath&#39;]<br>        <br>        if api_path == &#39;/claims&#39;:<br>            body = open_claims() <br>        elif api_path == &#39;/claims/{claimId}/identify-missing-documents&#39;:<br>   parameters = prediction[&#39;parameters&#39;]<br>            body = identify_missing_documents(parameters)<br>        elif api_path == &#39;/send-reminders&#39;:<br>            body =  send_reminders()<br>        else:<br>            body = {&quot;{}::{} is not a valid api, try another one.&quot;.format(action, api_path)}</pre><h4>9. Over-reliance</h4><blockquote>Systems or people overly depending on LLMs without oversight may face misinformation, miscommunication, legal issues, and security vulnerabilities due to incorrect or inappropriate content generated by LLMs.</blockquote><p>Everyone who has played around with GenAI in any capacity has run into times when the AI was just flat out wrong. It does not have the information, tools, or context to provide the correct response so it just makes one up called “hallucinations”. It’s important to provide sanity checks on outputs — This differs from insecure output handling which is mainly about properly typing your outputs and making sure they do not introduce exploits down stream. Over-reliance is focused on validating the actual content generated by the AI.</p><p><strong><em>Potential Impact:</em></strong></p><p>Overly relying on AI increases the likelihood that hallucinations will affect your company or your users. This can include code generated by an AI that is automatically executed or natural language responses being fed to downstream processes in the AI or to users. This is why it is so important for AIs to maintain a “human-in-the-loop” for sanity checks during its use and development.</p><p><strong><em>Mitigations</em></strong><em>:</em></p><ol><li>Regularly review model outputs for consistency and accuracy.</li><li>Test prompts multiple times to ensure the prompt always gives you the desired response.</li><li>When using RAG, use similarity filters.</li><li><a href="https://docs.aws.amazon.com/kendra/latest/dg/tuning.html">If using Amazon Kendra, add metadata to your documents and tune your searches with metadata weighting and relevancy parameters.</a> <em>Side note: can’t recommend this enough — do not just crawl your docs blindly.</em></li><li><a href="https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html">If using Amazon Kendra, enrich your documents by removing unnecessary content or adding new content.</a></li><li>Always look to optimize your model and app — fine-tuning, prompt engineering, adversarial testing, updating vector databases and external document stores.</li><li>Break down complex tasks into individual chains or agents.</li><li>Always make the user aware they are interacting with an AI — Transparency is core of AI Ethical Use.</li><li>Optimize randomness parameters like Temperature, Top P, and Top K.</li><li>Enabling Guardrails for Bedrock can minimize the risk your AI generates inappropriate content. (You do not want to rely on your AI to do this by itself.)</li><li>Add checks against trusted external sources for LLM outputs.</li></ol><h4>10. Model Theft</h4><blockquote>This involves unauthorized access, copying, or exfiltration of proprietary LLM models. The impact includes economic losses, compromised competitive advantage, and potential access to sensitive information.</blockquote><p>Protect your Intellectual Property! Model theft is not just ensuring the actual code of your model is kept safe; it also entails sending a high volume of carefully crafted prompts used by an attacker to partially reverse engineer your model — e.g., weights and parameters used, training data sources, foundation models etc.</p><p><strong><em>Potential Impact:</em></strong></p><p>If a competitor gets access to your model, it can potentially put you out of business by either offering the same product for cheaper or impersonating you in some way and cause reputational damage.</p><p>Mitigations:</p><ol><li>Use a centralized ML Model Inventory or Registry for ML models. <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry.html">AWS Sagemaker</a> has a model registry that enforces access control.</li><li>Develop and deploy models solely using ML Ops Pipelines. This includes training data, testing data, and RAG Source Data. This helps limit the identities that require access.</li><li><a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-version.html#model-registry-version-xaccount">Apply resource policies on your model registry to prevent access from unauthorized accounts. Monitor updates to these resource policies.</a></li><li>If using fine-tuned models Amazon Bedrock, put bucket policies on the training data to ensure only authorized individuals and processes are allowed. Monitor updates to these bucket policies.</li><li><a href="https://arxiv.org/pdf/2301.10226.pdf">Implement a watermark</a>.</li><li>Monitor query frequency of individual users and alert on anomalies. If using Amazon Lex, make sure you are receiving the userId in the logs. If you are receiving it, it may require enriching with third party API’s when alerting— e.g., userID = 383j10d for an actual user jsmith@domain.com.</li><li>Enable CloudTrail Data Events for Read events on your S3 buckets with proprietary data — training, RAG sources, etc. Ingest these events into your SIEM to identify authorized access.</li><li>Use Service Control Policies to ensure that Bedrock is only used in approved accounts in your organization.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*XePTUBp4msTaKJLvQMpggA.png" /><figcaption>A sample architecture with hotspots where different vulnerabilities can be introduced that must be accounted for in any implementation</figcaption></figure><p><strong><em>Conclusion</em></strong></p><p>As AI becomes increasingly integrated into our digital lives, the security of AI systems is of paramount importance. Cloud service providers like AWS offer a robust set of native AI services, but it’s crucial to be aware of the security challenges and risks associated with implementing and configuring real-world solutions utilizing these services. However, as a solutions specialist it is important to stay abreast of emerging standards and practices in the area of AI risk management. The OWASP LLM Top 10 provides valuable insights into potential threats and vulnerabilities that should not be overlooked.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a8d2c4e34e5" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/understanding-ai-risk-management-securing-cloud-services-with-owasp-llm-top-10-0a8d2c4e34e5">Understanding AI Risk Management — Securing Cloud Services with OWASP LLM Top 10</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Git Repo of Jupyter Notebooks for an Intro to GenAI on Bedrock]]></title>
            <link>https://itnext.io/new-git-repo-of-jupyter-notebooks-for-an-intro-to-genai-on-bedrock-9030695d512d?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/9030695d512d</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 16:27:34 GMT</pubDate>
            <atom:updated>2024-01-04T21:36:16.923Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a lot of folks who are looking to break into GenAI; however, there are a lot of concepts to learn, and it may be overwhelming. This was definitely the case for me, so I thought it would be helpful to document the concepts as I learned them in jupyter notebooks and share them. It’s mainly framed around using AWS Bedrock. My goal was to make the concepts covered very simple so people newer to the field can digest them.</p><h4>Topics Covered Thus Far:</h4><ol><li>Chaining</li><li>Agents</li><li>Custom Tools</li><li>Streaming</li><li>Prompting</li><li>OutputParser</li></ol><h4>Topics Planned:</h4><ol><li>Agents for AWS Bedrock</li><li>More complex chaining</li><li>More examples of tools.</li></ol><p>I am happy to receive any feedback or requests on labs. This is a pet project, so I cannot guarantee a timeline on any requests, but I will do my best!</p><p><a href="https://github.com/vennemp/ai-jupyter-notebooks">https://github.com/vennemp/ai-jupyter-notebooks</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9030695d512d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/new-git-repo-of-jupyter-notebooks-for-an-intro-to-genai-on-bedrock-9030695d512d">New Git Repo of Jupyter Notebooks for an Intro to GenAI on Bedrock</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a RAG-enabled ChatBot using AWS Bedrock, Lex, and Kendra]]></title>
            <link>https://itnext.io/building-a-rag-enabled-chatbot-using-aws-bedrock-lex-and-kendra-3add845e5ad6?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/3add845e5ad6</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 22:00:33 GMT</pubDate>
            <atom:updated>2023-12-14T03:40:56.040Z</atom:updated>
            <content:encoded><![CDATA[<p>In case you haven’t heard, GenAI is the bees knees. When used properly, it can accelerate work product tremendously. Most folks are aware of OpenAI ChatGPT and Google Bard, but what about building your own custom ChatBot to accelerate your work? AWS offers several service offers that accelerate AI development. Today we’re going to be examining these services and I integrated them into our solution.</p><h4>What is Amazon Lex?</h4><p>Amazon Lex is a service for building chatbots using voice and text that leverages the same conversation engine as Amazon Alexa. It natively integrates with Slack, FaceBook Messenger, Kik, and Twilio SMS. It even offers a visual IDE for desiging your chatbots — similar to Step Functions Workflow Studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*2H2jOgYvbmKFZX4x.png" /><figcaption>From AWS Lex documentation.</figcaption></figure><p>A high level of how it works:</p><ol><li>It takes a user input and sends it to the chatbot.</li><li>The chatbot then looks to define the “intent” of the user. Each chatbot can have one or multiple intents. It uses Natural Language Processing and Automatic Speech Recognition to identify the intent by comparing it to different key words that you define for each intent. For example, if you wanted to order Taco Bell, you may have the following phrases defined: “order Taco Bell”, “Crunchwrap Supreme”, “Cheesy Gordita Crunch”.</li><li>It then executes the desired action — the Chatbot can respond with static content or execute a Lambda function to fulfill the intent. You u can define Slots to have Lex prompt the user for missing information to fulfill their intent — for example delivery location, order location, how many chalupas? etc.</li></ol><h4>What is Amazon Kendra?</h4><p>Amazon Kendra is an AI-driven enterprise search service that enables searching across different content repositories with built-in connectors. S3, SharePoint, Box, Confluence, Jira, SalesForce are just a few of locations with built-in support.</p><p>However, you can also use Amazon Kendra for <strong><em>Retrieval Augmented Generation</em></strong> — to enrich the chat bot’s performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*w7a3acjkkGKS7uOtzAidzw.png" /><figcaption>Here is the architecture of the chatbot I built using AWS Native Services to answer questions using data from our internal Confluence to augment the response.</figcaption></figure><p>Retrieval Augmented Generation (RAG) is one means of incorporating custom data into a foundational model. This requires no re-training of the models; instead, it takes a vector representation of the user prompt and passes it to a database that has data mapped according to this vectorization — This is how Kendra can enrich a prompt before passing it to the LLM. The other options for enriching a foundational model’s output is through fine-tuning which requires re-training a model with labeled data stored in S3 — this requires Provisioned Throughput.</p><p>RAG is typically quicker to implement but slower in performance since it must query the external database every time. Fine-tuning typically requires more time to implement but is more more performant. It is possible to incorporate both techniques in a single AI system.</p><p>Note: Bedrock does have limited support for Continued Pre-training using unlabeled data but this is in Preview and only supported on the Titan Text Express model.</p><h4>What is Amazon Bedrock?</h4><p>Amazon Bedrock is a serverless, AI solution that offers streamlined access to many leading LLMs for testing — Anthropic, Amazon, AI21 Labs, and Meta are a few providers. It supports fine-tuning to customize your models and also R.A.G. with the following methods:</p><ol><li>Knowledge Bases —Fully Managed RAG — Store your data in S3 and Bedrock automates the end-to-end RAG workflow, including ingestion, retrieval, prompt augmentation, and citations, eliminating the need for you to write custom code to integrate data sources and manage queries. For the vector database, it supports OpenSearch Serverless, Redis Enterprise Search, and Pinecone — with Aurora and MongoDB coming soon. Amazon can automatically create an OpenSearch Serverless DB for your to start or you can use an existing vector DB from one of the supported options.</li><li>Custom — if getting your data into S3 is not feasible, rolling your own RAG solution is always an option. This is the pattern I used — since my data was in Confluence Cloud which had a native connector for Kendra. However, Kendra can be quite expensive — over $1000/month base cost. So we will examine building a data pipeline to get our data into S3 so we can leverage Knowledge Bases directly.</li></ol><h4>Building the Bot</h4><p>My company asked me to research some Generative AI solutions that we could leverage to accelerate our work product. I wanted to have a POC in place quickly so I could show the capabilities to our leadership by end of the week. Most of the services I used were brand new to me — conceptually all of the AWS Services made sense but learning the nuances of them is always the hard part.</p><p>The first step was to ingest the data into Kendra using one of their connectors. I found this blog by AWS that outlined the process.</p><p><a href="https://aws.amazon.com/blogs/machine-learning/index-your-confluence-content-using-the-new-confluence-connector-v2-for-amazon-kendra/">Index your Confluence content using the new Confluence connector V2 for Amazon Kendra | Amazon Web Services</a></p><p>The next step was step was to build the Chatbox. I found this AWS Sample to get me started.</p><p><a href="https://github.com/aws-samples/amazon-bedrock-kendra-lex-chatbot">GitHub - aws-samples/amazon-bedrock-kendra-lex-chatbot: The repository offers a base implementation of incorporating an Amazon Bedrock based chatbot with Amazon Lex.</a></p><p>A few things before running the template:</p><ol><li>I reviewed the Lambda config and the CloudFormation template to make sense of it. I was curious how the lambda was accessing Kendra and Bedrock. It used <em>langchain</em> which is a common SDK for various LLMs — it has many integrations built to simplify running inferences, embeddings, and more.</li><li>I had to make some slight modifications since the template also created the Kendra Index. This was already created in previous step.</li><li>The Lex bot definition included a few unneeded intents around resetting passwords etc.</li><li>Building and pushing the custom docker image for the Lambda into ECR.</li><li>Requesting access to the AL21 Labs Jurassic models in Bedrock. This was approved quickly.</li></ol><p>I deployed the template and was ready to move to the next step — the slack integration. Lex supports OAuth for authenticating Slack and other external systems.</p><p><a href="https://slack.com/help/articles/202035138-Add-apps-to-your-Slack-workspace">Add apps to your Slack workspace</a></p><p>I tested it out and after about 10 seconds it returned a response!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PareW6IDhCUxfYTFfIkg6A.png" /></figure><h4>Next Steps:</h4><ol><li>I will be exploring Bedrock Knowledge Bases for RAG as a way to keep costs down. This will likely require re-factoring the Lambda.</li><li>Examine what other data sources we can use. We are leaning towards strictly public at this time — as other internal data sources have sensitive information and we do not want to expose that data in a potential leak. Also, we considered the ethical ramifications of using sensitive data without approval from the relevant parties.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3add845e5ad6" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/building-a-rag-enabled-chatbot-using-aws-bedrock-lex-and-kendra-3add845e5ad6">Building a RAG-enabled ChatBot using AWS Bedrock, Lex, and Kendra</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Risk Assessment Standards for Deploying Safe & Ethical AI Systems]]></title>
            <link>https://itnext.io/understanding-risk-assessment-standards-for-deploying-safe-secure-ai-systems-53e4a66b8fc1?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/53e4a66b8fc1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ethics]]></category>
            <category><![CDATA[ieee]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 00:00:16 GMT</pubDate>
            <atom:updated>2023-12-31T16:24:23.458Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s no secret that Cloud 2.0 will be driven by Artificial Intelligence (AI). The rate at which the world is adopting AI-based solutions is nothing short of staggering; what was once viewed as science fiction, is quickly becoming science fact. With each AI system that gets deployed into the world, another machine takes ownership of decisions previously made by a human. We are currently seeing AI being adopted across all sectors of life: self-driving cars, college admissions, housing applications, the defense industry and more. This presents unique challenges and risks that require new thought leadership to properly assess and mitigate.</p><p>What happens if:</p><p>· An Autonomous Intelligence System (AIS) used for college admissions incorporates a bias against any demographic?</p><p>· An AI-powered smartwatch discovers its owner has a condition they wanted to keep private?</p><p>· An AIS escalates its own privileges to access unauthorized systems and/or services?</p><p>The risk and implications for government agencies and public sector agencies responsible for regulating healthcare, education and wide sections of the US economy are profound. To help answer these questions for organizations especially in highly regulated markets, stackArmor has focused on developing a standards-based governance model that is rooted in National Institute of Standards &amp; Technologies (NIST) frameworks including AI Risk Management Framework (RMF), NIST RMF and NIST SP 800–53. NIST AI RMF provides a starting point for understanding risk vectors and how to go about risk mitigations. We believe that training and equipping existing IT and Cybersecurity risk assessors with additional understanding of AI specific challenges like safety, bias and explainability will accelerate safe adoption of AI systems. However, there aren’t many standards to go by for helping train the next generation of AI-smart assessors and risk management professionals. Fortunately, we found a course from Institute of Electrical and Electronics Engineers (IEEE) to become a CertifAIEd™ Ethical AI Assessor.</p><p>In this blog we outline our experiences with the IEEE <strong>CertifAIEd</strong>™<strong> </strong>program and how FedRAMP, FISMA and Cybersecurity/IT systems risk management professional can evolve their skills to be relevant in an AI-powered world.</p><p><strong>What is the IEEE CertifAIEd</strong>™<strong>?</strong></p><p>In the IEEE’s own words:</p><blockquote><em>IEEE CertifAIEd</em>™<em> is a certification program for assessing ethics of AIS to help protect, differentiate, and grow product adoption. The resulting certificate and mark demonstrates the organization’s effort to deliver a solution with </em><a href="https://engagestandards.ieee.org/rs/211-FYL-955/images/AI%20Ethics%20for%20Solution%20Developers.pdf"><em>a more trustworthy AIS experience to their users</em></a><em>.</em></blockquote><blockquote><em>Through certification guidance, assessment and independent verification, IEEE CertifAIEd offers the ability to scale responsible innovation implementations, thereby helping to increase the quality of AIS, the associated trust with key stakeholders, and realizing associated benefits.</em></blockquote><p>An IEEE CertifAIEd™ assessment is framed around 4 Core Ontologies:</p><blockquote>1. <strong>Transparency</strong> –An AIS must be fully open and honest about its processes. This includes mechanisms to explain how each AI decision was made and the confidence in the system’s performance through training and testing. One way to look at it: can a user reasonably expect the AIS to perform in a predictable manner and what is the evidence of this?</blockquote><blockquote>2. <strong>Accountability</strong> — An AIS must take ownership of its decision-making process — both technically and organizationally. For example, if the AIS returns a potentially damaging result — what mechanisms does the organization have in place for mitigation? Who is responsible? Does the user have ability to refute the result? Is there a human-in-the-loop to oversee the training, testing, and actual results?</blockquote><blockquote>3. <strong>Privacy</strong> –Mechanisms must be in place to protect the user and the data they provide to the AIS. This includes user anonymity and confidentiality. What happens to a user’s data when they stop using the AIS?</blockquote><blockquote>4. <strong>Algorithmic Bias</strong> –Processes and policies should be implemented around the use of protected characteristics to ensure they treat all users fairly — regardless of gender, religion, race, sexual preference, etc. An organization may be required to demonstrate their existing policies that show why the use of the characteristics is required in the model and how they help the organization achieve their desired goals. From a technical perspective, organizations may be required to demonstrate the mechanisms used to ensure that each protected characteristic is not over/or undervalued during tuning, training, and testing of the AIS.</blockquote><p><strong>How do IEEE CertifiAIEd</strong>™<strong> assessments run?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*HyS42cuFf38PeKTDpvtTjg.png" /><figcaption>Here is a theoretical chatbot that a utility company uses to respond to user requests. The chatbot is powered by AWS Bedrock and leverages Retrieval Augmented Generation. Several ethical questions about the system are called out.</figcaption></figure><p>Figure 1: Here is a theoretical chatbot that a utility company uses to respond to user requests. The chatbot is powered by AWS Bedrock and leverages Retrieval Augmented Generation. Several ethical questions about the system are called out.</p><p>Assessments are performed by teams of CertifAIEd™ Assessors lead by a CertifAIEd™ Lead Assessor, which is an official designation given to the most experienced and adept assessors. Ideally, the assessment teams are comprised of assessors with a wide range of backgrounds and experience.</p><p>Each of the four ontologies has its own list of drivers and inhibitors, which are specific criteria that must be accounted for and documented during the assessment.</p><blockquote>· <strong>Drivers</strong> — Demonstrate how the AIS strives towards the embodiment of the ontology — the more evidence of drivers the better.</blockquote><blockquote>· <strong>Inhibitors</strong> — Demonstrate how the AIS does NOT embody the ontology — the less evidence of inhibitors the better.</blockquote><p>The number of drivers and inhibitors required for the assessment is dependent on the level of impact an AIS could have on the given ontology. It is the job of the assessor to determine the level of impact based on the likelihood of an AIS impacting the ontology and the severity that impact will have</p><p>The following is an example of a driver under the Transparency ontology:</p><p><strong>Organizational governance, capability, and maturity</strong> — This comprises the capability, maturity, and intent of the development organization in having the right motivation and resources, processes, and so forth to achieve transparency.</p><p>Here is an example of an inhibitor under the Transparency ontology:</p><p><strong>Concern with liability</strong> — The service provider’s awareness of potential risk exposure, and delivery of bare minimum (or inadequate) information to manage the risk. This could include legal, commercial, financial, and human intervention dimensions.</p><p>Additionally, each driver and inhibitor have Ethical Foundational Requirements (EFRs) which are individual evidentiary requirements that must be provided to the assessor. IEEE provides several EFRs for each driver/inhibitor by default to frame the assessment properly; however, the assessor does have the ability to customize the EFRs for each AIS which helps frame the discussion and assessment around the individual system.</p><p>Each EFR is then mapped to the Duty Holder responsible for providing the evidence:</p><p><em>· </em><strong><em>Developer </em></strong><em>— the person(s) who developed and designed the AIS.</em></p><p><em>· </em><strong><em>Integrator </em></strong><em>— the person(s) who deployed/integrated the AIS.</em></p><p><em>· </em><strong><em>Operator </em></strong><em>— the person(s) responsible for day-to-day operations of the AIS.</em></p><p><em>· </em><strong><em>Maintainer </em></strong><em>— the person(s) responsible for monitoring behavior of the AIS, performing system and model updates etc.</em></p><p><em>· </em><strong><em>Regulator </em></strong><em>— the person(s) responsible for enforcing laws, standards, and regulations that are relevant to the AIS.</em></p><p>Some EFRs may require input from all duty holders or a subset. It is possible that one person or group of people acts as multiple duty holders, depending on the implementation. This helps ensure that the proper entity is tasked with providing the evidence.</p><p>Once the assessment is complete, a report is submitted to the owner of the AIS being assessed and to an IEEE CertifAIEd™ Certifier. The certifier, which is a separate entity, reads the assessment and the recommendation of the assessor and makes a final decision on whether the AIS meets the ethical requirements of the ontologies.</p><p>The CertifAIEd™ program was first finalized in 2021 and <a href="https://standards.ieee.org/beyond-standards/the-ieee-certifaied-framework-for-ai-ethics-applied-to-the-city-of-vienna/?_gl=1*122c0ul*_ga*MTc2MDIyNDkuMTY5OTg0NTU5Nw..*_ga_M0JHQYTS84*MTcwMTk3MTU3My4yLjAuMTcwMTk3MTU3NC41OS4wLjA">there is a public blog</a> regarding the first ethical assessment of an email classification system used by the City of Vienna, Austria.</p><p><strong>My experiences with the course</strong></p><p>I just missed the opportunity to enroll in a course in a US time zone. The next one was in Singapore time — 13 hours ahead of Eastern Time! I was hungry for knowledge, so I enrolled in the course anyways. The course ran 4 days (nights?) in a row from 8PM-4AM.– During that time, plenty of caffeine was consumed, I assure you, as I was still working my regular day job during the week. All the other enrollees were overseas, mostly Australia, China, and Europe. The course itself was hosted on Zoom and was both instructor-led and interactive. The instructors were CertifAIEd™ Lead Assessors, very friendly, and knowledgeable regarding the process.</p><p><strong>Day 1 — </strong>The instructors outlined the overall CertifAIEd™ program and the importance of ethical assessment of AIS. There was a high-level discussion on the 4 ontologies, concluding with a workshop where the students broke up into groups and discussed how they would assess a theoretical AIS. Each group presented their thought process to the others and the trainers orchestrated a discussion. A big theme the trainers kept coming back to was “Why?”. Why did you choose this phrase? Why did you map it to this duty holder? Why did you customize this EFR? Why did you give the system a High impact?</p><p><strong>Day 2</strong> — Took a deep dive into Transparency and Accountability. Transparency is the most foundational of the ontologies, according to IEEE; with the other three ontologies having been derived from it. After reviewing each ontology in detail, we again separated into groups to assess another AIS through the Transparency and Accountability lenses respectively.</p><p><strong>Day 3</strong> — Retained the same deep dive and team review structure of Day 2 but, focused on Privacy and Algorithmic Bias.</p><p><strong>Day 4</strong> — Focused on the final exam, which I am glad to say I passed! What I appreciated most about the final exam was that it was not a regurgitation of facts, but rather focused on demonstrating what my thought process would be as a CertifAIEd™ Assessor evaluating and AIS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*j3ZpdpLBdWkdgD3FgMgnGw.png" /><figcaption>Will update the blog once/if I am accepted as an official Assessor.</figcaption></figure><p><strong>What’s next?</strong></p><p>For me, the next step is to submit an application to IEEE to become an official Assessor. Once my application is evaluated, I would then be interviewed by a panel of CertifAIEd™ assessors who will consider my final exam results, interview responses and application to determine if I am qualified to become an IEEE CertifAIEd™ Assessor. Whether or not I am formally accepted as an assessor, this was one of the most fulfilling experiences of my career and it excites me to be better equipped for an AI-driven world.</p><p>As a senior technologist and solutions architect responsible for designing and implementing solutions that comply with FedRAMP, FISMA, DOD and CMMC 2.0 standards amongst others, it is critical to understand and incorporate secure and safe design principles right from the beginning. By understanding how risk assessments are performed, I can incorporate a lot of these learnings and perspectives into core systems design and implementation into a governance model we at stackArmor call ATO for AI™.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53e4a66b8fc1" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/understanding-risk-assessment-standards-for-deploying-safe-secure-ai-systems-53e4a66b8fc1">Understanding Risk Assessment Standards for Deploying Safe &amp; Ethical AI Systems</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step Functions re:Invented]]></title>
            <link>https://itnext.io/step-functions-re-invented-2581fe7cd458?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/2581fe7cd458</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[step-functions]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 19:32:33 GMT</pubDate>
            <atom:updated>2023-12-07T19:10:34.287Z</atom:updated>
            <content:encoded><![CDATA[<h4>Testing out the new Step Function features announced at AWS re:Invent 2023</h4><p>re:Invent 2023 is officially in the books! I was in attendance and I can assure you I was wearing the Gold Jacket proudly all weekend long. Luckily for you all, I’ll spare you a full re:Cap this time around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-DMY_tISw7gcwZBHSk0VnA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*0i-TPBqwKLM47YDdNFk9bQ.jpeg" /><figcaption>(Left)Here I am with AWS Ambassador and Gold Jacket owner, Sammy Cheung. (Right) We tried to get all of the Golden Jacket owners who were in attendance for a group photograph. Let’s make it twice as big next year! the focus of this year’s re:Invent was undoubtedly how AWS is expanding their AI services — primarily Generative AI. That is not to say that there were not significant non-AI announcements. <a href="http://Why Step Functions is the Best AWS Service You Are Not Using">I’ve blogged previously about Step Functions</a> and two of the new features that were announced regarding Step Functions caught my eye:</figcaption></figure><ol><li>Native Step Function Action to make HTTP Request to Third Party API. — No need to write Lambda functions to do this anymore — for most use cases.</li><li>Test State: You can now individual test a state without running the entire state machine!</li></ol><p>This came at a perfect time as I was in the process of writing a State Machine for one of my customers. We are in the process of a Cloud Endure to AWS Elastic Disaster Recovery upgrade since Cloud Endure is EOL very soon. Stay tuned for another blog regarding this once we are done.</p><p>One of their requirements was their Recovery VPC should have semi-isolated (bubble) subnets for testing— the idea being it should not have full routability to their on-prem network. Some of their workloads were Windows and restoring a Windows VM could cause AD to recognize the newly restored server and not the source server. However, those servers would need to route to Entra ID (previously Azure AD) since the applications on those servers leveraged Entra ID Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*LWVMezlkLCOLxeIN8gcGEA.png" /></figure><p>Luckily, Microsoft publishes their IP range in a publicly accessibly URL. However, the IP list is large (over 100 different CIDRs) and it changes periodically.</p><p>I immediately thought the new Third Party API HTTP integration with Step Functions would be a great way to programmatically grab those URLs.</p><p>A few comments on the new Third Party API HTTP integration:</p><ol><li>It leverages EventBridge Destinations (previously introduced to store API authentication information, for EventBridge third party API access).</li><li>This stores the creds in a secret in Secrets Manager — however, this secret is free.</li><li>This Event Bridge destination is required even for unauthenticated APIs like this particular use-case with Microsoft. I just put dummy values for the user name and password.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PW0Qpym5azKih2gvax5tw.png" /><figcaption><em>Note: It would nice if they made the EventBridge Destination optional for unauthenticated API, since it requires unnecessary resources and more IAM permissions on the StateMachine Role.</em></figcaption></figure><p>Ultimately, I was not able to leverage the Third Party API Integration with Step Functions since it ran into the upper limit of Task Result size (256 KB) that my API Request was apparentty hitting. The response was 3.3 MB. Unfortunately, there was no way to filter the response on the HTTP request task. So I had to just a write a Lambda function. It would be nice if Step Functions enabled you to filter the JSON that is returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7Zg6t6wRArx4085r8QYdw.png" /></figure><pre>  Lambda:<br>    Type: AWS::Lambda::Function<br>    Properties:<br>      Role: !GetAtt LambdaRole.Arn<br>      Timeout: 300<br>      Handler: index.lambda_handler<br>      Runtime: python3.10<br>      Environment:<br>        Variables:<br>          URL: !Ref URLParameterName<br>      Code:<br>        ZipFile: |<br>          import boto3,os,urllib,json<br>          ssm=boto3.client(&quot;ssm&quot;)<br>          mainurl=ssm.get_parameter(Name=os.environ[&#39;URL&#39;])[&#39;Parameter&#39;][&#39;Value&#39;]<br><br>          def lambda_handler(event, context):<br>              response=urllib.request.urlopen(mainurl).read()<br>              filter=json.loads(response.decode(&#39;utf-8&#39;))[&#39;values&#39;]<br>              for i in filter:<br>                  if i[&#39;name&#39;] == &#39;AzureActiveDirectory&#39;:<br>                      result=i[&#39;properties&#39;][&#39;addressPrefixes&#39;]<br>              return result</pre><p>However, the Test State was much more useful this time around. You can test out all of your Input and Output processing in the state as well as your actual parameters. You can even specify a State input to test specific scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I3T5Q6aTzy6nljPcoDmBGw.png" /><figcaption>Here is the screen showing the Task output from the test. You can expand the JSON nodes as needed.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lKoFEiNZHlfUf5Lq1XUFA.png" /><figcaption>Here is the screen showing the Input/Output processing logic. You can expand the JSON nodes as needed.</figcaption></figure><p>Here is the final diagram of the flow chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nb8RkTYl1JpJf6AYAif7oQ.png" /></figure><ol><li>It starts by creating the new route table for the bubble subnets. This value must be passed down to the Parallel state since this new Route Table needs the routes added and needs to be associated with the proper subnets.</li><li>It then queries the Azure AD IPs — the lambda was able to filter the returned response.</li><li>It passes this list to the the parallel state which has two branches:</li></ol><p>1. Branch 1</p><ul><li>Loop through the CIDRs and add them to the route table created in the first step. This value was passed down from the previous step using ItemSelector to define a custom object for looping. Each iteration required the static value of the new Route Table but also the dynamic value of the CIDR block.</li><li>I used the new-ish error handling features of Step Functions to account for the different parameter names for IPv4 and IPv6 CIDRs — rather than trying to parse them myself.</li><li>We had to update the Service Quota for Routes per Route Table since the default is only 50. This could have performance implications for traffic into and out of the subnets associated with this larger route table — since the VPC router will have more routes to parse.</li></ul><p>2. Branch 2</p><ul><li>Wait 5 seconds so it does not associate the new route table prior to the Routes being added.</li><li>I have the existing Bubble route table ID stored as an SSM parameter, so I query that.</li><li>I then describe this route table to get all of the associations for that route table so I can iterate over them with a Map state.</li><li>This was interesting I had never directly run the ReplaceRouteTableAssociation API Action. I originally thought I would use the CreateRouteTableAssociation and it would overwrite the old association but this is not the case. The ReplaceRouteTableAssociation is what was needed and requires the existing AssociationId (one per subnet) and the new RouteTableId. The new Route Table ID was passed down from a previous step using ItemSelector to define a custom object for looping.</li></ul><p>4. Next it grabs the SSM Parameter storing the existing route table ID. I didn’t pass the previous GetParameter for this downstream since it would nested in a MapState and Parallel State. Would love global variables for this…</p><p>5. It then runs another parallel action</p><ol><li>Branch 1</li></ol><ul><li>Update the SSM parameter for the existing route table to store the value of the route table created in this iteration. This is so subsequent executions of the State Machine have no issues.</li></ul><p>2. Branch 2</p><ul><li>Delete the old route table.</li><li>I elected for the route table swap rather than overwriting the existing route table so I didn’t have to delete invalid routes and have error logic for routes that are still valid.</li></ul><p>Here is the full definition of my State Machine in CloudFormation. Side note: love the new intrinisic CFN function JsonToString!</p><pre>  StateMachine:<br>    Type: AWS::StepFunctions::StateMachine<br>    Properties:<br>      StateMachineName: AzureADRouteUpdate<br>      RoleArn: !GetAtt StateMachineRole.Arn<br>      DefinitionString:<br>        Fn::ToJsonString:<br>            Comment: A description of my state machine<br>            StartAt: CreateNewBubbleRouteTable<br>            States:<br>              CreateNewBubbleRouteTable:<br>                Type: Task<br>                Next: Query Azure AD IPs<br>                Parameters:<br>                  VpcId: !Ref VPC<br>                  TagSpecifications:<br>                    - ResourceType: route-table<br>                      Tags:<br>                        - Key: Name<br>                          Value: !Sub ${VPCName}-bubble-rt<br>                Resource: arn:aws:states:::aws-sdk:ec2:createRouteTable<br>                ResultSelector:<br>                  NewRouteTable.$: $.RouteTable.RouteTableId<br>              Query Azure AD IPs:<br>                Type: Task<br>                Resource: arn:aws:states:::lambda:invoke<br>                Parameters:<br>                  FunctionName: arn:aws:lambda:us-east-1:******:function:routing-statemachine-Lambda:$LATEST<br>                  Payload.$: $<br>                Retry:<br>                  - ErrorEquals:<br>                      - Lambda.ServiceException<br>                      - Lambda.AWSLambdaException<br>                      - Lambda.SdkClientException<br>                      - Lambda.TooManyRequestsException<br>                    IntervalSeconds: 1<br>                    MaxAttempts: 3<br>                    BackoffRate: 2<br>                ResultPath: $.Result<br>                ResultSelector:<br>                  CIDRs.$: $.Payload<br>                Next: Parallel<br>              Parallel:<br>                Type: Parallel<br>                Next: GetParameter<br>                Branches:<br>                  - StartAt: Loop Through IPs<br>                    States:<br>                      Loop Through IPs:<br>                        Type: Map<br>                        ItemProcessor:<br>                          ProcessorConfig:<br>                            Mode: INLINE<br>                          StartAt: CreateIPv4Route<br>                          States:<br>                            CreateIPv4Route:<br>                              Type: Task<br>                              End: true<br>                              Parameters:<br>                                RouteTableId.$: $.NewRouteTable<br>                                DestinationCidrBlock.$: $.CIDRs<br>                                GatewayId: !Ref TGW<br>                              Resource: arn:aws:states:::aws-sdk:ec2:createRoute<br>                              Catch:<br>                                - ErrorEquals:<br>                                    - States.TaskFailed<br>                                  Next: CreateIPv6Route<br>                                  ResultPath: $.Input<br>                            CreateIPv6Route:<br>                              Type: Task<br>                              Parameters:<br>                                RouteTableId.$: $.NewRouteTable<br>                                DestinationIpv6CidrBlock.$: $.CIDRs<br>                                GatewayId: !Ref TGW<br>                              Resource: arn:aws:states:::aws-sdk:ec2:createRoute<br>                              End: true<br>                        ItemSelector:<br>                          NewRouteTable.$: $.NewRouteTable<br>                          CIDRs.$: $$.Map.Item.Value<br>                        ItemsPath: $.Result.CIDRs<br>                        End: true<br>                        ResultPath: $.MapResult<br>                        OutputPath: $.NewRouteTable<br>                  - StartAt: Wait<br>                    States:<br>                      Wait:<br>                        Type: Wait<br>                        Seconds: 5<br>                        Next: GetRouteTable<br>                      GetRouteTable:<br>                        Type: Task<br>                        Next: DescribeRouteTables<br>                        Parameters:<br>                          Name: bubble-rt<br>                        Resource: arn:aws:states:::aws-sdk:ssm:getParameter<br>                        ResultSelector:<br>                          ExistingRouteTable.$: $.Parameter.Value<br>                        ResultPath: $.Result<br>                      DescribeRouteTables:<br>                        Type: Task<br>                        Next: Map<br>                        Parameters:<br>                          RouteTableIds.$: States.Array($.Result.ExistingRouteTable)<br>                        Resource: arn:aws:states:::aws-sdk:ec2:describeRouteTables<br>                        ResultPath: $.Output<br>                      Map:<br>                        Type: Map<br>                        ItemProcessor:<br>                          ProcessorConfig:<br>                            Mode: INLINE<br>                          StartAt: ReplaceRouteTableAssociation<br>                          States:<br>                            ReplaceRouteTableAssociation:<br>                              Type: Task<br>                              Parameters:<br>                                AssociationId.$: $.RouteTableAssociationId<br>                                RouteTableId.$: $.NewRouteTable<br>                              Resource: arn:aws:states:::aws-sdk:ec2:replaceRouteTableAssociation<br>                              End: true<br>                        End: true<br>                        ItemsPath: $.Output.RouteTables[0].Associations<br>                        ItemSelector:<br>                          NewRouteTable.$: $.NewRouteTable<br>                          RouteTableAssociationId.$: $$.Map.Item.Value.RouteTableAssociationId<br>                ResultPath: $.MapResult<br>                ResultSelector:<br>                  ValueEnteredInForm: &#39;&#39;</pre><h4>Final Thoughts:</h4><p>Just summarizing some things I’d like to see next from the Step Functions Team.</p><ol><li>Create Global Variables!!! It would nice if we could store values from previous tasks as a global variable rather than having to pass them down through several tasks.</li><li>Make EventBridge Destinations optional for the new Third Party API HTTP integration for unauthenticated APIs.</li><li>Add capability to filter the response of the Third Party API HTTP integration. I’m not sure which libraries are used under the hood to invoke the HTTP action but I can’t imagine the logic would be that difficult to pass it a JSONPath to filter the response.</li><li>Great Job on the Test State feature!!!</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2581fe7cd458" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/step-functions-re-invented-2581fe7cd458">Step Functions re:Invented</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging Zero-Trust To Secure Your Network Management Plane]]></title>
            <link>https://itnext.io/deep-dive-on-cisa-bod-23-02-54ca61e6d181?source=rss-ab5501fa9c31------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ca61e6d181</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Matthew Venne]]></dc:creator>
            <pubDate>Thu, 26 Oct 2023 17:24:57 GMT</pubDate>
            <atom:updated>2023-12-09T13:57:54.843Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Deep Dive on CISA BOD 23 — 02</h4><p>On June 13, 2023, CISA issued Binding Operational Directive 23–02: Mitigating the Risk from Internet-Exposed Management Interfaces. While the Directive explicitly targets US Government agencies, FedRAMP auditors (e.g., 3PAOs) have begun utilizing this directive to evaluate the network security posture of CSPs seeking a federal ATO. We will be taking a deep dive into the drivers of this directive and how it will it be evaluated.</p><h4>What is a management interface?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*60yb3MSXqnpY_9SPlIOtLw.png" /><figcaption>An example diagram of how a corporate firewall may be implemented.</figcaption></figure><ul><li>The external interface is where the inbound traffic enters prior to inspection and the outbound traffic exits the firewall post inspection.</li><li>Internal interface is where outbound traffic enters the firewall prior to inspection and inbound traffic exits the firewall prior to inspection.</li><li>These interfaces typically do not present a means (e.g., CLI or GUI) for administrators to update the configuration of the firewall. They make up what is frequently referred to as <strong><em>the data plane</em></strong>.</li><li>The management interface is where the GUI and CLI would be presentable. It is typically on a separate subnet from the other interfaces to allow for proper segmentation. This interface is where administrators can login via CLI or a GUI (usually web-based) and make configuration changes in the firewall — e.g., what traffic to allow. They support connections via standard protocols such as: HTTP (TCP/80), HTTPS (TCP/443), FTP (TCP/21), SFTP (TCP/22), TFTP (UDP/69), SSH (TCP/22), RDP (TCP/3389), SMB (TCP/445)</li><li>This is frequently called <strong><em>the management plane. </em></strong>I’ve always preferred firewalls that keep the management plane and data plane separate — separate interfaces and separate routing<strong><em>. </em></strong>This is not always the case though. In some firewalls, the data plane and management plane are not separate; therefore, the management interface uses the corporate firewall as its default router and one wrong static route can brick the whole thing.</li><li>All network devices have a management interface — routers, VPNs, switches, load balancers. If there is not dedicated management interface — a data-plane interface hosts the management plane — it will frequently have a unique port — like TCP/8443 for administrators to connect to.</li></ul><p>To put it lightly, management interfaces of network devices should NEVER be exposed to the internet — not even with IP-allowlisting and strong MFA in place. Session tokens can be stolen, admins can be phished, end-user devices can be compromised — therefore, it is critical to make sure there is not a public road straight to the brains of your network. This is what BOD 23–02 strives to remediate within the federal government and CSPs. These interfaces should <strong><em>ONLY</em></strong> be accessible from an internal network or via Zero-Trust devices that meet the proper criteria for a Policy Enforcement Point. (More on this later)</p><p>They do correctly point out that this logic should be extended to non-networking (“out-of-band”) devices — such as server rack management interfaces — e.g., iDRAC, and other critical servers. In reality, VERY few servers need a public IP and therefore be accessible directly from the internet. In today’s Cloud Native world, NAT Gateways, Transit Gateways, Load Balancers, and CDNs greatly limit the number of servers that need to be exposed to the internet.</p><p>Many environments are leveraging the above managed networking resources via a CSP like AWS, GCP, Azure, etc. BOD 23–02 excludes the management console and management API from this directive for two reasons:</p><ol><li>The management console and APIs are SaaS — they need to be exposed to the internet — it would sort of defeat the idea of a public cloud. Securing access to your CSP console and API is a customer responsibility. Luckily, many support IAM policy conditions to enforce source IP and even source VPC — meaning users may be able to access the console but they won’t be able to do anything if they aren’t coming from the pre-defined networks. However, these are enforced on the calling identity — AWS IAM Users, AWS IAM Roles, GCP Service Accounts, etc — not the network layer.</li><li>You do not actually access the management interface of the managed network devices (NAT GW, Network Firewall, Load balancers, VPC Routers). These devices are just a Virtual Machine under the hood.— like EC2, Google Compute Engine, Azure VMs. CSPs abstract your interactions with the management plane of the device by fronting it with their console/API.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*iMDXAa5eADuFT8h6aUT67w.png" /><figcaption>The management interfaces for the underlying VMs of managed network devices is in a separate subnet accessible only to AWS employees. This subnet is in the 198.16.0.0/16 range — NOTE: this is different reserved private IP range defined by RFC 5735, not RFC 1918. The data plane interfaces for your managed network devices are put in your VPC subnets, so they can access your VPC resources.</figcaption></figure><h4>The Requirements of BOD 23–02</h4><ol><li>Remove the interface from the internet by making it only accessible from an internal enterprise network (CISA recommends an isolated management network)</li></ol><ul><li>This means you can only access the management interface from on-premise. There is no remote access.</li></ul><p>2. Deploy capabilities, as part of a Zero Trust Architecture, that enforce access control to the interface through a policy enforcement point separate from the interface itself (preferred action).</p><ul><li>This means the managed interface must be behind a device that offers zero trust policy enforcement. Zero trust network devices support phishing-resistant MFA (can be via external IDP), micro-segmentation, device posture, continuous authentication, and robust logging.</li></ul><h4>Zero Trust Policy Enforcement Point Criteria</h4><p>Auditors will be looking for solutions that meet the following criteria</p><ol><li>Implements authentication and authorization separate from any interface being accessed.¹</li><li>Must be inside an authorized boundary including both the configuration console and gateway.²</li><li>Traffic from administrators to the ZT Policy Enforcement Point (PEP) is mutually authenticated.³</li><li>Traffic from the ZT PEP to any internal interface is mutually authenticated and authorized, where possible.⁴</li></ol><h3>A Few Potential Solutions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*P6_P1XE7-YEw34AC2RQi9g.png" /><figcaption>Here is an example architecture of how a remote administrator may access a management interface via a Zero-Trust Policy Enforcement Point.</figcaption></figure><p>Many CSPs now offer ZT-capable authenticated proxies. Here are a few CSP offerings that would meet the required criteria of BOD 23–02.</p><ul><li>GCP — Identity-Aware Proxy</li><li>Microsoft — Azure AD Application Proxy</li><li>AWS — Verified Access &amp; Application Load Balancer.</li><li>Zscaler — Private Access</li></ul><blockquote>ASIDE: From my perspective, I find it difficult to find the value proposition of Verified Access at this time — considering its price — you’re looking at starting around 200 dollars per month per application without factoring in the data processing). GCP’s IAP is free. AWS recommends you automating the creation and deletion of Verified Access via IaC on a schedule that meets your business needs — while this is viable, it can be difficult to predict application usage. Imagine having to log into a critical application after hours and the Verified Access stack was just destroyed.</blockquote><blockquote>This pricing issue is exacerbated by the fact that the <strong>exact same functionality</strong> can be accomplished using an Application Load Balancer for about 10% of the cost — ALB has supported OIDC authentication for quite a while. Verified Access under the hood is likely just an ALB with this feature added as an abstraction. few nice add-ons — it natively does device posture checks with CrowdStrike and it utilizes AWS new open-source authorization language, Cedar, for creating the access policies.</blockquote><blockquote>However, if your corporate IDP supports OIDC, phishing-resistant MFA and device posture checks —most of the major SaaS IDPs like DUO and Okta do all 3 — there are not many reasons to use Verified Access. I will say the cost of those SaaS IDPs with all the required features can be quite high but if you are already paying the money, it’s likely better to leverage them than to pivot. If those SaaS features require more cost than $200/mo — then Verified Access becomes a valid option.</blockquote><blockquote>If you are using AWS IAM Identity Center as your corporate IDP, without any external IDP integration, Verified Access becomes a valid option. IAM IC integrates natively with Verified Access (note: Verified Access does support direct integration with external IDPs), this makes Verified Access a valid option. Oddly, AWS IAM IC does not support custom OIDC applications, only SAML.</blockquote><blockquote>Verified Access only really makes sense for small organizations, yet the price of it really makes it a hard sell for them. AWS please lower the price of Verified Access!</blockquote><p>However, it’s important to understand if your ZT proxies operate only for HTTP/HTTPS based applications — like Web GUIs. Verified Access and the ALB-OIDC solution would not suffice for other protocols such as SSH or RDP.</p><p>A list of layer 4 solutions in no particular order:</p><ul><li>Zscaler Private Access — VPN software installed on end-user device.</li><li>GCP IAP — Direct integration for SSH in gcloud CLI. Other protocols require port-forwarding.</li><li>Appgate SDP — VPN software installed on end-user device.</li><li>Port-forwarding with AWS SSM — run from AWS CLI v2 integrated with IAM Identity Center with Corporate IDP enforcing the settings mentioned above. Target server must have SSM properly configured (Role, Network Path to API, SSM Agent installed)</li><li>Palo Alto Global Protect — VPN software installed on end-user device.</li><li>Cisco AnyConnect —VPN software installed on end-user device.</li><li>AWS EC2 Instance Connect with Private Endpoints — run from AWS CLI v2 integrated with IAM Identity Center with Corporate IDP enforcing the settings mentioned above.</li></ul><p>As we can see, there are many options available to us to implement Zero-Trust network access but more are coming out every day. BOD 23–02 does a great job identifying a critical attack vector and establishing ways to mitigate your risk. It’s not the end game though. A true Zero-Trust ideology embraces the idea that attack vectors are always evolving and therefore so must our security.</p><ol><li><em>Client VPNs and bastion/jump hosts have always done this — the layer-7 ZTAP is newer since OIDC is becoming more prevalent. However, implementing ZT with only a bastion/jump host is not recommended, as it is difficult to authenticate the end user device using standard bastion host protocols — like SSH and RDP. Also, phishing resistant MFA can be difficult to implement without significant security trade-offs. Phishing-resistant MFA uses devices on an end-user device — typically via USB or NFC. Redirecting USB from your local device over an RDP session could present a risk of unauthorized data exfiltration, since thumb drives are also USB devices. However, bastions still provide protection against data exfiltration since redirection can be disabled and access to file-sharing sites can be blocked at network layer via your corporate/cloud firewall. </em><strong><em>It’s important to do a risk-based analysis based on your organization’s business needs</em></strong><em>; if you are restricting access to authorized devices only via your IDP and ZT PEP, the risk may not be great enough to warrant a bastion host, since you can monitor the end-user device used. However, implementing a bastion/jump host behind a ZT PEP could offer additional protection for the most sensitive data.</em></li><li><em>Don’t use ZT PEPs from external parties or providers unless you have done your homework to make sure they can be trusted. If you are a federal customer and want to use a SaaS like Zscaler, make sure the service is FedRAMP authorized at the appropriate level. (</em><a href="https://marketplace.fedramp.gov/products/FR2219763604"><em>Zscaler does offer a FedRAMP solution</em></a><em>).</em></li><li><em>This is the traffic segment from your end-user device to the ZT PEP — 1–3 in the diagram below. Mutual authentication does not mean only mTLS! The end-user device should authenticate the ZT PEP — TLS should be sufficient since that includes server authentication. The ZT PEP should authenticate the user and the device used — this can be offloaded to your corporate IDP.</em></li><li><em>This one is a bit hand-wavy at the moment, which is why CISA says where possible. The internal interface would need to authenticate the ZT PEP. This would likely be either mTLS or an additional signed cookie for the session between the ZT PEP and the internal interface. I’m not personally aware of any ZT PEPs that provided this functionality but that doesn’t mean they don’t exist. For now, it is sufficient to restrict access at network layer — using AWS Security Groups, GCP Cloud Firewall etc.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ca61e6d181" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/deep-dive-on-cisa-bod-23-02-54ca61e6d181">Leveraging Zero-Trust To Secure Your Network Management Plane</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>