Palimpsests

本サイトが提示する下記のベストプラクティスを実行するプロジェクトは、Open Source Security Foundation (OpenSSF) バッジを達成したことを自主的に自己認証し、そのことを外部に示すことができます。

ソフトウェアに欠陥や脆弱性がないことを保証する手立てはありません。形式論的な証明ができたとしても、仕様や前提が間違っていると誤動作の可能性があります。また、プロジェクトが健全で、かつ機能的な開発コミュニティであり続けることを保証する手立てもありません。しかし、ベストプラクティスの採用は、プロジェクトの成果の向上に寄与する可能性があります。たとえば、いくつものベストプラクティスがリリース前の複数人によるレビューを定めていますが、それによりレビュー以外では発見困難な技術的脆弱性を見つけるのを助け、同時に異なる企業の開発者間の信頼を築き、さらに交流を続けることに対する意欲を生んでいます。バッジを獲得するには、すべてのMUSTおよびMUST NOT基準を満たさなければなりません。すべてのSHOULD基準も満たさなければなりませんが、正当な理由がある場合は満たさなくても構いません。そしてすべてのSUGGESTED基準も満たさなければなりませんが、満たさないとしても、少なくとも考慮することが望まれます。フィードバックは、 GitHubサイトのissueまたはpull requestとして提示されれば歓迎します。また、議論のためのメールリストも用意されています。

