Skip to content

feat: add configuration integrity checks - #1140

Open
codewithchotu wants to merge 5 commits into
accordproject:mainfrom
codewithchotu:security/config-integrity-guard
Open

codewithchotu wants to merge 5 commits into
accordproject:mainfrom
codewithchotu:security/config-integrity-guard

Conversation

@codewithchotu

Copy link
Copy Markdown
Contributor

Summary

Introduces a lightweight configuration integrity scanner to help identify suspicious content in sensitive repository files, motivated by the security incident described in #1101.

Changes

  • Added scripts/check-config-integrity.mjs.
  • Scans sensitive configuration, build scripts, package manifests, and GitHub Actions workflows.
  • Detects:
    • Unusually long lines (over 200 characters).
    • Non-whitespace content following 40 or more consecutive spaces or tabs.
    • Unexpected control characters.
  • Reports file names, line numbers, and finding types.
  • Handles unreadable files as scan failures.
  • Integrated the scanner into the PR build, test, and E2E workflows before npm ci.
  • Added 22 standalone Node.js tests.

Validation

  • Scanner tests: 22 passed.
  • Scanner execution against the repository: passed.
  • Existing Vitest suite: 650 tests passed.
  • Production build: passed.
  • git diff --check: passed.

Note: The repository-wide ESLint command currently reports existing violations across src/. The new scanner and its tests are outside the configured ESLint target.

Security considerations

This is a heuristic early-warning check, not a malware detector or security boundary. It can identify suspicious formatting patterns but cannot detect every form of malicious code. PR review and existing maintainer approval controls remain essential.

Related issue

Related to #1101.

Feedback on detection thresholds, sensitive-file coverage, and CI integration is welcome.

@codewithchotu
codewithchotu requested review from a team and TheCelestial25 as code owners November 19, 2026 11:35
@netlify

netlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

👷 Deploy request for ap-template-playground pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 963fd8c

I, Mohd Owais <mo0322975@gmail.com>, hereby add my Signed-off-by to this commit: d9098d2

Signed-off-by: Mohd Owais <mo0322975@gmail.com>
@codewithchotu

Copy link
Copy Markdown
Contributor Author

E2E Testing Update

Hi @mttrbrts!
I performed local E2E verification using Playwright with Chromium.

  • Initial run: 25/27 tests passed.
  • The two failures were in design-v2-default.spec.ts, involving the first-visit Design V2 layout.
  • On isolated rerun, the classic-layout test passed, while the first-visit test continued to fail with the default 5-second assertion timeout.
  • I temporarily increased that assertion timeout to 40 seconds for diagnosis. Both Design V2 tests then passed.
  • With that temporary adjustment, the complete E2E suite passed: 27/27 tests using a single worker.
  • I reverted the temporary timeout change and kept the PR focused on the configuration integrity checks.

The initial failure appears timing-related, but I haven't confirmed its root cause. I wanted to document this rather than report an unconditional E2E pass.

@mira-accord-project

Copy link
Copy Markdown

Thank you for opening this, and for the detail in the description and in your E2E note. A configuration integrity check that runs before npm ci is a sensible addition, and the 22 scanner tests are a good start. Because this PR changes the GitHub Actions workflows, its CI runs are waiting for a maintainer to approve them before they start, as is usual for pull requests from forks. Once they run, a maintainer for this repository will review the scanner, its thresholds and the workflow changes, and review comments will appear on this pull request.


Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this.

@codewithchotu

Copy link
Copy Markdown
Contributor Author

Thank you for opening this, and for the detail in the description and in your E2E note. A configuration integrity check that runs before npm ci is a sensible addition, and the 22 scanner tests are a good start. Because this PR changes the GitHub Actions workflows, its CI runs are waiting for a maintainer to approve them before they start, as is usual for pull requests from forks. Once they run, a maintainer for this repository will review the scanner, its thresholds and the workflow changes, and review comments will appear on this pull request.

Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this.

Thanks for the update! I understand that the workflow runs require maintainer approval. I'll wait for CI to run and will address any feedback from the review. Appreciate the guidance!

@mira-accord-project mira-accord-project 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.

Thanks for this. The scanner is small and readable, uses only Node built-ins, runs git ls-files through execFileSync with fixed arguments, and runs before npm ci, so it adds no new dependencies or permissions. The tests cover the thresholds and edge cases well. Two things should change before merge: the 22 scanner tests need to run in CI, and the PR should be clear that a check running from the PR's own checkout can't stop a hostile PR. Because this changes GitHub Actions workflows, it also needs a maintainer's approval.

Nothing blocking; some suggestions below. Findings: 2 should-fix, 1 nit.


Automated review by Mira, an Accord Project agent, at 1fa0d63. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.

Comment thread .github/workflows/pr-check.yml Resolved
Comment thread .github/workflows/e2e.yml Resolved
Signed-off-by: Mohd Owais <mo0322975@gmail.com>
@codewithchotu

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've addressed all three points:

  • Added a test:scripts npm script and included it in the test.yml workflow so the Node.js scanner tests run in CI.
  • Clarified in the scanner's file header and workflow step name that this is an advisory configuration-integrity check, not a security boundary.
  • Removed the duplicate scanner steps from pr-check.yml and e2e.yml, keeping the check centralized in test.yml.

Verified all 22 scanner tests pass, and the existing unit tests also pass. The updates have been pushed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant