<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: David Krohn</title>
    <description>The latest articles on Forem by David Krohn (@daknhh).</description>
    <link>https://forem.com/daknhh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F509215%2F883e52ad-ca24-4156-847a-8cab01796b76.png</url>
      <title>Forem: David Krohn</title>
      <link>https://forem.com/daknhh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/daknhh"/>
    <language>en</language>
    <item>
      <title>OWASP Top 10 (2025) and AWS WAF: Putting Managed Rules in Context</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Wed, 04 Feb 2026 15:55:00 +0000</pubDate>
      <link>https://forem.com/aws-builders/owasp-top-10-2025-and-aws-waf-putting-managed-rules-in-context-586c</link>
      <guid>https://forem.com/aws-builders/owasp-top-10-2025-and-aws-waf-putting-managed-rules-in-context-586c</guid>
      <description>&lt;p&gt;The OWASP Top 10 is not a tool recommendation, nor is it a product matrix. They explain systemic risks in web and API apps, no matter the platform, the cloud or the vendor. As a matter of fact, however, the same question arises repeatedly:&lt;br&gt;&lt;br&gt;
&lt;em&gt;Which of these risks can actually be addressed using AWS WAF Managed Rule Groups?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The short answer: AWS WAF can limit risk and make attacks visible, but it cannot fundamentally “fix” them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS WAF is not a substitute for secure design. As a guardrail it covers known patterns and anomalies, but not against structural vulnerabilities to the application’s security model.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this way a tidy mapping is also useful to know where AWS WAF is useful, where it functions only at the HTTP layer, and where additional controls are required.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS WAF in security model
&lt;/h2&gt;

&lt;p&gt;The role of AWS WAF is a logical interface with client and application. It will analyze HTTP(S) requests in terms of managed rule groups and optional custom rules. Its strength resides where attacks materialize in the form of requests: injection payloads, previously identified bad inputs, automated abuse, credential stuffing, or unexpected traffic bursts.&lt;/p&gt;

&lt;p&gt;Especially in environments where this value extends beyond blocking, such as managed rule groups, it has a signal and evidence functionality: they emit labels, counters, block events, and structured logs that can be processed centrally.&lt;/p&gt;

&lt;p&gt;Just as important, though, is a boundary: AWS WAF knows nothing about business logic, has no role models, and makes no cryptographic decisions. Anything that occurs before or after the HTTP request is beyond the scope of the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  OWASP Top 10 (2025) → AWS WAF Managed Rule Groups
&lt;/h2&gt;

&lt;p&gt;The following table maps the OWASP Top 10 categories to AWS-managed WAF rule groups.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;OWASP Top 10 (2025)&lt;/th&gt;
&lt;th&gt;AWS WAF Managed Rule Groups&lt;/th&gt;
&lt;th&gt;Interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A01 Broken Access Control&lt;/td&gt;
&lt;td&gt;AWSManagedRulesCommonRuleSet AWSManagedRulesAdminProtectionRuleSet AWSManagedRulesAmazonIpReputationList AWSManagedRulesBotControlRuleSet&lt;/td&gt;
&lt;td&gt;Reduces scanning and automated abuse on exposed endpoints, but does not enforce authorization or prevent insecure direct object references (IDOR).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A02 Security Misconfiguration&lt;/td&gt;
&lt;td&gt;AWSManagedRulesCommonRuleSet AWSManagedRulesKnownBadInputsRuleSet AWSManagedRulesAmazonIpReputationList&lt;/td&gt;
&lt;td&gt;Blocks simple exploit payloads, but does not fix insecure defaults, missing security headers, or IAM misconfigurations. Such aspects can only be partially addressed through targeted custom WAF rules.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A03 Software Supply Chain Failures&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;Originates before runtime (dependencies, CI/CD, artifacts) and lies entirely outside the WAF scope.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A04 Cryptographic Failures&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;TLS configuration, key management, and cryptographic algorithm selection are decided outside the WAF. Web application firewalls cannot detect or prevent these issues. Cryptographic weaknesses are instead identified through configuration and compliance tools such as Prowler.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A05 Injection&lt;/td&gt;
&lt;td&gt;AWSManagedRulesSQLiRuleSet AWSManagedRulesCommonRuleSet AWSManagedRulesKnownBadInputsRuleSet&lt;/td&gt;
&lt;td&gt;Using the AWSManagedRulesSQLiRuleSet, typical SQL injection patterns in query parameters, request bodies, and cookies can be reliably detected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A06 Insecure Design&lt;/td&gt;
&lt;td&gt;AWSManagedRulesCommonRuleSet AWSManagedRulesBotControlRuleSet&lt;/td&gt;
&lt;td&gt;Managed rule groups such as AWSManagedRulesCommonRuleSet (indirectly) and AWSManagedRulesBotControlRuleSet, combined with rate-based rules, can limit automated abuse and anomalous request patterns, but do not detect business logic flaws.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A07 Authentication Failures&lt;/td&gt;
&lt;td&gt;AWSManagedRulesATPRuleSet AWSManagedRulesACFPRuleSet AWSManagedRulesBotControlRuleSet AWSManagedRulesAmazonIpReputationList&lt;/td&gt;
&lt;td&gt;Protects login and signup flows from automated abuse, but does not replace MFA or secure session design.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A08 Software &amp;amp; Data Integrity Failures&lt;/td&gt;
&lt;td&gt;AWSManagedRulesCommonRuleSet (partial)&lt;/td&gt;
&lt;td&gt;Blocks exploit payloads, but does not verify signatures or build integrity.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A09 Security Logging &amp;amp; Monitoring Failures&lt;/td&gt;
&lt;td&gt;WAF logs &amp;amp; labels&lt;/td&gt;
&lt;td&gt;Provides actionable signals, but does not replace a SIEM or incident response setup.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A10 Mishandling of Exceptional Conditions&lt;/td&gt;
&lt;td&gt;AWSManagedRulesCommonRuleSet AWSManagedRulesKnownBadInputsRuleSet AWSManagedRulesBotControlRuleSet AWSManagedRulesAntiDDoSRuleSet&lt;/td&gt;
&lt;td&gt;Filters anomalies and exceptional request patterns, but does not fix error handling in application code.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Anti-DDoS to protect availability
&lt;/h2&gt;

&lt;p&gt;The basic structure of the AWS WAF involves pattern matching plus a behavioural part such as AWSManagedRulesAntiDDoSRuleSet. The goal is not to detect specific payloads, but rather to identify traffic anomalies that indicate Layer-7 DDoS attacks or abnormal load spikes. AWS WAF can automatically respond to these events by blocking browsing momentarily or launching silent challenges. These are combined with specific labels being applied to requests made in the event.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;When positioned correctly AWS WAF Managed Rule Groups are an effective solution as a Baseline. They allow detection and remediation of injection attacks, known malicious inputs, automated abuse and traffic anomalies. Nevertheless, the central OWASP risks like supply chain issues, cryptography, and insecure design are explicitly excluded from their focus.&lt;/p&gt;

</description>
      <category>waf</category>
      <category>aws</category>
      <category>security</category>
      <category>owasp</category>
    </item>
    <item>
      <title>IAM Auto-Remediation: Enforcing Least Privilege Automatically</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 02 Feb 2026 16:04:06 +0000</pubDate>
      <link>https://forem.com/aws-builders/iam-auto-remediation-enforcing-least-privilege-automatically-2af7</link>
      <guid>https://forem.com/aws-builders/iam-auto-remediation-enforcing-least-privilege-automatically-2af7</guid>
      <description>&lt;p&gt;&lt;em&gt;Misconfigured IAM roles and policies&lt;/em&gt; is one of the major root causes of serious cloud incidents: permissions (e.g., admin rights) are too many rather than the &lt;strong&gt;principle of least privilege&lt;/strong&gt;. It isn’t often malicious — most of the time it’s just making it work that becomes drift quietly. This hits hard: once a token is compromised an over-privileged role will do &lt;strong&gt;widespread damage&lt;/strong&gt; in the system data access, logging/evidence tampering, privilege escalation, key policy abuse. In healthcare, that’s more than security; it’s an &lt;strong&gt;immediately actionable governance and compliance risk&lt;/strong&gt;. Least privilege is not a preference. NIST frames it as a control (AC-6), while AWS emphasizes it as a core IAM best practice. Source: &lt;a href="https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final" rel="noopener noreferrer"&gt;NIST SP 800-53 Rev. 5 (AC-6 Least Privilege)&lt;/a&gt;. Read The Three Pillars of Digital Sovereignty for the bigger picture on why we treat this as an operational governance control. There, we demonstrate that sovereignty is not determined by location or certificates but actual control points: identities, keys, data flows, operations—and exactly why "audit-ready" means implementing those controls on-going.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;IAM is the “WHO” control point. Auto-remediation does it - that is, guardrails + evidence in near real time and is not stuck in manual review bottleneck.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The risk of attack is increased because of permanent admin privileges.
&lt;/h2&gt;

&lt;p&gt;It isn’t only a blanket rule: It’s the absolute absence of boundaries. In platforms with many teams, pipelines, and roles such as that one infected token can quickly become “everything”.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blast radius can explode: one credential could equate to an overall platform control.&lt;/li&gt;
&lt;li&gt;Evidence becomes weak: admin can tamper with records, policies and a critical path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operational drift:&lt;/strong&gt; “temporary admin” becomes the default, quietly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forensics rather than clarity:&lt;/strong&gt; “who altered what when?” becomes detective work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A common pattern.&lt;/p&gt;

&lt;p&gt;A batch role is assigned admin “just for now” weeks later, it’s still attached. Then a CI token is leaked—and now not just data but your evidence pipeline and other essentials are accessible and in your hands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture: event-driven IAM guardrails.
&lt;/h2&gt;

&lt;p&gt;Rather than waiting for occasional reviews we address IAM variations in near real-time (CloudTrail gives you API events, EventBridge captures relevant patterns (e.g. “AWS API Call via CloudTrail”), Lambda remediation takes you through guardrails).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CloudTrail&lt;/strong&gt;: It records IAM API calls (e.g., AttachRolePolicy, PutRolePolicy).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EventBridge&lt;/strong&gt; matches the most serious events and sends them to remediation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lambda&lt;/strong&gt; checks: an admin policy? wildcard admin? Optional: a machine-check findings via policy analysis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remediation&lt;/strong&gt;: disconnect admin + set up a &lt;strong&gt;permissions boundary&lt;/strong&gt; (quarantine/seatbelt). Permissions boundaries define the maximum permissions to work for IAM principals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence&lt;/strong&gt;: tags/logs/trigger details → audit-ready traceability.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why Access Analyzer helps here.&lt;/p&gt;

&lt;p&gt;For IAM access analytic work, the IAM Access Analyzer offers ValidatePolicy to document the IAM policies and the returned structured findings—handy if you want enforcement to generate machine-readable evidence.&lt;/p&gt;

&lt;p&gt;Example: &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html" rel="noopener noreferrer"&gt;AWS IAM Access Analyzer - Policy validation (ValidatePolicy)&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Safe by default: rolling out remediation without chaos
&lt;/h2&gt;

