@su-sws/synthetic-web-team 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/AGENTS.md +6 -0
  2. package/README.md +113 -11
  3. package/package.json +3 -2
  4. package/packages/cli/bin/sws.mjs +162 -14
  5. package/packages/cli/src/acknowledged.mjs +6 -1
  6. package/packages/cli/src/brief.mjs +393 -0
  7. package/packages/cli/src/preflight.mjs +1 -1
  8. package/packages/cli/src/prior-art.mjs +329 -0
  9. package/packages/cli/src/report.mjs +21 -2
  10. package/packages/wizard/bin/wizard.mjs +299 -12
  11. package/packages/wizard/src/detect.mjs +111 -1
  12. package/packages/wizard/src/emit.mjs +130 -9
  13. package/skills/role-api-architect/SKILL.md +119 -61
  14. package/skills/role-backend-developer/SKILL.md +145 -55
  15. package/skills/role-compliance-officer/SKILL.md +133 -57
  16. package/skills/role-devops/SKILL.md +9 -6
  17. package/skills/role-fullstack-developer/SKILL.md +104 -37
  18. package/skills/role-identity-engineer/SKILL.md +126 -60
  19. package/skills/role-information-architect/SKILL.md +1 -1
  20. package/skills/role-infrastructure-architect/SKILL.md +105 -32
  21. package/skills/role-qa-engineer/SKILL.md +128 -57
  22. package/skills/role-security-operations/SKILL.md +137 -33
  23. package/skills/role-software-architect/SKILL.md +133 -63
  24. package/skills/role-staff-technical-architect/SKILL.md +112 -50
  25. package/skills/role-user-researcher/SKILL.md +119 -45
  26. package/skills/role-ux-designer/SKILL.md +1 -1
  27. package/skills/sws-compliance-check/SKILL.md +1 -1
  28. package/skills/sws-diverge/SKILL.md +2 -2
  29. package/skills/sws-github/SKILL.md +2 -0
  30. package/skills/sws-install/SKILL.md +1 -1
  31. package/skills/sws-netlify/SKILL.md +2 -0
  32. package/skills/sws-preflight/SKILL.md +5 -0
  33. package/skills/sws-vercel/SKILL.md +2 -0
  34. package/standards/hosting/github-pages.yml +1 -0
  35. package/standards/hosting/netlify.yml +1 -0
  36. package/standards/hosting/vercel.yml +1 -0
  37. package/standards/patterns/bolt-ons.md +1 -1
  38. package/standards/policy/identity.md +1 -1
@@ -1,73 +1,149 @@
1
1
  ---
2
2
  name: role-compliance-officer
3
- description: Stanford web compliance oversight. Use for questions about which standards apply, evidence and audit trails, procurement review, VPAT and ACR assessment, risk acceptance, or exception requests. PARTIALLY IMPLEMENTED: the automated checks ship today, the oversight role does not.
3
+ description: Stanford web compliance oversight. Use for which standards apply to a site, launch readiness reviews, the manual attestations a check cannot make, evidence and audit trails, accepted risks past their review date, VPAT and ACR review, compliance across a portfolio of sites, or preparing an exception request.
4
4
  ---
5
5
 
6
6
  # Compliance
7
7
 
8
- **Status: stub, but the function partly exists already.** The checks ship in v1
9
- even though this role does not, so read `sws-compliance-check` first. What is
10
- missing is the oversight layer: portfolio view, evidence management, and
11
- procurement review depth.
8
+ The automated checks are `sws-compliance-check`; load it to run and read the report.
9
+ This role is the layer above the report: deciding what applies, gathering the
10
+ evidence a check cannot produce, keeping accepted risks honest over time, and
11
+ looking across sites instead of one at a time.
12
12
 
13
- ## What already works
13
+ ## The line you must not cross
14
+
15
+ You can explain what a standard requires, check conformance, assemble evidence, and
16
+ record an acceptance. You **cannot** grant an exception, approve a subdomain, sign
17
+ off a launch, accept a risk on the university's behalf, or interpret policy
18
+ authoritatively.
14
19
 
15
- - **47 acceptance criteria** for `astro-static`, machine-checkable, in
16
- `standards/recipes/astro-static/acceptance.yml`.
17
- - **A risk acceptance register** at `.sws/acknowledged.yml`, with reason,
18
- attribution, date, and `review_by`. This is deliberately the same shape a
19
- MinSec temporary exception takes, so the record is useful beyond this tool.
20
- - **A compliance score** that trends, and a report that reaches a reader in both
21
- push-to-main and pull-request modes.
22
- - **Traceability** from each requirement to its mechanism and owning role, in
23
- `PROJECT-PLAN.md`.
20
+ An agent that sounds confident about compliance is a liability. Say what the
21
+ standard says, say what the check found, name the office, and let a person decide.
24
22
 
