Skip to content

Test role access and inspect the audit log

Compare admin, guest, disabled, and unknown cards against zone permissions and verify the audit reason for each decision.

Shield Shelly: I want you to check who was recognized, what was allowed, and which audit entry proves it., your practice guide

Shield Shelly: I want you to check who was recognized, what was allowed, and which audit entry proves it.
Predict the reading, then compare it with the measurement.

Wokwi ESP32

Third party Tool

Compare admin, guest, disabled, and unknown cards against zone permissions and verify the audit reason for each decision.

Tier 1 · Web · No account

Version tested: Compiled and booted by the Wokwi gate (ESP32 Arduino core 3.3.11); captured in the Wokwi web editor on 2026-09-09. Date: 2026-09-09.

Open the ESP32 editor, paste diagram.json, then paste sketch.ino.

Open Wokwi to paste in the files (new tab)

Get the files

Use both prepared files. This is a paste-in setup; saving a project requires a Wokwi account.

diagram.json

3,375 bytes · Circuit connections

Download

sketch.ino

11,956 bytes · ESP32 program

Download

  1. Use the launch button above to open the ESP32 editor in Wokwi.
  2. Select the editor’s diagram.json tab and replace all its text with the supplied diagram.json.
  3. Select the sketch.ino tab, replace all its text with the supplied sketch.ino, then click Start Simulation.

Steps

Screens captured against Wokwi ESP32 Compiled and booted by the Wokwi gate (ESP32 Arduino core 3.3.11); captured in the Wokwi web editor on 2026-09-09 on 2026-09-09; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    Paste diagram.json and sketch.ino into a new Wokwi ESP32 project; inspect the seven GPIO connections before starting.
    You will see
    Four LED paths use GPIO 2, 4, 5, and 18 with 220 Ω resistors; the buzzer uses 19 and the two buttons use 15 and 16.
    Why it matters
    A visible output must correspond to the authorization decision. The host chapter separates identity from the permission to act.
    Step 1: LEDs, buttons, and buzzer connect to the ESP32. The ring marks the four LED and resistor paths.
    Step 1 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    Start the simulation and open Serial Monitor at 115200 baud. Send STATUS followed by Enter.
    You will see
    The startup heading reads IoT ACCESS CONTROL SYSTEM v1.0; STATUS reports Locked: NO | Fails: 0 | Card: RFID_ADMIN_001.
    Why it matters
    The initial state makes later decisions reproducible. A known identity and a clear policy are separate inputs to access control.
    Step 2: Locked: NO | Fails: 0 | Card: RFID_ADMIN_001 appears. The ring marks STATUS.
    Step 2 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 Step 3

    Do
    Send CARD 0, then ZONE 2, each on its own line.
    You will see
    ACCESS GRANTED: Alice Admin -> Server Room appears; the green and blue LEDs illuminate briefly.
    Why it matters
    The admin role satisfies the server room’s ADMIN requirement. This is the host chapter’s role-based baseline in a small controller.
    Step 3: ACCESS GRANTED: Alice Admin - width= Server Room appears. The ring marks the admin grant." loading="lazy">
    Step 3 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    Send CARD 2, then ZONE 2.
    You will see
    ACCESS DENIED: Eve Guest has GUEST, needs ADMIN appears and the red LED flashes three times.
    Why it matters
    Authentication can succeed while authorization fails. Recognizing the guest card does not give it an administrator’s permission.
    Step 4: ACCESS DENIED: Eve Guest has GUEST, needs ADMIN appears. The ring marks the denial.
    Step 4 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    Keep CARD 2 selected and send ZONE 0.
    You will see
    ACCESS GRANTED: Eve Guest -> Public Lobby appears and the green LED illuminates.
    Why it matters
    Least privilege allows the resource the role needs. A restricted identity can still have useful, explicitly scoped access.
    Step 5: ACCESS GRANTED: Eve Guest - width= Public Lobby appears. The ring marks the scoped guest grant." loading="lazy">
    Step 5 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    Send CARD 3, then ZONE 1, and finally LOG.
    You will see
    The red LED flashes and the audit log contains ACCOUNT_DISABLED for Frank Former with FAIL.
    Why it matters
    Credential lifecycle matters as much as role level. The host explains why retired or disabled identities must lose access.
    Step 6: The audit log records ACCOUNT_DISABLED for Frank Former with FAIL. The ring marks that audit entry.
    Step 6 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  7. 7 Step 7

    Do
    Send CARD 4 and then ZONE 2 three times, waiting for each red-flash sequence to finish.
    You will see
    The failure counter reaches AUTH FAILED: Unknown card (3/3), followed by !!! BRUTE FORCE LOCKOUT !!!.
    Why it matters
    The controller records unknown identity attempts separately from insufficient privileges. This is a teaching lockout, not the host’s full identity-provisioning system.
    Step 7: The third unknown-card failure triggers BRUTE FORCE LOCKOUT. The ring marks the third failure and lockout.
    Step 7 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  8. 8 Step 8

    Do
    During lockout, send CARD 0 and ZONE 2; then send LOG and STATUS.
    You will see
    The request is BLOCKED despite the admin card; LOG includes ACCESS_BLOCKED and STATUS reports Locked: YES.
    Why it matters
    A gate can deny an otherwise permitted request. The host’s broader lesson is to explain the policy and context behind every decision.
    Step 8: The log records ACCESS_BLOCKED and STATUS reports Locked: YES even for the admin card. The ring marks the blocked entry and locked status.
    Step 8 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)
  9. 9 Step 9

    Do
    Wait at least 60 simulated seconds for Lockout expired -- system unlocked.; send CARD 0 and ZONE 2 again.
    You will see
    The admin request is granted again. STATUS reports Locked: NO and Fails: 0.
    Why it matters
    Time and state change the result. This local cooldown illustrates contextual enforcement but does not implement a general ABAC engine.
    Step 9: After lockout expires, Alice Admin is granted access again and STATUS reports Locked: NO, Fails: 0. The ring marks the restored grant and status.
    Step 9 · Wokwi ESP32; numbered callout added to a real capture. Enlarge screenshot (new tab)

Chapter checks

These questions refer to the chapter’s examples. Use the return links to review their answers.

  1. A new technician account is created in an IoT platform. Following least privilege, what should its initial access be?

    Return to the chapter’s knowledge check
  2. An AWS IoT-style policy contains a broad statement that Allows publishing to all device topics and a separate statement that explicitly Denies publishing to another tenant's topics. A device tries to publish to another tenant's topic. What happens?

    Return to the chapter’s knowledge check

Caution

Use only the supplied fictional card IDs. This is a local teaching model: hardcoded cards, volatile logs, a shared lockout, and RESET are not production identity controls. The comparison still depends on input length and is not a vetted cryptographic primitive. Retain each LED resistor; briefly click buttons because holding Select cycles cards. USERS and ZONES are advertised by the source menu but are not implemented; use CARD, ZONE, STATUS, and LOG.

Return to IoT Access Control: Models and Policy · Browse Labs