&lt;p&gt;Auto-remediation is powerful—which is exactly why rollout must be controlled. In regulated environments, a staged model works well: observe first, steer next, enforce last.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Observe&lt;/strong&gt;: collect findings only, no enforcement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Warn&lt;/strong&gt;: notify + ticket/Slack, add evidence tags.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quarantine&lt;/strong&gt;: apply a permissions boundary (block escalation, avoid breaking workloads).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block&lt;/strong&gt;: hard remediation (detach admin immediately) if risk is unambiguous.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this post we default to &lt;strong&gt;safe mode&lt;/strong&gt;: remediate only allowlisted roles or roles tagged &lt;code&gt;foundra:autofix=true&lt;/code&gt;. By doing that, there will be fewer surprises and the same security outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Audit-ready operations: evidence &amp;amp; metrics.
&lt;/h2&gt;

&lt;p&gt;There will be no sovereignty if you can’t quantify it. For IAM guardrails, these measures translate ‘policy intent’ to operational state.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Policy coverage&lt;/strong&gt;: share of workload roles with boundaries / without admin policies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Risk findings&lt;/strong&gt;: admin/wildcard events per team/account/service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MTTR&lt;/strong&gt;: amount of time from risky change → remediation (seconds, not days).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence tags:&lt;/strong&gt; foundra:remediated, foundra:trigger, foundra:reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Operational mini-check.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can you explicitly indicate when certain IAM roles are a growing risk?&lt;/li&gt;
&lt;li&gt;Can you evidence the timeliness of triggering remediation, by which event, and with what result?&lt;/li&gt;
&lt;li&gt;Is the default secure—even when people are operating under time pressure?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architectural example: analyzer and rule and remediation.
&lt;/h2&gt;

&lt;p&gt;With this example we outline a pragmatic baseline: &lt;strong&gt;AdministratorAccess&lt;/strong&gt; is not allowed on workload roles. We also identify basic “wildcard admin” inline policies (&lt;code&gt;Action: "*"&lt;/code&gt; &amp;amp; &lt;code&gt;Resource: "*"&lt;/code&gt;) and have a &lt;strong&gt;permissions boundary&lt;/strong&gt; as a guardrail.&lt;/p&gt;

&lt;p&gt;Permissions boundaries are an AWS application capability to limit permissions to IAM principals, a “seatbelt” for auto-remediation, ideally minimally invasive, reversible and measurable.&lt;/p&gt;

&lt;p&gt;Example: &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html" rel="noopener noreferrer"&gt;AWS IAM - Permissions boundaries&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access Analyzer: policy analysis / ValidatePolicy as well as structured findings.&lt;/li&gt;
&lt;li&gt;EventBridge: To filter out dangerous IAM API changes (CloudTrail events).&lt;/li&gt;
&lt;li&gt;Remediation Lambda: disengage admin; apply boundary, tag evidence.&lt;/li&gt;
&lt;li&gt;Boundary policy: limit “maximum permissions” (seatbelt) without compromising workloads unnecessarily.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why even more so in healthcare.
&lt;/h2&gt;

&lt;p&gt;IAM is more than “security” in healthcare platforms. IAM is the technical implementation of privacy and governance objectives into actionable reality—and least privilege is the tipping point between “incident” and “incident with massive exposure”.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Least privilege&lt;/strong&gt; reduces exposure of sensitive data (PII/PHI) as much as possible in an event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrails&lt;/strong&gt; safeguard evidence and operations (logs, keys, policies) from tampering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt; makes MTTR lower and compliance on a day-to-day basis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Combined with the sovereignty framework: you govern &lt;strong&gt;WHO&lt;/strong&gt; (IAM), you perform &lt;strong&gt;HOW&lt;/strong&gt; (guardrails/remediation), and you produce &lt;strong&gt;EVIDENCE&lt;/strong&gt; (tags/logs/metrics)—as one unified machine.&lt;/p&gt;

&lt;p&gt;An example implementation which shows this pattern is &lt;a href="https://github.com/daknhh/iam-autoremediation" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
    </item>
    <item>
      <title>Securing Digital Sovereignty for regulated Industries</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Thu, 13 Feb 2025 10:35:08 +0000</pubDate>
      <link>https://forem.com/aws-builders/securing-digital-sovereignty-for-regulated-industries-3ipb</link>
      <guid>https://forem.com/aws-builders/securing-digital-sovereignty-for-regulated-industries-3ipb</guid>
      <description>&lt;p&gt;As the digital world continues to evolve, the regulated sector is challenged to maintain strong controls over personal data.. The concept of digital sovereignty not only safeguards governments and corporations from losing control over their data on a routine basis, but empowers them to take advantage of what is already technologically available with the intelligence of the cloud. Critical Infrastructure (KRITIS) regulated sectors and domains like finance, healthcare, energy and telecommunication sectors have a high level of data governance for security, compliance and local control of data needs. AWS is such a robust platform to tackle these type of challenges that, with secure, resilient and compliant cloud services, organisations can innovate without boundaries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F73eed7ff1b8bc3b391925051666a4932c813fc37-1920x1080.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F73eed7ff1b8bc3b391925051666a4932c813fc37-1920x1080.webp" alt="Blog Content" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Challenges of Digital Sovereignty
&lt;/h2&gt;

&lt;p&gt;Digital sovereignty can be divided into 3 pillars, data sovereignty, technological independence and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data sovereignty&lt;/strong&gt; is an essential component of digital sovereignty. Governments and regulated sectors must protect sensitive information, secure data sovereignty and protect data from unauthorised access. There are various regulations for this, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Germany's critical infrastructures (KRITIS) are defined and regulated by their essential services. An independent and reliable source for KRITIS specifications is &lt;a href="https://www.openkritis.de/" rel="noopener noreferrer"&gt;OpenKRITIS&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;  The financial sector is regulated by &lt;a href="https://www.eiopa.europa.eu/digital-operational-resilience-act-dora_en" rel="noopener noreferrer"&gt;DORA&lt;/a&gt; and ensures its digital resilience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To gain more insights into data sovereignty and effective practices, check out our blog post about &lt;a href="https://globaldatanet.com/cloud-insights/confidence-in-the-cloud-with-data-sovereignty" rel="noopener noreferrer"&gt;Confidence in the cloud with data sovereignty&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technological independence&lt;/strong&gt; means freeing yourself from dependence on a single provider. By using AWS technologies, your organisation can gain flexibility, eliminate dependencies and drive innovation. Here you can get a deeper insight into how to maintain &lt;a href="https://globaldatanet.com/cloud-insights/technologische-unabhngigkeit-in-der-aws-cloud" rel="noopener noreferrer"&gt;technological independence in the AWS cloud&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt; is a key pillar of digital sovereignty, protecting organisations from cyber-attacks while also ensuring compliance, resilience and reliability. &lt;a href="https://dev-new.globaldatanet.com/cloud-insights/security-as-the-foundation-of-digital-sovereignty" rel="noopener noreferrer"&gt;Security as the foundation of digital sovereignty&lt;/a&gt; helps you to promote trust, protect sensitive data and prevent reputational and financial losses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Traditional Data Centers vs. Cloud: Cutting Costs and Complexity
&lt;/h2&gt;

&lt;p&gt;Moving to the cloud eliminates the complexities of traditional data center management, offering organizations greater agility, cost savings, and operational efficiency.&lt;/p&gt;

&lt;p&gt;✅ Simplified Operations - Cloud services eliminate the need to manage cumbersome physical servers and complex network configurations, freeing your teams to create value and scale the business with speed.&lt;/p&gt;

&lt;p&gt;💰 Cost Efficiency: Cloud computing reduces the capital and operational expenses of maintaining, upgrading, and securing on-premise data centers. With a pay-as-you-go-modell, you pay only according to the usage, thus optimizing costs for scalability.&lt;/p&gt;

&lt;p&gt;🔄 Flexible Service Models: IaaS, PaaS, SaaS - Scale and tune your cloud model with different approaches that will provide a mix of control versus flexibility, suitable to meet each organization's business needs.&lt;/p&gt;

&lt;p&gt;🔖 Built-in Compliance – Take advantage of certifications from AWS and other cloud providers (like C5) to ease the certification process, as many services already comply with industry standards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F57000428a8af058e41965e10c19971698db769a8-1920x1080.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F57000428a8af058e41965e10c19971698db769a8-1920x1080.webp" alt="Blog Content" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Digital Sovereignty within AWS
&lt;/h2&gt;

&lt;p&gt;AWS is committed to improving digital sovereignty, to overcome the challenges of data control, there is Confidential Computing, which encrypts sensitive and protects data from unauthorised access. In addition, ende 2025 is opening a European Sovereign Cloud, an isolated AWS cloud operated by a separate company. It provides a robust solution for organisations with strict data management requirements, especially in critical sectors. It also ensures that all staff operating this cloud or supporting customers are EU citizens and located in the EU.&lt;/p&gt;

&lt;p&gt;AWS offers built-in services such as Audit Manager and Config for automated compliance monitoring and real-time reporting that ensure organisations meet ongoing compliance with ease.&lt;/p&gt;

&lt;p&gt;With many services already C5 certified, AWS improves security in highly regulated industries by simplifying compliance through automated framework mapping, which lessens the complexity and burden of various compliance checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Driving Innovation Across regulated Industries
&lt;/h2&gt;

&lt;p&gt;Leading banks rely on AWS to safeguard financial transactions, ensuring compliance, data integrity, and protection from cyber threats. Insurance companies use AWS to effectively manage and process sensitive health data while upholding the highest security standards. At the same time, Deutsche Bahn counts on AWS to support and maintain its essential transportation infrastructure, guaranteeing reliability and operational excellence.&lt;/p&gt;

</description>
      <category>digitalsovereingty</category>
      <category>aws</category>
    </item>
    <item>
      <title>Enhancing Your AWS CDK Projects with Testing</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Thu, 16 Jan 2025 07:33:45 +0000</pubDate>
      <link>https://forem.com/aws-builders/enhancing-your-aws-cdk-projects-with-testing-1ged</link>
      <guid>https://forem.com/aws-builders/enhancing-your-aws-cdk-projects-with-testing-1ged</guid>
      <description>&lt;p&gt;Automated unit and integration testing validates system components and increases confidence in your infrastructure code, but unfortunately this is a very neglected topic at CDK. But let's start at the beginning. A few weeks ago, we decided to start a new version of a CDK construct library in a project - this meant taking our CDK testing to a new level. We wanted to test each custom construct with multiple unit and integration tests. Here is an explanation of the difference between a unit test and an integration test.&lt;/p&gt;

&lt;p&gt;Unit testing in the CDK focuses on testing the logic within CDK constructs, which are reusable components that define and configure cloud resources. These tests simply synthesized CDK code to a CloudFormation template without actually deploying any AWS resources. In short, AWS services are simply mocked up and we compare the generated template against our checks.&lt;/p&gt;

&lt;p&gt;Integration testing, on the other hand, deploys the actual resources to an AWS account to ensure that the deployed resources work together correctly. These tests verify the behavior of the entire AWS application, including permissions, networking, and service integrations. Unlike unit testing, integration testing requires a real AWS account and uses tools such as the AWS SDK, AWS CLI, and custom resources to verify functionality in a real-world environment. We use the integ-test module - part of the CDK library - for testing in CDK.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F873e8b46435e10705a90339ab897f1dbcb4daa1f-1151x611.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F873e8b46435e10705a90339ab897f1dbcb4daa1f-1151x611.webp" alt="Blog Content" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we're just starting out with this new topic and wanted to see how other people are testing their infrastructure, we decided to do some research. Unfortunately there's a lack of good examples on the web and the same example is copied across many blog posts on the web. 🫠&lt;/p&gt;