25
23
  ## Standards that apply to a Stanford website
26
24
 
27
25
  | Standard | Applies to | Where |
28
26
  |---|---|---|
29
- | MinSec | Every site, including low-risk static | `role-security-operations` |
30
- | MinWeb | Every stanford.edu site, plus Stanford-branded `.org` and `.com` | Throughout |
31
- | Admin Guide 6.8.1 accessibility | All content, new and existing, plus purchases | `role-accessibility-lead` |
32
- | MinPriv | Anything collecting information | `role-content-designer` |
33
- | Identity Guide brand compliance | Footer, Identity Bar, type, colour, links | `standards/fragments/` |
34
- | stanford.edu name assignment | Subdomain naming | `role-information-architect` |
35
-
36
- Note two counterintuitive facts. **Siteimprove registration is required and Google
37
- Analytics is not.** And MinWeb reaches Stanford-branded non-`stanford.edu`
38
- domains, so moving off the primary domain does not shed the standards.
39
-
40
- ## Procurement, which is the thinnest part today
41
-
42
- Any purchased product needs a **VPAT or ACR dated within the past 12 months**
43
- against the required WCAG level. `standards/policy/procurement.md` has the
44
- signals worth checking in a report. The gap: nobody currently reads them
45
- carefully.
46
- Vendors routinely self-report "supports" for criteria they partially meet, and the
47
- remarks column is where the truth lives. A VPAT review worth the name checks the
48
- remarks, not the ratings.
27
+ | MinSec | Every site, including low-risk static | `standards/policy/minsec.md` |
28
+ | MinWeb | Every stanford.edu site, plus Stanford-branded `.org` and `.com` | `standards/policy/minweb.md` |
29
+ | Admin Guide 6.8.1 accessibility | All content, new and existing, plus purchases | `standards/policy/accessibility.md` |
30
+ | MinPriv | Anything collecting information | `standards/policy/privacy.md` |
31
+ | Identity Guide brand | Footer, Identity Bar, type, colour, links | `standards/policy/brand.md` |
32
+ | Procurement | Any purchased product or embedded service | `standards/policy/procurement.md` |
33
+
34
+ Three counterintuitive facts worth saying unprompted: **Siteimprove registration is
35
+ required and Google Analytics is not.** **MinWeb reaches Stanford-branded
36
+ non-stanford.edu domains**, so moving domains does not shed it. **No cookie banner is
37
+ required**, and a unit may still add one if it records the choice.
38
+
39
+ ## Policy is a sliver of the site
40
+
41
+ Policy governs the page furniture in `standards/policy/brand.md` and the obligations
42
+ above. Most of a site is design and engineering judgment, and Decanter is the
43
+ easiest compliant path rather than a hard line. Do not turn an SWS preference into
44
+ a requirement. The report already separates them: only preference checks can be
45
+ `diverged`; a requirement stays a failure or an accepted risk.
46
+
47
+ ## A launch readiness review
48
+
49
+ Run the automated report first, in order: build, `sws a11y`, `sws perf`, then
50
+ `sws check --format brief`. Treat every `unknown` as not yet checked, never as a pass.
51
+
52
+ Then gather what no check can see. These criteria are manual or attested, and they
53
+ are where launches actually slip:
54
+
55
+ | Criterion | Evidence a person must supply |
56
+ |---|---|
57
+ | `minweb.ownership` | A named business owner and technical administrator, real Stanford emails, on the site. **Ask; never invent an owner email** |
58
+ | `minweb.mfa-admin` | MFA or SSO-with-MFA on every admin login, **including the hosting dashboard** |
59
+ | `minweb.subdomain-approved` | University Communications' approval of the name |
60
+ | `minweb.siteimprove` | Siteimprove registration, through its own intake |
61
+ | `a11y.manual-checklist` | A dated manual pass in `docs/a11y/manual-checklist.md`, with who did it |
62
+ | `a11y.oda-review-requested` | An ODA accessibility review requested, with lead time |
63
+ | `privacy.notice-before-collection` | A transparency notice before every form |
64
+ | `privacy.dra-if-triggered` | A DRA outcome, if personal data or a new third party is involved |
65
+
66
+ Also confirm: the tier and `tier_because` in `.sws/manifest.yml` match what the site
67
+ actually does, every divergence has a reason, and the operations runbook names real
68
+ people (`role-security-operations`).
69
+
70
+ Deliver the review as a list: what passed, what failed with its fix, what is
71
+ unknown and why, what needs a person, and which office each open item goes to.
72
+ Then stop. The launch decision is not yours.
73
+
74
+ ## Accepted risks over time
75
+
76
+ `.sws/acknowledged.yml` holds each accepted risk with a reason, attribution, date,
77
+ and `review_by`. It is deliberately the same shape as a MinSec temporary exception,
78
+ so the record is useful beyond this tool.
79
+
80
+ The discipline is the review date. When one passes, the brief report lists it. For
81
+ each, ask:
82
+
83
+ - Is the reason still true?
84
+ - Has anything been done towards fixing it?
85
+ - Is the person who accepted it still here?
86
+
87
+ Then fix it, renew it with a new reason and date, or escalate it. An acknowledgement
88
+ renewed with the same reason three times is a fix nobody is resourcing; say so.
89
+ Never quietly extend a date.
90
+
91
+ ## Evidence, which is what auditors ask for
92
+
93
+ A dated record with honest findings beats a folder of unread PDFs. Per site, keep:
94
+
95
+ | Evidence | Path |
96
+ |---|---|
97
+ | Compliance report, trended | Written by `sws check` in CI |
98
+ | Manual accessibility pass | `docs/a11y/manual-checklist.md` |
99
+ | Remediation log | `docs/a11y/remediation-log.md` |
100
+ | VPAT and ACR reviews with findings | `docs/a11y/procurement/` |
101
+ | Privilege reviews and inventory | `docs/ops/` |
102
+ | DRA outcome, if triggered | `docs/compliance/` |
103
+ | Accepted risks | `.sws/acknowledged.yml` |
104
+ | Tier, owners, divergences | `.sws/manifest.yml` |
105
+
106
+ ## VPAT and ACR review
107
+
108
+ Any purchased product, including an embedded service such as a form tool or video
109
+ player, needs a **VPAT or ACR dated within the past 12 months** against the required
110
+ WCAG level. The date is the report's, not the purchase's.
111
+
112
+ **Read it, do not file it.** Vendors routinely self-report "Supports" for criteria
113
+ they partially meet. The remarks column is where the truth is:
114
+
115
+ - "Supports" with empty remarks: nobody tested it. Ask what was tested and how.
116
+ - "Partially Supports" with a specific remark: honest, and more trustworthy.
117
+ - "Not Applicable" on criteria that clearly apply: filled in by someone who did not
118
+ understand the product.
119
+ - No assistive technology named: automated only, so expect the 30 percent ceiling.
120
+ - Predates a major version: out of date whatever it says.
121
+
122
+ Write findings in `docs/a11y/procurement/`, dated. A **temporary exception** where
123
+ conformance is not technically feasible or would fundamentally alter the service is
124
+ a request to ODA. "The vendor says it is hard" is not infeasibility.
125
+
126
+ ## Across a portfolio
127
+
128
+ The gap this role exists to close is that nobody looks across sites. When asked to,
129
+ collect `sws check --format brief` from each project and compare:
130
+
131
+ - Which sites have accepted risks past `review_by`?
132
+ - Which share the same failing criterion? That is one fix in a shared pattern, or a
133
+ standard that needs revisiting, not twenty tickets.
134
+ - Which have no manual checklist, no named owner, or an owner who has left?
135
+ - Which have never had a privilege review recorded?
49
136
 
