Skip to the lesson
CivOps AI Academy · F05BEnterprise Connectivity: Ignition, OPC UA, Sparkplug B and the DMZ Connector
0%

Chapter 1 · Session 20

The path from the press to the platform, and who does what

Until now every reading in the platform was typed by a person or made up for testing. This session lets the machines report for themselves, without anyone outside the plant ever being able to reach a machine. Most of the work is done with your IT and OT people, not by Claude Code; this chapter says who does which part, and writes the design down before anyone changes a firewall.

30 min2 stepsAbout 3 hours hands-on in all, plus two meetings with IT and OT

By the end of this chapter you can

  • Name each layer between a press controller and the platform: OPC UA, the Ignition gateway, MQTT with Sparkplug B, the DMZ connector.
  • Place each piece on the Purdue model and explain why every connection starts inside the plant and goes out.
  • Say which parts IT, OT, you and Claude Code each do.
  • Have Claude Code draft docs/connectivity.md, and fill in what only IT and OT know.

Six layers, each with one job

A press's peak tonnage lives in its controller's memory. To reach a screen on a supervisor's phone it passes through six layers. Each layer does one job and can be replaced without disturbing the others, and only the bottom one can ever touch a machine.

The connectivity stackSix layers from machines through drivers and OPC UA, the gateway, MQTT with Sparkplug B and the DMZ connector, to the platform. Machines and controllersPLCs, drives, meters, vision systems: their own protocols (EtherNet/IP, S7, Modbus)Drivers and OPC UAthe gateway's drivers, or an OPC UA server on the controller, turn addresses into named, typed valuesGateway (Ignition)templates, aliases, history, alarms, local screens: keeps running if everything above it is downMQTT with Sparkplug Bthe gateway publishes changes outward to a broker; consumers subscribeConnector in the DMZtakes what the platform needs and sends it out over HTTPS; nothing comes back inYour platformdatabase, sign-in and screens on your own cloud accountsdata flows up
The connectivity stack. Data moves up. Control stays at the bottom: nothing above the gateway can write to a machine.
LayerIts jobIn the stamping plant
ControllersRun the press. Their memory holds the values.Six press PLCs and the in-die sensors
Drivers and OPC UARead values and give them names and typesOPC UA servers on the newer PLCs, the gateway's drivers on the older ones [1]
GatewayTags, history, alarms and local screens; keeps running if everything above it is downIgnition, at Level 3 [2]
MQTT with Sparkplug BPublish changes, not polls, to a brokerIgnition's MQTT Transmission module publishing to a broker in the DMZ [3]
DMZ connectorTakes the readings the platform needs and sends them outA small program Claude Code writes in this session
Your platformStores, secures and shows the dataSupabase and Vercel, on the company's accounts (Session 1)

OPC UA, Sparkplug B and CESMII in one paragraph each

OPC UA (IEC 62541) lets a client browse named, typed values with a time and a quality flag instead of register numbers, and builds security into the connection: each side has a certificate, and the mode is None, Sign, or Sign and Encrypt [1]. Ask OT for Sign and Encrypt and a read-only account; mode None is for laboratories.

An OPC UA secure connectionAn OPC UA client and server exchange certificates, agree a security policy and the Sign and Encrypt mode, then the user signs in with a read-only role. OPC UA clientthe gateway's OPC UA connectioncertificate: gateway.derOPC UA serveron the PLC or a vendor servercertificate: plc-line2.derSecure channel1. exchange and trust certificates2. policy: Basic256Sha256 or newer3. mode: Sign and Encrypt4. user sign-in, read-only roleMode None sends values in clear text and lets anyone connect: never use it outside a lab.opc.tcp:// default port 4840 · browse a typed address space, not raw registers
An OPC UA secure connection. Certificates first, then the policy and mode, then a sign-in with only the rights needed.

MQTT sends a value only when it changes (report by exception), to a broker that passes it on to whoever subscribed. Sparkplug B, an Eclipse specification published as ISO/IEC 20237, fixes the topic shape and payload and adds birth certificates (a device announces every value it has when it connects) and death certificates (the broker announces when a device drops off, so a frozen value is never mistaken for a steady one) [3].

CESMII, the US Smart Manufacturing Institute, publishes Smart Manufacturing Profiles: open definitions of a type of equipment and its values, and runs the Smart Manufacturing Innovation Platform (SM-IP) where members model and share data with them [4]. Before you name a press's values, look for a profile or an OPC UA companion specification and reuse its names in your naming standard (Session 4).

Where each piece sits, and which way it connects

IT sorts the plant into Purdue levels: machines and controllers at 0 and 1, supervisory screens at 2, site operations (the gateway, the historian) at 3, the business network and the internet at 4 and 5. Between 3 and 4 is the industrial DMZ, Level 3.5, where traffic from either side ends [5] [6]. Your platform is in the cloud. That is fine as long as it never reaches down.

Where each piece sits in the Purdue modelThe platform at Levels 4–5, the connector and DMZ broker at Level 3.5, the Ignition gateway at Level 3, edge and OPC UA servers at Level 2, controllers at Levels 0–1. Level 4–5Enterprise and cloudYour platform (Vercel + Supabase) · the connector signs in here, outbound 443Level 3.5Industrial DMZPlant connector · DMZ MQTT broker (OT and IT install them; IT patches them)Level 3Site operationsIgnition gateway · site MQTT broker · historian · MESLevel 2Supervisory controlHMIs · Ignition Edge · OPC UA serversLevel 0–1Process and controlPLCs · drives · sensors (never reached from above Level 3)
Where each piece sits. The gateway stays at Level 3, the broker and connector at Level 3.5, the platform in the cloud. Controllers are never reached from above Level 3.

The DMZ connector pattern is one rule: every connection starts inside and goes out. The gateway publishes out to the DMZ broker on port 8883 (MQTT with TLS). The connector, also in the DMZ, subscribes to that broker and sends readings out to Supabase on port 443 (HTTPS), signed in as its own account that may only add readings. Nothing in the cloud or the office has an address to call into the plant, so even a stolen platform key cannot touch a press.

The DMZ connector patternThe gateway publishes out to a DMZ broker on port 8883; the connector in the DMZ sends to the platform over HTTPS 443; no inbound connection reaches the plant. Plant network (Level 3)Industrial DMZ (Level 3.5)Internet / your cloudIgnition gatewaypublishes changesSite historianthe full recordDMZ brokerreceives, keeps nothingConnectorbuffers, then sendsYour platformHTTPS API, one login8883443✗ nothing from the cloud or the office ever connects into the plant
The DMZ connector pattern. Two outbound arrows and no inbound ones. This one picture answers most of IT's questions.

Who does what

