Skip to content

v0.1.4

Choose a tag to compare

@karthikbd karthikbd released this 19 Nov 18:50
· 8 commits to main since this release
12431fa

OpenSSF Best Practices silver and baseline groundwork, and the fixes found by a threat model of sp2react. Each fix has a test in tests/test_threat_model.py or tests/test_sandbox.py that fails on 0.1.3.

Security

  • The generated app's back-end tests and loader run in a sandbox (pipeline.sandbox, default auto). They import custom handlers written by agents, which until now ran as ordinary processes with the user's file and network access. container runs them in a throwaway Docker or Podman container with no network (or only the database host), a read-only file system except the folder the step writes, no capabilities, a non-root user and none of the host's environment; guard (used by auto when no container runtime answers) runs them under an audit hook that refuses writes outside that folder, new processes, other network hosts and ctypes; off keeps plain processes. Set pipeline.sandbox_image to use a check image from your registry
  • NTLM is an explicit, TLS-only choice. sharepoint.auth has no default any more (NTLMv2 needs MD4 and HMAC-MD5 by protocol), and NTLM is never answered over plain HTTP (the site URL or any later request, so a redirect cannot downgrade it) unless sharepoint.allow_ntlm_over_http: true. The generated app's SharePoint data source does the same (SP_AUTH required, SP_ALLOW_NTLM_OVER_HTTP=1). Upgrade note: a config without sharepoint.auth now fails with "Field required"; add auth: ntlm (or cookie, bearer, none). Configs written by sp2react init already have it
  • extract: a page or asset URL from the site with .. segments (for example <script src="/sites/x/../../../y.js"> in a page) was written relative to the workspace, so a page editor could make sp2react write files outside it. Every file the extract writes (page source, web part, wiki and rendered sidecars, assets, list folders) is now checked (.., absolute and drive paths, symlinks) and a refused one is listed as an extraction error, before it is downloaded
  • migrate: attachment names and item ids from the server are checked the same way before the attachment is downloaded and written to the export folder
  • The generated app's builds and tests no longer receive sp2react's own credentials: the variables named in sharepoint.*_env, llm.api_key_env and database.url_env are removed from their environment
  • Spec screen ids must be plain names (letters, digits, _, -, ., at most 128 characters), since they become folder and file names; generated ids longer than 100 characters are shortened and keep a hash of the full name

Fixed

  • Generated app: startswith, endswith and substringof in $filter with a number instead of quoted text (endswith(Title,0)) failed with a server error; they now answer 400 like any other bad filter (found by ClusterFuzzLite). With DATA_SOURCE=database, % and _ in their text are matched literally, as SharePoint and the other data sources do, instead of acting as SQL wildcards. Regenerating an existing app picks this up (odata.py, sql_repo.py, sp_repo.py; files you changed are kept)

Added

  • GOVERNANCE.md, CODE_OF_CONDUCT.md, ROADMAP.md, a VEX document (vex.openvex.json), and in the documentation a security assurance case (threat model), a dependency and scanning policy, testing and releasing pages
  • Pull requests: a DCO check (every commit signed off) and GitHub dependency review
  • CI: statement coverage must stay at 80% or more (about 86% now); a job builds the package twice and checks the files are identical, and releases are built the same way (SOURCE_DATE_EPOCH, ci/reproducible_sdist.py); the vulnerability audit also checks versions pinned only for other Python versions (ci/all_pins.py); a job runs the generated tests in a real container; Dependabot watches the fuzzing and check images

Changed

  • mypy --strict and ruff with the Bandit security rules (S), comprehensions, PIE and RUF are clean and required
  • CI tool locks are compiled for the Python versions their jobs run (build 3.11, e2e 3.12)
  • Documentation reorganised into Getting started, User guide, Reference, Development and Release notes; installation covers offline installs and verifying a download's signature, and the JFrog Curation notes no longer list the dependencies removed in 0.1.3

Docs: https://sp2react.readthedocs.io