&lt;p&gt;This situation is over now. After troubleshooting, testing, failing and gaining experience. We are now in a position to share our experiences and examples with you. 🙌🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Unit Testing
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;No, you don’t need to test every line of your CDK application - Yan Cui&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I see it the same way as &lt;a href="https://theburningmonk.com/2023/06/no-you-dont-need-to-test-every-line-of-your-cdk-application/" rel="noopener noreferrer"&gt;Yan Cui&lt;/a&gt;, if you only declare and use official CDK constructs, we don't necessarily have to test, I would only test to ensure compliance (security and regulatory compliance), because as in the shift left principle, we can prevent this before we deploy insecure resources by CDK testing. However, this should not be used as an alternative just as an addition to check if you comply with security and regulatory frameworks in your AWS environments. You should still use config and/or conformance packs that are rolled out organization-wide to check AWS resources against your compliance requirements. But now lets start with an easy example. Since Security is everyones job we should test if all RDS Instances will be encrypted. This can be easily done like that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allResourcesProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::RDS::DBInstance&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;StorageEncrypted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;p&gt;In addition, we should use a custom KMS key to encrypt the RDS Intention and this key should be rotated regularly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// KMS Key rotation Check&lt;/span&gt;
  &lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allResourcesProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::KMS::Key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;EnableKeyRotation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;


&lt;span class="c1"&gt;//RDS Instance Check&lt;/span&gt;
&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allResourcesProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::RDS::DBInstance&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;StorageEncrypted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;KmsKeyId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;anyValue&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;p&gt;Unit tests like this could be implemented in any CDK project when using tools like &lt;a href="https://github.com/projen/projen" rel="noopener noreferrer"&gt;projen&lt;/a&gt; - or whenever you create your own custom construct library.&lt;/p&gt;

&lt;p&gt;Imagine you have a platform team and a lot of application development teams, and you want to give them easily deployable infrastructure code that meets your company's security and regulatory frameworks, and includes resources that are commonly used for almost every application.&lt;/p&gt;

&lt;p&gt;Now let's take it a step further, we want to provide our application teams with constructs that expose databases or other resources according to our corporate specifications and legal requirements. this often requires custom resources. to find these in the synthesized stack, we need a little more configuration to specify the resources and check that the references are set correctly. In the following example, we search for a KMS key using the properties in the synthesised template and check that the reference is set correctly in the following secret.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// eslint-disable-next-line @typescript-eslint/no-explicit-any&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;logicalIdFromResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// eslint-disable-next-line @typescript-eslint/no-unsafe-argument&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resKeys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resKeys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No Resource found.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resKeys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Resource is not unique.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;logicalId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;resKeys&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;logicalId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;testKmsKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findResources&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::KMS::Key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DescriptionTestKey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;


    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;testKmsKeyLogicalId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;logicalIdFromResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testKmsKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findResources&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AWS::SecretsManager::Secret&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;KmsKeyId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Fn::GetAtt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;testKmsKeyLogicalId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Arn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;},}});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration Testing
&lt;/h2&gt;

&lt;p&gt;As mentioned at the beginning, integration tests are concerned with deploying resources from a CDK application to a test environment to test the application from start to finish. These tests can take a little more time than a unit test, but they also ensure that the resources are used as intended. Integration tests allow you to use different assertions to check resources for properties or settings.&lt;/p&gt;

&lt;p&gt;For example, there is an awsApiCall that can be executed to check whether certain values are in a resource. Here is an example where we check a secret content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Check whether the secret was created with the correct content&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assertion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;integTest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assertions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;awsApiCall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;secrets-manager&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GetSecretValue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;SecretId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;SECRETARN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SecretString&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nx"&gt;assertion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addToRolePolicy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;Effect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Allow&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;Action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;kms:Decrypt*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="c1"&gt;// reference errors when using the key. &lt;/span&gt;
  &lt;span class="na"&gt;Resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;assertion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertAtPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SecretString.username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ExpectedResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringLikeRegexp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;assertion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertAtPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SecretString.password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ExpectedResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringLikeRegexp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.*?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;p&gt;With this assertion we use a nice Feature, instead of checking the whole response object at the end, we use "assertAtPath" to get back only parts of the secret string to do a regex on it.&lt;/p&gt;

&lt;p&gt;During the integration test of a CDK app, two stacks are deployed, one stack containing the resources and another stack containing the testing resources. CloudFormation Outputs can be used to pass arns or other variables between the stacks, for example to read a specific secret. This would look as follows in the example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;cdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CfnOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testStack&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;AdminSecretArn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;adminSecret&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secretArn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;exportName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;testStack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stackName&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-AdminSecretArn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;


&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SECRETARN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;importValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;testStack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stackName&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-AdminSecretArn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;p&gt;In addition to the assertions for “awsApiCalls”, there is also the “invokeFunction”. This triggers an AWS Lambda Function that you can define yourself within the assertionStack. Using a lambda function you can execute far more complex tests which return a result at the end which can be checked using the CDK testing framework. For example, if you do not know exactly how long the function will take or when an object will end up in an s3 bucket, you can use a "waitForAssertions" method to define at what interval and for how long a lambda function should be triggered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Invoke the assertion Lambda function to validate the received payload in s3&lt;/span&gt;
&lt;span class="nx"&gt;integTest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assertions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invokeFunction&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;assertionLambda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ExpectedResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;objectLike&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;Payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;200&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;})).&lt;/span&gt;&lt;span class="nf"&gt;waitForAssertions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;totalTimeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/integ-tests-alpha-readme.html" rel="noopener noreferrer"&gt;Integ-test module&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://theburningmonk.com/2023/06/no-you-dont-need-to-test-every-line-of-your-cdk-application/" rel="noopener noreferrer"&gt;No, you don’t need to test every line of your CDK application -Yan Cui&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aws.amazon.com/blogs/devops/how-to-write-and-execute-integration-tests-for-aws-cdk-applications/" rel="noopener noreferrer"&gt;How to write and execute integration tests for AWS CDK applications&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Automated unit and integration testing is critical for validating CDK constructs and ensuring the security and compliance of infrastructure code. By improving CDK testing-from unit tests that validate synthesized CloudFormation templates to integration tests that deploy and verify real AWS resources-we can build robust and secure cloud architectures. However, there are still challenges to overcome as the test constructs are still in alpha.&lt;/p&gt;

&lt;p&gt;We hope that our insights into testing the CDK have helped you and made it easier for you to get started.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cdk</category>
    </item>
    <item>
      <title>Security as the foundation of digital sovereignty</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Sat, 04 Jan 2025 10:01:25 +0000</pubDate>
      <link>https://forem.com/aws-builders/security-as-the-foundation-of-digital-sovereignty-10cp</link>
      <guid>https://forem.com/aws-builders/security-as-the-foundation-of-digital-sovereignty-10cp</guid>
      <description>&lt;p&gt;Any organization processing and storing data of any form is potentially a target of cyber-attacks. Therefore you need to protect your data against such attacks. Especially when you are handling sensitive data. That is why security is an important main pillar of digital sovereignty.&lt;/p&gt;

&lt;p&gt;Security is not just about protecting against unauthorised access and cyberattacks. It is also about ensuring the resilience, compliance and reliability of your digital assets. This is achieved through strict access controls and robust authentication mechanisms that protect your data from breaches. By implementing robust security measures, you can protect your customers' data and ensure compliance with relevant regulations, such as  General Data Protection Regulation (GDPR) or DORA (Digital Operational Resilience Act).&lt;/p&gt;

&lt;p&gt;Beyond technical measures, security fosters trust, as customers and partners are more likely to engage with organisations that prioritise data protection, making it a fundamental aspect of credibility and digital sovereignty. On the other hand companies which have security incidents additionally suffer from big losses in their reputation.&lt;/p&gt;

&lt;p&gt;In summary, with security you want to:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Protect Data - Implementing least privilege and encryption protect data and counter the rise of threats.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comply with regulations - Ensure compliance and meet legal requirements for your data, such as GDPR.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintain customer confidence and trust - Build trust by protecting privacy and demonstrating a commitment to digital sovereignty.  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security in the Cloud
&lt;/h3&gt;

&lt;p&gt;Securing the cloud is a dynamic and critical process that requires a blend of robust technical controls, well-defined organizational policies, and proactive continuous monitoring. By addressing the unique challenges of cloud environments with a structured approach, you can safeguard data, applications, and infrastructure against evolving threats.  &lt;/p&gt;

&lt;p&gt;Here's a comprehensive guide to achieving and maintaining cloud security:&lt;/p&gt;

&lt;h3&gt;
  
  
  Shared Responsibility
&lt;/h3&gt;

&lt;p&gt;AWS shares the responsibility for security and compliance with you. AWS manages and controls infrastructure components such as physical security, the virtualisation layer, and the host operating system.  &lt;/p&gt;

&lt;p&gt;You as a Customer are responsible for managing the security in the cloud like guest operating system, application software, updates, patches, and security configurations, such as firewalls and access permissions.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2Fafb172eee633e75d5792869e7b46224d459875fb-1920x1080.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2Fafb172eee633e75d5792869e7b46224d459875fb-1920x1080.webp" alt="Blog Content" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Identity and Access Management (IAM)
&lt;/h3&gt;

&lt;p&gt;Identity and access management  helps you to securely manage and scale access to your resources, between your resources and for your employees.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Using temporary security credentials and permission sets enhances security by minimizing the risk of long-term credential exposure, enabling controlled, time-bound access to AWS resources.&lt;/li&gt;
&lt;li&gt;  AWS Identity Center, you can efficiently manage workload and workforce identities by managing user access within a single AWS account or centralising identity management across multiple accounts for seamless and secure authentication and authorisation.&lt;/li&gt;
&lt;li&gt;  Access Analyzer helps you identify and remove unused or external access to resources, and create least privilege policies to limit access to only what's needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a deep dive into centralised permission management at scale with AWS IAM Identity Center, check out this &lt;a href="https://globaldatanet.com/tech-blog/aws-iam-identity-center-permission-management-at-scale-part-3" rel="noopener noreferrer"&gt;post&lt;/a&gt;.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Detection and Response
&lt;/h3&gt;

&lt;p&gt;AWS provides comprehensive detection and response capabilities through services such as Amazon GuardDuty as an intrusion detection system (IDS) for threat detection and AWS Security Hub for a single view of all security alerts.  Amazon GuardDuty continuously analyses network traffic and uses multiple workload and account logs to detect threats using anomaly detection, AI, ML, and threat intelligence. The service integrates directly into the AWS landscape and automated response mechanisms can be used to automatically remediate the threat.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Data Protection
&lt;/h3&gt;

&lt;p&gt;To achieve data protection, you need to focus on three important pillars: Data classification, protection of data at rest and protection of data in transit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Data Classification helps you categorize your data based on its importance and sensitivity, providing a foundation for determining the appropriate protection and retention controls. AWS services like Amazon Macie can help automate this process.&lt;/li&gt;
&lt;li&gt;  Protecting Data at Rest is a must. In AWS, you can use AWS Key Management Service (KMS) to encrypt data for your workloads and apply least privileges access policies to your encryption Keys. Additionally, you can bring your own key material using a Hardware Security Module (HSM) and integrate it with KMS through the External Key Store (XKS) feature, enabling seamless encryption across AWS services.&lt;/li&gt;
&lt;li&gt;  Protecting Data in Transit is crucial to ensure secure communication between systems. AWS provides a Service called AWS Certificate Manager (ACM) to manage SSL/TLS certificates, making it easier to enforce secure connections across your workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For handling confidential data, AWS provides the &lt;a href="https://aws.amazon.com/blogs/security/confidential-computing-an-aws-perspective/" rel="noopener noreferrer"&gt;Nitro system&lt;/a&gt; – a specialized hardware security solution that ensures complete isolation of virtual machines.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Compliance
&lt;/h3&gt;

&lt;p&gt;AWS helps you to comply with the legal requirements and compliance for your data by providing you tools and services that help you to comply with various laws and regulations. AWS itself is already certified and fulfils numerous standards such as ISO 27001 or C5 (BSI requirements for cloud providers). So that you can monitor the compliance status of your resources, there are services such as AWS Config that monitor resource changes and check them according to applicable regulations. You can also use automated audit processes with the AWS Audit Manager to check how well your regulations are being met.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Network and Application Protection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Network and application protection in AWS is essential for securing your infrastructure and services against unauthorized access and attacks.&lt;/p&gt;

&lt;p&gt;AWS offers services to protect applications from common internet attacks. These include DDoS attacks, which can compromise security and availability. If you want to learn more about web application firewalls, check out our &lt;a href="https://globaldatanet.com/solutions/web-application-firewalls-at-scale" rel="noopener noreferrer"&gt;Web application Firewalls at Scale Service&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Amazon VPC lets you create isolated network environments to manage traffic with security groups and NACLs. AWS Security Groups function as virtual firewalls for virtual instances like EC2, controlling inbound and outbound traffic.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Robust security is essential for every organization handling data, especially sensitive information, to protect against cyberattacks and ensure compliance. AWS offers various services to safeguard data and manage access effectively. Security helps you build trust, stay compliant and keep your digital assets safe.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>digitalsovereignty</category>
    </item>
    <item>
      <title>Confidence in the cloud with data sovereignty</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Sat, 04 Jan 2025 09:59:35 +0000</pubDate>
      <link>https://forem.com/aws-builders/confidence-in-the-cloud-with-data-sovereignty-1p6a</link>
      <guid>https://forem.com/aws-builders/confidence-in-the-cloud-with-data-sovereignty-1p6a</guid>
      <description>&lt;p&gt;Data sovereignty refers to the requirement that specific types of data – including intellectual property, financial records, and personal information – must be collected, stored, and processed within defined geographic boundaries, such as within the European Union (EU). Whether your application stores credit card information on an e-commerce website or backs up the electronic patient record (EPR), data sovereignty must be ensured so that this user data is subject to the legal framework of the country or other legal provisions in which these users are citizens. Especially for companies that are subject to certain regulations, understanding and implementing data sovereignty is of crucial importance.&lt;/p&gt;

&lt;p&gt;Almost every country has a data protection law that protects the personal data collected from its citizens in some way. This includes, for example, the General Data Protection Regulation (GDPR), and for certain industries there are additional regulations such as DORA (Digital Operational Resilience Act) for the financial sector.&lt;/p&gt;

&lt;p&gt;In simple terms, data sovereignty is about WHO - WHERE and HOW.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  WHERE is your data stored?&lt;/li&gt;
&lt;li&gt;  WHO can access and use your data?&lt;/li&gt;
&lt;li&gt;  HOW is your data controlled by regulations (which laws and regulations apply to your data)?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data sovereignty in the cloud
&lt;/h2&gt;

&lt;p&gt;It is important to choose a cloud service that enables the storage, processing and management of data according to specific requirements. For example, it can be helpful to use a service that can restrict storage to specific regions or data centres to enable a higher level of data localisation and storage. In addition, it is crucial that the data is encrypted, for instance with an own dedicated key, and that high standards of access rights can be maintained in accordance with all legal requirements of your organization.  &lt;/p&gt;

&lt;p&gt;Let's go back to the WHERE, WHO and HOW and discover how AWS can help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHERE?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS gives you access to a global infrastructure with data centres in many countries. This enables you to choose where your data is stored and processed. To ensure that your data does not leave the selected region, you can restrict access to certain regions. Additionally you can even use AWS Outpost as a fully managed solution that allows you to run AWS services on-premises.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHO?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cloud storage services like Amazon S3 offer detailed control over data access permissions. For handling confidential data, AWS provides the &lt;a href="https://aws.amazon.com/blogs/security/confidential-computing-an-aws-perspective/" rel="noopener noreferrer"&gt;Nitro system&lt;/a&gt; – a specialized hardware security solution that ensures complete isolation of virtual machines. This system prevents access by operators and separates each virtual machine from both the hypervisor and other machines, creating strong hardware-level protection for your data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS helps you to comply with the legal requirements for your data by providing you tools and services that help you to comply with various laws and regulations. AWS itself is already &lt;a href="https://aws.amazon.com/compliance/" rel="noopener noreferrer"&gt;certified&lt;/a&gt; and fulfils numerous standards such as ISO 27001 or C5 (BSI requirements for cloud providers). So that you can monitor the compliance status of your resources, there are services such as AWS Config that monitor resource changes and check them according to applicable regulations. You can also use automated audit processes with the AWS Audit Manager to check how well your regulations are being met.  &lt;/p&gt;

&lt;h2&gt;
  
  
  European Sovereign Cloud
&lt;/h2&gt;

&lt;p&gt;AWS is investing EUR 7.8 billion in a special European Sovereign Cloud to support data sovereignty by the end of 2025.The European Sovereign Cloud is an isolated instance of the AWS cloud operated by an independent and separate company. It provides a robust solution for organisations with strict data management requirements, especially in critical sectors.It also ensures that all employees operating this cloud or supporting customers are EU citizens and located in the EU.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu95h5k7eetg8qs4lbsg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu95h5k7eetg8qs4lbsg5.png" alt="European Sovereign Cloud" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Data sovereignty is important for digital sovereignty - it focuses on the legal and jurisdictional aspects of data management. Choosing cloud providers such as AWS and implementing strategic practices will help you maintain control over your data, comply with relevant laws and regulations, and control where data is processed.&lt;/p&gt;

</description>
      <category>digitalsovereignty</category>
      <category>aws</category>
      <category>security</category>
    </item>
    <item>
      <title>AWS IAM Identity Center Permission Management at Scale Part 3</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Fri, 26 Apr 2024 14:04:08 +0000</pubDate>
      <link>https://forem.com/aws-builders/aws-iam-identity-center-permission-management-at-scale-part-3-21hn</link>
      <guid>https://forem.com/aws-builders/aws-iam-identity-center-permission-management-at-scale-part-3-21hn</guid>
      <description>&lt;p&gt;Identity management is the easiest when you can manage identities in one place and use them across accounts and applications. AWS IAM Identity Center streamlines identity management by enabling you to connect to your identity provider (IdP), such as Active Directory, and use the IdP's identity information for access and collaboration within applications. You can do this, for example, by using an AD Connector and connecting it to your on-premises or Azure AD. An AD Connector is a directory gateway that allows you to route directory requests to your on-premises Microsoft Active Directory without storing information in the cloud cache.&lt;/p&gt;

&lt;p&gt;If you have a large Active Directory with several thousand groups and users, you may not want to explicitly select the identities you want to synchronise with AWS Identity Center.  &lt;/p&gt;

&lt;p&gt;In this blog post, we will show you a solution that allows you to specify different prefixes for Active Directory groups that will be automatically synced to your AWS Identity Center.&lt;/p&gt;

&lt;p&gt;The solution workflow includes the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Synchronization of Active Directory Groups&lt;/li&gt;
&lt;li&gt; Automated Documentation &amp;amp; Notification&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Prerequisite:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/get-started-enable-identity-center.html"&gt;Identity Center must be enabled in your Organization&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Connection to local or Azure Active Directory&lt;/li&gt;
&lt;li&gt;  Active Directory User who has read access&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Solution overview
&lt;/h2&gt;

&lt;p&gt;The following architecture shows the solution of the automated sync of Active Directory Groups to AWS Identity Center .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_huVJi1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/1df979d6613d571c3bc1b0f14a674e525626a52a-1197x792.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_huVJi1B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/1df979d6613d571c3bc1b0f14a674e525626a52a-1197x792.webp" alt="Blog Content" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kirnberger1980/sso-setup-automation/blob/main/CDK/GroupSync/README.md"&gt;🔗 Here you can find the Solution on Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our CDK based project several resources will be provisioned due deployment.&lt;/p&gt;

&lt;p&gt;The Stack contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Amazon EventBridge rule that runs on a schedule&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/dbsystel/cdk-sops-secrets"&gt;CDK Sops Secrets Construct&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;  Secret which holds the Active Directory Credentials&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  Lambda Function to create the Synchronisation Filter in AWS IAM Identity Center&lt;/li&gt;
&lt;li&gt;  all necessary IAM Roles and Permissions for the Lambda Function&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Synchronization of Active Directory Groups
&lt;/h3&gt;

&lt;p&gt;With Active Directory group synchronisation, you use IAM Identity Center to assign users and groups from Active Directory access to AWS accounts and to AWS-managed or customer-managed applications. All Active Directory Groups with specified prefixes will be automatically synchronised to your AWS IAM Identity Center.&lt;/p&gt;
&lt;h4&gt;
  
  
  How the automation with the lambda function works
&lt;/h4&gt;

&lt;p&gt;The Sync LambdaFunction is triggered by Eventbridge Scheduled event to ensure that the Groups you want sync from your active directory are always uptodate in your AWS Identity Center.&lt;/p&gt;

&lt;p&gt;The workflow of our Sync LambdaFunction is the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Retrieve Active Directory credentials from AWS Secrets Manager&lt;/li&gt;
&lt;li&gt; Log on to Active Directory using LDAP(s) using the credentials just retrieved&lt;/li&gt;
&lt;li&gt; Search and retrieve Active Directory group names based on specified prefixes&lt;/li&gt;
&lt;li&gt; Retrieve current Filters of Groups which are sync scope from AWS Identity Center&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add missing Active Directory groups as synchronisation filters in AWS Identity Center  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; ℹ Synchronisation to AWS Identity Center will start after a short amount of time.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generating of automated documentation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sending notification to MS Teams&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Deployment
&lt;/h4&gt;

&lt;p&gt;The deployment of the solution is done via a cdk stack which is part of the solution's repository. All the required Parameters will be configured in a typescript file - an example file is also included in the repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you have to configure:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;

&lt;tbody&gt;

&lt;tr&gt;

&lt;th&gt;Property&lt;/th&gt;

&lt;th&gt;Description&lt;/th&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Produkt&lt;/td&gt;

&lt;td&gt;will be used to generate StackName&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Stage&lt;/td&gt;

&lt;td&gt;will be used to generate StackName&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Prefix&lt;/td&gt;

&lt;td&gt;will be used to generate StackName&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;s3_DOKUBUCKET&lt;/td&gt;

&lt;td&gt;Name of the S3 Bucket for the generated documentation&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;WebhookUrlTeams&lt;/td&gt;

&lt;td&gt;URL of your MS Teams Webhook&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;DocuWebsite&lt;/td&gt;

&lt;td&gt;Link to the Website where the generated HTML snippet has been published used for a button in the Team Nofitication&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;LambdaSchedule&lt;/td&gt;

&lt;td&gt;Duration how often your Lambda should be trigger from Eventbridge. Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes.&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;rootCaCertificateString*&lt;/td&gt;

&lt;td&gt;the Root CA Certificate in PEM format which issues the server certificates Active Directory&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;vpcId&lt;/td&gt;

&lt;td&gt;Id of your VPC where the lambda will be deployed to&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;subnetIds&lt;/td&gt;

&lt;td&gt;Ids of subnets where the lambda will be deployed to&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;ad_DomainName&lt;/td&gt;

&lt;td&gt;Name of your Active Directory&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;BasePath&lt;/td&gt;

&lt;td&gt;Path in your Active Directory where the Lambda can find the Users you want to Sync&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;GroupPrefixes&lt;/td&gt;

&lt;td&gt;Array of prefixes of groups you want to synchronise into your AWS Identity Center&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;SecretFile&lt;/td&gt;

&lt;td&gt;Path to your Sops secrets file, which should contain the Active Directory user credentials.&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Url&lt;/td&gt;

&lt;td&gt;LDAP Url to your Active Directory. The LDAP URL format is ldap:// hostname&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Port&lt;/td&gt;

&lt;td&gt;Port of your LDAP - LDAP default is 389, LDAPs = 636&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;IdentityStoreId&lt;/td&gt;

&lt;td&gt;Identity Store Id of your AWS Identity Center&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Endpoint&lt;/td&gt;

&lt;td&gt;

AWS hidden API Endpoint- should be identity-sync..amazonaws.com

&lt;/td&gt;

&lt;/tr&gt;

&lt;/tbody&gt;

&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Automated Documentation &amp;amp; Notification
&lt;/h3&gt;

&lt;p&gt;After each execution of the Synchronisation Lambda, we aim to notify our team about the actions taken during the previous run. Therefore, we have implemented a Teams notification that includes a status update and a link to an automatically generated dashboard.&lt;/p&gt;

&lt;p&gt;ℹ️ Notifications are only sent when groups are added or deleted, or when an automation error occurs, to avoid a flood of notifications.&lt;/p&gt;

&lt;p&gt;The following screenshot illustrates an example of a Teams notification.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yiC6bc2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/a8de04d085041443629b7e3d19ba8e8c6941d954-625x144.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yiC6bc2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/a8de04d085041443629b7e3d19ba8e8c6941d954-625x144.webp" alt="Blog Content" width="625" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Documentation
&lt;/h4&gt;

&lt;p&gt;Our Active Directory Synchronization Status Dashboard is a simple HTML file which will be generated trough a Lambda Function, saved in S3 and will be distributed trough a CloudFront. You can integrate this Dashboards in your Confluence or any other internal Wiki. This Dashboard is secured via CloudFormation Function - additionally you can also add a &lt;a href="https://globaldatanet.com/solutions/web-application-firewalls-at-scale"&gt;Firewall&lt;/a&gt; to restrict the access to an specific CIDR or Geographic region and prevent access from third parties. The screenshot below provides an example of a dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TUItwydr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/20c6847fbe0ef93a490c7a85026f124881141877-954x457.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TUItwydr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/20c6847fbe0ef93a490c7a85026f124881141877-954x457.webp" alt="Blog Content" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this blog post, we showed you how to improve your security posture by automatically and regularly synchronising Active Directory groups that match a specific pattern with AWS Identity Center. This simplifies access management and increases security by automatically revoking access in AWS Identity Center when group objects are deleted or created in Active Directory. Furthermore, the automatically generated documentation facilitates an overview of the synchronised group objects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kirnberger1980/sso-setup-automation/blob/main/CDK/GroupSync/README.md"&gt;🔗 Here you can find the Solution on Github&lt;/a&gt;&lt;/p&gt;



</description>
      <category>security</category>
      <category>aws</category>
      <category>iam</category>
    </item>
    <item>
      <title>AI TRiSM - Building trust in artificial intelligence</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Wed, 14 Feb 2024 12:06:32 +0000</pubDate>
      <link>https://forem.com/aws-builders/ai-trism-building-trust-in-artificial-intelligence-287a</link>
      <guid>https://forem.com/aws-builders/ai-trism-building-trust-in-artificial-intelligence-287a</guid>
      <description>&lt;p&gt;Artificial intelligence (AI) is an important part of our daily lives. Chatbots, coding assistants, and even self-driving cars are becoming popular. According to a report by the McKinsey Global Institute, generative AI is expected to contribute up to $4.4 trillion to the global economy annually. However it's often challenging for people to embrace change, especially when it involves complicated topics like artificial intelligence (AI). To many individuals, AI can seem like­ a complex puzzle. It incorporates complicate­d algorithms and learning models, resulting in confusion for those­ without expert knowledge­ when trying to comprehend the­ reasoning behind certain de­cisions. Building AI systems requires a vast amount of data and cle­ver algorithms in order to dete­ct patterns and predict future tre­nds. Even the creators of the­se systems sometime­s struggle to fully understand their ope­rations. This lack of transparency can pose issues. It can make­ it difficult to spot and rectify errors or biased re­sults, leading to the perce­ption that AI systems are untrustworthy due to the­ir hard-to-grasp nature.&lt;/p&gt;

&lt;p&gt;Companies not handling AI risk rightly can face­ more negative re­sults, like AI leaks. Sometime­s, models may not function as planned, causing safety and privacy trouble­s and financial or reputational damage. If done badly, AI can le­ad the companies to make bad busine­ss choices.&lt;/p&gt;

&lt;p&gt;AI system obscurity pre­sents a big challenge. This has le­d to increased attention on cre­ating a solution called AI Trust, Risk, and Security Management, or TRiSM. It's a thorough way to address important parts of creating and launching an AI system. It plays a big part in le­ssening possible problems like­ security risks, data breaches, and othe­r risks that might affect how well AI systems work and if the­y're fair and honest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is TRiSM?&lt;/strong&gt;&lt;br&gt;
Gartner defined the AI TRiSM framework to support governance, trustworthiness, fairness, reliability, robustness, effectiveness, and privacy of AI models. The AI TRiSM framework is built around four key pillars:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrisdavmgoveqmqmte43.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrisdavmgoveqmqmte43.png" alt="Image description" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explainability&lt;/strong&gt;&lt;br&gt;
Explainability refers to the ability of a model to provide clear and human-understandable explanations of its decision-making process. This is critical for building trust with users and ensuring fair and ethical outcomes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ModelOps&lt;/strong&gt;&lt;br&gt;
Model Operations (short ModelOps) includes the management of the entire model lifecycle, from data preparation and ingestion to model training, deployment and ongoing monitoring. This ensures that the model performs as expected, identifies and resolves problems or biases, and continually optimises its performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI security&lt;/strong&gt;&lt;br&gt;
AI security is a critical concern for organisations, as evidenced by a growing class of adversarial machine learning attacks. The data and models are often extremely valuable, and robust security measures must be implemented to ensure their integrity and confidentiality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy and Ethics&lt;/strong&gt;&lt;br&gt;
Privacy and ethics ensure that data is collected and used in a responsible and ethical manner, respecting the privacy of individuals. Organisations must also consider the downstream socio-economic impacts of using AI in their applications, and work to mitigate negative impacts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Key Actions for AI TRiSM?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve your AI models with making them explainable or interpretable (sometimes you can leverage AWS solution or OpenSource)&lt;/li&gt;
&lt;li&gt;Setup a dedicated Competency Circle to manage AI TRiSM efforts, broaden perspectives and give you strategic advice&lt;/li&gt;
&lt;li&gt;Incorporate risk management into model operations. Use solutions that ensure both model and data integrity.&lt;/li&gt;
&lt;li&gt;Make sure that your AI is designed to maintain accountability.&lt;/li&gt;
&lt;li&gt;Implement data protection solutions (Encryption is everyone's Job) used by AI models and prepare the use of different data protection methods for different use cases and their components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
⁤TRiSM is essential in our current time for companies to ensure the responsible and safe use of AI. ⁤⁤The proactive approach of this framework ensures the potential of AI is realised while mitigating risks, maintaining security and ethical standards. ⁤&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>Ensuring Compliance with Custom AWS Config Rules</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 14 Aug 2023 07:23:13 +0000</pubDate>
      <link>https://forem.com/aws-builders/ensuring-compliance-with-custom-aws-config-rules-1bo9</link>
      <guid>https://forem.com/aws-builders/ensuring-compliance-with-custom-aws-config-rules-1bo9</guid>
      <description>&lt;p&gt;In today's data-driven world, ensuring compliance with industry regulations and internal policies has become a top priority for organisations. While many organisations implement standard compliance measures, custom Config Rules offer a more tailored approach to meet specific requirements. In this blog post we will discuss the importance of custom Config Rule for compliance and provide examples of custom Config Rules using AWS CloudFormation Guard 2.0 and Lambda.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Custom Config Rules are Important for Compliance
&lt;/h2&gt;

&lt;p&gt;Basic security and governance are provided by standard compliance measures, protecting organizations with a minimum level of security. But businesses operate in different environments, each with unique characteristics. One-size-fits-all compliance frameworks may not meet specific requirements, possibly leaving vulnerabilities unattended. This is where personalised Config Rules come into play, offering bespoke solutions that match an organisation's unique requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Accurate Management of Risks&lt;/strong&gt;: Personalised Config Rules allow organisations to precisely address potential risks and vulnerabilities that are specific to their operations. When adjusting compliance efforts to their specific context, businesses can effectively reduce threats and improve their security status.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Alignment to standards in the industry&lt;/strong&gt;: Many fields have unique rules and standards that extend beyond standard compliance frameworks. Organisations can adjust custom Config Rules to satisfy these industry-specific demands without violating complying to broader regulations.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Adjusting to Change&lt;/strong&gt;: The business world changes constantly, and as organisations develop, so do the risks they face. Tailored setup regulations can be modified and improved with ease to incorporate changes in technology, operations, and regulations, thereby guaranteeing consistent enforcement in a flexible setting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F928404bb5cc8cf2a2c577dd5d539abd540820299-265x245.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F928404bb5cc8cf2a2c577dd5d539abd540820299-265x245.webp" alt="Blog Content"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS CloudFormation Guard 2.0: Empowering Custom Config Rules
&lt;/h2&gt;

&lt;p&gt;AWS CloudFormation Guard 2.0 is a powerful tool that helps organizations adhere to compliance requirements with custom Config Rules. This open-source project provides a language that facilitates developers and security teams to establish and enforce compliance rules for infrastructure-as-code. With a user-friendly syntax, CloudFormation Guard 2.0 enables organizations to efficiently and clearly define their compliance requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Examples of Custom Config Rules with CloudFormation Guard 2.0&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  GuardDuty Settings
&lt;/h4&gt;

&lt;p&gt;The following CloudFormation snippet for a custom Config Rule using AWS CloudFormation Guard 2.0, checks whether GuardDuty has S3 protection enabled, Kubernetes protection enabled and Findings are published every 15 minutes.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  CustomGuardDutySettings:&lt;br&gt;
    Type: AWS::Config::ConfigRule&lt;br&gt;
    Properties: &lt;br&gt;
      ConfigRuleName: GuardDutySettings&lt;br&gt;
      Description: Compliant if GuardDuty has S3 protection enabled, Kubernetes protection enabled AND Findings are published every 15 minutes.&lt;br&gt;
      Scope:&lt;br&gt;
        ComplianceResourceTypes: &lt;br&gt;
          - "AWS::GuardDuty::Detector"&lt;br&gt;
      Source:&lt;br&gt;
        Owner: CUSTOM_POLICY&lt;br&gt;
        CustomPolicyDetails:&lt;br&gt;
          EnableDebugLogDelivery: "True"&lt;br&gt;
          PolicyRuntime: guard-2.x.x&lt;br&gt;
          PolicyText: |&lt;br&gt;
            let s3protection = true&lt;br&gt;
            let kubernetesprotection = true&lt;br&gt;
            let publishfrequency = 'FIFTEEN_MINUTES'
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            rule compliancecheck when 
                resourceType == "AWS::GuardDuty::Detector" {
                    configuration.DataSources.S3Logs.Enable == %s3protection
                    configuration.DataSources.Kubernetes.AuditLogs.Enable == %kubernetesprotection
                    configuration.FindingPublishingFrequency == %publishfrequency
                }
    SourceDetails: 
    - 
      EventSource: "aws.config"
      MessageType: "ConfigurationItemChangeNotification"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Apache Kafka (MSK) Broker Encryption at rest&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;The following CloudFormation snippet for a custom Config Rule using AWS CloudFormation Guard 2.0, creates a Config Rule to check whether Amazon Managed Streaming for Apache Kafka (MSK) data volume is encrypted.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  CustomMskBrokerEncryptionAtRest:&lt;br&gt;
    Type: AWS::Config::ConfigRule&lt;br&gt;
    Properties:&lt;br&gt;
      ConfigRuleName: CUSTOM-MSK-BROKER-ENCRYPTION-AT-REST&lt;br&gt;
      Description: Checks whether MSK has at the broker volume encryption at rest active&lt;br&gt;
      Scope:&lt;br&gt;
        ComplianceResourceTypes:&lt;br&gt;
          - "AWS::MSK::Cluster"&lt;br&gt;
      Source:&lt;br&gt;
        Owner: "CUSTOM_POLICY"&lt;br&gt;
        CustomPolicyDetails:&lt;br&gt;
          EnableDebugLogDelivery: false&lt;br&gt;
          PolicyRuntime: guard-2.x.x&lt;br&gt;
          PolicyText:&lt;br&gt;
            !Sub |&lt;br&gt;
            rule check_resource_type {&lt;br&gt;
                resourceType == "AWS::MSK::Cluster"&lt;br&gt;
            }&lt;br&gt;
            rule check_broker_encryption_at_rest when check_resource_type {&lt;br&gt;
              let kmsKey = configuration.EncryptionInfo.EncryptionAtRest.DataVolumeKMSKeyId&lt;br&gt;
              %kmsKey == /arn:aws:kms:\w+(?:-\w+)+:\d{12}:key\/(?:[-a-z0-9]+)/&lt;br&gt;
            }&lt;br&gt;
        SourceDetails:&lt;br&gt;
          -&lt;br&gt;
            EventSource: aws.config&lt;br&gt;
            MessageType: ConfigurationItemChangeNotification&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Limitations of AWS CloudFormation Guard 2.0 when using it for custom Config Rules:&lt;br&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Simplicity:&lt;/strong&gt; CloudFormation Guard 2.0 has been developed to be simple and straightforward when defining compliance rules. However, this simplicity can be a disadvantage when handling complex compliance requirements that include complicated logic, multiple conditions or dependencies on resources.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Flexibility of rules:&lt;/strong&gt; The flexibility of the rule definitions in CloudFormation Guard 2.0 is somewhat limited when compared to more comprehensive programming languages. If you need to implement complex calculations or evaluations for advanced rules, you may find the syntax of CloudFormation Guard 2.0 restrictive.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Dynamic data retrieval is not possible:&lt;/strong&gt; CloudFormation Guard 2.0 can't fetch data from external sources or make API calls to gather information for rule evaluations. This limitation makes it difficult to create rules that depend on real-time data from APIs or external sources, especially when compliance mandates it.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;AWS Config Limitation:&lt;/strong&gt; It should be noted that while AWS CloudFormation Guard offers support for array and regex functionalities, AWS Config may currently lack the capability to evaluate all of them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Example of Custom Config Rule using Lambda&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The following CloudFormation snippet for a custom Config Rule backed by AWS Lambda, checks whether any resource tag contains an phone number or an email.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  DsgvoConfigRuleFunction:&lt;br&gt;
    Type: AWS::Lambda::Function&lt;br&gt;
    Properties:&lt;br&gt;
      FunctionName:&lt;br&gt;
        Fn::Sub: DsgvoConfigRuleFunction-${AWS::Region}&lt;br&gt;
      Description: Checks for Email and Phone in Ressource Tags&lt;br&gt;
      Code:&lt;br&gt;
        ZipFile: |-&lt;br&gt;
          import json&lt;br&gt;
          import boto3&lt;br&gt;
          import re&lt;br&gt;
          import os
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      def find_violation(current_tags):
          violation = ""
          for tag in current_tags:
              if tag['value'] != "":
                  phoneregex = r"(^\+49+[0-9]*|^49+[0-9]*|^01+[0-9]*|^\+01+[0-9]*)"
                  if re.match(phoneregex, tag['value']):
                      violation += f"- found phone number in Tag: {tag['key']} "
                  emailregex = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
                  if re.match(emailregex, tag['value']):
                      violation += f" - found E-mail address in Tag: {tag['key']} "
          return  violation

      def evaluate_compliance(configuration_item):
          if configuration_item["configurationItemStatus"] == "ResourceDeleted" or os.environ['AWS_DEFAULT_REGION'] != configuration_item["awsRegion"]:
              return {
                  "compliance_type": "NOT_APPLICABLE",
                  "annotation": "The configurationItem was deleted and therefore cannot be validated."
              }
          violation = None
          current_tags = configuration_item["configuration"].get("tags")
          if current_tags != None or current_tags == "":
              violation = find_violation(current_tags)
          if violation:
              return {
                  "compliance_type": "NON_COMPLIANT",
                  "annotation": violation[:255]
              }

          return {
              "compliance_type": "COMPLIANT",
              "annotation": "The tags of this resource are DSGVO compliant."
          }

      def handler(event, context):
          invoking_event = json.loads(event["invokingEvent"])
          configuration_item = invoking_event["configurationItem"]
          result_token = "No token found."
          if "resultToken" in event:
              result_token = event["resultToken"]


          evaluation = evaluate_compliance(configuration_item)

          config = boto3.client("config")
          config.put_evaluations(
              Evaluations=[
                  {
                      "ComplianceResourceType":
                          configuration_item["resourceType"],
                      "ComplianceResourceId":
                          configuration_item["resourceId"],
                      "ComplianceType":
                          evaluation["compliance_type"],
                      "Annotation":
                          evaluation["annotation"],
                      "OrderingTimestamp":
                          configuration_item["configurationItemCaptureTime"]
                  },
              ],
              ResultToken=result_token)

  Handler: index.handler
  Runtime: python3.11
  Role:
    Fn::GetAtt:
      - DsgvoConfigRuleRole
      - Arn
  Timeout: 60
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;CustomDsgvoTags:&lt;br&gt;
    Type: AWS::Config::ConfigRule&lt;br&gt;
    Properties:&lt;br&gt;
      ConfigRuleName: CUSTOM-DSGVO-TAGS&lt;br&gt;
      Description: Checks whether no sensitive data from employees are added into Tags are set&lt;br&gt;
      Source:&lt;br&gt;
        Owner: "CUSTOM_LAMBDA"&lt;br&gt;
        SourceDetails:&lt;br&gt;
          -&lt;br&gt;
            EventSource: aws.config&lt;br&gt;
            MessageType: ConfigurationItemChangeNotification&lt;br&gt;
        SourceIdentifier: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:DsgvoConfigRuleFunction-${AWS::Region}'&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;In the time of data-based operations, it's important to have both compliance and customisation working together effectively. Although standard compliance measures are important, it is better for companies to have custom Config Rules that suit their unique needs and mitigate specific risks. AWS CloudFormation Guard 2.0 shines as a tool that empowers organizations to implement and enforce custom compliance rules seamlessly. However if you want to implement more complex checks you need to use Custom Config Rules backed by Lambda. Organizations can confidently move towards a secure and compliant future in the data-driven world by using custom Config Rules.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>compliance</category>
      <category>optimization</category>
    </item>
    <item>
      <title>Deploying CloudFormation StackSets with AWS CDK</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Thu, 20 Jul 2023 12:55:20 +0000</pubDate>
      <link>https://forem.com/aws-builders/deploying-cloudformation-stacksets-with-aws-cdk-16f2</link>
      <guid>https://forem.com/aws-builders/deploying-cloudformation-stacksets-with-aws-cdk-16f2</guid>
      <description>&lt;p&gt;AWS Cloud Development Kit (CDK) is a powerful framework that allows developers to define cloud infrastructure as code using familiar programming languages. With CDK, you can easily provision and manage AWS resources in a consistent and automated manner. In this blog post, we'll walk you through the process of creating a StackSet using AWS CDK.&lt;/p&gt;

&lt;p&gt;Before we dive into the details, let's take a quick look at what a StackSet is and how it can help you manage your AWS infrastructure.&lt;/p&gt;

&lt;p&gt;StackSets are containers for CloudFormation stacks that enable simultaneous creation, update, and deletion across multiple AWS accounts and regions. With StacksSets, you can ensure that all environments are consistent and compliant with the policies you have in place.&lt;/p&gt;

&lt;p&gt;The native support for StackSet in CDK is somewhat rudimentary, due to the fact that it is more common in CDK to use &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html" rel="noopener noreferrer"&gt;CDK pipelines&lt;/a&gt; to roll out stacks to multiple accounts and regions.&lt;/p&gt;

&lt;p&gt;Therefore, in order to use StackSet in CDK, a few things need to be considered. In this blogpost, we will show steps on how to deploy StackSets via CDK.&lt;/p&gt;

&lt;p&gt;Let’s see how this works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial, make sure you have the following prerequisites&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html" rel="noopener noreferrer"&gt;An AWS account with appropriate permissions to create StackSets and associated resources.&lt;/a&gt;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/cli/?nc1=h_ls" rel="noopener noreferrer"&gt;AWS Command Line Interface (CLI)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html" rel="noopener noreferrer"&gt;AWS Cloud Development Kit (AWS CDK)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of TypeScript&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bootstrap AWS Account
&lt;/h2&gt;

&lt;p&gt;Bootstrapping is the process of providing resources for the AWS CDK before you can deploy AWS CDK applications in an AWS environment. Normally you could use the default&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk bootstrap aws://ACCOUNT-NUMBER-1/REGION-1&lt;/code&gt; command. However, we need to customise the template to make the assets available to the entire AWS Organization, as we want to use this CDK environment to deploy StackSets. To get the latest version of the CDK bootstrap template, do the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk bootstrap --show-template &amp;gt; bootstrap-template.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ℹ️ The CDK boostrap template contains an S3 bucket for files and an ECR repository for container images. It also creates few IAM roles.&lt;/p&gt;

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

&lt;p&gt;After that, we need to modify two resources in this template. The s3 bucket for Assets and the KMS Key that will be used to encrypt the assets.&lt;/p&gt;

&lt;p&gt;Add the following Part to the &lt;strong&gt;Parameters&lt;/strong&gt; Section of the template:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  PrincipalOrgID:
    Description: &amp;gt;-
      The identifier of your AWS organization. Used in the KMS key policy and S3 bucket to
      share the key with all accounts under your organization
    Type: String
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We will reference this Parameter in the Resource section.&lt;/p&gt;

&lt;p&gt;Add this CodeSnippet to the &lt;strong&gt;FileAssetsBucketEncryptionKey&lt;/strong&gt; Resource in to the Key Policy Section. This will&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        KeyPolicy:
        Statement:
          - Action:
          ....
          - Action:
              - kms:Decrypt
              - kms:DescribeKey
            Effect: Allow
            Principal:
              AWS: "*"
            Resource: "*"
            Condition:
              StringEquals:
                kms:ViaService:
                  - Fn::Sub: s3.${AWS::Region}.amazonaws.com
              ForAnyValue:StringLike:
                aws:PrincipalOrgID:
                - !Ref PrincipalOrgID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Extend the PolicyDocument of the &lt;strong&gt;StagingBucketPolicy&lt;/strong&gt; with the following CodeSnippet. This will ensure that all Accounts of the Organization get access to the objects in the Asset Bucket.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      PolicyDocument:
        Id: AccessControl
        Version: "2012-10-17"
        Statement:
        ...
          - Sid: ''
            Effect: Allow
            Principal: '*'
            Action:
            - s3:Get*

            Resource: !Sub '${StagingBucket.Arn}/*'
            Condition:
              ForAnyValue:StringLike:
                aws:PrincipalOrgID:
                - !Ref PrincipalOrgID
          - Sid: ''
            Effect: Allow
            Principal: '*'
            Action: s3:ListBucket
            Resource: !Sub '${StagingBucket.Arn}'
            Condition:
              ForAnyValue:StringLike:
                aws:PrincipalOrgID:
                - !Ref PrincipalOrgID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After all the adjustments we need to deploy the template.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws cloudformation create-stack \
  --stack-name CDKToolkit \
  --template-body file://bootstrap-template.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F600f8d44147a9ceeb87aabcce6e44b2f7f97e9cd-280x280.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fglobaldatanet.com%2Fimages%2Fcms%2F600f8d44147a9ceeb87aabcce6e44b2f7f97e9cd-280x280.webp" alt="Blog Content"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up Your CDK Project
&lt;/h2&gt;

&lt;p&gt;After bootstrapping our Account we are ready to Initialize a new CDK project. We will do that in a new directory. The initialisation creates a new CDK project structure with a &lt;code&gt;sample lib/stackset-cdk-demo-stack.ts&lt;/code&gt; file, which we will modify to create our StackSet.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Create new directory
mkdir stackset-cdk-demo
cd stackset-cdk-demo

#Init new CDK Project
cdk init app --language typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Define the StackSet
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;lib/stackset-cdk-demo-stack.ts&lt;/code&gt; and remove the example stack definition. We'll define our stackset instead:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as cdk from 'aws-cdk-lib';
import * as servicecatalog from 'aws-cdk-lib/aws-servicecatalog';
import { StackSetTemplate } from "./stackSetTemplate";
import * as s3 from "aws-cdk-lib/aws-s3";

export class StackSetCdkDemoStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);


    const stackSetTemplateSandbox = new StackSetTemplate(this, "stacksettemplate", {
      Config: props.stacksetProps,
      assetBucket: s3.Bucket.fromBucketName(this, "assetbucket", "myCDKAssetBucket")
    });

    new cdk.CfnStackSet(this, "TESTSTACKSET", {
      permissionModel: "SELF_MANAGED",
      stackSetName: "TEST-STACKSET",
      description:
        "example of StackSet with CDK",
      capabilities: ["CAPABILITY_NAMED_IAM"],
      templateUrl: servicecatalog.CloudFormationTemplate.fromProductStack(stackSetTemplateSandbox).bind(this).httpUrl,
      operationPreferences: {
        failureToleranceCount: 30,
        maxConcurrentCount: 30,
      }
    });
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;⚠️ Ensure to adjust the myCDKAssetBucket to your AWS Account Assets Bucket.&lt;/p&gt;

