<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Security | Tech Learning Hub</title><link>https://www.tech-learning-hub.com/tag/security/</link><atom:link href="https://www.tech-learning-hub.com/tag/security/index.xml" rel="self" type="application/rss+xml"/><description>Security</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Sat, 03 Oct 2026 00:00:00 +0000</lastBuildDate><image><url>https://www.tech-learning-hub.com/media/logo_hu17383905045384214746.png</url><title>Security</title><link>https://www.tech-learning-hub.com/tag/security/</link></image><item><title>AWS Multi-Account Strategy</title><link>https://www.tech-learning-hub.com/cheatsheets/aws/multi-account/</link><pubDate>Sat, 03 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.tech-learning-hub.com/cheatsheets/aws/multi-account/</guid><description>&lt;p>One AWS account is a useful starting point. A well-designed &lt;strong>account portfolio&lt;/strong> is how a growing team gives workloads room to move without giving risk room to spread.&lt;/p>
&lt;h2 id="-multi-account-strategies">🧭 Multi-Account Strategies&lt;/h2>
&lt;p>An AWS account is more than a billing container: it is a strong boundary for identity, quotas, operational ownership, and many security controls. Separate accounts when workloads need different owners, environments, data classifications, or blast-radius limits.&lt;/p>
&lt;details class="accordion rounded border dark:border-darkBorder" >
&lt;summary class="flex items-center px-4 py-2 font-bold before:mr-0.5 before:-mt-0.5 before:text-xl before:text-gray-400">A practical account layout&lt;/summary>
&lt;div class="border-t px-4 py-2 dark:border-darkBorder">&lt;ul>
&lt;li>&lt;strong>Management&lt;/strong>: owns the AWS Organization and billing; keep workloads out.&lt;/li>
&lt;li>&lt;strong>Security&lt;/strong>: central security tooling, investigation, and delegated security services.&lt;/li>
&lt;li>&lt;strong>Log archive&lt;/strong>: tightly controlled destination for organization-wide audit logs.&lt;/li>
&lt;li>&lt;strong>Shared services&lt;/strong>: approved common services such as directory, artifact, or DNS services.&lt;/li>
&lt;li>&lt;strong>Workloads&lt;/strong>: separate production, non-production, and sandbox environments where the risk and ownership justify it.&lt;/li>
&lt;/ul>
&lt;p>Start with a small number of purposeful accounts and automate account creation. Avoid both extremes: one account for everything, and an account for every tiny component before you can operate them.&lt;/p>&lt;/div>
&lt;/details>
&lt;p>Good boundaries make incidents easier to contain, costs easier to attribute, and policy easier to reason about. They also add moving parts: cross-account roles, network paths, quotas, and deployment workflows all need deliberate design.&lt;/p>
&lt;h2 id="-aws-organizations">🌳 AWS Organizations&lt;/h2>
&lt;p>AWS Organizations groups accounts into an &lt;strong>organization&lt;/strong>. The management account creates the organization, invites or creates accounts, arranges them into &lt;strong>organizational units (OUs)&lt;/strong>, and applies organization-level policies.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Building block&lt;/th>
&lt;th>What it does&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Root&lt;/td>
&lt;td>Top of the organization hierarchy; every account belongs under it.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>OU&lt;/td>
&lt;td>Groups accounts with similar purpose or governance needs. OUs can nest.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Member account&lt;/td>
&lt;td>A workload or shared-purpose account governed by the organization.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Management account&lt;/td>
&lt;td>Owns organization-wide administration and consolidated billing. Keep workloads elsewhere.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Use OUs to express &lt;strong>policy boundaries&lt;/strong>, not just org charts. A common pattern is &lt;code>Security&lt;/code>, &lt;code>Infrastructure&lt;/code>, and &lt;code>Workloads&lt;/code>, with workload OUs split further by environment or regulatory needs. Keep the hierarchy shallow enough that operators can predict inherited policy.&lt;/p>
&lt;p>Consolidated billing provides a combined bill and may enable eligible pricing benefits across accounts; it does &lt;strong>not&lt;/strong> merge account resources or replace chargeback and budget controls.&lt;/p>
&lt;h2 id="-service-control-policies">🛑 Service Control Policies&lt;/h2>
&lt;p>An &lt;strong>SCP&lt;/strong> sets the maximum permissions available to IAM users and roles in member accounts. It is a guardrail around what account administrators can grant, not a permission grant itself. An identity still needs an IAM allow, and an SCP must not block the requested action.&lt;/p>
&lt;ul>
&lt;li>Attach policies to the organization root, an OU, or an account; the effective boundary follows the hierarchy.&lt;/li>
&lt;li>Explicit denies override allows. A restrictive allow-list SCP can also limit what is possible below it.&lt;/li>
&lt;li>SCPs do not affect principals in the management account and do not restrict service-linked roles.&lt;/li>
&lt;li>Roll out new guardrails in a test OU first; an overly broad deny can block account operations and deployments.&lt;/li>
&lt;li>Keep emergency access and policy-change procedures documented and tested.&lt;/li>
&lt;/ul>
&lt;p>Think of the decision as two gates: &lt;strong>identity/resource permissions allow the action&lt;/strong>, and &lt;strong>organization guardrails do not deny it&lt;/strong>. Both must be true.&lt;/p>
&lt;h2 id="-iam-identity-center">👤 IAM Identity Center&lt;/h2>
&lt;p>IAM Identity Center gives people one sign-in experience for access to multiple AWS accounts. Connect it to an identity source, organize people into groups, create &lt;strong>permission sets&lt;/strong>, then assign groups to accounts.&lt;/p>
&lt;ol>
&lt;li>Put users in identity-provider groups that reflect job responsibilities.&lt;/li>
&lt;li>Map groups to permission sets such as &lt;code>ReadOnly&lt;/code>, &lt;code>Developer&lt;/code>, or a carefully controlled &lt;code>Administrator&lt;/code> set.&lt;/li>
&lt;li>Assign those sets to the accounts where the group needs access.&lt;/li>
&lt;li>Review access regularly and remove assignments when roles change.&lt;/li>
&lt;/ol>
&lt;p>Permission sets provision IAM roles in the target accounts and provide temporary credentials. This keeps routine workforce access out of long-lived IAM users and access keys. Use separate, tightly controlled break-glass access for emergencies and monitor its use.&lt;/p>
&lt;h2 id="-aws-control-tower">🧰 AWS Control Tower&lt;/h2>
&lt;p>Control Tower helps establish and govern a multi-account landing zone on top of AWS Organizations. It sets up foundational accounts and logging, provides an account provisioning workflow through &lt;strong>Account Factory&lt;/strong>, and helps apply &lt;strong>controls&lt;/strong> across OUs.&lt;/p>
&lt;ul class="nav nav-tabs" id="control-types" role="tablist">&lt;li class="nav-item">&lt;a data-toggle="tab" class="nav-link active" href="#control-types-0" role="tab" aria-controls="control-types-0" aria-selected="true">Preventive&lt;/a>&lt;/li>
&lt;li class="nav-item">&lt;a data-toggle="tab" class="nav-link" href="#control-types-1" role="tab" aria-controls="control-types-1">Detective&lt;/a>&lt;/li>
&lt;li class="nav-item">&lt;a data-toggle="tab" class="nav-link" href="#control-types-2" role="tab" aria-controls="control-types-2">Proactive&lt;/a>&lt;/li>&lt;/ul>
&lt;div class="tab-content" id="control-types">&lt;div id="control-types-0" class="tab-pane show active" role="tabpanel" aria-labelledby="control-types-0">
&lt;p>&lt;p>Implemented with policy guardrails, commonly SCPs. They block selected actions before a change can happen.&lt;/p>
&lt;/div>
&lt;div id="control-types-1" class="tab-pane" role="tabpanel" aria-labelledby="control-types-1">
&lt;p>&lt;p>Implemented with monitoring and configuration checks. They report noncompliant state for investigation and remediation.&lt;/p>
&lt;/div>
&lt;div id="control-types-2" class="tab-pane" role="tabpanel" aria-labelledby="control-types-2">
&lt;p>&lt;p>Validate supported resources against rules before provisioning through governed workflows. Coverage depends on the resource and control.&lt;/p>
&lt;/div>&lt;/div>
&lt;p>Control Tower is a managed path to consistent governance, not a substitute for understanding Organizations, IAM, networking, or service-specific limits. Register and govern OUs deliberately, and test controls against real deployment needs before broad rollout.&lt;/p>
&lt;h2 id="-cicd-deployment-models">🚦 CI/CD Deployment Models&lt;/h2>
&lt;p>Choose a deployment model that matches the number of accounts, required approval points, and the blast radius you can tolerate.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model&lt;/th>
&lt;th>How it works&lt;/th>
&lt;th>Good fit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Per-account pipeline&lt;/td>
&lt;td>Each workload account owns its build and deploy workflow.&lt;/td>
&lt;td>Independent teams and strong operational autonomy.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Central tooling account&lt;/td>
&lt;td>A shared pipeline assumes deployment roles in workload accounts.&lt;/td>
&lt;td>Standardized controls and a shared platform team.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hybrid&lt;/td>
&lt;td>Shared build and security stages, with team-owned or delegated deployment stages.&lt;/td>
&lt;td>Common governance with different release needs.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Keep the &lt;strong>pipeline definition&lt;/strong> separate from &lt;strong>environment configuration&lt;/strong>. Promote the same versioned artifact through environments, with explicit approval or automated health checks at higher-risk boundaries. Avoid rebuilding different binaries for production after testing a different artifact in staging.&lt;/p>
&lt;h2 id="-cloudformation-stacksets">📦 CloudFormation StackSets&lt;/h2>
&lt;p>CloudFormation StackSets deploy one CloudFormation template to stacks across multiple accounts and Regions. They are useful for repeatable baseline resources such as organization-wide roles, configuration rules, or standard logging components.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Service-managed permissions&lt;/strong> integrate with Organizations and can target OUs or the organization. This is usually the simpler model for organization-wide rollout.&lt;/li>
&lt;li>&lt;strong>Self-managed permissions&lt;/strong> use administrator and execution roles that you manage in the target accounts.&lt;/li>
&lt;li>Configure deployment concurrency and failure tolerance to control rollout risk.&lt;/li>
&lt;li>Use stack instances and drift status to see where the template succeeded and where it did not.&lt;/li>
&lt;/ul>
&lt;p>StackSets are a fleet deployment mechanism, not a universal replacement for account vending or application pipelines. Test changes in a small target set, especially when an update can modify or delete shared resources.&lt;/p>
&lt;h2 id="-aws-cloud-development-kit-cdk">🏗️ AWS Cloud Development Kit (CDK)&lt;/h2>
&lt;p>The AWS CDK lets you define infrastructure in a programming language, compose reusable &lt;strong>constructs&lt;/strong>, and synthesize CloudFormation templates. It gives teams familiar programming tools, while CloudFormation remains the deployment engine.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">CDK source -&amp;gt; tests and policy checks -&amp;gt; cdk synth -&amp;gt; CloudFormation template
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> -&amp;gt; reviewed artifact -&amp;gt; deploy to account/Region
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Pin dependencies and review synthesized templates as deployment artifacts.&lt;/li>
&lt;li>Use constructs to standardize secure defaults, not to hide important behavior.&lt;/li>
&lt;li>Bootstrap each target account and Region before deployment; bootstrap resources establish the roles and assets CDK uses.&lt;/li>
&lt;li>Separate application configuration from secrets, and use explicit environments for account and Region targeting.&lt;/li>
&lt;li>For organization-wide foundations, compare CDK pipelines, ordinary CI/CD, and StackSets against your ownership and rollout model.&lt;/li>
&lt;/ul>
&lt;h2 id="-secrets-manager-for-iac">🔐 Secrets Manager for IaC&lt;/h2>
&lt;p>Infrastructure code should describe &lt;strong>how a workload gets a secret&lt;/strong>, not contain the secret value. Store credentials and other sensitive values in Secrets Manager, scope access to the consuming role, and enable rotation where the service and application support it.&lt;/p>
&lt;ul>
&lt;li>Never commit a secret into source, a CDK context file, a template parameter default, a build log, or a plain environment variable in a pipeline definition.&lt;/li>
&lt;li>Prefer runtime retrieval by the workload role when possible; the secret need not pass through the deployment system at all.&lt;/li>
&lt;li>CloudFormation dynamic references can resolve a Secrets Manager value during resource operations. The target service still needs a secure way to consume it, and not every resource or property supports dynamic references.&lt;/li>
&lt;li>For cross-account retrieval, configure the secret resource policy and KMS key policy as well as the caller&amp;rsquo;s IAM permissions. Share only with named accounts or roles.&lt;/li>
&lt;li>Remember that rotation can invalidate a value cached by an application. Design refresh and reconnect behavior, not just the rotation schedule.&lt;/li>
&lt;/ul>
&lt;details class="accordion rounded border dark:border-darkBorder" >
&lt;summary class="flex items-center px-4 py-2 font-bold before:mr-0.5 before:-mt-0.5 before:text-xl before:text-gray-400">A quick secret-handling test&lt;/summary>
&lt;div class="border-t px-4 py-2 dark:border-darkBorder">Ask: &lt;strong>Could a person with repository, build-log, or template access read the secret?&lt;/strong> If yes, move retrieval to the runtime identity or use a supported secret reference with narrowly scoped access.&lt;/div>
&lt;/details>
&lt;h2 id="-drift-detection-and-remediation">🔎 Drift Detection and Remediation&lt;/h2>
&lt;p>&lt;strong>Drift&lt;/strong> is the difference between the state declared in IaC and the live resource configuration. A console change, emergency fix, or another automation system can create it.&lt;/p>
&lt;ol>
&lt;li>Detect drift with CloudFormation drift detection, AWS Config rules, or an IaC-specific plan/check.&lt;/li>
&lt;li>Triage whether the live change was intentional, unauthorized, or temporary.&lt;/li>
&lt;li>Choose the source of truth: update code and redeploy, or restore the declared state.&lt;/li>
&lt;li>Record the change and fix the process that allowed unreviewed configuration changes.&lt;/li>
&lt;/ol>
&lt;p>Detection coverage varies by resource and property; an &lt;code>IN_SYNC&lt;/code> result is not proof that every aspect of a workload is correct. Remediation should be risk-aware: automatic correction is useful for safe, well-understood controls, but a blanket revert can interrupt a legitimate incident fix or production service.&lt;/p>
&lt;h2 id="-pipeline-security-scanning">🛡️ Pipeline Security Scanning&lt;/h2>
&lt;p>Treat a pipeline as production infrastructure: it can change every account it is trusted by. Add checks before credentials or deployment authority are available wherever possible.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Stage&lt;/th>
&lt;th>Example checks&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Source / pull request&lt;/td>
&lt;td>Secret scanning, peer review, branch protection, dependency and license checks.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Build&lt;/td>
&lt;td>Unit tests, SAST, dependency and container-image scanning.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>IaC validation&lt;/td>
&lt;td>&lt;code>cdk synth&lt;/code>, &lt;code>cfn-lint&lt;/code>, policy-as-code checks such as &lt;code>cfn-guard&lt;/code>, and CDK-specific checks such as &lt;code>cdk-nag&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Artifact&lt;/td>
&lt;td>Immutable/versioned storage, encryption, provenance, and signing where supported.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Deployment&lt;/td>
&lt;td>Least-privilege target roles, approvals for production, and post-deploy health checks.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Use short-lived credentials (for example, OIDC federation from an external CI provider), pin third-party actions and build images, restrict who can change pipeline definitions, and prevent untrusted pull-request code from inheriting deployment credentials.&lt;/p>
&lt;h2 id="-cross-account-pipeline-architecture">🔁 Cross-Account Pipeline Architecture&lt;/h2>
&lt;p>A central pipeline can deploy across account boundaries without copying human credentials. A typical flow is:&lt;/p>
&lt;ol>
&lt;li>A source change starts the pipeline in a dedicated &lt;strong>tooling account&lt;/strong>.&lt;/li>
&lt;li>Build and test stages produce one versioned artifact.&lt;/li>
&lt;li>The pipeline assumes a narrowly scoped deployment role in a non-production account.&lt;/li>
&lt;li>After validation and any required approval, it assumes the corresponding production role.&lt;/li>
&lt;li>The target role deploys the approved artifact and reports status to the pipeline.&lt;/li>
&lt;/ol>
&lt;p>The target role&amp;rsquo;s trust policy should name the specific tooling account and, where practical, constrain which pipeline role can assume it. Its permissions should be limited to the deployment&amp;rsquo;s resources and actions. For encrypted artifacts, grant the target role only the required S3 read and KMS decrypt access; the bucket policy, key policy, and IAM policy must agree.&lt;/p>
&lt;p>Do not let a build job choose arbitrary target role ARNs or accounts. Make approved targets explicit, log role assumptions, and separate production approval from the identity that can modify the pipeline itself.&lt;/p>
&lt;h2 id="-deployment-strategies-and-rollback">🚀 Deployment Strategies and Rollback&lt;/h2>
&lt;p>Use &lt;strong>waves&lt;/strong> to increase confidence gradually: a test account, a small canary set, a broader non-production group, then production. Account waves limit the number of environments affected by a bad change.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Strategy&lt;/th>
&lt;th>Traffic or rollout behavior&lt;/th>
&lt;th>Rollback consideration&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Rolling&lt;/td>
&lt;td>Replace instances or resources in batches.&lt;/td>
&lt;td>Capacity and compatibility must hold while old and new versions coexist.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Blue/green&lt;/td>
&lt;td>Deploy a parallel environment, then shift traffic.&lt;/td>
&lt;td>Fast traffic reversal is possible if the old environment remains healthy.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Canary&lt;/td>
&lt;td>Send a small share of traffic to the new version, then increase it.&lt;/td>
&lt;td>Automate metrics-based alarms and stop conditions.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>All at once&lt;/td>
&lt;td>Update all targets in one operation.&lt;/td>
&lt;td>Fast, but exposes the full target set to a defect at once.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Rollback is not always a simple redeploy. Database changes, one-way data migrations, and external side effects may not be reversible. Favor backward-compatible schema changes, keep artifacts immutable, define health metrics and alarms, and document when the correct recovery is &lt;strong>roll forward&lt;/strong> instead.&lt;/p>
&lt;h2 id="-putting-it-together---finished-architecture">🧩 Putting It Together - Finished Architecture&lt;/h2>
&lt;p>Here is one starting architecture: Organizations and Control Tower govern purpose-built OUs; Identity Center gives people temporary access; a tooling account builds and scans a single artifact, then deploys through constrained cross-account roles; security and log archive accounts centralize oversight.&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="AWS multi-account organization and cross-account CI/CD deployment architecture"
src="https://www.tech-learning-hub.com/media/images/uploads/aws-multi-account-architecture.svg"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;p>Use the diagram as a conversation starter, not a universal blueprint. Add accounts, network boundaries, and approval steps where different ownership, data sensitivity, or recovery requirements justify them. The strongest design is the one your team can explain, operate, and test.&lt;/p></description></item></channel></rss>