Skip to content

[ci] Add static defensive validation workflow - #2

Merged
aisamuraiagent-source merged 1 commit into
mainfrom
codex/add-static-validation-ci
Jun 13, 2026
Merged

[ci] Add static defensive validation workflow#2
aisamuraiagent-source merged 1 commit into
mainfrom
codex/add-static-validation-ci

Conversation

@aisamuraiagent-source

Copy link
Copy Markdown
Owner

Summary

Adds a GitHub Actions workflow for static defensive validation of the Daybreak Defensive Remediation Lab.

What the workflow checks

  • Required repository files exist.
  • app.js passes JavaScript syntax validation with node --check app.js.
  • Runtime files do not contain unsafe rendering or dynamic execution patterns:
    • innerHTML
    • outerHTML
    • insertAdjacentHTML
    • eval(
    • new Function
  • Runtime files do not contain obvious secret patterns.
  • Local state and generated artifacts are not committed:
    • .netlify/
    • .zip
    • .tar
    • .tar.gz
    • .7z
    • .log
  • Required bounded public-claim language remains present.

Defensive scope

This workflow performs static repository validation only. It does not scan external targets, install project dependencies, run offensive tests, or interact with third-party systems.

Why this matters

This turns the previous manual PowerShell validation into a repeatable PR gate. The next remediation cycle becomes more audit-ready because GitHub records validation evidence automatically on pull requests.

@aisamuraiagent-source
aisamuraiagent-source merged commit 9b6619c into main Jun 13, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 061a5850ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

run: |
set -euo pipefail

pattern='innerHTML|outerHTML|insertAdjacentHTML|eval\(|new Function'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make dynamic-execution grep whitespace-tolerant

In this workflow, the dynamic-execution guard only matches the exact tokens eval( and new Function. If a future runtime change uses valid JavaScript such as eval (value) or Function("..."), node --check still passes and this grep does not report it, so the CI gate can approve code that reintroduces dynamic execution despite the step name claiming to block it. Please broaden the expression to cover whitespace and the Function constructor forms you intend to forbid.

Useful? React with 👍 / 👎.


pattern='innerHTML|outerHTML|insertAdjacentHTML|eval\(|new Function'

if grep -RInE "$pattern" app.js index.html; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scan every runtime JavaScript file

With this grep target list, a PR can add and load a new script such as helper.js from index.html while leaving app.js unchanged; the workflow still only scans app.js and index.html, so helper.js could contain innerHTML/outerHTML and pass the gate. Since the required-file check does not forbid additional runtime files, scan all tracked HTML/JS assets or resolve scripts from index.html before declaring the unsafe-pattern check passed.

Useful? React with 👍 / 👎.

run: |
set -euo pipefail

pattern='SECRET|TOKEN|API[_-]?KEY|PASSWORD|PRIVATE KEY|OPENAI_API_KEY|client_secret|sk-[A-Za-z0-9]|ghp_|github_pat_'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match secret keywords case-insensitively

This grep is case-sensitive, so runtime secrets named with common lowercase identifiers such as password or api_key are not reported even though the policy and checklist treat those as forbidden secrets. In a future change to the scanned runtime files, const password = ... or api_key = ... would pass CI, leaving the secret-pattern gate ineffective for common naming conventions; use a case-insensitive match or include lowercase variants.

Useful? React with 👍 / 👎.

@@ -0,0 +1,134 @@
name: Static Defensive Validation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update evidence after adding CI

Adding this workflow makes the repository evidence stale: docs/evidence/02_security_triage.md still says “No automated CI workflow exists,” docs/remediation/remediation_plan.md still defers “add GitHub Actions CI,” and docs/validation/validation_report.md still lists CI as a pending later PR. Because this lab treats audit-ready evidence as part of the deliverable, the new CI file should be reflected in those required docs before merging.

Useful? React with 👍 / 👎.

Comment on lines +127 to +128
for claim in "${required_claims[@]}"; do
if ! grep -RInF "$claim" README.md docs SECURITY.md >/dev/null; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject contradictory affiliation claims

This loop only checks that the bounded-claim strings exist somewhere, so a future README or evidence file can keep the required disclaimer while also adding a contradictory claim such as OpenAI acceptance or authorization, and the workflow will still pass. Since the documented risk is public overclaiming, add a forbidden-claim scan rather than only requiring the disclaimer text to be present.

Useful? React with 👍 / 👎.

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.

1 participant