&lt;p&gt;🚨 Using the servicecatalog ProductStack construct we get rid of the PseudoParameter for the assets bucket in lambdas in the template.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ Without using the servicatalog ProductStack:

!sub cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}

✅ Using the servicatalog ProductStack:

cdk-hnb659fds-assets-123456789012-eu-central-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Undefined&lt;/p&gt;

&lt;p&gt;This workaround will ensure that all AWS accounts can access the assets in our CDK app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create StackSet template
&lt;/h2&gt;

&lt;p&gt;In the lib directory create a new file called &lt;strong&gt;&lt;code&gt;stackSetTemplate.ts&lt;/code&gt;&lt;/strong&gt; and add the following code to the file:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as cdk from "aws-cdk-lib";&lt;br&gt;
import { Construct } from "constructs";&lt;br&gt;
import * as servicecatalog from "aws-cdk-lib/aws-servicecatalog";&lt;br&gt;
import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";&lt;br&gt;
import * as lambda from "aws-cdk-lib/aws-lambda";

&lt;p&gt;//Standardstackdefinition&lt;br&gt;
export class StackSetTemplate extends servicecatalog.ProductStack {&lt;br&gt;
// export class CdkStack extends cdk.Stack {&lt;br&gt;
  constructor(scope: Construct, id: string, props: cdk.StackProps) {&lt;br&gt;
    super(scope, id, props);&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Dummy Node JS Lambda Function
 */
  const lambdaFunction = new NodejsFunction(this, "testFunction", {
    memorySize: 128,
    timeout: cdk.Duration.seconds(60),
    runtime: lambda.Runtime.NODEJS_18_X,
    handler: "handler",
    entry: path.join(__dirname, "lambda/index.ts"),
    bundling: {
      minify: true,
      externalModules: ["aws-sdk"]
    }
  });
  lambdaFunction.applyRemovalPolicy(cdk.RemovalPolicy.RETAIN);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;}&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Example Lambda Code&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Create a new directory &lt;strong&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/strong&gt; in the &lt;strong&gt;&lt;code&gt;lib&lt;/code&gt;&lt;/strong&gt; directory. In the new lambda directory create a new file called &lt;strong&gt;&lt;code&gt;index.ts&lt;/code&gt;&lt;/strong&gt; and add the following code:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Handler } from 'aws-lambda';

&lt;p&gt;export const handler: Handler = async (event, context) =&amp;gt; {&lt;br&gt;
    console.log('EVENT: \n' + JSON.stringify(event, null, 2));&lt;br&gt;
    return context.logStreamName;&lt;br&gt;
};&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Deploy the StackSet&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;cdk deploy&lt;/code&gt;&lt;br&gt;&lt;br&gt;
in a terminal to deploy the StackSet and associated CloudFormation stacks.&lt;/p&gt;

&lt;p&gt;ℹ️ CDK will ask you to confirm that you want to deploy the changes. Type &lt;strong&gt;y&lt;/strong&gt; and press Enter to continue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we've explored how to create a StackSet using AWS CDK. We also learned how to share the CDK Assets to the whole AWS Organization. StackSets are an essential tool for managing infrastructure at scale across multiple AWS accounts and regions. Using CDK, you can easily define and deploy complex cloud infrastructure as code, and leverage the full power of AWS CloudFormation to ensure consistency, compliance, and efficiency across your organisation's cloud resources.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cdk</category>
      <category>devops</category>
      <category>governance</category>
    </item>
    <item>
      <title>Enterprise-scaled Self-Healing StackSets</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Mon, 29 May 2023 14:40:06 +0000</pubDate>
      <link>https://forem.com/aws-builders/enterprise-scaled-self-healing-stacksets-4ff5</link>
      <guid>https://forem.com/aws-builders/enterprise-scaled-self-healing-stacksets-4ff5</guid>
      <description>&lt;p&gt;With more than 5 million articles from over 7,000 brands, OTTO is one of the leading German online shopping platforms. In the future, it will open up to even more brands and partners as part of its transformation. OTTO is part of the internationally active Otto Group, with headquarters in Hamburg, and employs 6,100 people throughout Germany. In the 2020/21 financial year, OTTO generated revenues of 4.5 billion euros.&lt;/p&gt;

&lt;p&gt;At OTTO, we faced several challenges to operate &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html"&gt;AWS CloudFormation StackSets&lt;/a&gt; at Scale. We must govern several hundred AWS accounts for our product teams, all while balancing the need for agility and control.&lt;/p&gt;

&lt;p&gt;At this scale, operations can take a lot of time, because there are multiple operational tasks that we need to do when AWS accounts are leaving the &lt;a href="https://aws.amazon.com/organizations/"&gt;AWS Organization&lt;/a&gt; or Teams are &lt;a href="https://github.com/rebuy-de/aws-nuke"&gt;nuking&lt;/a&gt; the AWS account, StackSets Instances get drifted, because not all required resources for compliance can be secured ( &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/organization-scp-size/#:~:text=The%20maximum%20size%20for%20SCPs,root%2C%20or%20account%20is%20five."&gt;SCP Limitations&lt;/a&gt; ), existing AWS accounts are joining the AWS Organization and all mandatory StackSets needs to be deployed, and manual steps should be reduced to a minimum. Furthermore, there is no feature from the Service itself to gain an overview of the status of drifted Instances and the general health of your StackSet health and compliance.&lt;/p&gt;

&lt;p&gt;The cloud competence center at OTTO IT, also known as the Governance at Scale (GAS) team, developed a solution for self-healing on StackSets, that is integrated into the OTTO tooling ecosystem with Confluence and Microsoft Teams.&lt;/p&gt;

&lt;p&gt;OTTO worked with globaldatanet to set up its Landing Zone. &lt;a href="https://globaldatanet.com/"&gt;globaldatanet&lt;/a&gt; is an award-winning AWS Advanced Consulting Partner and longtime Cloud Solution Provider for OTTO, supporting the team in cloud security and GAS. Their focus on building cloud-native solutions using Serverless supported over 100 companies within 5 years to develop and innovate products and services in the cloud.&lt;/p&gt;

&lt;p&gt;In this post, we’ll demonstrate how to implement fully automated enterprise-scaled self-healing on StackSets using AWS StepFunctions and create a Dashboard to get an overview of your StackSet health and compliance and reduce operational time.&lt;/p&gt;

&lt;p&gt;The solution workflow includes the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; The tagging concept for StackSets&lt;/li&gt;
&lt;li&gt; Automatically create StackSets configuration in SSM Parameter Store&lt;/li&gt;
&lt;li&gt; Implementing StepFunction for StackSet Self-Healing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s see how this works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;The following prerequisites are necessary for following along with the contents of this post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account"&gt;Two existing AWS Accounts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Few AWS StackSets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Solution overview
&lt;/h2&gt;

&lt;p&gt;The following architecture shows the whole solution of the Self Healing StackSets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3kNCb5LP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/73ad2c0392dc4f62fff9d5fbe3060e6a0df7ff3b-1459x561.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3kNCb5LP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/73ad2c0392dc4f62fff9d5fbe3060e6a0df7ff3b-1459x561.webp" alt="Blog Content" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Architecture of fully-automated Self Healing Solution with integration to Confluence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tagging concept for StackSets
&lt;/h3&gt;

&lt;p&gt;The solution requires a JSON file in the AWS parameter store, the easiest way is to create it automatically based on the StackSet configurations and the tags assigned there. We'll go into more detail about this in the next section of the Automatically create StackSets configuration Parameter Store article. In the following, we describe which tags we introduced to our StackSet and what we need these tags for.&lt;/p&gt;

&lt;p&gt;⚠️ AWS tags do not allow commas in value, so ":" as divider for arrays&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;antidependson&lt;/td&gt;
&lt;td&gt;StackSet Name&lt;/td&gt;
&lt;td&gt;antidependson marks stacksets which collide with each other.&lt;/td&gt;
&lt;td&gt;MYSTACKSET&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dependson&lt;/td&gt;
&lt;td&gt;[List of StackSet Names]&lt;/td&gt;
&lt;td&gt;List of Stacksets that need to be rolled out before deploying this stackset (e.g. Enable Config before Activate Config Rules). NOTE : Please reduce to only one dependson-stackset for now. Form "chains" for multi-dependencies.&lt;/td&gt;
&lt;td&gt;MY-STACKSET1:MYSTACKSET2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mandatory&lt;/td&gt;
&lt;td&gt;true or false&lt;/td&gt;
&lt;td&gt;The stackset instances must be present on all AWS accounts&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;selfhealing&lt;/td&gt;
&lt;td&gt;true or false&lt;/td&gt;
&lt;td&gt;StackSet can be healed via Delete &amp;amp; Redeploy (exception e.g. IDP roles) - Parameter Overwrites will be cached.&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;region&lt;/td&gt;
&lt;td&gt;[Regions]&lt;/td&gt;
&lt;td&gt;List of Regions in which the stackset instances are to be deployed&lt;/td&gt;
&lt;td&gt;eu-west-1:eu-central-1:us-east-1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Automatically create StackSets configuration Parameter Store
&lt;/h3&gt;

&lt;p&gt;The automated generation of the Stackset-configuration via JSON inside the ParameterStore is a multi-purpose-utility:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Removing the chore to configure manually a JSON-document&lt;/li&gt;
&lt;li&gt; Ensure the Account vending-machines knows what to deploy in which order&lt;/li&gt;
&lt;li&gt; Supporting the self-healing StepFunction about the expected setup of the member-accounts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Lambda responsible for the task is invoked via a Events-Rule:&lt;br&gt;&lt;br&gt;
Every time a Stackset-Operation has been finished with status "succeeded".&lt;br&gt;&lt;br&gt;
This is due the tags on a Stackset are part of the stackset, not Additional items describing a Stackset, therefore a change to the tags always will result in a Stackset-Update-operation.  &lt;/p&gt;

&lt;p&gt;In terms of computerscience the Lambda is quite interesting, as the primary problem was to build a nonweighted tree based on the "dependson" and "antidependson" tags and then compile an ordered one-dimensional list, like in the good old "travelling salesmen"-problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementing StepFunction for StackSet Self-Healing
&lt;/h3&gt;

&lt;p&gt;AWS Step Functions is a cloud service that enables you to coordinate the components of distributed applications and microservices using visual workflows. It allows you to build and automate the execution of complex processes and tasks across multiple AWS services, using a visual interface to define and execute your workflows. Since the Self Healing Solutions needs a complex workflow we decided to use Step Functions for this Usecase. Following we will explain you the workflow of the Self Healing.&lt;/p&gt;

&lt;h4&gt;
  
  
  StepFunction Workflow
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hVP5DjD2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/a701712d51949496331e32828724ecf6ef673448-877x1074.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hVP5DjD2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/a701712d51949496331e32828724ecf6ef673448-877x1074.webp" alt="Blog Content" width="800" height="980"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Functionality
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;ƛ Serverless Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;StackSetInitCleanupLambda&lt;/strong&gt;: Performs a search to identify StackSet instances of AWS Accounts that are either not present within the AWS Organization or deployed to AWS accounts that are suspended. Once identified, proceed with the deletion of these instances from all associated StackSets.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MandatoryStackSetDeploymentLambda&lt;/strong&gt;: Search missing StackSets Instances (which are tagged with mandatory = true) and deploy those Instances&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetDriftDetectionLambda&lt;/strong&gt;: Trigger &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DetectStackDrift.html"&gt;Drift Detection&lt;/a&gt; on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TriggerDriftStatusLambda&lt;/strong&gt;: Check if Drift Detection is completed on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;SearchStackSetInstanceToHealLambda&lt;/strong&gt;: Searches for drifted StackSet Instances from StackSets which are tagged with &lt;strong&gt;Selfhealing = true&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetCleanupLambda&lt;/strong&gt;: Removes unhealthy StackSet Instances and redeploys them. Parameter Overrides will be cached so the new deployed instance will have the same setting as before.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StatusPrepareHTMLLambda&lt;/strong&gt;: Prepare the HTML output Dashboard for Confluence and Json log file of the current StackSet Healthiness State&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TeamsNotificationLambda&lt;/strong&gt;: Send Teams Notification which summary to notify the GAS Team after each execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;？！Decisions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;InitCleanup Complete:&lt;/strong&gt; Check whether all unnecessary instances have been removed. If not, StepFunction is triggering the &lt;strong&gt;StackSetInitCleanupLambda&lt;/strong&gt; function again.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MandatoryStackSetDeployment Complete&lt;/strong&gt;: Checks whether all mandatory instances have been deployed. If not, StepFunction is triggering the &lt;strong&gt;MandatoryStackSetDeploymentLambda&lt;/strong&gt; function again.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;StackSetDriftDetection Complete:&lt;/strong&gt; Wait until StackSet Drift Detection has been finished on all StackSets&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Healing Complete:&lt;/strong&gt; Check if all unhealthy Instances are healed otherwise invoke &lt;strong&gt;StackSetCleanupLambda&lt;/strong&gt; again&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;While developing the solution we faced several limitations. Here are our findings and solutions for that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html"&gt;🚨 StackSets instance operations&lt;/a&gt;:&lt;/strong&gt; Maximum number of stack instances, across all stack sets, that you can run operations on in each Region at the same time, per administrator account is limited to 10.000 operations.  &lt;/p&gt;

&lt;p&gt;✅ We implemented a counter to count the current StackSets operations which are in progress, in addition we also catching the Exception from CloudFormation and waiting few seconds to try the operation again.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;🚨 Parameter Overwrites Caching:&lt;/strong&gt; Whenever removing a drifted StackSet Instance which has Parameter Overwrite you will lose the individually parameters of the Instance.  &lt;/p&gt;

&lt;p&gt;✅ Before deleting the drifted StackSet Instance we cache the Parameter Overwrites and deploy the StackSet Instance after successful deletion again with the cached Parameter Overwrites again.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2020/09/aws-step-functions-increases-payload-size-to-256kb/"&gt;🚨AWS Step Functions Payload size:&lt;/a&gt;&lt;/strong&gt; AWS Step Functions supports payload sizes up to 256KB. For our solution we need more Payloads between the States especially when we want to pass our log or the concurrent Parameter Overwrites per StackSet.  &lt;/p&gt;

&lt;p&gt;✅ We are storing our states in an S3 bucket to pass the state. At the end of the execution we are deleting the state from S3 to not to influence the next Step Function execution with the wrong state.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Documentation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After each execution of the StackSet Health StepFunction, we aim to notify our GAS team about the actions taken during the previous run. Therefore, we have implemented a Teams notification that includes a status update, a link to the generated dashboard, and a link to the log file.&lt;/p&gt;

&lt;p&gt;The following screenshot illustrates an example of a Teams notification. It provides a summary report and directs you to the dashboard and log file for further details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CcB0cbwJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/9fc7f6a337e34d6785f8a511b57143d4fe68f17f-609x387.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CcB0cbwJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/9fc7f6a337e34d6785f8a511b57143d4fe68f17f-609x387.webp" alt="Blog Content" width="609" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dashboard
&lt;/h3&gt;

&lt;p&gt;Our StackSet Health Dashboard is a simple HTML file which will be generated trough a Lambda Function, saved in S3 and will be distributed trough a CloudFrount. You can integrate this Dashboards in your Confluence or any other internal Wiki. This Dashboard is secured via CloudFormation Function - additionally you can also add a &lt;a href="https://globaldatanet.com/solutions/web-application-firewalls-at-scale"&gt;Firewall&lt;/a&gt; to restrict the access to an specific CIDR or Geographic region and prevent access from third parties. The screenshot below provides an example of the overall StackSet Health status information for an entire AWS Organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0tk2gglT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/cfe9d56ad3dc1596dc5bbd743dff3f502ee4c8b6-1376x499.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0tk2gglT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://globaldatanet.com/images/cms/mobile/cfe9d56ad3dc1596dc5bbd743dff3f502ee4c8b6-1376x499.webp" alt="Blog Content" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post, we demonstrated a solution to automatically heal AWS CloudFormation StackSets at scale. By implementing this Solution Organisations we reduced manual effort for StackSet cleanup operations by 4 hours per week, improved the overall reliability of our StackSets, increased our compliance in the organisation, and managed to get a daily updated overview for all StackSet Instances using the dashboards. In summary, the self-healing CloudFormation StackSets solution combines automation, monitoring, and self-recovery capabilities to deliver a robust and resilient system for StackSets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vbsr6V-3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg3zazfc8na45c08th27.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vbsr6V-3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg3zazfc8na45c08th27.jpg" alt="Image description" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>governance</category>
      <category>devops</category>
    </item>
    <item>
      <title>Serverless querying and evaluating of Logs using Athena Part 2</title>
      <dc:creator>David Krohn</dc:creator>
      <pubDate>Tue, 21 Mar 2023 09:08:22 +0000</pubDate>
      <link>https://forem.com/aws-builders/serverless-querying-and-evaluating-of-logs-using-athena-part-2-3ip3</link>
      <guid>https://forem.com/aws-builders/serverless-querying-and-evaluating-of-logs-using-athena-part-2-3ip3</guid>
      <description>&lt;p&gt;In part one of this blog series, "Serverless Querying and Evaluating of Logs Using Athena," we discussed the importance of logging and monitoring in your organization and how to implement it in a serverless way for the most critical AWS services. We also showed you how to use partition projection in Athena to fully automate partition management. These partition projections are configured through Glue parameters, with each table having an account parameter that includes all AWS Account IDs required as partitions to query for.&lt;/p&gt;

&lt;p&gt;However, the question arises of how to keep these parameters automated and up-to-date with the current status of the AWS Organization. New accounts can be created at any time, or accounts can join the AWS Organization via invitation. To avoid manually maintaining all parameters of the Glue tables for these events, we have an automation solution for you.&lt;/p&gt;

&lt;p&gt;ℹ️ We actually decided to not remove AWS Account Ids from the partition parameter whenever an AWS Account leaves the AWS Organizations or will be SUSPENDED, because the logs are still valid and maybe needed whenever an request for this account from the past is made in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Overview
&lt;/h3&gt;

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

&lt;p&gt;Our automation creates an EventBridge where the Management Account of our AWS Organization has access to perform a "PutEvent" action. This PutEvent action to our central EventBridge will be performed each time a new AWS Account is successfully created in our AWS Organization (CreateAccountResult) or an existing AWS Account accepts the AWS Organization invitation (AcceptHandshake). This event will trigger a Lambda function through our central EventBridge, which will update our existing Glue tables for the new AWS Account ID for the specific Glue table parameter required as input for the AWS Accounts partition. After this automated update, you will be able to query your logs immediately after your new AWS Accounts have been created or your AWS Account has joined your AWS Organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source
&lt;/h3&gt;

&lt;p&gt;We have published the complete code of the solution freely on &lt;a href="https://github.com/daknhh/cdk-glue-autoupdate"&gt;Github&lt;/a&gt; as we want to give something back to the community. We hope you find this solution helpful in automating your indexes for Glue / Athena tables! If you have any feedback about the solution, please feel free to reach out to us or open a github &lt;a href="https://github.com/daknhh/cdk-glue-autoupdate/issues"&gt;issue&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Automating the Glue partitions will help you with your daily work so that no one needs to worry about adding new AWS Accounts to the partition parameters. This ensures that decisions due to missing information in log queries are prevented, and your queries for the information sources are kept up to date.&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>aws</category>
      <category>cdk</category>
    </item>
  </channel>
</rss>