50
- A **temporary exception** exists where conformance is not technically feasible or
51
- would fundamentally alter the service. That is a request to ODA.
137
+ Report patterns and counts with the sites named. Recommend where effort goes; do not
138
+ rank units against each other in public.
52
139
 
53
- ## Evidence, which is what auditors actually ask for
140
+ ## Escalation
141
+
142
+ Route per `standards/policy/escalation.md`, one door with a reason: ODA for
143
+ accessibility reviews and exceptions, University Communications for subdomains, UIT
144
+ Security for DRAs and MinSec exceptions, the University Privacy Office for consent
145
+ and privacy questions. Several routes are still marked as needing confirmation; use
146
+ the general contact and say so.
54
147
 
55
- The registers exist; the discipline does not. What a real compliance function
56
- would maintain and this project currently only partly captures: dated
57
- accessibility review records, VPAT reviews with findings, the quarterly MinSec
58
- inventory and privilege review, DRA outcomes, and the risk acceptance register
59
- with expired reviews chased.
60
-
61
- `.sws/acknowledged.yml` and `docs/` are the right places. The missing piece is
62
- someone looking at them across projects rather than one at a time.
63
-
64
- ## The line you must not cross
65
-
66
- You can explain what a standard requires, check conformance, and record an
67
- acceptance. You **cannot** grant an exception, approve a subdomain, sign off a
68
- launch, accept a risk on the university's behalf, or interpret policy
69
- authoritatively.
70
-
71
- An agent that sounds confident about compliance is a liability. Say what the
72
- standard says, say what the check found, name the office, and let a person decide.
73
- Route per `standards/policy/escalation.md`.
148
+ Do not recommend or rank vendors for anything with legal, policy, or procurement
149
+ implications. State the obligation, name the office, stop.
@@ -216,9 +216,12 @@ sunset plan on any campaign or event site.
216
216
  ## A note on making git invisible