Be honest with yourself about this table. Claude Code cannot configure Ignition, open a firewall or install a server in the DMZ, and should not try. What it does well is write the design, the account and its tests, the connector and its tests, and the exact requests IT and OT need, so each meeting ends with a decision instead of a list of questions.

TaskWho does itClaude Code's part
Reading the presses into Ignition, OPC UA securityOT (controls engineer)None. It gives OT the list of tags the platform needs
Publishing Sparkplug B to the DMZ broker over TLSOT, in Ignition's MQTT Transmission moduleWrites the exact group, node, device and metric names
The DMZ host, the broker, firewall rules, the company proxyIT (network or OT security)Writes the request: one row per rule, with the reason
The design: docs/connectivity.mdYou, with Claude CodeDrafts it; you correct it with IT and OT
The connector's matrix row, access rules and testsYou, with Claude CodeWrites them in one pull request
Creating the connector's account and its passwordYou, in the Supabase dashboardNone. It never sees a password
The connector program, simulated and realClaude Code writes it; you run it; IT installs itWrites it with its tests
Step 1

Have Claude Code draft the connector design, with the questions only IT and OT can answer

15 minutes

Why

IT and OT approve what they can read. A design written before the meetings turns each meeting into corrections to a page instead of an open discussion, which is the difference between one meeting and four. Writing it in the repository, next to the code, means it changes when the design changes, and Session 21's IT package is generated from it.

Do this

Terminal or PowerShell
cd ~/code/acme-platform && git switch main && git pull && claude
Paste into Claude Code
Read docs/INTENT.md, docs/naming-standard.md, docs/SCHEMA-PLAN.md, docs/matrix.json and docs/KEYS.md first. Do not write any code in this task.

On a new branch connectivity/design, write docs/connectivity.md: how machine readings from Cleveland (cle) reach the platform, for an IT and OT reader who has never seen the platform. Use these headings:

1. What the platform needs from the machines: only the measures the intent's decision needs, each by its standard name from the naming standard, with unit and how often it changes. No recipes, PLC programs, drawings or personal data ever leave the plant.
2. The path: controllers, OPC UA or drivers, the Ignition gateway (Level 3), MQTT with Sparkplug B over TLS on port 8883 to a broker in the industrial DMZ (Level 3.5), a connector in the DMZ that sends readings over HTTPS on port 443 to https://abcdefghijklmnopqrst.supabase.co. Draw it as a Mermaid diagram with the Purdue levels.
3. The rule: every connection starts inside and goes out; nothing connects into Level 3 or below.
4. The connector's account: a machine account in the matrix, role plant_connector, site cle, that may insert readings and nothing else. It signs in with its own password, never with the Supabase secret (service role) key.
5. Data flows: one row per arrow, with source, destination, protocol, port, which side starts it, the data and the account.
6. Firewall request: one row per allowed flow, ending with "deny everything else, and log it".
7. When something fails: the internet link, the broker, the connector, the platform, the gateway. For each: what the plant does, what the platform shows, how it recovers. The connector stores readings while the link is down and sends them in order when it returns.
8. Questions for OT and Questions for IT: everything this design needs that the repository cannot know (tag names in Ignition, OPC UA security mode, whether the MQTT Transmission module is licensed, the DMZ host, the broker, the proxy, who installs and patches what). Mark every unknown in the text as TO CONFIRM.

Open a pull request titled "Connectivity design (draft)" and show me the link. Do not merge it.

You will see recreated screen

claude — acme-platform
⏺ Read(docs/naming-standard.md)
⎿ Read 64 lines
⏺ Read(docs/matrix.json)
⎿ Read 212 lines
1
⏺ Write(docs/connectivity.md)
+## 5. Data flows
+| # | From | To | Protocol, port | Starts from | Data | Account |
+| F1 | Ignition gateway (L3) | DMZ broker (L3.5) | MQTT over TLS, 8883 | Plant | Press measures | Gateway certificate |
+| F2 | Connector (L3.5) | DMZ broker (L3.5) | MQTT over TLS, 8883 | DMZ | Same, subscribe only | Connector certificate |
+| F3 | Connector (L3.5) | abcdefghijklmnopqrst.supabase.co | HTTPS, 443 | DMZ | Readings | plant_connector, insert only |
2
⏺ Write(docs/connectivity.md)
+## 8. Questions for OT
+1. Which Ignition tags hold peak tonnage, stroke count and running state on each press? TO CONFIRM
+2. Is the MQTT Transmission module licensed on the gateway? TO CONFIRM
+## Questions for IT
+1. Is there a DMZ host for the broker and connector, and who patches it? TO CONFIRM
+2. Does outbound HTTPS go through a proxy? If so, its address. TO CONFIRM
3
⏺ Pull request #41 adds docs/connectivity.md: three data flows, all starting inside, three firewall rows plus deny-all, and 11 questions (5 for OT, 6 for IT). No code.
Claude Code reads the standing documents, writes the design, and leaves every fact it cannot know as a question.
  1. It reads the naming standard and the matrix first, so the measures and the account use names that already exist.
  2. Every arrow is a row. IT will check that the diagram and this table match exactly.
  3. The questions are the agenda for the two meetings in Step 2.

Check it worked

Pull request Connectivity design (draft) has one file, docs/connectivity.md, with a diagram, a data flow table in which no row starts outside the plant, a firewall request ending in deny-all, and a list of questions for OT and for IT.

Fastest path

Send the link to the pull request's file to the OT and IT people the same day, with the two question lists pasted into the email. They answer in their own time and the meetings get shorter.

If it goes wrong

Claude Code proposed that the platform connect to the gateway, or a VPN into the plant

Say: No connection may start outside the plant and end at Level 3 or below. Redraw it so the gateway publishes out to the DMZ and the connector sends out to Supabase. A vendor's cloud service that wants to reach the gateway gets the same answer: it reads from the DMZ.

The design lists every tag on the gateway

Say: Only the measures docs/INTENT.md's decision needs. Move the rest to a Not now list. Each extra measure is another row IT has to approve and another thing that can break.

It wants to use the Supabase secret (service role) key for the connector

Say: No. That key skips every access rule. The connector signs in as its own account, which the matrix limits to adding readings. On our own platform the most powerful login was the one that did the damage; the connector is the program most exposed to the outside, so it gets the weakest one.

Step 2

Walk the gateway with OT and the firewall with IT, then record their answers

2 meetings, then 10 minutes

Why

Only OT knows which tag on press 3 really holds peak tonnage, and only IT knows whether outbound traffic goes through a proxy. A guess at either costs a failed install day in the plant. Recording their answers in the design, in their words, also gives Session 21 the evidence that IT and OT were consulted.

Do this

With the OT engineer, at the Ignition gateway's web page: look at the device connections together, then the tag browser, and write next to each measure in the design the exact tag path that holds it. Ask whether the PLCs' OPC UA connections use Sign and Encrypt, and whether the MQTT Transmission module is installed and licensed (it is a paid module from Cirrus Link; price it before you promise a date).

With the IT person: read the data flow table and the firewall request together. Ask the six questions. Agree who provides the DMZ host and the broker, who patches them, and whether outbound HTTPS goes through a proxy.

Paste into Claude Code, after replacing the <...> parts
OT and IT answered the questions in docs/connectivity.md:
OT: <paste their answers, including the exact Ignition tag path for each measure>
IT: <paste their answers>

On the same branch:
1. Replace each TO CONFIRM they answered with their answer, and list anything still open under "Open items" with an owner and a date.
2. If docs/naming-standard.md or the repository already has an alias table, add these tags to it. Otherwise create docs/tag-aliases.csv with the columns legacy_tag, standard_name, unit, conversion, source: one row per Ignition tag, mapping it to the measure's standard name. Run node scripts/check-names.mjs and fix any name it refuses.
3. Add "Reviewed with <OT role> and <IT role> on <date>" at the top.
Push, wait for the checks, and tell me what is still open.

You will see recreated screen

ignition-gateway:8088 · Gateway web page
StatusConnectionsDevicesOPC UATagsMQTT Transmission
Device Connections
1
NameDriverStatus
press-1Allen-Bradley LogixConnected
press-2Allen-Bradley LogixConnected
press-3OPC UA (Sign and Encrypt)Connected
press-4Siemens S7-1500Connected
press-5Siemens S7-1500Connected
press-6Modbus TCPConnected
Tag path for press 3 peak tonnage[default]Press3/PLC/PeakTonnage2
The Ignition gateway's web page, as the OT engineer will show it. This is a generic recreation: menu names differ between Ignition versions, and your engineer knows where they are.
  1. One connection per press. The driver column tells you which presses speak OPC UA and which use the gateway's own drivers: ask about security mode on every OPC UA line.
  2. The legacy tag path. It goes in the alias table next to the standard name; nothing in Ignition is renamed.

You will see recreated screen

claude — acme-platform
⏺ Write(docs/tag-aliases.csv)
+legacy_tag,standard_name,unit,conversion,source
+[default]Press3/PLC/PeakTonnage,acme/cle/stamping/press-3/peak_tonnage_kn,kN,US tonf x 8.896,ignition
+[default]Press3/PLC/StrokeCount,acme/cle/stamping/press-3/stroke_count,,none,ignition
1
⏺ Bash(node scripts/check-names.mjs)
⎿ 18 names checked, 0 refused
⏺ 9 of 11 questions are answered. Open: the DMZ host (IT, by 30 October) and the MQTT Transmission licence (OT, by 6 November). docs/tag-aliases.csv maps 18 Ignition tags to standard names; one conversion (US tons-force to kN) is recorded.
Claude Code records the answers and maps each legacy tag to its standard name.
  1. The alias table: the plant keeps its names, the platform uses the standard one, and any unit conversion is written down.

Check it worked

docs/connectivity.md says who reviewed it and when; every measure has its Ignition tag path; docs/tag-aliases.csv (or your existing alias table) maps each tag to a standard name that check-names accepts; open items have an owner and a date. Owner two approves and it merges.

Fastest path

Ask OT for an export of the tag list for the presses (Ignition can export tags as a file) and paste the relevant rows into the prompt. Typing tag paths by hand is where the mistakes come from.

If it goes wrong

OT says the PLCs' OPC UA connections use security mode None

Write it down as an open item for OT, not a blocker for this session: the connector never talks to the PLCs. But it is a real risk on the plant network, and Session 21's package will list it.

IT says nothing may leave the plant network at all

Ask which exit they do allow (many plants allow outbound HTTPS through a proxy from the DMZ only). If none, the connector cannot work yet; record it as the first open item and continue with the simulation in Chapter 3, which needs no plant network.

The same measure has different tag names on different presses

That is normal and exactly what the alias table is for: several legacy tags, one standard name per press.

Knowledge check

Which layer keeps the presses' screens, alarms and history running when the internet is down?

Knowledge check

A vendor asks for their cloud service to connect to the Ignition gateway to collect data. What does the pattern say?

References

  1. OPC Foundation: OPC Unified Architecture. https://opcfoundation.org/about/opc-technologies/opc-ua/
  2. Inductive Automation: Ignition user manual. https://docs.inductiveautomation.com/
  3. Eclipse Foundation: Sparkplug specification. https://sparkplug.eclipse.org/specification/
  4. CESMII, the Smart Manufacturing Institute. https://www.cesmii.org/
  5. NIST SP 800-82 Rev. 3, Guide to Operational Technology (OT) Security. https://csrc.nist.gov/pubs/sp/800/82/r3/final
  6. Cisco and Rockwell Automation: Converged Plantwide Ethernet, Industrial DMZ design (CPwE IDMZ). https://www.cisco.com/c/en/us/td/docs/solutions/Verticals/CPwE/3-5-1/IDMZ/DIG/CPwE_IDMZ_2_CVD/CPwE_IDMZ_2_Chap2.html

Chapter 2 · Session 20

The connector's account: one matrix row, insert-only, proven

The connector is the program most exposed to the outside world, so it gets the weakest account in the platform: it may add readings for its own site and do nothing else, not even read them back. One prompt adds that account to the role matrix, generates its access rules and the tests that prove them; then you create the account yourself in the development project.

35 min2 stepsThe machine account testing protocol

By the end of this chapter you can

  • Explain why the connector is a machine account in the matrix and never uses the secret (service role) key.
  • Have Claude Code add the readings table, the plant_connector row, its generated policies and its access tests in one pull request.
  • Create the connector's account in the development project yourself, and record it in docs/KEYS.md by name only.

A machine account is a role like any other

Session 7's matrix lists jobs, not people: operator, supervisor, quality lead and the others. The connector is one more column with the same treatment: a role (plant_connector), a scope (one site) and rights per table. Because the access rules and their tests are generated from the matrix (Session 8), adding the row is enough to give the connector exactly its rights and to prove it has no others.

The tempting shortcut is the Supabase secret key, which already works and needs no account. It also skips every access rule and can change or delete anything [1]. If the DMZ host were ever compromised, whoever held that key would hold the whole platform. With its own account, the worst a thief can do is add readings for one site, which the database marks with the connector's name.

Rightplant_connectorWhy
Insert into machine_readings, own siteYesIts one job
Insert for another siteNoA connector at cle speaks for cle only
Read any table, including its own readingsNoIt never needs to; a stolen password reads nothing
Update or delete anythingNoReadings are records: append-only, like inspections
Any page or route of the appNoIt has no screens; every route refuses it

The machine account testing protocol

These tests join the access tests from Session 8 and run on a fresh database on every pull request. Each exists because a missing one has cost someone a record or an audit:

TestWhat it proves
Allowed: insert at own siteThe connector can do its job
Refused: insert at another siteA connector, or a stolen password, cannot write as another plant (the cross-site test from Session 8)
Refused: select on every tableA stolen password reads nothing
Refused: update and delete on readingsHistory cannot be changed, by the connector or anyone
Refused: insert into any other tableIt cannot create lots, holds or memberships
Refused: every route of the appSigning in as the connector opens no page (the route tests from Session 9)
Refused: a measure that breaks the naming standardA mis-mapped tag fails loudly instead of creating a new name
Refused: a duplicate readingReplaying the buffer after an outage cannot double-count
Step 3

One prompt: the readings table, the matrix row, its access rules and its tests

20 minutes

Why

The table, the matrix row, the generated policies and the tests belong together: a right without a test is a right an agent can quietly widen later, and a table without its rules is readable through the website's key. One complete prompt, which also tells Claude Code to wait for GitHub's check, replaces the half-dozen rounds it takes to add each piece as you remember it.

Do this

Paste into Claude Code
Read docs/connectivity.md, docs/naming-standard.md, docs/SCHEMA-PLAN.md, docs/matrix.json, scripts/gen-policies.mjs and supabase/tests/access.test.sql first, and follow how roles, policies and tests are already done.

On a new branch connectivity/connector-account:

1. Run npx supabase migration new machine_readings and create public.machine_readings, an event table: one row is one value one machine reported. Columns: id, site_id, equipment_id (references equipment), measure (the standard name; a check that it follows the naming standard's pattern), value numeric, read_at timestamptz (the time at the machine), received_at timestamptz default now(), source_tag (the legacy tag it came from), reading_key text (unique per site, so a replayed reading is refused as a duplicate), synthetic boolean not null default false, recorded_by uuid default auth.uid(). Append-only with the existing append_only() trigger. Row-level security on.
2. Add the role plant_connector to docs/matrix.json as a machine account: scope one site; insert on machine_readings only; no select, update or delete anywhere; no screens. Add read rights on machine_readings for the human roles that need it for the decision, as docs/INTENT.md says, and show me which you chose.
3. Run node scripts/gen-policies.mjs so the policies migration, lib/access/routes.ts and the access tests are regenerated from the matrix. Do not write policies by hand.
4. Make sure the tests prove, signed in as plant_connector at cle: insert at own site allowed; insert at another site refused; select on every table returns nothing; update and delete on machine_readings refused; insert into every other table refused; a measure that breaks the naming standard refused; a duplicate reading_key refused; every route of the app refuses the connector.
5. In docs/connectivity.md, add a section "Creating the connector account" with the exact SQL a person runs in the Supabase SQL editor to give an existing account the plant_connector membership at site cle, using the account email connector.cle@acme.com.
6. Do not connect to or change any Supabase project.

Show me one of the refusal tests failing when its rule is removed, then put the rule back. Push, open a pull request titled "Connector account: insert-only machine role", wait for every check, and tell me the result in plain words. If a check fails, fix it and wait again before reporting.

You will see recreated screen

claude — acme-platform
⏺ Write(docs/matrix.json)
 "roles": {
+ "plant_connector": { "job": "Sends machine readings from the plant", "scope": "site", "machine": true },
 },
 "tables": {
+ "machine_readings": { "kind": "event", "by": "recorded_by",
+ "rights": { "plant_connector": "insert", "quality_lead": "read", "supervisor": "read" } }
 }
1
⏺ Bash(node scripts/gen-policies.mjs)
⎿ Wrote supabase/migrations/20261103101200_policies_from_matrix.sql · 9 roles · 11 tables · 214 access tests
⏺ Bash(npx supabase test db)
⎿ With the cross-site rule removed: not ok 147 - plant_connector cannot insert at another site
2
⏺ Bash(gh pr checks --watch)
⎿ ci pass · schema pass · clamps pass
⏺ Pull request #43 is green. machine_readings is append-only with row-level security. plant_connector may insert readings at cle and nothing else: 22 new access tests, 21 of them refusals, all pass. Quality lead and supervisor can read readings for their site. With the cross-site rule removed, test 147 failed, as it should; the rule is back.3
Claude Code changes the matrix, generates everything else from it, shows a test failing with its rule removed, and reports only after GitHub's checks are green.
  1. The only hand-written change: one role in the matrix. Policies, routes and tests are generated from it.
  2. Shown red first: the test fails when its rule is missing, so it can never pass by accident.
  3. Count the refusals. Almost everything this account tries must be refused.

Check it worked

Pull request Connector account: insert-only machine role is green on GitHub. Its Files changed tab shows one hand-edited role in docs/matrix.json, a new migration, regenerated policies and tests, and the SQL for the membership in docs/connectivity.md. Owner two approves; merge. The deploy workflow (Session 11) applies the migration to production on merge.

Fastest path

"Wait for every check and fix it before reporting" saves a round trip. "Show me a refusal test failing when its rule is removed" saves the worst kind of round trip: finding out months later that a test could never fail.

If it goes wrong

Claude Code wrote policies by hand instead of regenerating them

Say: Remove the hand-written policies. Change docs/matrix.json and run scripts/gen-policies.mjs. The matrix is the only source of rights. A hand-written policy is a right nobody reviewed.

It gave plant_connector select on machine_readings "so the insert works"

That is the read-back problem above. Say: Remove the select right. Insert without returning the row (no .select() after insert).

The route tests fail because the new role has no screens

Correct behaviour, wrong test. Say: The route tests must expect every route to refuse plant_connector. Fix the generator so a role with no screens is refused everywhere, then regenerate.

Claude Code says all tests pass, but the check on GitHub is red

Say: The check on the pull request is red. Read its log with gh run view --log-failed, fix the cause and wait for green before you report. A summary is a claim; the check on GitHub is the evidence.

Step 4

Apply it to the development project, and create the connector's account yourself

15 minutes

Why

The account has a password, and passwords are handled by people, in the password manager, never by Claude Code. The simulation in Chapter 3 runs against the development project, so the new table and the account go there first; production gets its own account only when the real connector is installed, so made-up readings can never reach it.

Do this

In a terminal, not inside Claude Code. When asked, paste the development project's database password from the password manager (Supabase: acme-platform-dev database password):

Terminal or PowerShell
cd ~/code/acme-platform && git switch main && git pull && npx supabase link --project-ref tsrqponmlkjihgfedcba && npx supabase db push

In the password manager, create an entry Platform connector, acme-platform-dev with a generated password of at least 24 characters. Then create the account:

Open

https://supabase.com/dashboard/project/tsrqponmlkjihgfedcba/auth/users

Choose Add user, then Create new user. Email: connector.cle@acme.com. Paste the password from the password manager. Tick Auto Confirm User. Create.

Open

https://supabase.com/dashboard/project/tsrqponmlkjihgfedcba/sql/new

Paste the SQL from the section Creating the connector account in docs/connectivity.md, and press Run. It should look like the example below.

Supabase SQL editor, development project
-- Give the connector account its one role, at one site.
insert into public.memberships (user_id, site_id, role)
select u.id, s.id, 'plant_connector'
from auth.users u, public.sites s
where u.email = 'connector.cle@acme.com' and s.code = 'cle';

Last, the register. In Claude Code:

Paste into Claude Code
On a new branch docs/keys-connector, add to docs/KEYS.md, names and locations only, never values: "Platform connector password, development" (unlocks: adding readings at cle in acme-platform-dev; lives in the company password manager; held by pat@acme.com and sam@acme.com) and "Platform connector password, production" (not created yet: created in Session 20 step 8; will live in the password manager and in IT's credential store on the DMZ host). Add the account connector.cle@acme.com to the accounts list as a machine account. Open a pull request.

You will see recreated screen

Terminal
$ npx supabase link --project-ref tsrqponmlkjihgfedcba
Finished supabase link.
$ npx supabase db push
Do you want to push these migrations to the remote database? • 20261103100500_machine_readings.sql • 20261103101200_policies_from_matrix.sql [Y/n] y1
Finished supabase db push.
db push lists the files it will apply to the development project. Check the project reference before you answer y.
  1. Only the new files. If the list is long or includes files you do not recognise, the development project is behind main: answer n and ask Claude Code which versions differ before going on.

You will see recreated screen

supabase.com/dashboard/project/tsrqponmlkjihgfedcba/auth/users
UsersSign In / ProvidersPoliciesURL Configuration
1
EmailProviderCreatedLast sign in
connector.cle@acme.comEmail3 Nov 2026Never
pat@acme.comEmail14 Oct 20262 Nov 2026
The new account in the development project. It has never signed in, and has no screens to sign in to.
  1. A company address that IT controls (a shared mailbox or alias), never a person's own. When people leave, the connector keeps working.

Check it worked

The SQL editor answers Success. 1 row to the membership insert. The users list shows connector.cle@acme.com. docs/KEYS.md lists both connector passwords by name, with no value anywhere in the pull request.

If it goes wrong

The membership insert says 0 rows

Either the email is typed differently in the users list, or the site code is not cle in the sites table. Check both, character by character; do not change the SQL's role name.

db push lists migrations you did not expect

The development project fell behind main. Answer n. In Claude Code: Compare npx supabase migration list for the development project with supabase/migrations on main and tell me in plain words what each missing version does, without changing anything. Apply them only once you understand them; it is the development project, but its seed data matters for Chapter 3.

You pasted the password somewhere other than the password manager and the Supabase form

Treat it as known to others. Create a new password, set it on the user in Supabase (the user's menu, then reset or change the password), and note the date in docs/KEYS.md.

Key or secretWhat it unlocksWhere it livesWho holds itNever
Platform connector password, developmentAdding readings at cle in acme-platform-dev, and nothing elseCompany password managerpat@acme.com, sam@acme.comNever in Claude Code, a chat, the repository or a file
Platform connector password, productionAdding real readings at cle, and nothing elsePassword manager, and IT's credential store on the DMZ hostpat@acme.com, sam@acme.com, ITNever on a laptop, never shared by email
Supabase publishable keyWhat the access rules allow a signed-in account to doTyped into the connector when it starts; public by designAnyoneNever relied on for protection
Supabase secret (service role) keyEverything, ignoring access rulesVercel, server onlyNobody copies itNever on the connector or the DMZ host

Knowledge check

Why does the connector sign in as its own account instead of using the Supabase secret key?

Knowledge check

The connector's insert is refused with "new row violates row-level security policy", though it has the insert right. What is the likely cause?

References

  1. Supabase Docs: Understanding API keys. https://supabase.com/docs/guides/api/api-keys
  2. Supabase Docs: Row Level Security. https://supabase.com/docs/guides/database/postgres/row-level-security
  3. PostgreSQL Documentation: Row Security Policies. https://www.postgresql.org/docs/current/ddl-rowsecurity.html
  4. Supabase Docs: Testing your database (pgTAP). https://supabase.com/docs/guides/database/testing

Chapter 3 · Session 20

A simulated connector, then the real one with IT and OT

Claude Code writes the connector and runs it against the development project with made-up press readings, so you can see rows arrive, pull the network cable, and watch nothing get lost, all before anyone touches the plant. Then it writes the run sheet IT and OT follow to install the real one, and you witness the first real readings arrive in production.

40 min4 stepsEnds with a gate

By the end of this chapter you can

  • Have Claude Code write the connector: alias table, store and forward, no default addresses, made-up data only to the development project.
  • Prove the three things IT will ask: an outage loses nothing, nothing can reach back in, and the account can read nothing.
  • Hand IT and OT a run sheet they can follow without you, and witness the first real readings in production.

What the connector does, and what it must never do

It doesIt never does
Receive press values (simulated, or Sparkplug B from the DMZ broker)Open a port that anything can connect to
Map each legacy tag to its standard name through the alias table, refusing tags not in itInvent a name for a tag it does not know
Keep readings on disk while Supabase cannot be reached, and send them in order when it canDrop readings, or send them twice (the reading key makes a replay a harmless duplicate)
Sign in as connector.cle@acme.com and insert readingsUse the secret key, or read anything back
Send made-up readings only to acme-platform-dev, real ones only to acme-platform-prodHave a default address: every address comes from configuration
Store and forwardOver eight hours the internet drops for two; the connector buffers readings, then replays them in order; the plant keeps running throughout. Internet down 2 h06:0008:0010:0012:0014:00sent as it happensbuffer fillsreplayed in orderMachines, the gateway, local screens and the historian keep running the whole timeA connector that stores and forwards loses no records when the link fails
Store and forward. A two-hour outage costs the platform two hours of delay, not two hours of data. The plant notices nothing.
Step 5

A simulated connector against the development project

25 minutes

Why

A simulation proves everything from the alias table to the database, on your laptop, with made-up data, before IT has to install anything. Every fault you find here costs a prompt; the same fault found on install day costs a second visit from IT and OT. Keeping made-up readings out of production is built into the program, not left to memory.

Do this

Paste into Claude Code
Read docs/connectivity.md, docs/tag-aliases.csv (or the alias table it names), docs/naming-standard.md and the machine_readings migration first.

On a new branch connectivity/connector, write the connector in connector/ as a small Node.js program with its tests (npm test):

1. Two sources: "sim", which makes up readings for the six presses using the legacy tag names in the alias table (peak tonnage per stroke around each press's normal value, stroke count, running state), and "mqtt", which subscribes to the DMZ broker over TLS on 8883 and decodes Sparkplug B, handling birth certificates (metric names and aliases) and death certificates (record the device's connection state as offline). Use established libraries for MQTT and Sparkplug B.
2. Map every tag through the alias table, applying the recorded unit conversion. A tag not in the table is refused and counted, never sent.
3. Sign in to Supabase as the connector account with the publishable key and the password, and insert into machine_readings without asking for rows back. Never use the secret key.
4. Store and forward: write every reading to a local queue on disk first; send in order; when Supabase cannot be reached, keep the readings and retry with back-off; treat a duplicate reading_key as already delivered. Keep the queue folder out of git.
5. Addresses: no default address anywhere. The target comes from --target. connector/targets.json allows https://tsrqponmlkjihgfedcba.supabase.co for source sim only and https://abcdefghijklmnopqrst.supabase.co for source mqtt only; refuse anything else. When a target cannot be reached, say "could not reach", not "failed". If HTTPS_PROXY is set, use it (Node needs NODE_USE_ENV_PROXY=1 for its built-in fetch); say so in connector/README.md.
6. Secrets: never read them from a file or the repository. If CONNECTOR_PASSWORD and SUPABASE_PUBLISHABLE_KEY are not set, ask for them in the terminal with the typing hidden. Never print them. Check their shape and say which is missing or malformed, by name.
7. Mark simulated readings synthetic = true and give their reading keys the prefix SYN_.
8. Opens no listening port. Add a test that fails if anything in connector/ listens.
9. Add an npm script "connector" and a script "connector:probe" that signs in as the connector and tries to select from every table, update and delete a reading, and insert for another site, and prints each result (all must be refused).

Tests must cover: unknown tag refused; unit conversion; replay after an outage keeps order and creates no duplicates; sim refuses the production address; mqtt refuses the development address; no default address; nothing listens. Show me one test failing with its rule removed. Push, open a pull request titled "Plant connector", wait for the checks, and tell me the result.

When it is green and merged, run it yourself, in a terminal, not inside Claude Code. It asks for the development project's publishable key (Supabase, Project Settings, API Keys) and the connector password from the password manager; nothing shows as you paste.

Terminal or PowerShell
cd ~/code/acme-platform && git switch main && git pull && npm install && npm run connector -- --source sim --target https://tsrqponmlkjihgfedcba.supabase.co --minutes 10
Open

https://supabase.com/dashboard/project/tsrqponmlkjihgfedcba/editor

Open machine_readings in the development project's Table Editor while it runs.

You will see recreated screen

claude — acme-platform
☒ Alias mapping and unit conversion
☒ Disk queue, in-order replay, duplicate = delivered
☒ Targets: no default, sim to dev only, mqtt to prod only
☒ Hidden prompts for the key and password
☐ Open the pull request and wait for checks
1
⏺ Bash(npm test -- connector)
⎿ With the target guard removed: FAIL sim refuses the production address. Guard restored: 19 passed
⏺ Bash(gh pr checks --watch)
⎿ ci pass · schema pass · clamps pass
⏺ Pull request #44 is green. The connector maps 18 tags, refuses unknown ones, queues on disk and replays in order. In simulation it can only send to acme-platform-dev; with real data only to acme-platform-prod. It opens no port and never reads a key from a file.
Claude Code writes the connector and its tests, and proves a guard by breaking it first.
  1. The plan, ticked off. Each line is a rule from the prompt and has a test.

You will see recreated screen

Terminal
$ npm run connector -- --source sim --target https://tsrqponmlkjihgfedcba.supabase.co --minutes 10
SUPABASE_PUBLISHABLE_KEY (hidden): 1
CONNECTOR_PASSWORD (hidden):
Signed in as connector.cle@acme.com · target tsrqponmlkjihgfedcba (development) · source sim · synthetic
09:41:05 sent 12 readings (6 presses) · queue 0
09:41:10 sent 12 readings · queue 0
09:41:15 refused tag [default]Press7/PLC/PeakTonnage: not in the alias table (1 so far)2
The simulated connector on your laptop. It asks for the two values with the typing hidden, then sends a batch every few seconds.
  1. Paste each value from the password manager or the dashboard. Nothing appears; that is intended.
  2. A tag the alias table does not know is refused and counted, never sent under a made-up name. The simulation includes one on purpose.

You will see recreated screen

supabase.com/dashboard/project/tsrqponmlkjihgfedcba/editor
equipmentholdsinspectionslotsmachine_readingsmembershipssites
1
measurevalueread_atsource_tagsynthetic
acme/cle/stamping/press-3/peak_tonnage_kn2847.609:41:09[default]Press3/PLC/PeakTonnagetrue
acme/cle/stamping/press-3/stroke_count1834209:41:09[default]Press3/PLC/StrokeCounttrue
acme/cle/stamping/press-1/running_state109:41:08[default]Press1/PLC/Runningtrue
Readings arriving in the development project. Every row is marked synthetic.
  1. Standard names in, legacy names kept next to them, synthetic marked.
  2. The connector itself cannot read this table. You can, because the dashboard uses the owner's rights.

Check it worked

After ten minutes the terminal says how many readings it sent, with the queue at 0, and the same number of synthetic rows for that period is in the development project's machine_readings. The refused tag is counted, not sent.

Fastest path

Leave the simulation running while you do Step 6: it is the outage test.

If it goes wrong

could not reach https://...supabase.co, or a 403 that looks like a wrong key, on the company network

Find out who refused it before changing any key. In Claude Code: The connector got a 403. Before changing any key: show me the full response body without any secret, tell me whether it came from Supabase, a proxy or a rate limit, and check whether HTTPS_PROXY is set. If it is, rerun with NODE_USE_ENV_PROXY=1. We hit exactly this behind a company proxy: Node's built-in fetch ignored the proxy until told to use it. The proxy setting goes into docs/connectivity.md and Session 21's package.

Invalid login credentials

The password was copied with a space, or the account is in the other project. Copy it again from the password manager entry for acme-platform-dev. The connector checks the shape of what you paste and names what is wrong, never printing it.

new row violates row-level security policy

The insert asked for the row back. Say: The connector's insert must not return the row: remove .select() after insert, and add a test. Do not give the connector a read right to make it go away.

The connector refuses the address

Correct, if you pointed the simulation at acme-platform-prod: made-up readings never enter production. Use the development address.

Rows arrive, but the dashboard's time is an hour out

read_at is stored with its time zone and shown in yours. Check the press's own clock with OT before changing anything: a gateway with the wrong time zone is common and is an open item for OT, not a code change.

Step 6

Prove what IT will ask: nothing lost, nothing reaches in, nothing read

15 minutes

Why

IT's three questions about any connector are: what happens when the link drops, can anything outside use it to reach the plant, and what can a stolen password do. Answering each with a test you ran, with the output pasted into the design, ends the discussion. Saying "it is designed to" starts one.

Do this

1. Nothing lost. While the simulation from Step 5 runs, turn off your computer's Wi-Fi (or unplug the network) for about two minutes, then turn it back on. Watch the queue fill and empty.

2. Nothing reaches in. In a second terminal, while it runs, list what is listening on your computer for the connector's process:

Terminal (Mac or Linux)
lsof -nP -iTCP -sTCP:LISTEN | grep -i node || echo "no node process is listening"
PowerShell (Windows)
Get-NetTCPConnection -State Listen | Where-Object { (Get-Process -Id $_.OwningProcess).ProcessName -eq 'node' }

3. Nothing read. Run the probe, which signs in as the connector and tries everything it must not do:

Terminal or PowerShell
npm run connector:probe -- --target https://tsrqponmlkjihgfedcba.supabase.co

Then record the evidence:

Paste into Claude Code, after replacing the <...> part
Add a section "Evidence" to docs/connectivity.md on a new branch connectivity/evidence, with today's date: the outage test (how long the link was down, readings queued, readings delivered, duplicates), the listening-port check (nothing listening), and the probe results, as I paste them below. Do not change anything else.
<paste the last lines of the connector's output, the port check and the probe output>

You will see recreated screen

Terminal
09:47:20 could not reach tsrqponmlkjihgfedcba.supabase.co (network) · queued 12 · queue 121
09:49:20 could not reach · queue 300
09:49:25 link back · replaying 300 in order · 0 duplicates · queue 02
$ npm run connector:probe -- --target https://tsrqponmlkjihgfedcba.supabase.co
select machine_readings ........ 0 rows (refused by policy)
select lots, holds, memberships . 0 rows each
update machine_readings ........ refused
delete machine_readings ........ refused
insert reading for another site . refused
9 of 9 attempts refused3
The outage and the probe. The queue fills while the network is off and empties in order when it returns; the probe is refused everywhere.
  1. "Could not reach", not "failed": the network is down, not the connector.
  2. Every queued reading delivered, in order, none twice.
  3. A stolen connector password reads nothing and changes nothing.

Check it worked

The number of synthetic rows in the development project for the run equals the number the connector generated (count them in the SQL editor if in doubt); the port check shows nothing listening; the probe says every attempt was refused; the evidence is in docs/connectivity.md on main.

If it goes wrong

After the outage there are fewer rows than readings generated

Readings were lost, which is the one thing the connector must not do. In Claude Code: The outage test lost readings: generated N, in the database M. Find where they were dropped, add a test that reproduces it, fix it, and show me the test failing before the fix.

After the outage there are more rows than readings

Duplicates got in, so the reading key is not unique per site. Say: Duplicates were stored after replay. Check the unique constraint on (site_id, reading_key) and the connector's handling of a duplicate, with a test.

The probe reads rows

Stop: the account has a read right it must not have. Say: The connector probe could read

. Find which policy allows it, fix the matrix, regenerate, and add the refusal test that would have caught it. Do not install anything in the plant until this is fixed.

The port check shows a node process listening

Another program (a development server) may be running. Stop the others and check again. If it is the connector, say: The connector is listening on a port. Remove whatever listens and make the no-listening test fail when it does.

The real connection

The real connector is the same program with --source mqtt, installed by IT on the DMZ host, reading what OT publishes from Ignition. Claude Code cannot do any of that from your laptop, and should not try: it writes the run sheet, and the people who own each system follow it.

Where each piece sits in the Purdue modelThe platform at Levels 4–5, the connector and DMZ broker at Level 3.5, the Ignition gateway at Level 3, edge and OPC UA servers at Level 2, controllers at Levels 0–1. Level 4–5Enterprise and cloudYour platform (Vercel + Supabase) · the connector signs in here, outbound 443Level 3.5Industrial DMZPlant connector · DMZ MQTT broker (OT and IT install them; IT patches them)Level 3Site operationsIgnition gateway · site MQTT broker · historian · MESLevel 2Supervisory controlHMIs · Ignition Edge · OPC UA serversLevel 0–1Process and controlPLCs · drives · sensors (never reached from above Level 3)
Who installs what, where. OT works at Levels 2 and 3, IT at 3.5 and the firewalls, you in the cloud. Each part of the run sheet is for one of them.
Step 7

Write the run sheet IT and OT follow without you

15 minutes, then their time

Why

An install day where someone has to phone you for a setting is an install day that slips. A run sheet in each person's own terms, with every name, port and host written out and a test at the end of each part, lets OT and IT work in parallel, on their own schedule, and tells you when each part is done.

Do this

Paste into Claude Code
Read docs/connectivity.md, docs/tag-aliases.csv, connector/README.md and connector/targets.json.

On a new branch connectivity/run-sheet, add a section "Run sheet" to docs/connectivity.md with three parts, each ending in a test the person can do themselves:

For OT (Ignition): the Sparkplug B group id acme-cle, edge node id and device ids for the six presses; the exact Ignition tags to publish (from the alias table) and nothing else; the MQTT Transmission server settings: the DMZ broker's address on port 8883 with TLS and its certificate; that the gateway connects out and nothing connects in. Test: the broker shows a birth certificate for each press.

For IT: the DMZ host (operating system, Node.js version, disk for the queue); installing the connector from the tagged release as a service that restarts on failure, running as its own non-admin user; where the connector password and publishable key are stored (their credential store, never a file in the repository or on a laptop); the proxy setting if outbound HTTPS goes through one; the firewall rows from section 6 with host names, not IP addresses; logs and patching. Test: the service is running, nothing listens, and the connector's log says "signed in" and "queue 0".

For us: create the production connector account (same steps as development, in acme-platform-prod); share its password with IT through the password manager; watch the first readings arrive.

Also list every outside address the connector can call and where it is configured, so IT can check the list against the firewall. Open a pull request titled "Connectivity run sheet".

You will see recreated screen

claude — acme-platform
⏺ Write(docs/connectivity.md)
+### For OT: Ignition
+Group id: acme-cle · Edge node: ignition-gw · Devices: press-1 … press-6
+Publish only these 18 tags (from docs/tag-aliases.csv). Nothing else.
+MQTT Transmission server: ssl://dmz-broker:8883, TLS, broker certificate from IT
+Test: the broker shows a DBIRTH for each of press-1 … press-6.
1
⏺ Write(docs/connectivity.md)
+### Outside addresses the connector can call
+| Address | Port | Configured in | Used for |
+| dmz-broker | 8883 | --broker flag | Sparkplug B, subscribe only |
+| abcdefghijklmnopqrst.supabase.co | 443 | connector/targets.json | Sign-in and inserts |
2
⏺ Pull request #46 adds the run sheet: 7 steps for OT, 9 for IT, 4 for us, each part ending in a test. The connector can call exactly two addresses; both are configured, neither has a default.
Claude Code writes one part per owner, each ending in a test the owner can run.
  1. Exact names OT can type into Ignition. The platform's names come from the alias table, not from Ignition.
  2. The complete list of outside addresses. IT compares it with the firewall rules; anything not on it is refused.

You will see recreated screen

ignition-gateway:8088 · MQTT Transmission · Servers
StatusDevicesOPC UATagsMQTT Transmission
SettingsServersTransmitters
1
NameURLTLSStatus
dmz-brokerssl://dmz-broker:8883OnConnected
Group IDacme-cle2
What OT will see in Ignition once the run sheet is followed: the gateway connected out to the DMZ broker. A generic recreation; the module's pages differ by version.
  1. One server, in the DMZ, over TLS, connected. The gateway made this connection; nothing connected to the gateway.
  2. The group id from the run sheet. The connector only accepts this group.

Check it worked

The run sheet is on main with three parts and a test at the end of each. OT and IT each have the link, and each has given you a date.

Fastest path

Send OT and IT the link to the section, not the whole file, and ask each for a date. The parts are independent: OT can publish to the broker before IT has installed the connector.

If it goes wrong

IT asks for the platform's IP addresses for the firewall

Supabase and Vercel addresses can change. Ask for host-name rules (abcdefghijklmnopqrst.supabase.co), which most current firewalls support. If theirs cannot, record it as an open item for Session 21: an IP rule that silently goes stale is worse than a known gap.

OT wants to publish every tag on the gateway "while we are at it"

Only the tags in the alias table. Each extra tag is data leaving the plant that nobody classified; adding one later is a one-line change to the alias table and a pull request.

Step 8

First real readings in production, witnessed

30 minutes on the day

Why

The production account is created only now, by a person, so no simulation could ever have written to production. Watching the first real readings arrive with OT and IT in the room, and pulling the plug once on purpose, turns the design into evidence the IT package can point to.

Do this

When OT and IT have each finished their part of the run sheet: create the production account exactly as in Step 4, in the production project, with a new password in a new password manager entry Platform connector, acme-platform-prod, and share that entry with the IT person who installs the connector.

Open

https://supabase.com/dashboard/project/abcdefghijklmnopqrst/auth/users

Add user, Create new user: connector.cle@acme.com, the new password, Auto Confirm User.

Open

https://supabase.com/dashboard/project/abcdefghijklmnopqrst/sql/new

Run the membership SQL from docs/connectivity.md, in the production project.

IT starts the connector service with --source mqtt --target https://abcdefghijklmnopqrst.supabase.co. With everyone watching, check the readings and then ask OT to stop the MQTT Transmission for one minute and start it again:

Supabase SQL editor, production project
-- Real readings in the last 15 minutes, per press and measure. Must not be synthetic.
select measure, count(*) as readings, max(read_at) as latest, bool_or(synthetic) as any_synthetic
from public.machine_readings
where read_at > now() - interval '15 minutes'
group by measure order by measure;

You will see recreated screen

supabase.com/dashboard/project/abcdefghijklmnopqrst/sql/new
Results
1
measurereadingslatestany_synthetic
acme/cle/stamping/press-1/peak_tonnage_kn21410:31:58false
acme/cle/stamping/press-1/running_state310:31:02false
acme/cle/stamping/press-3/connection_state210:28:40false
The first real readings in production. any_synthetic is false on every line.
  1. The stop and start of the MQTT Transmission shows as connection_state readings: the death certificate, then the birth. A frozen value is never mistaken for a steady one.
  2. One line per measure in the alias table. A missing line is a tag OT has not published yet.

Check it worked

Every measure in the alias table has readings in production from the last 15 minutes, none synthetic; the one-minute stop shows as an offline then online connection_state; the connector's log on the DMZ host says queue 0. Write the date and the witnesses' roles in docs/connectivity.md's Evidence section with a pull request.

If it goes wrong

Nothing arrives, and the connector's log says could not reach

The firewall or the proxy. IT compares the connector's outside-address list with the firewall rules and the proxy setting in the run sheet. Do not change the connector to try a different address: there is no other address.

The connector signs in but every insert fails with relation "machine_readings" does not exist

Production is behind main: the migration was merged but never applied. Check the deploy workflow's last run on GitHub (Session 11 applies migrations on merge) and the daily production-freshness check. We once found our live database nine migrations behind main.

Readings arrive for some presses only

Compare the broker's birth certificates with the alias table. A device with no birth certificate is not publishing (OT); a refused-tag count in the connector's log is a tag missing from the alias table (you, with a pull request).

Before you go on · Session 20 is done whenTick each one

Knowledge check

The link to Supabase is down for two hours. With store and forward, what does the platform lose?

Knowledge check

The connector cannot reach Supabase from behind the company firewall. What should it report?

References

  1. Cirrus Link Solutions: MQTT modules for Ignition (MQTT Transmission). https://cirrus-link.com/mqtt-modules/
  2. Eclipse Tahu: Sparkplug reference implementations and payload libraries. https://github.com/eclipse-tahu/tahu
  3. OASIS: MQTT Version 5.0. https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
  4. Node.js Documentation: command-line options and environment variables. https://nodejs.org/api/cli.html
  5. CISA: Industrial Control Systems. https://www.cisa.gov/topics/industrial-control-systems

Chapter 4 · 12 questions · 80% passes

Final assessment

Twelve questions across the element. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.

15 min12 questions≈ 15 minutesRetake allowed

Choose one answer for each question, then submit. You will see the right answer and why for every question.

1. In the DMZ connector pattern, which connection is allowed?
2. What does OPC UA's Sign and Encrypt mode give a connection?
3. What is a Sparkplug B death certificate for?
4. Where do the DMZ broker and the connector sit in the Purdue model?
5. Which part of the connectivity work does Claude Code do?
6. What rights does the plant_connector role have?
7. Why must the connector never use the Supabase secret (service role) key?
8. Who creates the connector's account and its password?
9. The simulated connector is pointed at the production project. What happens?
10. The connector cannot reach Supabase through the plant firewall. What should it report?
11. Behind a company proxy, the connector gets a 403 although the password is right. What do you check first?
12. An Ignition tag the alias table does not list reaches the connector. What does it do?