Open lesson

Mission: the evidence vault door

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Apply least privilege to a service account and explicitly test allowed and denied actions.

Imani shows Mara the supplier account's permissions. Voss insists it 'only delivered files.' Yet the list opens one door to the evidence archive and another to publication. Prepare a simple comparison for the team before the fictional meeting, without changing a real system or displaying keys. The urgency belongs to the story; this exercise has no timer.

Your mission

  1. Name the single permission the supplier needs in this copy.
  2. Name the two excessive permissions and their risks.
  3. Give three authorization tests after reduction, with expected outcomes.
  4. Explain why the rights list alone cannot identify who changed the evidence.

How to check your work

  • write intake is necessary.
  • write evidence_archive and publish report exceed the task.
  • Delivery allowed; archive change and publication denied.
  • A permission shows capability, not an observed action or the person behind an identity.

Course example

# This is a local permission simulation; it changes no cloud account.
supplier_before = {
    ("write", "intake"),
    ("write", "evidence_archive"),
    ("publish", "report"),
}
supplier_needed = {("write", "intake")}
supplier_after = supplier_needed.copy()
investigator = {("read", "evidence_archive"), ("read", "report")}

def can(permission_set, action, resource):
    return (action, resource) in permission_set

print(sorted(supplier_before - supplier_needed))
print(can(supplier_before, "write", "evidence_archive"))
print(can(supplier_after, "write", "evidence_archive"))
print(can(supplier_after, "write", "intake"))
print(can(investigator, "read", "evidence_archive"))

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with # are task reminders. Python ignores them. Write your code beneath them.

Python console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.py

Current editor source. Inspection shows your current edits.

# Name the single permission the supplier needs in this copy.
# Name the two excessive permissions and their risks.
# Give three authorization tests after reduction, with expected outcomes.
# Explain why the rights list alone cannot identify who changed the evidence.

exemple.py

Declarative lesson asset; this is not a file created in the Python filesystem.

# This is a local permission simulation; it changes no cloud account.
supplier_before = {
    ("write", "intake"),
    ("write", "evidence_archive"),
    ("publish", "report"),
}
supplier_needed = {("write", "intake")}
supplier_after = supplier_needed.copy()
investigator = {("read", "evidence_archive"), ("read", "report")}

def can(permission_set, action, resource):
    return (action, resource) in permission_set

print(sorted(supplier_before - supplier_needed))
print(can(supplier_before, "write", "evidence_archive"))
print(can(supplier_after, "write", "evidence_archive"))
print(can(supplier_after, "write", "intake"))
print(can(investigator, "read", "evidence_archive"))