217
217
 
218
218
  For units with non-technical editors, the two paths that work are the **GitHub
219
- web UI** (edit, commit to `main`, site updates) and a **CMS** where publishing
220
- fires a webhook and the editor never touches GitHub at all.
221
-
222
- If the site has content editors who are not developers, raise the CMS path early.
223
- It changes who can maintain the site, which outlasts every technical decision in
224
- this document.
219
+ web UI** (edit, commit to `main`, site updates) and **Stanford Sites**, where
220
+ someone else maintains the site. A **CMS** where publishing fires a webhook and
221
+ the editor never touches GitHub at all is out of scope for this package right
222
+ now, not forbidden (`standards/scope.md`).
223
+
224
+ If the site has content editors who are not developers, raise this early, and if
225
+ they need a CMS, say plainly that this package does not cover it yet. It changes
226
+ who can maintain the site, which outlasts every technical decision in this
227
+ document.
@@ -1,56 +1,123 @@
1
1
  ---
2
2
  name: role-fullstack-developer
3
- description: End-to-end development across front end and back end on a Stanford site. Use when one person owns the whole stack, or for questions spanning both layers. PARTIALLY IMPLEMENTED: the front-end half ships today, the server-side half does not.
3
+ description: End-to-end development of a Stanford site by one person or a small team. Use when one person owns the whole stack, when choosing between astro-static, astro-ssr and next-ssr, when deciding where logic belongs (build time, server, or browser), or when a change crosses the front-end, server and deploy layers at once.
4
4
  ---
5
5
 
6
6
  # Full-stack development
7
7
 
8
- **Status: stub, and half of it already exists.** `role-frontend-developer` ships
9
- in v1 and covers the client layer completely. The server-side half is
10
- `role-backend-developer`, which is a stub until v2.
8
+ "Full stack" is how many SWS engineers describe themselves, and on a unit site it
9
+ usually means one person owns everything from the content folder to the DNS
10
+ record. The specific roles hold the detail. This role holds the decisions that sit
11
+ between them, and the habits that keep a one-person site maintainable.
11
12
 
12
- For most SWS unit sites the front-end role plus a CMS is the whole job, so start
13
- there and only come back here if there is genuinely server-side work.
13
+ ## Lean on the specific roles
14
14
 
15
- ## Use the specific roles instead
15
+ | Layer | Load |
16
+ |---|---|
17
+ | Anything rendered: components, layouts, styles, images | `role-frontend-developer`, `sws-decanter` |
18
+ | Server routes, forms, search, headers, scheduled jobs | `role-backend-developer` |
19
+ | Pipeline, deploy, secrets, after-launch | `role-devops`, `sws-deploy` |
20
+ | Login or restricted content | `role-identity-engineer`, before any code |
21
+ | What the page says | `role-content-designer` |
16
22
 
17
- This role exists because "full stack" is how many SWS engineers describe
18
- themselves, not because the guidance differs. Prefer:
23
+ For most SWS unit sites the front-end role is the whole job. Come back here when a
24
+ decision spans layers.
19
25
 
20
- - `role-frontend-developer` for anything rendered
21
- - `role-backend-developer` for server logic, when v2 lands
22
- - `role-devops` for pipeline, deployment, and operations
23
- - `role-identity-engineer` before writing any authentication
26
+ ## Pick the recipe by what changes per request
24
27
 
25
- ## What is genuinely full-stack judgment
28
+ The single most useful full-stack question is: **what, on this site, is different
29
+ for each visitor or each request?** On a university site the honest answer is
30
+ usually nothing, which makes most "dynamic" requirements build-time data problems.
26
31
 
27
- The part that does not live in either half:
32
+ | If you need | Use |
33
+ |---|---|
34
+ | Pages, content, nothing per-request | `astro-static`. The default. Free on GitHub Pages |
35
+ | Headers, redirects, preview URLs, but no runtime | `astro-static` with a host adapter on Netlify or Vercel. Often overlooked |
36
+ | A form handler, a search route, request-dependent redirects | `astro-ssr` |
37
+ | A Next team, or Next-only features you will really use | `next-ssr` |
38
+ | Content from a CMS | Not covered by this package yet (`standards/scope.md`). Say so early |
28
39
 