私たちは多言語で情報を提供していますが、翻訳版に矛盾や意味の不一致がある場合は、英語版を正式な記述とします。
これがあなたのプロジェクトなら、あなたのプロジェクトページにあなたのバッジステータスを表示してください!バッジステータスは次のようになります。 プロジェクト 13534 のバッジ レベルは gold です バッジステータスの埋め込み方法は次のとおりです。
バッジステータスを表示するには、あなたのプロジェクトのマークダウンファイルに以下を埋め込みます
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13534/badge)](https://www.bestpractices.dev/projects/13534)
あるいは、以下をHTMLに埋め込みます
<a href="https://www.bestpractices.dev/projects/13534"><img src="https://www.bestpractices.dev/projects/13534/badge"></a>


これらはゴールドレベルの基準です。合格またはシルバーレベル基準を表示することもできます。

Baseline Series: ベースラインレベル1 ベースラインレベル2 ベースラインレベル3

        

 基本的情報 5/5

  • 一般

    他のプロジェクトが同じ名前を使用していないか注意してください。

    Layered local-LLM inference engine for agentic workloads: Ollama and llama.cpp behind one abstraction, context-memory (sink/window/evict + block retrieval), encrypted audit log. Native L3 serving layer in progress.

    SPDXライセンスの表現形式を使用してください。 例:「Apache-2.0」、「BSD-2-Clause」、「BSD-3-Clause」、「GPL-2.0+」、「LGPL-3.0+」、「MIT」、「(BSD-2-Clause OR Ruby)」。一重引用符または二重引用符を含めないでください。
    複数の言語がある場合は、コンマを区切り(スペースを入れてもよい)としてリストし、使用頻度の高いものから順に並べます。使用言語が多くある場合は、少なくとも最初の3つの最も多く使われるものをリストアップしてください。言語がない場合(例:ドキュメントだけ、またはテスト専用のプロジェクトの場合)、1文字 " - "を使用します。言語ごとにある大文字・小文字の慣用を踏襲してください(例:「JavaScript」)。
    Common Platform Enumeration(CPE)は、情報技術(IT)システム、ソフトウェア、およびパッケージのための構造化された命名体系です。脆弱性を報告する際に、多くのシステムやデータベースで使用されています。
  • 前提要件


    プロジェクトは、シルバー レベル バッジを達成しなければなりません。 [achieve_silver]

  • プロジェクトの管理・運営


    プロジェクトは2以上の "バス ファクタ"を持つ必要があります。 (URLが必要です) [bus_factor]
    「バス ファクタ」(別名「トラック ファクタ」)は、知見があり有能な人材が離脱して、プロジェクトが停止に至る時に、プロジェクトから突然消失する(「バスに当たった」)プロジェクトメンバーの最小人数です。 トラック ファクタツールは、GitHub上のプロジェクトに対してこれを見積もることができます。詳細については、Cosentino et al。の Gitリポジトリのバス ファクタの評価を参照してください。

    The project's bus factor is 2. Two people are significant contributors, each able to keep the project going on their own: the maintainer (@andreysparish) and the co-maintainer (@olksandrvertel-arch). Both hold repository-admin rights and can independently review, merge, and release; the co-maintainer has 35+ commits, including the hardware-isolation test suite and the role of independent PALA-1 verifier. Losing either one would not halt the project. Roles and the split of work are documented in docs/GOVERNANCE.md, and the contribution history is visible in the repository.
    URL (required) — the contributors graph is the most direct evidence of a bus factor ≥ 2:
    https://github.com/Assault-Consulting/Palimpsests/graphs/contributors



    プロジェクトには少なくとも2人の関係を持たない重要な貢献者がいなければなりません。 (URLが必要です) [contributors_unassociated]
    同じ組織によって作業に対しに支払われ(従業員または請負業者)、組織がプロジェクトの成果の恩恵を受ける場合、貢献者は関連します。財務補助金が他の組織を通過する場合、同じ組織のものであると見なされません(例えば、共通の政府やNGOのソースから異なる組織に支払われた科学補助金は、貢献者を関連させません)。過去1年間にプロジェクトに些細でない貢献をしていれば、その人は大きな貢献をしています。重要な貢献者の良い指標の例としては、少なくとも1,000行のコード、50個のコミット、または少なくとも20ページの文書化が挙げられます。

    Unassociated significant contributors in the past year: (1) Oleksii Turak, independent developer, no relationship with Assault Consulting — author of the fifth independent PALA-1 verification: a from-spec Perl 5 verifier with a hand-rolled NIST-validated AES-GCM implementation, ~2,300 lines (verifier + methodology + run record), merged 2026-08-18 (docs/specs/pala-1/independent-runs/turak/); (2) Sharyar Naseem, independent — the fourth independent verification run and a merged feature contribution (export seq-range bounds, PR #135, 2026-08-14). The two contributors are not associated with each other or with Assault Consulting; neither is paid by Assault Consulting. Andrii Sparysh and Oleksandr Verteletskyi (Assault Consulting) are counted as one associated group and excluded. Evidence: https://github.com/Assault-Consulting/Palimpsests/graphs/contributors


  • その他


    プロジェクトは、各ソースファイルにライセンスステートメントを含まなければなりません。これは、各ファイルの先頭近くに次のコメントを含めることによって行うことができます: SPDXライセンス識別子:[プロジェクトに対するSPDXライセンス表現] [license_per_file]
    これは、ライセンスを特定する自然言語での記述を含めることによっても行うことができます。プロジェクトには、ライセンス テキストまたは完全なライセンステキストを指し示す安定したURLを含めることもできます。 license_location基準は、プロジェクトライセンスが標準の場所にあることを要求します。 SPDXライセンスの詳細については、このSPDXチュートリアルを参照してください。 copyright_per_file との関係に注意してください。その内容は通常、ライセンス情報に先行します。

    Every file in the Palimpsests repository has an explicit SPDX license statement. Most source files include an inline # SPDX-License-Identifier: [expression] comment near the top of the file; the remaining files are covered by a catch-all annotation in REUSE.toml (path = "**"). The project uses two licenses, each declared per file with the correct SPDX expression: the main codebase is Apache-2.0, while the PALA-1 specification and its reference implementations are dedicated to the public domain as CC0-1.0 (so a third party can implement the format without being bound by Apache terms). The repository is compliant with version 3.3 of the REUSE Specification: reuse lint reports 206/206 files with license information. The full license texts are stored in the standard location under LICENSES/ (Apache-2.0.txt and CC0-1.0.txt), and the conventional LICENSE file remains at the repository root.


 変更管理 4/4

  • 公開されたバージョン管理ソースリポジトリ


    プロジェクトのソースリポジトリは、共通の分散バージョン管理ソフトウェア(gitやmercurialなど)を使用しなければなりません。 [repo_distributed]
    Gitが特別に必要とされているわけでなく、プロジェクトでは、集中型バージョン管理ソフトウェア(例:subversion)を正当とする証拠を持って使用できます。

    Repository on GitHub, which uses git. git is distributed.



    プロジェクトは、新規または偶に参加する貢献者によって実行できる小さなタスクを明確に識別しなければなりません。 (URLが必要です) [small_tasks]
    この特定は、通常、課題トラッカーの選択された課題に対して、プロジェクトがそのために使用する1つまたは複数のタグ、たとえば、 up-for-grabs(誰でも使用可能)first-timers-only(初心者専用)、Small fix(小修正)、microtask(小タスク)、またはIdealFirstBug(理想的な最初のバグ)のいずれかをマークすることによって行われます。 これらの新しいタスクには機能を追加する必要はありません。ドキュメントを改善したり、テストケースを追加したり、プロジェクトを支援したり、プロジェクトの詳細を貢献者が理解できるようにすることができます。

    The project maintains a good first issue label that marks starter tasks suitable for new or casual contributors — small, self-contained work such as documentation fixes, CLI polish, and additional test cases (the label and its initial set of tasks were curated on 2026-08-14). These tasks do not require adding core functionality, so they can be picked up by contributors who are not yet familiar with the codebase. They are discoverable as a filtered list of open issues carrying the label (see URL).
    met_url:
    https://github.com/Assault-Consulting/Palimpsests/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22



    プロジェクトは、中央リポジトリを変更したり、機密データ(プライベート脆弱性レポートなど)にアクセスするために、開発者に対して二要素認証(2FA)を要求する必要があります。推奨されませんが、2FAメカニズムは、SMSのような暗号化メカニズムを持たないメカニズムを使用することができます。 [require_2FA]

    GitHub requires 2FA as of March 2023. [osps_ac_01_01]



    プロジェクトの2要素認証(2FA)は、偽装を防ぐために暗号化メカニズムを使用すべきです。ショート メッセージ サービス(SMS)ベースの2FA自体は、暗号化されていないため、この基準を満たしていません。 [secure_2FA]
    この基準を満たす2FAメカニズムは、一定時間後に変更される認証コードを自動的に生成するタイムベースのワン タイム パスワード(TOTP)アプリケーションです。 GitHubはTOTPをサポートしています

    Two-factor authentication for the project's maintainers is provided by a Time-based One-Time Password (TOTP) authenticator application, not SMS. TOTP is a cryptographic mechanism — an HMAC-based one-time code derived from a shared secret and the current time — so it does not carry the impersonation risk of unencrypted SMS-based 2FA. All maintainers with write/admin access to the central GitHub repository authenticate with app-based TOTP (and/or hardware security keys); none rely on SMS.


 品質 7/7

  • コーディング標準


    プロジェクトは、コードレビューの実施方法、チェックする必要があるもの、受け入れられる必要があるものなど、コードレビュー要件を文書化しなければなりません。 (URLが必要です) [code_review_standards]
    two_person_review とcontribution_requirementsも参照してください。

    Code review requirements are documented in docs/REVIEW.md, with the contributor workflow in CONTRIBUTING.md and merge authority in GOVERNANCE.md. The document covers all three required elements. How review is conducted: every change — code and documentation — lands through a pull request that a non-author must approve before merge; main is branch-protected, so required green checks plus one non-author approval are enforced, not merely requested. What must be checked: the reviewer confirms that tests ship with behavior and that coverage stays above the gate (statement ≥ 90%, branch ≥ 80%), that ruff lint is clean, that any new dependency is justified, that security-sensitive paths (audit chain, key management, the crypto boundary, untrusted-input deserialization, the capability boundary) receive extra scrutiny against SECURITY.md / THREAT_MODEL.md / ASSURANCE-CASE.md, that public API/CLI and wire-format changes are deliberate and respect the format freeze, and that documentation matches the change; changes affecting released artifacts additionally require byte-verification and a green reproducible-build job. What is acceptable: approval means the reviewer believes the change is correct, tested, within the project's security and design boundaries, and free of known issues that would argue against inclusion — a reviewer who is unsure asks rather than approves, and author confidence alone is not grounds to merge.
    met_url:
    https://github.com/Assault-Consulting/Palimpsests/blob/main/docs/REVIEW.md



    プロジェクトは、公開する前に、提案されたすべての変更の少なくとも50%を著作者以外の人がレビューして、それが価値のある変更であり、取り込みに反対する既知の問題がないかどうかを判断しなければなりません。 [two_person_review]

    Every proposed modification to Palimpsests is reviewed by a non-author before release, which far exceeds the 50% threshold. main is branch-protected: direct pushes are blocked, and every change — code and documentation alike — must go through a pull request that receives at least one approval from a person other than the author, plus a green required status check (ci-complete: lint, tests, and coverage across macOS/Linux/Windows), before it can be merged. These protections have been enforced since 2026-07-11 (documented in GOVERNANCE.md), which is the measurement anchor for the review-coverage figure: every merge from that date forward is non-author reviewed, so the reviewed fraction is effectively 100% and monotonically rising. The requirement is documented in GOVERNANCE.md and CONTRIBUTING.md.


  • 作業ビルドシステム


    プロジェクトが再現可能なビルドを持たなければなりません。ビルドが発生しない場合(たとえば、コンパイルされないでソースコードが直接使用されるスクリプト言語)、「該当なし」(N/A)を選択します。 (URLが必要です) [build_reproducible]
    再現可能なビルドは、複数の当事者がソース ファイルから情報を生成するプロセスを独立にやり直し、ビット単位でまったく同じ結果を得られることを意味します。ある場合には、これ(再現可能なビルド)は、あるソート順を強いることで解決されます。Javaスクリプトの開発者は、npm shrinkwrapとwebpack OccurenceOrderPluginの使用を検討するかもしれません。GCCとclangのユーザーは、-frandom-seedオプションが有用であることを見つけるかもしれません。ビルド環境(ツールセットを含む)は、リビルドに使用できる特定のコンテナや仮想マシンの暗号化ハッシュを指定することによって、外部パーティのために、しばしば定義可能です。再現可能なビルド プロジェクトは、これを行う方法を記載したドキュメントを有します

    Palimpsests has a reproducible build, so this is Met rather than N/A: the project publishes distribution artifacts, and both the sdist (.tar.gz) and the wheel (.whl) are bit-for-bit reproducible — building the same commit produces identical bytes. Determinism is achieved by building with hatchling via PEP 517 (fixed archive-member order, no wall-clock build time stamped into output), pinning SOURCE_DATE_EPOCH to the commit date, and fixing LC_ALL=C.UTF-8, TZ=UTC, and umask 0022. This is enforced on every push and pull request by the reproducible-build job in .github/workflows/ci.yml, which runs scripts/check_reproducible_build.sh to build the artifacts twice and fail if they differ; the job is a required check in the ci-complete gate. The release workflow builds published artifacts with the same pinned SOURCE_DATE_EPOCH/locale/umask, so released files are the reproducible ones. A step-by-step reproduction recipe is documented (docs/REPRODUCIBLE-BUILD.md) so any third party can independently rebuild a release and verify it by hash. Reproducibility covers the Python distribution artifacts; the optional native (llama.cpp) path links against a separately installed C library and is out of scope.
    https://github.com/Assault-Consulting/Palimpsests/blob/main/docs/REPRODUCIBLE-BUILD.md


  • 自動テスト スイート


    テストスイートは、その言語の標準的な方法で呼び出すことができなければなりません。 (URLが必要です) [test_invocation]
    たとえば、「make check」、「mvn test」、「rake test」(Ruby)などです。

    The test suite is invoked in the standard way for Python: python -m pytest (equivalently pytest) from the repository root, with pytest configured in the standard [tool.pytest.ini_options] section of pyproject.toml. This is the conventional Python test invocation, documented in CONTRIBUTING.md and used unchanged by the CI workflow. URL: https://github.com/Assault-Consulting/Palimpsests/blob/main/pyproject.toml



    プロジェクトは、新しいコードまたは変更されたコードが頻繁に中央コードリポジトリに統合され、その結果に対して自動化されたテストが実行される、継続的な統合を実装しなければなりません。 (URLが必要です) [test_continuous_integration]
    ほとんどの場合、これは、プロジェクトでフルタイムで働く各開発者が少なくとも1日に1回統合作業をすることを意味します。

    The project uses continuous integration. On every push to main and every pull request, GitHub Actions runs the automated test suite (pytest) and the linter (ruff) across a matrix of three operating systems (Linux, macOS, Windows) and two Python versions (3.11, 3.12). New and changed code is integrated into main frequently via pull requests, with the tests run automatically on each. Branch protection requires the checks to pass before merge. URL: https://github.com/Assault-Consulting/Palimpsests/blob/main/.github/workflows/ci.yml



    プロジェクトは、選択された言語でこの基準を測定できる少なくとも1つのFLOSSツールがある場合、少なくとも80%のステートメント カバレッジを提供するFLOSS自動テストスイートを備えていなければなりません。 [test_statement_coverage90]

    A FLOSS coverage tool exists for the selected language (coverage.py, run via pytest-cov), so N/A does not apply and the project meets the bar directly. The automated pytest suite achieves 90.3% statement coverage measured over the whole src/palimpsests package; only if TYPE_CHECKING: blocks and raise NotImplementedError lines are excluded, per the standard coverage convention. The single module that reads low — the in-process ctypes backend llamacpp_backend.py, which can only run with the optional [native] extra against a real GGUF model on GPU hardware and therefore cannot be exercised in CI — is counted, not omitted: the overall figure clears 90% with it included, and that backend is validated separately on hardware (benchmarks/RUNBOOK.md). Coverage is computed on every push and pull request (pytest --cov --cov-report=json) and enforced by scripts/coverage_gate.py, which fails the build below 90% statement (and 80% branch). The coverage job is a required check in the ci-complete gate, so coverage cannot silently regress below the bar.



    選択された言語でこの基準を測定できる少なくとも1つのFLOSSツールがあれば、少なくとも80%のブランチカバレッジを提供するFLOSS自動テストスイートがプロジェクトに存在しなければなりません。 [test_branch_coverage80]

    A FLOSS coverage tool exists for the selected language (coverage.py, run via pytest-cov with branch coverage enabled), so N/A does not apply and the project meets the bar directly. The automated pytest suite achieves 82.4% branch coverage measured over the whole src/palimpsests package, with branch = true set in the coverage configuration; only if TYPE_CHECKING: blocks and raise NotImplementedError lines are excluded, per the standard convention. The hardware-only in-process ctypes backend llamacpp_backend.py — runnable only with the optional [native] extra against a real GGUF model on GPU hardware, so not exercisable in CI — is counted, not omitted: the overall figure clears 80% with it included, and that backend is validated separately on hardware (benchmarks/RUNBOOK.md). Branch coverage is computed on every push and pull request and enforced together with statement coverage by scripts/coverage_gate.py, which fails the build below 80% branch (and 90% statement). The coverage job is a required check in the ci-complete gate, so branch coverage cannot silently regress below the bar.


 セキュリティ 5/5

  • 優良な暗号手法を使用する

    一部のソフトウェアは暗号化メカニズムを使用する必要がないことに注意してください。あなたのプロジェクトが作成するソフトウェアが、(1) 暗号化機能を含む、アクティブ化する、または有効化し、(2) 米国(US)から米国外または米国市民以外にリリースされる可能性がある場合は、法的に義務付けられた追加手順の実行を要求される可能性があります。通常、これにはメールの送信が含まれます。詳細については、 Understanding Open Source Technology & US Export Controls「オープンソース技術と米国の輸出管理について」)の暗号化のセクションを参照してください。

    プロジェクトで作成されたソフトウェアは、ネットワーク通信すべてに対して、SSHv2以降、TLS1.2以降 (HTTPS)、IPsec、SFTP、SNMPv3などのセキュア プロトコルをサポートしなければなりません。FTP、HTTP、telnet、SSLv3以前、SSHv1などのセキュアでないプロトコルは、デフォルトで無効にしておき、ユーザーが特別に設定した亜場合のみ有効にしなければなりません。プロジェクトによって作成されたソフトウェアがネットワーク通信をサポートしない場合は、「該当なし」(N/A)を選択します。 [crypto_used_network]

    Where the software makes network communication, it uses secure protocols only. Outbound network access (e.g. talking to model/back-end endpoints and to release/publishing infrastructure) goes through httpx over HTTPS/TLS — TLS 1.2+ as negotiated by the platform's TLS stack — and release publishing uses HTTPS with OIDC Trusted Publishing and Sigstore. The project does not implement or default to any insecure protocol (no plain HTTP fetch-and-trust, no FTP/telnet/SSLv3/SSHv1); an insecure transport is not enabled anywhere by default. The core product is a local-first, on-device inference engine, so most operation involves no network at all, and what network communication exists is over TLS.



    プロジェクトによって作成されたソフトウェアは、TLSをサポートあるいは使用する場合、少なくともTLSバージョン1.2をサポートしなければなりません。TLSの前身は、SSLと呼ばれていたことに注意して下さい。ソフトウェアがTLSを使用ない場合、「該当なし」(N/A)を選択します。 [crypto_tls12]

    The software uses TLS and supports TLS 1.2 or later. All HTTPS communication goes through httpx, which uses Python's standard TLS stack (OpenSSL via the ssl module); on the supported Python versions (3.11+) that stack negotiates TLS 1.2 and 1.3 and treats older SSL/TLS versions as disabled by default. The project does not force, pin, or fall back to any pre-1.2 protocol (no SSLv3/TLS 1.0/1.1), so TLS 1.2+ is the effective floor for every TLS connection it makes.


  • MITM(man-in-the-middle:中間者)攻撃に対応できる安全な配信


    プロジェクトウェブサイト、リポジトリ(ウェブからアクセス可能な場合)、およびダウンロードサイト(別々の場合)には、許容できない値を持つキー強化ヘッダーが含まれていなければなりません。 (URLが必要です) [hardened_site]
    GitHubやGitLabはこれを満たしていることが知られているので注意してください。https://securityheaders.com/ のようなサイトは、これをすぐに確認することができます。重要なセキュリティ強化ヘッダーは以下の通りです。Content Security Policy (CSP)、HTTP Strict Transport Security (HSTS)、X-Content-Type-Options (「nosniff」として)、および X-Frame-Options 。Web ページからログインする機能のない完全に静的な Web サイトでは、いくつかの強化ヘッダーを省略してもリスクは少なくて済みますが、そのようなサイトを検出する信頼できる方法がないため、完全に静的なサイトであってもこれらのヘッダーが必要です。

    The project website (https://palimpsests.dev) returns the four key hardening headers with nonpermissive values on every response, configured in site/vercel.json. Content-Security-Policy: default-src 'self' with object-src 'none', frame-ancestors 'none', base-uri 'self', and upgrade-insecure-requests. Strict-Transport-Security: max-age=63072000; includeSubDomains; preload (two years). X-Content-Type-Options: nosniff. X-Frame-Options: DENY. It additionally sets Referrer-Policy and a restrictive Permissions-Policy. An external scan (securityheaders.com, 2026-08-14) grades the site A, with all key headers present; the only item below A+ is 'unsafe-inline' in script-src/style-src, tracked as a site improvement. The source repository and the download site are hosted on GitHub (and the package is published to PyPI), which are known to meet this criterion.


  • その他のセキュリティ上の課題


    プロジェクトは過去5年間にセキュリティレビューを実施していなければなりません。このレビューは、セキュリティ要件とセキュリティ境界を考慮しなければならりません。 [security_review]
    これは、プロジェクトメンバーおよび/または独立した評価によって行うことができます。この評価は、静的および動的解析ツールによってサポートされることができますが、ツールが検出できない問題(特に設計上)を特定するためには、人間によるレビューが必要です。

    The project performed an internal security review in July 2026 — within the last 5 years — documented in docs/security/AUDIT-2026-07.md. It was a human review (manual examination of the audit subsystem, key management, process lifecycle, native backend, KV store, context memory, and CLI), supported by Bandit SAST and dependency/workflow review, covering the full source tree at a pinned commit plus the CI workflows and the published PyPI artifact. The review explicitly considered both the security requirements and the security boundary: the assets and properties to protect, the trust boundaries (the filesystem and the Python→C hand-off), and attacker capabilities are documented in docs/THREAT_MODEL.md, and the audit assessed the design against them — including validating the project's stated "honest boundary" (what the tamper-evident anchor does and does not guarantee; e.g., an attacker holding both the key and keychain-write access is explicitly out of scope). The review produced concrete findings (H1–H2, M1–M4, L1–L3) with severity and remediation status; most were fixed in PR #47, and the remaining items are tracked as explicit, boundary-scoped decisions.



    プロジェクトによって作成されたソフトウェアで強化メカニズムを使用しなければならないので、ソフトウェア欠陥がセキュリティ上の脆弱性を引き起こす可能性が低くなります。 (URLが必要です) [hardening]
    強化メカニズムは、Content Security Policy(CSP)などのHTTPヘッダー、攻撃を緩和するコンパイラ フラグ(-fstack-protectorなど)、または未定義の動作を排除するためのコンパイラ フラグを含みます。私たちの目的のために、最低限の特権は強化メカニズムとはみなされません(最低の特権は重要ですが、別の話です)。

    The software uses hardening mechanisms so that a defect is less likely to become a security vulnerability. The primary mechanism is language choice: all code the project produces is written in a memory-safe language (Python), eliminating whole classes of defect-to-vulnerability paths (buffer overflows, use-after-free). The single memory-unsafe boundary — the third-party llama.cpp C library — is isolated behind an optional [native] extra, and the untrusted-input surface in front of it (the KV-state validator guarding load_state) is coverage-guided fuzzed with Atheris, so malformed input is rejected before any byte reaches C. Additional mechanisms: SQL is parameterized throughout (no injection); there is no unsafe deserialization (pickle/eval/shell=True are absent); cryptographic keys come from a CSPRNG (secrets.token_bytes); the at-rest audit store is encrypted (SQLCipher/AES-256) with the key held in the OS keychain, and the design fails closed — it refuses to open rather than fall back to plaintext if SQLCipher is unavailable; the audit chain's canonical serialization is length-prefixed so field boundaries cannot be forged; provider exception text is clipped before it enters the log to prevent secret leakage; and the CI/release pipeline runs with least-privilege permissions, SHA-pinned actions, and OIDC-scoped publishing. These mechanisms, and the security argument for them, are documented in docs/ASSURANCE-CASE.md, with the asset-to-mechanism mapping in docs/THREAT_MODEL.md. As a local-first library with no network service of its own, HTTP transport-hardening headers do not apply to the software itself; the project website's hardening headers are covered separately under hardened_site.
    https://github.com/Assault-Consulting/Palimpsests/blob/main/docs/ASSURANCE-CASE.md


 分析 2/2

  • 動的コード分析


    プロジェクトは、リリース前にプロジェクトによって作成されたソフトウェアの主要な製品リリースに対して、少なくとも1つの動的解析ツールを適用しなければなりません。 [dynamic_analysis]
    動的解析ツールは、ソフトウェアを特定の入力で実行して検査します。たとえば、プロジェクトは、ファジングツール(アメリカンファジーロップなど)やウェブ アプリケーション スキャナ(例: ZAP または w3af )です。場合によっては、 OSS-Fuzz プロジェクトがプロジェクトにファズテストを適用する可能性があります。この基準のために、動的分析ツールは、様々な種類の問題を探すために何らかの方法で入力を変更するかまたは少なくとも80%のブランチ カバレッジを持つ自動テスト スイートである必要があります。 動的解析に関するWikipediaのページ ファジングに関するOWASPページで、いくつかの動的解析ツールを特定しています。解析ツールは、セキュリティの脆弱性を探すことに重点を置くことができますが、これは必須ではありません。

    The project applies a dynamic analysis tool — Atheris, the Python binding for libFuzzer — as coverage-guided fuzzing. The harness (fuzz/fuzz_state_blob.py) targets the security-critical untrusted-input boundary: NativeSession.load_state, the pure-Python frame parser standing between arbitrary bytes and the C KV-state deserializer (llama_state_seq_set_data). It enforces the invariant that a malformed blob is rejected in Python (raising StateBlobError, with the backend never called) and never reaches C; any other outcome is a finding. Fuzzing runs in .github/workflows/fuzz.yml: a short deterministic regression pass on every push and pull request to main (so a previously found crash cannot silently return), plus a longer time-budgeted run nightly and on demand. Because every change to main is fuzzed and releases are cut from main, at least one dynamic analysis tool has been applied to the code before each release. Assertions are enabled during the run (the harness executes under CPython without -O). The one memory-unsafe component — the third-party llama.cpp C library — is outside the project's own code; the harness deliberately fuzzes the project's guard in front of it. (Independently, the project's automated test suite also exceeds 80% branch coverage, which on its own satisfies this criterion.)
    https://github.com/Assault-Consulting/Palimpsests/blob/main/fuzz/README.md



    プロジェクトは、生成するソフトウェアに多くの実行時アサーションを含めるべきであり、動的分析中にそれらのアサーションをチェックするべきです。 [dynamic_analysis_enable_assertions]
    この基準は、本番環境でアサーションを有効にすることを示唆するものではありません。それは完全にプロジェクトとそのユーザーが決定することです。この基準の焦点は、展開の動的分析中の障害検出を改善することです。プロダクション環境でのアサーションの有効化は、動的分析(テストなど)中にアサーションを有効にすることとはまったく異なります。場合によっては、プロダクション環境でアサーションを有効にすることは非常に賢明ではありません(特に高整合性コンポーネントの場合)。プロダクション環境でアサーションを有効にすることには多くの議論があります。たとえば、ライブラリは呼び出し元をクラッシュさせてはなりません。ライブラリが存在するとアプリストアによる拒否が発生する可能性があります。また、プロダクション環境でアサーションをアクティブにすると、秘密鍵などの秘密データが公開される可能性があります。多くのLinuxディストリビューションではNDEBUGが定義されていないため、これらのディストリビューションのプロダクション環境ではデフォルトで C/C++ assert() が有効になります。これらの環境でのプロダクション環境では、別のアサーションメカニズムを使用するか、 NDEBUGを定義することが重要です。

    The project deliberately enforces validation and invariants with explicit exceptions (raise, ~113 across the codebase) rather than assert, because assert is stripped under -O and must not be relied on for checks that need to always execute. These checks run unconditionally, including during fuzzing. The project does not add a large number of dedicated assert-style assertions solely for dynamic analysis, so this SHOULD is not claimed as met.



ツールやAIシステムを使って、https://www.bestpractices.dev/ja/projects/13534/choose/edit?osps_ac_01_01_status=Met&osps_ac_01_01_justification=GitHub+enforcedのような簡単なURLで変更を提案できます。その方法については、自動化提案システムをご覧ください。 このデータは、Community Data License Agreement – Permissive, Version 2.0 (CDLA-Permissive-2.0)のもとで利用可能です。これは、データ受領者が、データ受領者がこの契約のテキストを共有データとともに利用可能にする限り、変更の有無にかかわらずデータを共有できることを意味します。andreysparishおよびOpenSSFベストプラクティスバッジのコントリビューターにクレジットを表示してください。

プロジェクト バッジ登録の所有者: andreysparish.
エントリの作成日時 2026-07-08 10:49:53 UTC、 最終更新日 2026-08-23 07:20:40 UTC 最後に2026-07-08 11:51:23 UTCにバッジ合格を達成しました。