[{"data":1,"prerenderedAt":305},["ShallowReactive",2],{"practiceExams":3,"studies":184,"free-lesson-\u002Fcourses\u002Faws-certified-solutions-architect-professional\u002Flessons\u002Frow-level-security-tenant-bound-policies-for-shared-tables-sap-c03":185},[4,22,36,48,60,72,84,97,109,120,130,141,154,163,175],{"id":5,"slug":6,"description":7,"questionCount":8,"isActive":9,"datePublicModified":10,"difficulty":11,"examVersion":18},22,"aws-certified-solutions-architect-professional-sap-c03","Prepare for the AWS Certified Solutions Architect - Professional (SAP-C03) exam with realistic practice questions on architecture, security, cost, resilience and automation, with detailed explanations.",767,true,"2026-11-15T00:00:00.000Z",{"providerId":12,"title":13,"subtitle":14,"slug":15,"coverImageUrl":16,"level":17},1,"AWS Certified Solutions Architect - Professional","SAP-C02","aws-certified-solutions-architect-professional","\u002Fimages\u002Fdifficulties\u002Faws-certified-solutions-architect-professionalsap-c02\u002Fcovers\u002Faws-SAP-C02.png","advanced",{"slug":6,"code":19,"dateBetaStart":20,"dateReleased":21,"pageSlug":15},"SAP-C03",null,"2026-11-17",{"id":23,"slug":24,"description":25,"questionCount":26,"isActive":9,"datePublicModified":27,"difficulty":28,"examVersion":34},5,"aws-certified-cloud-practitioner-clf-c02","Master your AWS Certified Cloud Practitioner exam with our Practice Exam Simulator. Prepare effectively and assess your readiness with realistic practice exams designed to mirror the most popular official AWS exam.",937,"2026-10-30T00:00:00.000Z",{"providerId":12,"title":29,"subtitle":30,"slug":31,"coverImageUrl":32,"level":33},"AWS Certified Cloud Practitioner","CLF-C02","aws-certified-cloud-practitioner","\u002Fimages\u002Fdifficulties\u002Faws-certified-cloud-practitionerclf-c02\u002Fcovers\u002Faws-CLF-C02.png","foundational",{"slug":24,"code":30,"dateBetaStart":20,"dateReleased":35,"pageSlug":31},"2023-09-19",{"id":37,"slug":38,"description":39,"questionCount":40,"isActive":9,"datePublicModified":27,"difficulty":41,"examVersion":46},8,"aws-certified-devops-engineer-professional-dop-c02","Boost your readiness for the AWS Certified DevOps Engineer - Professional (DOP-C02) exam with our practice exam simulator. Featuring realistic questions and detailed explanations, it helps you identify knowledge gaps and improve your skills.",1040,{"providerId":12,"title":42,"subtitle":43,"slug":44,"coverImageUrl":45,"level":17},"AWS Certified DevOps Engineer - Professional","DOP-C02","aws-certified-devops-engineer-professional","",{"slug":38,"code":43,"dateBetaStart":20,"dateReleased":47,"pageSlug":44},"2023-03-07",{"id":49,"slug":50,"description":51,"questionCount":52,"isActive":9,"datePublicModified":27,"difficulty":53,"examVersion":57},11,"aws-certified-ai-practitioner-aif-c01","Prepare for the AWS Certified AI Practitioner exam with our practice exam simulator. Realistic questions on AI, machine learning and generative AI fundamentals, with detailed explanations, help you find your knowledge gaps and assess your readiness.",928,{"providerId":12,"title":54,"subtitle":55,"slug":56,"coverImageUrl":45,"level":33},"AWS Certified AI Practitioner","AIF-C01","aws-certified-ai-practitioner",{"slug":50,"code":55,"dateBetaStart":58,"dateReleased":59,"pageSlug":56},"2024-08-13","2024-10-22",{"id":12,"slug":61,"description":62,"questionCount":63,"isActive":9,"datePublicModified":27,"difficulty":64,"examVersion":70},"aws-certified-solutions-architect-associate-saa-c03","Unlock your potential with the AWS Certified Solutions Architect - Associate Practice Exam Simulator. This comprehensive tool is designed to prepare you thoroughly and assess your readiness for the most sought-after AWS associate certification.",1203,{"providerId":12,"title":65,"subtitle":66,"slug":67,"coverImageUrl":68,"level":69},"AWS Certified Solutions Architect - Associate","SAA-C03","aws-certified-solutions-architect-associate","\u002Fimages\u002Fdifficulties\u002Faws-certified-solutions-architect-associatesaa-c03\u002Fcovers\u002Faws-SAA-C03.png","associate",{"slug":61,"code":66,"dateBetaStart":20,"dateReleased":71,"pageSlug":67},"2022-08-30",{"id":73,"slug":74,"description":75,"questionCount":76,"isActive":9,"datePublicModified":27,"difficulty":77,"examVersion":81},9,"aws-certified-data-engineer-associate-dea-c01","Prepare for your AWS Certified Data Engineer - Associate exam with our practice exam simulator. Featuring real exam scenarios, detailed explanations, and instant feedback to boost your confidence and success rate.",891,{"providerId":12,"title":78,"subtitle":79,"slug":80,"coverImageUrl":45,"level":69},"AWS Certified Data Engineer - Associate","DEA-C01","aws-certified-data-engineer-associate",{"slug":74,"code":79,"dateBetaStart":82,"dateReleased":83,"pageSlug":80},"2023-11-27","2024-03-12",{"id":85,"slug":86,"description":87,"questionCount":88,"isActive":9,"datePublicModified":89,"difficulty":90,"examVersion":94},17,"aws-certified-generative-ai-developer-professional-aip-c01","Get ready for the AWS Certified Generative AI Developer - Professional exam with our practice exam simulator. Realistic scenario-based questions with detailed explanations help you assess your readiness to build generative AI solutions on AWS.",982,"2026-10-29T00:00:00.000Z",{"providerId":12,"title":91,"subtitle":92,"slug":93,"coverImageUrl":45,"level":17},"AWS Certified Generative AI Developer - Professional","AIP-C01","aws-certified-generative-ai-developer-professional",{"slug":86,"code":92,"dateBetaStart":95,"dateReleased":96,"pageSlug":93},"2025-11-28","2026-03-17",{"id":98,"slug":99,"description":100,"questionCount":101,"isActive":9,"datePublicModified":89,"difficulty":102,"examVersion":107},13,"aws-certified-security-specialty-scs-c03","Advance your career in cloud security with the AWS Certified Security - Specialty (SCS-C03) Exam Simulator. Realistic, scenario-based practice exams mirror the official exam, with detailed explanations to close your knowledge gaps.",864,{"providerId":12,"title":103,"subtitle":104,"slug":105,"coverImageUrl":106,"level":17},"AWS Certified Security - Specialty","SCS-C03","aws-certified-security-specialty","\u002Fimages\u002Fdifficulties\u002Faws-certified-security-specialtyscs-c02\u002Fcovers\u002Faws_SCS_c02.png",{"slug":99,"code":104,"dateBetaStart":20,"dateReleased":108,"pageSlug":105},"2025-12-01",{"id":110,"slug":111,"description":112,"questionCount":113,"isActive":9,"datePublicModified":89,"difficulty":114,"examVersion":118},19,"aws-certified-machine-learning-engineer-associate-mla-c02","Prepare for the AWS Certified Machine Learning Engineer - Associate exam with our practice exam simulator. Realistic questions with detailed explanations help you find your knowledge gaps and assess your readiness to build and run ML workloads on AWS.",861,{"providerId":12,"title":115,"subtitle":116,"slug":117,"coverImageUrl":45,"level":69},"AWS Certified Machine Learning Engineer - Associate","MLA-C02","aws-certified-machine-learning-engineer-associate",{"slug":111,"code":116,"dateBetaStart":119,"dateReleased":20,"pageSlug":117},"2026-09-29",{"id":121,"slug":122,"description":123,"questionCount":124,"isActive":9,"datePublicModified":89,"difficulty":125,"examVersion":129},15,"aws-certified-ai-business-strategist-aib-c01","Prepare for the AWS Certified AI Business Strategist exam with our practice exam simulator. Realistic, scenario-based questions with detailed explanations help you assess your readiness to lead AI adoption on AWS and close your knowledge gaps.",848,{"providerId":12,"title":126,"subtitle":127,"slug":128,"coverImageUrl":45,"level":33},"AWS Certified AI Business Strategist","AIB-C01","aws-certified-ai-business-strategist",{"slug":122,"code":127,"dateBetaStart":119,"dateReleased":20,"pageSlug":128},{"id":131,"slug":132,"description":133,"questionCount":134,"isActive":9,"datePublicModified":89,"difficulty":135,"examVersion":139},21,"aws-certified-cloudops-engineer-associate-soa-c03","Prepare for the AWS Certified CloudOps Engineer - Associate exam with our practice exam simulator. Realistic questions with detailed explanations help you assess your readiness to deploy, operate and troubleshoot workloads on AWS.",862,{"providerId":12,"title":136,"subtitle":137,"slug":138,"coverImageUrl":45,"level":69},"AWS Certified CloudOps Engineer - Associate","SOA-C03","aws-certified-cloudops-engineer-associate",{"slug":132,"code":137,"dateBetaStart":20,"dateReleased":140,"pageSlug":138},"2025-09-30",{"id":142,"slug":143,"description":144,"questionCount":145,"isActive":9,"datePublicModified":146,"difficulty":147,"examVersion":151},10,"aws-certified-advanced-networking-specialty-ans-c01","The AWS Certified Advanced Networking - Specialty practice exam simulates the real test, offering scenario-based questions that assess your ability to design, implement, and troubleshoot complex AWS networking solutions. ",681,"2024-11-13T00:00:00.000Z",{"providerId":12,"title":148,"subtitle":149,"slug":150,"coverImageUrl":45,"level":17},"AWS Certified Advanced Networking - Specialty","ANS-C01","aws-certified-advanced-networking-specialty",{"slug":143,"code":149,"dateBetaStart":152,"dateReleased":153,"pageSlug":150},"2022-01-01","2022-07-12",{"id":155,"slug":156,"description":157,"questionCount":158,"isActive":9,"datePublicModified":159,"difficulty":160,"examVersion":161},6,"aws-certified-solutions-architect-professional-sap-c02","Elevate your career with the AWS Certified Solutions Architect - Professional Exam Simulator. Get ready to ace the most popular Professional AWS exam with our realistic practice exams. Assess your readiness, boost your confidence, and ensure your success.",789,"2024-06-06T00:00:00.000Z",{"providerId":12,"title":13,"subtitle":14,"slug":15,"coverImageUrl":16,"level":17},{"slug":156,"code":14,"dateBetaStart":20,"dateReleased":162,"pageSlug":20},"2022-11-15",{"id":164,"slug":165,"description":166,"questionCount":167,"isActive":9,"datePublicModified":159,"difficulty":168,"examVersion":173},4,"aws-certified-developer-associate-dva-c02","Unlock your potential as a software developer with the AWS Certified Developer - Associate Exam Simulator! Prepare thoroughly with realistic practice exams designed to mirror the official exam.",399,{"providerId":12,"title":169,"subtitle":170,"slug":171,"coverImageUrl":172,"level":69},"AWS Certified Developer - Associate","DVA-C02","aws-certified-developer-associate","\u002Fimages\u002Fdifficulties\u002Faws-certified-developer-associatedva-c02\u002Fcovers\u002Faws-DVA-C02.png",{"slug":165,"code":170,"dateBetaStart":20,"dateReleased":174,"pageSlug":171},"2023-02-28",{"id":176,"slug":177,"description":178,"questionCount":179,"isActive":9,"datePublicModified":159,"difficulty":180,"examVersion":181},7,"aws-certified-security-specialty-scs-c02","Advance your career in cloud cybersecurity with the AWS Certified Security - Specialty Exam Simulator! Tailored for professionals, this tool offers realistic practice exams to mirror the official exam.",5431,{"providerId":12,"title":103,"subtitle":104,"slug":105,"coverImageUrl":106,"level":17},{"slug":177,"code":182,"dateBetaStart":20,"dateReleased":183,"pageSlug":20},"SCS-C02","2023-07-11",[],{"slug":186,"title":187,"focus":188,"level":17,"components":189,"diagrams":190,"steps":191,"dateModified":300,"course":301,"nextLesson":302},"row-level-security-tenant-bound-policies-for-shared-tables-sap-c03","Row-Level Security: tenant-bound policies for shared tables","How row policies enforce tenant boundaries using trusted session context, including fail-closed behavior, connection-pool context handling, and privileged-role bypass risks.",[],[],[192,196,215,218,229,251,269,272,287],{"kind":193,"title":194,"body":195},"explanation","Make the tenant boundary a database rule","\u003Cp>\u003Cstrong>Row-level security (RLS)\u003C\u002Fstrong> adds row authorization to ordinary table privileges. Consider PostgreSQL, including Aurora PostgreSQL, with a shared \u003Ccode>orders\u003C\u002Fcode> table and a non-null UUID \u003Ccode>tenant_id\u003C\u002Fcode>. Enable enforcement with \u003Ccode>ALTER TABLE orders ENABLE ROW LEVEL SECURITY\u003C\u002Fcode>. For roles subject to RLS, an enabled table with no applicable policy defaults to denying rows; granting table access alone does not make rows accessible.\u003C\u002Fp>\u003Cp>A tenant policy can compare each row against session context using \u003Ccode>tenant_id = NULLIF(current_setting('app.tenant_id', true), '')::uuid\u003C\u002Fcode>. Use this predicate in both \u003Cstrong>USING\u003C\u002Fstrong> and \u003Cstrong>WITH CHECK\u003C\u002Fstrong>. USING determines which existing rows are eligible for SELECT, UPDATE, or DELETE. WITH CHECK validates proposed rows for INSERT and UPDATE, preventing an application from inserting another tenant's row or moving an existing row into another tenant.\u003C\u002Fp>\u003Cp>These are different checks: an UPDATE must pass the existing-row test and the new-row test. Ordinary SQL privileges still determine which operations are allowed. RLS adds a boundary even when application SQL omits its tenant filter, but its correctness depends on the supplied tenant context and the database role actually being subject to enforcement.\u003C\u002Fp>",{"kind":197,"title":198,"exercise":199},"exercise","Separate existing rows from proposed rows",{"type":200,"question":201,"groups":202,"statements":205},"versus","Sort each check by the policy clause that performs it.",[203,204],"USING: existing-row eligibility","WITH CHECK: proposed-row validity",[206,209,211,213],{"text":207,"group":208},"Decide whether an existing order can appear in a SELECT result.",0,{"text":210,"group":12},"Validate the tenant_id of a newly inserted order.",{"text":212,"group":208},"Decide whether an existing order is eligible for DELETE.",{"text":214,"group":12},"Reject an UPDATE whose proposed tenant_id belongs to another tenant.",{"kind":193,"title":216,"body":217},"Bind trusted context to one transaction","\u003Cp>\u003Cstrong>Trusted context\u003C\u002Fstrong> starts with authentication and authorization, not a browser-supplied tenant identifier. The application verifies identity and confirms membership in the selected tenant before setting database context. A tenant selector can express a request, but cannot grant membership. A shared database login cannot distinguish tenants unless this authorized context reaches the database.\u003C\u002Fp>\u003Cp>The example predicate is \u003Cstrong>fail-closed\u003C\u002Fstrong>: the missing-setting argument in \u003Ccode>current_setting('app.tenant_id', true)\u003C\u002Fcode> returns NULL when absent, and NULLIF also treats an empty value as missing. The comparison then is not true, so existing rows are not admitted and proposed rows fail the check. A malformed UUID raises an error rather than granting access. A valid but unauthorized tenant UUID, however, will match that tenant's rows: the predicate cannot establish whether its input was honestly assigned.\u003C\u002Fp>\u003Cp>With a \u003Cstrong>connection pool\u003C\u002Fstrong>, authorize first, then begin an explicit transaction on a checked-out connection. Before tenant SQL, execute parameterized \u003Ccode>SELECT set_config('app.tenant_id', $1, true)\u003C\u002Fcode>; true makes the setting transaction-local. Commit or roll back before returning the connection. Local settings revert to the prior session state, so maintain a clean baseline with no session-level tenant setting. Never run tenant SQL after context initialization fails; roll back, and discard a connection whose cleanup is uncertain.\u003C\u002Fp>",{"kind":197,"title":219,"exercise":220},"Practice the pooled-connection lifecycle",{"type":221,"question":222,"steps":223},"process","Identity and tenant membership are already verified, and a clean connection is checked out. Put the successful request lifecycle in order.",[224,225,226,227,228],"Begin an explicit transaction on the checked-out connection.","Set app.tenant_id with parameterized set_config and is_local = true.","Execute the tenant's SQL in that transaction.","Commit the successful transaction.","Return the clean, idle connection to the pool.",{"kind":193,"title":230,"body":231,"table":232},"Know which roles can bypass the policy","\u003Cp>An RLS predicate is ineffective when the executing role bypasses it. In PostgreSQL, \u003Cstrong>superusers\u003C\u002Fstrong> and roles with \u003Cstrong>BYPASSRLS\u003C\u002Fstrong> bypass row policies. Table owners normally bypass them too. \u003Ccode>ALTER TABLE orders FORCE ROW LEVEL SECURITY\u003C\u002Fcode> subjects the owner to row policies for ordinary row operations, but does not constrain superusers or BYPASSRLS roles.\u003C\u002Fp>\u003Cp>Use a \u003Cstrong>non-owner runtime role\u003C\u002Fstrong> without BYPASSRLS, and keep ownership and migrations under separate credentials. FORCE is useful defense in depth, not a reason to make the runtime role an owner: an owner can alter the table's security configuration. Also prevent the runtime role from assuming a bypassing role. Testing only through an administrative connection can conceal both missing policies and broken tenant predicates.\u003C\u002Fp>\u003Cp>Review \u003Cstrong>effective privileges\u003C\u002Fstrong> along indirect paths. A SECURITY DEFINER function executes with its owner's privileges; a privileged owner can therefore create a bypass path. Views also require review of their security mode and whose permissions and policies apply. Restrict administrative functions, credentials, and cross-tenant jobs rather than assuming the normal application's RLS boundary protects those paths.\u003C\u002Fp>",{"columns":233,"rows":237},[234,235,236],"Executing role","Ordinary RLS behavior","Effect of FORCE",[238,242,245,249],[239,240,241],"Non-owner, no bypass","Policies apply","Still applies",[243,244,240],"Table owner","Normally bypasses",[246,247,248],"BYPASSRLS role","Bypasses","Still bypasses",[250,247,248],"Superuser",{"kind":197,"title":252,"exercise":253},"Identify effective enforcement",{"type":200,"question":254,"groups":255,"statements":258},"For ordinary row operations on an RLS-enabled table, sort these executing roles by whether row policies apply. Assume no role switching or security-definer execution.",[256,257],"Row policies apply","Row policies are bypassed",[259,261,263,265,267],{"text":260,"group":208},"A non-owner with neither superuser nor BYPASSRLS privileges.",{"text":262,"group":12},"A table owner without FORCE, superuser, or BYPASSRLS privileges.",{"text":264,"group":208},"A table owner with FORCE and neither superuser nor BYPASSRLS privileges.",{"text":266,"group":12},"A non-owner with BYPASSRLS, even when FORCE is enabled.",{"text":268,"group":12},"A superuser, even when FORCE is enabled.",{"kind":193,"title":270,"body":271},"Validate the whole enforcement contract","\u003Cp>\u003Cstrong>Policy composition\u003C\u002Fstrong> can weaken an otherwise correct predicate. Applicable permissive PostgreSQL policies combine with OR; a second permissive policy that admits every row can defeat a tenant restriction. Restrictive policies combine with AND, but still require an applicable permissive policy to grant access. Review the complete policy set, its target roles, and its commands—not just the policy named tenant_isolation.\u003C\u002Fp>\u003Cp>\u003Cstrong>Session context is not authentication.\u003C\u002Fstrong> An application-controlled custom setting is not tamper-proof against arbitrary SQL executed as that application role. Use parameterized queries and protect the context-setting path. This pattern guards against omitted tenant filters; it does not independently contain a compromised application that can choose tenant context. For stronger threat models, use a design in which the caller cannot forge the authorization identity or choose a stronger isolation boundary.\u003C\u002Fp>\u003Cp>Validate the contract as a whole: an \u003Cstrong>authorized tenant\u003C\u002Fstrong> is bound to a \u003Cstrong>single transaction\u003C\u002Fstrong>, both existing and proposed rows are checked, and a \u003Cstrong>non-bypassing runtime role\u003C\u002Fstrong> executes the SQL. Test as that actual role with missing, empty, malformed, and unauthorized context; cross-tenant reads and writes; and sequential requests from different tenants on the same connection after both commit and rollback. An unauthorized but valid tenant value must be rejected by the authorization path, not expected to fail the equality predicate.\u003C\u002Fp>",{"kind":197,"title":273,"exercise":274},"Connect the boundary's four safeguards",{"type":275,"question":276,"text":277,"answers":278,"distractors":283},"placeholder","Complete the enforcement contract using the safeguards taught in this lesson.","Derive the tenant context from {}, then bind it using {} context on a pooled connection with a clean baseline. Validate inserted and updated row values with {}, and execute runtime SQL as a {}.",[279,280,281,282],"verified tenant membership","transaction-local","WITH CHECK","non-owner role without superuser or BYPASSRLS privileges",[284,285,286],"an unvalidated browser tenant selector","USING alone","table-owner role without FORCE",{"kind":193,"title":288,"body":289,"takeaways":290},"What to remember","\u003Cp>\u003Cstrong>Tenant-bound RLS\u003C\u002Fstrong> works only when trusted context, connection lifetime, complete row checks, and effective role privileges preserve the same boundary.\u003C\u002Fp>",[291,294,297],{"title":292,"text":293},"Deny without trusted context","Authorize tenant membership before assigning context. Missing context must admit no rows; a valid forged tenant value is not stopped by an equality predicate.",{"title":295,"text":296},"Scope context and writes","Use transaction-local context on a clean pooled connection, with confirmed completion or rollback before reuse. Pair USING with WITH CHECK to protect both existing rows and proposed values.",{"title":298,"text":299},"Audit every effective path","Keep runtime roles separate from owners and bypass privileges, and review policy composition and privileged execution paths. FORCE subjects ordinary owners to policies but does not constrain superusers or BYPASSRLS roles.","2026-11-16T06:51:24.102Z",{"pageSlug":15,"code":19,"certification":13,"certificationSlug":15},{"slug":303,"title":304},"envelope-encryption-tenant-bound-key-hierarchies-sap-c03","Envelope Encryption: Tenant-Bound Key Hierarchies",1796130196408]