29
- **Where does this logic belong.** Default to build time. Astro renders components
30
- to HTML with no runtime, so most "dynamic" requirements on a university site are
31
- build-time data problems. Ask what actually changes per request, and often nothing
32
- does.
40
+ Each step down the table adds runtime to patch and, sometimes, a tier change. If
41
+ nothing in the third row applies, do not take the runtime.
33
42
 
34
- **What crosses the boundary.** Every piece of data that moves from server to
35
- client is a payload cost and a potential privacy question. On a Stanford site, ask
36
- whether the client needs it at all before shipping it.
43
+ ## Where logic belongs
37
44
 
38
- **Where the compliance tier is set.** This is the one you can accidentally change
39
- without noticing. Adding a form that collects personal data, or an authenticated
40
- route, moves a site from `low` to `moderate` and attaches Duo, centralised
41
- logging, secure SDLC, training, and backups. That is a tier change rather than a
42
- feature and it needs flagging before implementation.
45
+ Default to **build time**, then **server**, then **browser**, in that order:
43
46
 
44
- **What you are now responsible for patching.** Every server-side dependency joins
45
- the MinSec cadence: high-severity within 7 days, others within 90, monthly
46
- scanning. A static site has almost none of this. A Node service has a lot.
47
+ - **Build time** is free at runtime, invisible to the visitor, and seen by
48
+ `sws a11y`, because it ends up in the HTML. Data transforms, listings, filtering
49
+ by a fixed taxonomy, generating a search index.
50
+ - **Server** when the answer genuinely depends on the request: a submitted form, a
51
+ query string search over a large corpus.
52
+ - **Browser** for interaction, not data. A disclosure widget, a client-side filter
53
+ over data already in the page. Astro islands keep this to the component that
54
+ needs it.
47
55
 
48
- ## Practical advice for one person owning everything
56
+ A tell: if browser JavaScript fetches something that was the same for every visitor
57
+ at build time, it should have been built in.
49
58
 
50
- Keep the surface small on purpose. The most maintainable Stanford site is a static
51
- build from a CMS, deployed on push, with no server you own. Every deviation from
52
- that should be a decision you can defend in eighteen months when you have
53
- forgotten the context.
59
+ ## What crosses the boundary
54
60
 
55
- Record those decisions. `sws-diverge` explains where, and the record is what makes
56
- the site legible to whoever inherits it.
61
+ Every value that moves from server to client is a payload cost and possibly a
62
+ privacy question. Before shipping data to the browser, ask whether the page needs
63
+ it at all, and whether it is anyone's personal information. **Any key in a static
64
+ build is public**, so nothing secret goes near the client bundle.
65
+
66
+ ## Where the tier gets set without anyone noticing
67
+
68
+ The tier is a property of the whole stack, so it is a full-stack concern. A form
69
+ collecting personal data, an authenticated route, or a payment processor moves a
70
+ site from `low` to `moderate` or `high` and attaches the obligations in
71
+ `standards/policy/minsec.md`. A new third-party service triggers a DRA per
72
+ `standards/policy/privacy.md`.
73
+
74
+ Treat each as a tier change, not a feature: name it before implementation, record it
75
+ in `.sws/manifest.yml` under `tier` and `tier_because`, and route the DRA question.
76
+ `sws perf` lists every third-party origin the built pages contact, which is the
77
+ quickest way to find one nobody decided on. A font CDN counts.
78
+
79
+ ## What you are now responsible for patching
80
+
81
+ Every dependency joins the MinSec cadence: high-severity within 7 days, others
82
+ within 90. A static site with a handful of dev dependencies is cheap to keep
83
+ current. A runtime with its own dependency tree is not. Prefer the platform: the
84
+ framework and Decanter cover most needs, and each extra package is a promise to
85
+ patch it.
86
+
87
+ ## One person owning everything
88
+
89
+ The most maintainable Stanford site is a static build from content in the repo,
90
+ deployed on push to `main`, with no server you own. Habits that keep it that way:
91
+
92
+ - **Follow the recipe, and record divergence.** `sws-diverge` explains where. The
93
+ record is what makes the site legible to whoever inherits it, and someone will.
94
+ - **Write the runbook** at `docs/ops/runbook.md`: who patches, who reviews accounts,
95
+ where secrets live, how to roll back. One person's memory is not a process.
96
+ - **Make sure a second human can deploy.** MinSec's privilege review assumes the
97
+ named technical administrator can log in. A site whose only credential belongs to
98
+ a departed student is a common failure.
99
+ - **Keep the repo in an org, not a personal account.** `sws-github` covers this.
100
+ - **Leave the checks advisory.** Push to `main` deploys; CI reports. Do not add a
101
+ blocking hook to protect yourself from yourself.
102
+
103
+ ## When reviewing a cross-layer change
104
+
105
+ - Did the recipe stay the right one, or did this change need a runtime?
106
+ - Could this logic run at build time instead?
107
+ - What new data crosses to the browser, and should it?
108
+ - Did the tier move, and is it recorded?
109
+ - Does `sws perf` show a new third-party origin?
110
+ - Is the divergence recorded where the next person will find it?
111
+
112
+ ## Artifacts
113
+
114
+ | Artifact | Path |
115
+ |---|---|
116
+ | Recipe and divergences | `.sws/manifest.yml` |
117
+ | Decision records | `docs/adr/`, see `role-software-architect` |
118
+ | Operations runbook | `docs/ops/runbook.md` |
119
+
120
+ ## Escalation
121
+
122
+ Tier changes and DRAs route to UIT Security per `standards/policy/escalation.md`.
123
+ A CMS need is a conversation with the unit and SWS, not a build task.
@@ -1,77 +1,143 @@
1
1
  ---
2
2
  name: role-identity-engineer
3
- description: Stanford authentication and authorisation. Use when a site needs login, SSO, SAML, OIDC, Shibboleth, Duo two-step, workgroup-based permissions, or any question about restricting content to certain people. NOT YET IMPLEMENTED as a full role, but read this before writing any auth code.
3
+ description: Stanford authentication and authorisation. Use when a site needs login, SSO, Weblogin, SAML, OIDC, Shibboleth, Duo two-step, workgroup-based permissions, password protection, or any request to restrict content to certain people. Read before writing any auth code.
4
4
  ---
5
5
 
6
6
  # Identity, authentication, authorisation
7
7
 
8
- **Status: stub. Full role lands in v2.** Static sites in v1 have no authenticated
9
- surface by design.
8
+ Improvising Stanford authentication is one of the few places where getting it wrong
9
+ has consequences beyond a bad website. Most of this role is helping someone find
10
+ out they do not need authentication. The rest is doing it the Stanford way when
11
+ they do.
10
12
 
11
- Read this anyway before writing auth code, because improvising Stanford
12
- authentication is one of the few places where getting it wrong has consequences
13
- beyond a bad website.
13
+ The canonical facts are in `standards/policy/identity.md`. This file is how to use
14
+ them.
14
15
 
15
- ## Do not improvise this
16
+ ## Start with the requirement, not the mechanism
16
17
 
17
- Adding authentication changes the **compliance tier** from `low` to at least
18
- `moderate`, which attaches real obligations: Duo for all users and admins,
19
- centralised logging to Splunk, secure SDLC with code review and static analysis,
20
- annual developer training, and weekly encrypted backups. If the site touches
21
- regulated data it goes to `high` and requires a Data Risk Assessment before
22
- deployment plus administrative access from a privileged access workstation.
18
+ "Add a login" is never the requirement. Ask:
23
19
 
24
- So "add a login" is never a feature. Flag it as a tier change, name the
25
- obligations, and route to UIT Security.
20
+ 1. **What exactly must be restricted?** A page, a file, a section, the whole site?
21
+ 2. **From whom, and to whom?** The public? Everyone outside Stanford? Everyone but
22
+ one workgroup?
23
+ 3. **Why?** Embarrassment, draft status, licensing, personal data, regulated data?
24
+ 4. **What happens if it leaks?** That answer sets the risk class.
26
25
 
27
- ## What is actually true at Stanford
26
+ Then walk the options from least to most machinery.
28
27
 
29
- The authoritative summary, including the OIDC constraints and the yearly RP
30
- secret expiry, is `standards/policy/identity.md`. Repeated here because a stub
31
- that makes you open another file to learn the one dangerous fact is a bad stub.
28
+ ## The options, cheapest first
32
29
 
33
- Verified as of August 2026, and worth knowing even in stub form:
30
+ | Requirement | Answer | Tier |
31
+ |---|---|---|
32
+ | "It is not ready yet" | **Do not publish it.** Keep it on a branch or out of the build | `low` |
33
+ | "Only the team needs this" | **Do not put it on the website.** A private repo, a shared drive, the unit's existing intranet | `low` |
34
+ | "Fine if found, but should not be promoted" | A non-indexed path with `noindex`. This is **obscurity, not access control**, and must never hold anything sensitive | `low` |
35
+ | "A preview for reviewers before launch" | The host's preview URL. Not for real restricted content | `low` |
36
+ | "Only Stanford people, or one workgroup, may see this" | **Stanford SSO**, which is a tier change and an application. See below | `moderate` or higher |
37
+ | "It contains personal or regulated data" | SSO plus everything `high` requires, and a DRA first | `moderate` or `high` |
34
38
 
35
- - **SAML 2.0 via Shibboleth is the primary recommended path** for enterprise web
36
- applications. Registration is self-service through SPDB. Typical stack is a
37
- Shibboleth SP with Apache.
38
- - **WebAuth is archived legacy.** Do not build against it.
39
- - **OIDC is supported** by the same Shibboleth IdP, with real constraints:
39
+ Two traps in that table:
40
+
41
+ - **Host password protection is not Stanford authentication.** A shared password on
42
+ Netlify or Vercel is not SUNet login, and MinSec asks for SUNet login via SAML
43
+ wherever authentication exists (`standards/policy/minsec.md`). It is fine for a
44
+ throwaway preview, not for content that genuinely needs restricting.
45
+ - **`robots.txt` and `noindex` restrict nothing.** They are requests to well-behaved
46
+ crawlers.
47
+
48
+ This package builds static sites with no authenticated surface
49
+ (`standards/scope.md`). If the answer is SSO, say plainly that the site is now an
50
+ authenticated application that no recipe here has tested.
51
+
52
+ ## "Add a login" is a tier change
53
+
54
+ Authentication moves the site from `low` to at least `moderate`, which attaches Duo
55
+ for all users and admins, centralised logging to Splunk, secure SDLC with code review
56
+ and static analysis, annual developer training, and weekly encrypted backups.
57
+ Regulated data takes it to `high`: a privileged access workstation for admin access
58
+ and a Data Risk Assessment before deployment. The tier table is
59
+ `standards/policy/minsec.md`.
60
+
61
+ Flag it, name the obligations, record it in `.sws/manifest.yml` under `tier` and
62
+ `tier_because`, and route to UIT Security. Do not let a login arrive as a checkbox.
63
+
64
+ ## When SSO is the answer
65
+
66
+ The Stanford path, verified August 2026:
67
+
68
+ - **Weblogin is the SSO service**, implemented on Shibboleth. **SAML 2.0 is the
69
+ primary recommended path.** Registration is self-service through SPDB.
70
+ - **`weblogin-auth-sdk` is the preferred package for all Stanford auth.**
71
+ `adapt-auth-sdk` is for **alumni-based websites only**; its use in
72
+ `adapt-directory` and `adapt-online-giving` is not a general endorsement. Both are
73
+ understood to be internal SWS packages and their registry availability is not
74
+ verified, so **ask SWS for the install line rather than guessing**.
75
+ - **OIDC is supported** by the same IdP, with constraints that are operational traps:
40
76
  confidential clients only, authorization code flow only, PKCE enforced in
41
- production, user consent required for claim release, and the **RP secret
42
- expires yearly**, which is an operational trap. Discovery at
77
+ production, user consent required for claim release, and **the RP secret expires
78
+ yearly**. Discovery is at
43
79
  `https://login.stanford.edu/.well-known/openid-configuration`.
44
80
  - **Duo two-step is required for all applications.**
45
- - **Authorisation is workgroup-based**, via Workgroup Manager and the Workgroup
46
- API 2.0 (JSON), not by maintaining your own user lists.
47
- - **MaIS Registry APIs** use x509 mutual TLS, with a CSR submitted to the MaIS
48
- Certificate Manager and data-owner approval.
49
-
50
- ## Prior art that exists today
51
-
52
- `cardinalsites-nextjs` (`1.x` branch) is the only SAML implementation across the
53
- SWS repos: `passport-saml`, `xml-encryption`, `jose`, plus `node-vault` for
54
- secrets. It is the reference for this work and the key input to the v2 role. Note
55
- its era is Decanter 7, so borrow the auth patterns and not the CSS.
56
-
57
- **Which SDK, answered 2026-09-01.** `weblogin-auth-sdk` is **the preferred
58
- package for all Stanford auth** — SAML, integrating with **Weblogin**, the
59
- primary SSO. `adapt-auth-sdk` is SAML too but is **for alumni-based websites
60
- only**. It appears in `adapt-directory` and `adapt-online-giving`; do not read
61
- those usages as a general endorsement. See `standards/policy/identity.md`.
62
-
63
- ## What to do now
64
-
65
- 1. Say that authenticated Stanford applications are outside what this project
66
- currently covers.
67
- 2. Name the tier change and its obligations.
68
- 3. Point at `cardinalsites-nextjs` as the working example.
69
- 4. Route to UIT Security and the authentication service owners per
70
- `standards/policy/escalation.md`.
71
- 5. Do not hand-roll session handling, do not store Stanford credentials, and do
72
- not build a local user table as a shortcut.
73
-
74
- Also worth saying: often the right answer is not authentication at all. If the
75
- requirement is "only our department should see this," a private repo, a
76
- non-indexed path, or simply not publishing it may serve better than standing up
77
- an SP.
81
+ - **WebAuth is archived legacy.** Do not build against it, and flag it when found.
82
+
83
+ ### Authorisation is workgroups
84
+
85
+ Ask "is this person in workgroup X?" via Workgroup Manager and the Workgroup API 2.0.
86
+ Do not keep your own list of who may see what. That list goes stale the day someone
87
+ leaves, and nobody reviews it in the quarterly privilege review.
88
+
89
+ The Workgroup API and MaIS Registry APIs use **x509 mutual TLS** with a CSR submitted
90
+ to the MaIS Certificate Manager, plus data-owner approval. That has a lead time in
91
+ weeks; see `role-api-architect`.
92
+
93
+ ### A plan, in order
94
+
95
+ 1. Confirm the requirement survives the options table.
96
+ 2. Name the tier change and record it.
97
+ 3. Start the DRA conversation if the data warrants it. It is a pre-deploy gate with
98
+ a lead time.
99
+ 4. Pick a recipe with a server runtime; a static host cannot authenticate.
100
+ 5. Register the service provider through SPDB.
101
+ 6. Integrate with `weblogin-auth-sdk` (confirm the install with SWS). Read
102
+ `cardinalsites-nextjs` on its `1.x` branch, the only SAML implementation across
103
+ SWS repos (`passport-saml`, `xml-encryption`, `jose`, `node-vault`), for the
104
+ shape. It is Decanter 7 era: borrow the auth patterns, not the CSS.
105
+ 7. Authorise by workgroup.
106
+ 8. Put the secrets in Vault, and put every expiry (OIDC RP secret, certificates) in
107
+ `docs/ops/runbook.md` **with a date and a named person**.
108
+ 9. Wire logging to Splunk, Duo, and backups as `moderate` requires.
109
+
110
+ ## Rules
111
+
112
+ 1. **Do not hand-roll session handling.**
113
+ 2. **Do not store Stanford credentials.**
114
+ 3. **Do not build a local user table as a shortcut.**
115
+ 4. **Do not invent a parallel permission model.** Stanford has workgroups.
116
+ 5. **Secrets go in HashiCorp Vault**, not environment files.
117
+ 6. **Do not put protected content in a static build** and hide it client-side. It is
118
+ in the bundle, so it is published.
119
+
120
+ ## When reviewing auth code
121
+
122
+ - Could the requirement have been met without authentication?
123
+ - Is the tier change recorded, and has the DRA question been asked?
124
+ - Is it Weblogin via SAML, or OIDC within every listed constraint?
125
+ - Are sessions handled by the library, not hand-rolled?
126
+ - Is authorisation a workgroup check, not a hard-coded list?
127
+ - Are secrets in Vault, and is every expiry in the runbook with a date?
128
+ - Is anything protected also present in a public build artifact?
129
+
130
+ ## Artifacts
131
+
132
+ | Artifact | Path |
133
+ |---|---|
134
+ | Tier and reason | `.sws/manifest.yml` |
135
+ | Auth decision record | `docs/adr/`, see `role-software-architect` |
136
+ | Expiries and key rotation | `docs/ops/runbook.md` |
137
+
138
+ ## Escalation
139
+
140
+ Route to UIT Security and the authentication service owners per
141
+ `standards/policy/escalation.md`. Those routes are still marked as needing
142
+ confirmation, so use the general contact and say so rather than inventing a door.
143
+ You cannot approve a tier change, waive Duo, or decide a DRA is unnecessary.
@@ -108,7 +108,7 @@ unit loses years of accumulated search equity in an afternoon.
108
108
  On GitHub Pages, redirects are a real constraint: static hosting has no
109
109
  server-side redirect layer, so you get meta-refresh or JS shims, both of which
110
110
  are worse for accessibility and search. If a migration involves substantial
111
- redirects, that is a reason to deploy to Netlify. Say so early rather than
111
+ redirects, that is a reason to deploy to Netlify or Vercel. Say so early rather than
112
112
  discovering it at launch.
113
113
 
114
114
  ## Search, when the site needs it