Skip to content

Eop card browser/m1 data scaffolding#3122

Open
ayman-art wants to merge 26 commits into
masterfrom
eop-card-browser/m1-data-scaffolding
Open

Eop card browser/m1 data scaffolding#3122
ayman-art wants to merge 26 commits into
masterfrom
eop-card-browser/m1-data-scaffolding

Conversation

@ayman-art

@ayman-art ayman-art commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Implements web scaffolding and the basic mappings population for the Elevation of Privilege (EoP) edition (eop-5.0-en) including a reusable Python scaffolding script (scripts/scaffold_cards.py) to automate card folders generation, making it easy to onboard future editions and games.
  • The PR completes the first milestone of the EoP Card Browser Project Adding a endpoint for each eop card and to the card browser #1322

Changes

Data scaffolding — cornucopia.owasp.org/data/cards/eop-cards-5.0-en/

  • Created EoP edition data folder with 78 cards across 6 suits: spoofing, tampering, repudiation, information-disclosure, denial-of-service, elevation-of-privilege
  • Each card folder contains two files:
    • explanation.md — pre-filled with a Scenario/Threat Modeling template
    • technical-note.md — intentionally empty, to be filled later

source/eop-mappings-5.0.yaml

  • Populated mappings for all 78 cards with metadata: id, value, url, stride, stride_print
  • For EoP, stride and stride_print map to the first letter and full name of the suit respectively (e.g. S / Spoofing)

scripts/scaffold_cards.py

  • Created Python script to scaffold card files under cornucopia.owasp.org/data/cards/ by parsing card data files under source/
  • Fixed docstring to accurately reflect the real output directory (cornucopia.owasp.org/data/cards/)
  • Added path traversal prevention: all YAML-sourced path components (meta.edition, meta.version, meta.language, suit.name, card.id) are validated against allowlist regexes via safe_component(), and resolved paths are verified to stay within ROOT
  • Added explicit validation for all required YAML keys (meta, meta.edition, meta.version, meta.language, suits, suit.name, suit.cards, card.id) to produce clear ValueError messages instead of cryptic KeyErrors

tests/scripts/scaffold_cards_utest.py

  • Added 28 unit tests covering:
    • Correct directory layout and file content creation
    • Non-overwrite semantics (existing files are not modified on re-run)
    • Rejection of unsafe path components (traversal sequences, invalid formats, ...)
    • Acceptance of all valid input formats
    • Missing required YAML key detection for all required fields

tests/test_files/source/scaffold-cards-1.0-en.yaml

  • Added a minimal YAML file used by the tests to show the full scaffolding flow

Screenshots

output files
image
unit test run output
image

Resolved or fixed issue: none (partial progress on #1322)

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

@ayman-art ayman-art marked this pull request as draft June 16, 2026 22:33
@qltysh

qltysh Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

❌ 1 blocking issue (1 total)

Tool Category Rule Count
mypy Lint Library stubs not installed for "yaml" 1

Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
ayman-art and others added 2 commits June 17, 2026 02:09
…_cards.py

Co-authored-by: qltysh[bot] <168846912+qltysh[bot]@users.noreply.github.com>
@ayman-art ayman-art marked this pull request as ready for review June 16, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial data scaffolding needed to support browsing the Elevation of Privilege (EoP) 5.0 deck in the Cornucopia site, and introduces a Python utility to generate the per-card content folder structure from source/*-cards-*.yaml.

Changes:

  • Populated source/eop-mappings-5.0.yaml with per-card metadata for all EoP suits/cards (IDs, URLs, STRIDE fields).
  • Added scripts/scaffold_cards.py to scaffold cornucopia.owasp.org/data/cards/<edition>-cards-<version>-<lang>/... from a source cards YAML.
  • Added scaffolded per-card Markdown placeholders under cornucopia.owasp.org/data/cards/eop-cards-5.0-en/ (explanation + technical note).

Reviewed changes

Copilot reviewed 80 out of 158 changed files in this pull request and generated 5 comments.

File Description
source/eop-mappings-5.0.yaml Adds full per-card mapping entries for the EoP 5.0 deck (IDs/URLs/stride metadata).
scripts/scaffold_cards.py Introduces a generator script to create the expected card folder/file layout from source/*cards*.yaml.
cornucopia.owasp.org/data/cards/eop-cards-5.0-en/** Adds scaffolded EoP card content folders (templates for explanation/technical notes).

Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py

@sydseter sydseter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the Copilot comments.

@rewtd rewtd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Security │ Blocking - path traversal not yet fixed
  • Code quality │ Minor issues (error handling, broad exception)
  • Process │ Outstanding review comments not addressed

The scaffolding approach is sensible, but this PR will not be merged until the path traversal issue is fixed and comments addressed.

Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py Outdated
Comment thread tests/scripts/scaffold_cards_utest.py
Comment thread tests/scripts/scaffold_cards_utest.py Outdated
Comment thread tests/scripts/scaffold_cards_utest.py
Comment thread tests/scripts/scaffold_cards_utest.py
Comment thread tests/scripts/scaffold_cards_utest.py
Comment thread tests/test_files/source/scaffold-cards-1.0-en.yaml
Comment thread tests/test_files/source/scaffold-cards-1.0-en.yaml
Comment thread tests/test_files/source/scaffold-cards-1.0-en.yaml
Comment thread tests/test_files/source/scaffold-cards-1.0-en.yaml
Comment thread tests/test_files/source/scaffold-cards-1.0-en.yaml
@ayman-art ayman-art requested review from rewtd and sydseter June 27, 2026 15:52
@sydseter sydseter requested a review from Copilot June 29, 2026 10:33
Comment thread tests/scripts/scaffold_cards_utest.py Outdated
Comment thread scripts/scaffold_cards.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 82 out of 160 changed files in this pull request and generated 2 comments.

Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
import shutil
from pathlib import Path
from unittest.mock import patch
import yaml as _yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Library stubs not installed for "yaml" [mypy:import-untyped]

@ayman-art ayman-art requested a review from sydseter June 29, 2026 12:19
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread scripts/scaffold_cards.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sydseter

Copy link
Copy Markdown
Collaborator

@ayman-art please look at the remaining comments

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 82 out of 160 changed files in this pull request and generated 5 comments.

Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py Outdated
sydseter and others added 4 commits June 29, 2026 16:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread scripts/scaffold_cards.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py
Comment thread scripts/scaffold_cards.py Outdated
Comment thread scripts/scaffold_cards.py Outdated
@sydseter

Copy link
Copy Markdown
Collaborator

@ayman-art getting close now.

@ayman-art

Copy link
Copy Markdown
Collaborator Author

@sydseter, Thank you, I extracted validation logic into separate methods to reduce the complexity, let me know if there is remaining work.

@OWASP OWASP deleted a comment from github-actions Bot Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants