macontrol

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

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

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


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

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

        

 基本的情報 13/13

  • 一般

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

    Control your Mac from Telegram — system, media, network, power, and more. Apple Silicon, Go, one binary

    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)システム、ソフトウェア、およびパッケージのための構造化された命名体系です。脆弱性を報告する際に、多くのシステムやデータベースで使用されています。

    macontrol is a tiny Go daemon that runs on your Mac and exposes a menu-first Telegram bot for remote control: change volume / brightness, toggle Wi-Fi / Bluetooth, read battery & system stats, take screenshots, send desktop notifications, lock / sleep / restart, and more.

  • 基本的なプロジェクト ウェブサイトのコンテンツ


    プロジェクトのウェブサイトは、ソフトウェアが何をするのか(何の問題を解決するのか)を簡潔に記述しなければなりません。 [description_good]
    これは、潜在的なユーザーが理解できる言語でなければなりません(例えば、それは最小限の専門用語を使用します)。


    プロジェクトのウェブサイトは、取得方法、フィードバックの提供方法(バグ報告や拡張機能)、ソフトウェアへの貢献方法に関する情報を提供しなければなりません。 [interact]

    貢献する方法に関する情報は、貢献プロセス(たとえばプル リクエストが使用されか、など)を説明する必要があります。 (URLが必要です) [contribution]
    別段の記載がない限り、GitHub上のプロジェクトは、(GitHubが提供する)課題管理とプルリクエストを使用することを想定します。この情報は不足しているかもしれません。すなわち、プロジェクトがプルリクエストと課題追跡ツールを使うことか、メーリングリストへの投稿を言及している。(どちら?)

    Non-trivial contribution file in repository: https://github.com/amiwrpremium/macontrol/blob/master/CONTRIBUTING.md.



    貢献する方法に関する情報は、貢献を受け入れるための要件(たとえば、必要なコーディング標準への参照)を含むべきです。 (URLが必要です) [contribution_requirements]
  • FLOSSライセンス


    プロジェクトによって作成されたソフトウェアは、FLOSSとしてリリースされなければなりません。 [floss_license]
    FLOSSは、オープンソース定義またはフリーソフトウェア定義を満たす方法でリリースされたソフトウェアです。そのようなライセンスの例としては、CC0MIT2項型BSD 3項型BSD Apache 2.0 Less GNU General Public License(LGPL)、および GNU General Public License(GPL)を参照してください。私たちの目的のためには、これはライセンスが以下のものでなければならないことを意味します: ソフトウェアは他の方法でライセンスされているかもしれません(たとえば、「GPLv2またはプロプライエタリ」は許容されます)。

    The MIT license is approved by the Open Source Initiative (OSI).



    プロジェクトによって作成されたソフトウェアに必要なライセンスは、オープンソース・イニシアチブ(OSI)によって承認されていることが推奨されています。 [floss_license_osi]
    OSIは、厳格な承認プロセスを使用して、どのライセンスがOSSであるかを判断します。

    The MIT license is approved by the Open Source Initiative (OSI).



    プロジェクトは、結果のライセンスをソースリポジトリの標準的な場所に投稿しなければなりません。 (URLが必要です) [license_location]
    たとえば、LICENSEまたはCOPYINGという名前の最上位ファイルです。ライセンスファイル名の後に ".txt" や ".md" などの拡張子を付けることができます。別の規則は、ライセンスファイルを含むLICENSESという名前のディレクトリを持つことです。これらのファイルは通常、 REUSE仕様で説明されているように、SPDXライセンス識別子とそれに続く適切なファイル拡張子として名前が付けられます。この基準は、ソースリポジトリの要件にすぎないことに注意してください。ソースコード(実行可能ファイル、パッケージ、コンテナなど)から何かを生成するときに、ライセンスファイルを含める必要はありません。たとえば、Comprehensive R Archive Network(CRAN)のRパッケージを生成するときは、標準のCRANプラクティスに従います。ライセンスが標準ライセンスの場合は、標準の短いライセンス仕様を使用して(テキストのコピーをさらにインストールしないようにするため)、リストします。 .Rbuildignoreなどの除外ファイル内のLICENSEファイル。同様に、Debianパッケージを作成する場合、著作権ファイルに /usr/share/common-licenses のライセンス テキストへのリンクを配置し、作成したパッケージからライセンス ファイルを除外できます(たとえば、dh_auto_installを呼び出した後にファイルを削除します )。可能な場合は、生成された形式で機械可読ライセンス情報を含めることをお勧めします。

    Non-trivial license location file in repository: https://github.com/amiwrpremium/macontrol/blob/master/LICENSE.


  • ドキュメンテーション


    プロジェクトは、プロジェクトによって作成されたソフトウェアに関する基本的なドキュメンテーションを提供しなければなりません。 [documentation_basics]
    このドキュメントは、インストール方法、起動方法、使用方法(可能であれば例示したチュートリアル)、および、そのソフトウェアの適切なトピックであれば安全に使用する方法(たとえば何をするべきで、何をすべきでないか)を記述し、メディア(たとえば、テキストやビデオなど)に収められている必要があります。セキュリティの文書は必ずしも長文である必要はありません。プロジェクトは、ドキュメンテーションとしてプロジェクト以外の素材へのハイパーテキストリンクを使用してもよいです。プロジェクトがソフトウェアを作成しない場合は、「該当なし」(N / A)を選択します。

    Some documentation basics file contents found.



    プロジェクトは、プロジェクトによって作成されたソフトウェアの外部インタフェース(入力と出力の両方)を記述する参照ドキュメントを提供しなければなりません。 [documentation_interface]
    外部インターフェイスのドキュメントは、エンドユーザーまたは開発者に、その使用方法を説明します。ドキュメントには、ソフトウェアにアプリケーション プログラム インターフェイス(API)が含まれている場合、アプリケーション プログラム インターフェイスが含まれます。ライブラリの場合、呼び出すことができる主要なクラス/型とメソッド/関数を文書化します。ウェブ アプリケーションの場合、URLインタフェース(多くの場合、RESTインタフェース)を定義します。コマンドラインインターフェイスの場合は、サポートするパラメータとオプションを文書化します。多くの場合、ドキュメントのほとんどを自動生成すると、ソフトウェアが変更されたときにドキュメントがソフトウェアと同期したままなので、最も良い方法ですが、これは必須ではありません。プロジェクトは、ドキュメンテーションとしてプロジェクト以外の素材へのハイパーテキストリンクを使用してもよいです。ドキュメンテーションは自動的に生成されるかもしれません(実際的に、しばしばこれを行う最良の方法です)。 RESTインタフェースのドキュメントは、Swagger / OpenAPIを使用して生成することができます。コード インタフェースのドキュメントは、 JSDoc (JavaScript)、 ESDoc (JavaScript)、pydoc(Python)、devtools (R)、pkgdown (R)、およびDoxygen(多数)のいずれかです。実装コードにコメントがあるだけでは、この基準を満たすには不十分です。すべてのソースコードを読むことなく情報を見るための簡単な方法が必要です。プロジェクトがソフトウェアを作成しない場合は、「該当なし」(N/A)を選択します。

  • その他


    プロジェクトサイト(ウェブサイト、リポジトリ、およびダウンロードURL)は、TLSを使用したHTTPSをサポートしなければなりません。 [sites_https]
    これには、プロジェクトのホームページのURLとバージョン管理リポジトリのURLが「http:」ではなく「https:」で始まる必要があります。Let's Encryptからフリーの証明書を入手できます。プロジェクトは、(例えば) GitHubページ GitLabページ、またはSourceForgeプロジェクトページを使ってこの基準を実装してもよいです。HTTPをサポートしている場合は、HTTPトラフィックをHTTPSにリダイレクトすることを強くお勧めします。

    Given only https: URLs.



    プロジェクトは、議論(提案された変更や問題を含む)のための1つ以上の検索可能なメカニズムを持たなければならず、メッセージやトピックがURLでアドレス指定され、新しい人々がディスカッションのいくつかに参加できるようにしなければならず、クライアント側でプロプライエタリなソフトウェアのインストールを必要としないようにします。 [discussion]
    受け入れ可能なメカニズムの例には、アーカイブされたメーリングリスト、GitHubのイシューとプルリクエストの議論、Bugzilla、Mantis、Tracなどがあります。非同期ディスカッション メカニズム(IRCなど)は、これらの基準を満たしていれば許容されます。 URLアドレス可能なアーカイブ機構があることを確認してください。独自のJavaScriptは、推奨されませんが、許可されています。

    GitHub supports discussions on issues and pull requests.



    プロジェクトは英語で文書を提供し、英語でコードに関するバグ報告とコメントを受け入れることができるべきです。 [english]
    現在、英語はコンピュータ技術のリンガ フランカです。英語をサポートすることで、世界中のさまざまな潜在的な開発者とレビュアーの数を増やします。コア開発者の主要言語が英語でなくても、プロジェクトはこの基準を満たすことができます。


    プロジェクトはメンテナンスされている必要があります。 [maintained]
    少なくとも、プロジェクトは重大な問題と脆弱性の報告に対応するように努める必要があります。バッジを積極的に追求しているプロジェクトは、おそらくメンテナンスされているでしょう。すべてのプロジェクトや人のリソースには限りがあり、提案された変更をプロジェクトが拒否しなければならないこともあるため、リソースに限りがあることや、提案が拒否されることが、メンテナンスされていないプロジェクトを示すわけではありません。

    プロジェクトが今後メンテナンスされなくなることがわかった場合は、この基準を「不適合(Unmet)」に設定し、適切なメカニズムを使用して、メンテナンスされないことを人々に示す必要があります。たとえば、READMEの最初の見出しに「DEPRECATED」(将来のサポートが保証されないので使用すべきでない)を使用し、ホームページの先頭近くに「DEPRECATED」を追加し、コード リポジトリのプロジェクトの説明の先頭に「DEPRECATED」を追加し、そのREADMEおよび/またはホームページにno-maintenance-intendedバッジを追加し、すべてのパッケージ リポジトリでdeprecated(非推奨)としてマークしたり(例: npm deprecate )、コード リポジトリのマーキングシステムを使用してアーカイブします(例:GitHubの"archive" 設定、GitLabの"archived" マーキング、 Gerritの "readonly" ステータス、またはSourceForgeの"abandoned" プロジェクト ステータス)。詳細な説明については、こちらを参照してください。

 変更管理 9/9

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


    プロジェクトには、公開され、URLを持つ、バージョン管理のソース リポジトリがなければなりません。 [repo_public]
    URLはプロジェクトのURLと同じであってもよいです。プロジェクトは、変更が公開されていない間に(例えば、公開前に脆弱性を修正するため)、特定のケースでプライベート(非公開)ブランチを使用することができます。

    Repository on GitHub, which provides public git repositories with URLs.



    プロジェクトのソース リポジトリは、どのような変更が行われたのか、誰が変更を行ったのか、いつ変更が行われたのかを追跡しなければなりません。 [repo_track]

    Repository on GitHub, which uses git. git can track the changes, who made them, and when they were made.



    共同レビューを可能にするために、プロジェクトのソースリポジトリには、リリース間のレビューのための中間バージョンが含まれなければなりません。最終リリースのみを含めることはできません。 [repo_interim]
    プロジェクトは、公開ソース リポジトリから特定の暫定版を省略することを選択することができます。(たとえば、特定の非公開のセキュリティ脆弱性を修正するものは、公開されないか、または、合法的に投稿できないか、最終リリースに入らないです)

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

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


  • 一意的なバージョン番号


    プロジェクトの結果には、ユーザーが使用することを意図されたリリースごとに固有のバージョン識別子が必要です。 [version_unique]
    これはコミットID(git commit idやmercurial changeset idなど)やバージョン番号(YYYYMMDDのようなセマンティックバージョニングや日付ベースのスキームを使用するバージョン番号を含む)など、さまざまな方法で対応できます。

    リリースには、Semantic Versioning (SemVer)またはCalendar Versioning (CalVer)のバージョン番号形式を使用することが推奨されます。CalVerを使用する場合は、マイクロレベル値を含めることが推奨されます。 [version_semver]
    プロジェクトは一般的に、エコシステムで使用されている通常のフォーマットなど、ユーザーが期待しているフォーマットを優先するべきです。多くのエコシステムではSemVerが好まれており、一般的にSemVerはアプリケーションプログラマインターフェース(API)やソフトウェア開発キット(SDK)に好まれています。CalVerは、規模が大きく、独自に開発した依存関係が異常に多いプロジェクトや、スコープが常に変化するプロジェクト、時間的な制約があるプロジェクトで使用される傾向があります。CalVerを使用する際には、マイクロレベルの値を含めることが推奨されます。マイクロレベルを含めることで、必要になった場合にはいつでも同時にメンテナンスされるブランチをサポートできるからです。git commit ID や mercurial changeset ID など、バージョンを一意に識別できるものであれば、他のバージョン番号形式をバージョン番号として使用することができます。しかし、(git commit ID のような)いくつかの代替形式は、リリースの識別子として問題を引き起こす可能性があります。すべての受信者が最新バージョンを実行しているだけの場合 (たとえば、継続的な配信を介して常に更新されている単一のWebサイトまたはインターネットサービスのコード)には、バージョン ID の形式はソフトウェアのリリースを識別する上で重要ではないかもしれません。


    プロジェクトがバージョン管理システム内の各リリースを特定することが推奨されています。たとえば、gitを使用しているユーザーがgitタグを使用して各リリースを特定することが推奨されています。 [version_tags]
  • リリースノート


    プロジェクトは、各リリースにおいて、ユーザーがアップグレードすべきかどうか、また、アップグレードの影響を判断できるよう、そのリリースの主要な変更の要約を説明したリリースノートを提供しなければなりません(MUST)。リリースノートは、バージョン管理ログの生の出力であってはなりません(例えば、 "git log"コマンドの結果はリリースノートではない)。プロジェクトの成果物が複数の場所で再利用されることを意図していないプロジェクト(単独のウェブサイトやサービスのためのソフトウェアなど)で、かつ、継続的・断続的な配布を行う場合は、「該当なし」を選択することができます。 (URLが必要です) [release_notes]
    リリースノートは様々な方法で実装できます(MAY)。多くのプロジェクトは、 "NEWS"、 "CHANGELOG"、または "ChangeLog"という名前のファイルでそれらを提供し、 ".txt"、 ".md"、 ".html"などの拡張子を付けることもあります。歴史的には、 "change log"という言葉はすべての変更のログを意味していましたが、本基準を満たすために必要なものは、人間が読める要約です。リリースノートは代わりに、 GitHubリリースのワークフローなどのバージョン管理システムのメカニズムによって提供してもよい(MAY)。

    Non-trivial release notes file in repository: https://github.com/amiwrpremium/macontrol/blob/master/CHANGELOG.md.



    リリースノートでは、このリリースで修正された、リリースの作成時にすでにCVE割り当てなどがあった、公に知られているランタイムの脆弱性をすべて特定する必要があります。 ユーザーが通常、ソフトウェアを実際に更新できない場合(たとえば、カーネルの更新によくあることです)、この基準は該当なし(N/A)としてマークされる場合があります。 この基準はプロジェクトの結果にのみ適用され、依存関係には適用されません。 リリースノートがない場合、または公に知られている脆弱性がない場合は、[N/A]を選択します。 [release_notes_vulns]
    この基準は、特定の更新によって一般に知られている脆弱性が修正されるかどうかをユーザーが判断するのに役立ち、ユーザーが情報に基づいて更新について決定できるようにします。ユーザーが通常、コンピューター上でソフトウェア自体を実際に更新することはできず、代わりに1つ以上の仲介者に依存して更新を実行する必要がある場合(カーネルお​​よびカーネルと絡み合っている下位レベルのソフトウェアの場合によくあることです)、この追加情報はそれらのユーザーには役立たないため、プロジェクトは「該当なし」(N/A)を選択する場合があります。同様に、すべての受信者が最新バージョンのみを実行している場合(継続的デリバリーによって絶えず更新される単一のWebサイトまたはインターネットサービスのコードなど)、プロジェクトはN/Aを選択できます。この基準はプロジェクトの結果にのみ適用され、依存関係には適用されません。プロジェクトのすべての推移的な依存関係の脆弱性を一覧表示することは、依存関係が増加および変化するにつれて扱いにくくなるため、不要です。依存関係を調べて追跡するツールがよりスケーラブルな方法でこれを実行できます。

 報告 8/8

  • バグ報告プロセス


    プロジェクトは、ユーザーが不具合報告を送信するプロセスを提供しなければなりません(たとえば、課題トラッカーやメーリングリストを使用します)。 (URLが必要です) [report_process]

    Non-trivial SECURITY[.md] file found file in repository: https://github.com/amiwrpremium/macontrol/blob/master/SECURITY.md. [osps_do_02_01]



    プロジェクトは、個々の課題を追跡するための課題トラッカーを使用するべきです。 [report_tracker]

    このプロジェクトは、過去2〜12か月間に提出された多数のバグ報告の受領を認めなければなりません。応答に修正を含める必要はありません。 [report_responses]


    プロジェクトは、直近2〜12ヶ月(2ヶ月を含む)に増強要求の多数(> 50%)に対応すべきです。 [enhancement_responses]
    応答は、「いいえ」や、そのメリットについての議論であってもよいです。目標は、単にプロジェクトがまだ生きていることを示している、いくつかの要求に対する応答があることです。この基準のために、プロジェクトは偽のリクエスト(スパマーや自動システムなど)をカウントする必要はありません。プロジェクトで機能強化が行われていない場合は、「満足されない」(unmet)を選択し、この状況をユーザーに明確にするURLを含めてください。プロジェクトが強化要求の数によって圧倒される傾向がある場合は、「満足されない」(unmet)を選択して説明してください。


    プロジェクトは、後で検索するために、レポートとレスポンスのアーカイブを公開する必要があります。 (URLが必要です) [report_archive]
  • 脆弱性報告プロセス


    プロジェクトは、脆弱性を報告するプロセスをプロジェクト サイトに公開しなければなりません。 (URLが必要です) [vulnerability_report_process]
    たとえば、https:// PROJECTSITE / securityの明示的に指定されたメール アドレスで、これはしばしばsecurity@example.orgの形式です。これはバグ報告プロセスと同じかもしれません。脆弱性レポートは常に公開される可能性がありますが、多くのプロジェクトでは、プライベート脆弱性を報告するメカニズムがあります。

    プライベート脆弱性報告がサポートされている場合、プロジェクトは、プライベートに保持された方法で情報を送信する方法を含んでいなくてはなりません。 (URLが必要です) [vulnerability_report_private]
    例としては、HTTPS(TLS)を使用してWeb上に提出されたプライベート不具合報告や、OpenPGPを使用して暗号化された電子メールがあります。脆弱性報告が常に公開されている場合(プライベート脆弱性報告は存在しないため)、「該当なし」(N / A)を選択します。

    過去6ヶ月間に受け取った脆弱性報告に対するプロジェクトの初期応答時間は、14日以下でなければなりません。 [vulnerability_report_response]
    過去6か月間に脆弱性が報告されていない場合は、「該当なし」(N/A)を選択します。

 品質 13/13

  • 作業ビルドシステム


    プロジェクトによって作成されたソフトウェアを利用するためにビルドが必要な場合、プロジェクトは、ソース コードからソフトウェアを自動的にリビルドできる作業ビルド システムを提供しなければなりません。 [build]
    ビルドシステムは、ソフトウェアをリビルドするのに必要なアクション(およびその順序)を決定し、それらのステップを実行します。たとえば、ビルドシステムは、ソースコードをコンパイルするためにコンパイラを呼び出すことができます。実行可能ファイルがソースコードから生成される場合、ビルドシステムは、プロジェクトのソースコードを変更でき、その変更を含む更新された実行ファイルを生成できなければなりません。プロジェクトによって生成されたソフトウェアが外部ライブラリに依存する場合、ビルドシステムはそれらの外部ライブラリをビルドする必要はありません。ソースコードが変更されても、ソフトウェアを使用するためにビルドする必要がない場合、「該当なし」(N/A)を選択します。

    ソフトウエアをビルドするために、一般的なツールを使用することをお勧めします。 [build_common_tools]
    たとえば、Maven、Ant、cmake、autotools、make、rake (Ruby)、 devtools (R)などです。

    プロジェクトは、FLOSSツールだけを使用してビルドができるようにするべきです。 [build_floss_tools]

    It cleanly satisfies this criterion:

    Written in Go — the official Go toolchain is BSD-licensed FLOSS.
    Build system is Make (Makefile) — GPL FLOSS.
    Lives in Git on GitHub — Git itself is GPL FLOSS.
    Linting via golangci-lint — GPL/MIT FLOSS.
    Released via GoReleaser + release-please — both MIT FLOSS.
    Targets macOS, but the build doesn't require Xcode's proprietary bits; go build cross-compiles for darwin/arm64 from any platform.


  • 自動テスト スイート


    プロジェクトは、FLOSSとして公開されている自動テストスイートを少なくとも1つ使用する必要があります(このテストスイートは、別個のFLOSSプロジェクトとして維持される場合があります)。 プロジェクトは、テストスイートの実行方法を明確に示すか文書化する必要があります(たとえば、継続的インテグレーション(CI)スクリプトを介して、またはBUILD.md、README.md、CONTRIBUTING.mdなどのファイルの文書を介して)。 [test]
    プロジェクトでは、複数の自動化されたテストスイートを使用することができます(たとえば、迅速に実行するもの、より完全であるが特別な装置が必要なもの)。Selenium (ウェブブラウザの自動化)、Junit (JVM, Java)、RUnit (R)、testthat (R) など、多くのテストフレームワークやテスト支援システムが利用可能です。
    1. Automated test suite under FLOSS license ✅
      The repo contains 48 Go test files (*_test.go) covering essentially every package — runner, config, keychain, capability, every domain module (battery, bluetooth, display, media, music, notify, power, sound, status, system, tools, wifi), and the Telegram handlers/callbacks. They use Go's standard testing package, which ships with the Go toolchain under a BSD-3-Clause license — unambiguously FLOSS. The tests themselves inherit the project's MIT license.
      There's also a fuzz test (FuzzDecode in internal/telegram/callbacks/), which is a nice extra — Go's built-in fuzzer is also FLOSS.

    2. Documentation of how to run them ✅
      Multiple, redundant places — any reviewer will find one:
      Makefile has both make test (go test ./...) and make lint test mentioned in the README's Development section.
      README.md explicitly shows make lint test under the Development heading on line 135.
      .github/workflows/ci.yml runs go test -race -coverprofile=coverage.out ./... on every push/PR, with a coverage matrix uploading to Codecov and Codacy (the badges on the README link to both dashboards).
      docs/development/testing.md exists as a dedicated testing doc, plus docs/development/ci.md documents the CI pipeline.
      CONTRIBUTING.md at the repo root is also present.



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

    test_invocation — macontrol evidence

    The project satisfies this criterion. Tests are invoked using the standard Go convention:

    go test ./...

    This is the canonical Go test command and works directly from a fresh clone with no flags, environment setup, or custom scripts.

    Makefile (wraps the standard command, doesn't replace it):
    test: go test ./...
    test-race: go test -race -coverprofile=coverage.out ./...

    make test and make test-race are convenience aliases — the underlying command is exactly what a Go developer would type by reflex. A reviewer ignoring the Makefile entirely would still succeed by running go test ./....

    CI (.github/workflows/ci.yml) uses the same standard command:
    go test -race -coverprofile=coverage.out ./...

    Fuzz tests also use the canonical Go invocation:
    go test -run='^$' -fuzz=FuzzDecode -fuzztime=30s ./internal/telegram/callbacks/

    Summary: the project uses go test ./... (the standard Go invocation), exposes it through a conventional Makefile test target, and runs the same command in CI. No custom test runner, no proprietary harness, no project-specific learning curve required.



    テスト スイートは、コードブランチ、入力フィールド、および機能のほとんど(または理想的にはすべて)をカバーすることが推奨されています。 [test_most]

    test_most — macontrol evidence

    The project satisfies this suggested criterion with strong, enforced coverage of code branches, input fields, and functionality.

    Test surface area:

    • 48 *_test.go files against 96 non-test .go files — roughly a 1:2 test-to-source ratio, with every internal package having a corresponding test file.
    • Tests cover every domain module: battery, bluetooth, display, media, music, notify, power, sound, status, system, tools, wifi — plus runner, config, keychain, capability, version, and the telegram handlers/callbacks.
    • 30+ table-driven test blocks exercise multiple input cases per function — the standard Go pattern for branch and input-field coverage.
    • A fuzz test (FuzzDecode in internal/telegram/callbacks/data_fuzz_test.go) exercises the callback decoder against randomized input to catch edge-case branches; it runs in CI via go test -run='^$' -fuzz=FuzzDecode -fuzztime=30s.

    Coverage is measured and enforced, not just claimed:

    • CI runs go test -race -coverprofile=coverage.out ./... on every push/PR.
    • Coverage is uploaded to both Codecov and Codacy — both badges are visible at the top of README.md and link to public dashboards.
    • A coverage floor is enforced in CI via the cover-floor Make target, which runs go-test-coverage --config=./.testcoverage.yml.

    Coverage thresholds (from .testcoverage.yml):

    • Total project: 80%
    • Per package: 75%
    • Per file: 50%
    • internal/domain/status: 80% (package-specific override)
    • internal/telegram/telegramtest: 70% (test helper)
    • cmd/macontrol: 5% (entry point — covered by integration tests on a real Mac, not unit tests; documented in the config file)
    • cmd/macontrol/shim.go: 0% (tiny shim, documented)

    Notably the thresholds are intentionally set below current measured coverage (per the comment in .testcoverage.yml) so that regressions are caught without blocking every small change — meaning actual coverage exceeds these floors.

    Summary: the project doesn't just have tests — it measures branch/file/package coverage, publishes it on two public dashboards, enforces a per-package floor of 75% and a project floor of 80% in CI, and uses fuzz testing on the highest-risk parser (the callback data decoder). Documented exceptions (entry-point and shim files) are explicit and justified.



    プロジェクトは、継続的インテグレーション(新しいコードまたは変更されたコードが頻繁に中央コードリポジトリに統合され、その結果に対して自動テストが実行される)を実装することを推奨されています。 [test_continuous_integration]

    test_continuous_integration — macontrol evidence

    The project satisfies this suggested criterion. CI is implemented via GitHub Actions, runs on every push and pull request, and integrates code into the central repository with a full battery of automated checks.

    CI configuration: .github/workflows/ci.yml

    Triggers:

    • push to master
    • pull_request targeting master
    • concurrency group cancels superseded runs to keep feedback fast

    Jobs that run on every change:

    1. Lint (ubuntu-latest)

      • golangci-lint at latest version
    2. Test (matrix: ubuntu-latest + macos-14)

      • go test -race -coverprofile=coverage.out ./...
      • Coverage uploaded as workflow artifact
      • Coverage floor enforced via go-test-coverage against .testcoverage.yml
      • Coverage published to Codecov and Codacy on every run
    3. Build (ubuntu-latest)

      • Cross-compiles the actual release target: GOOS=darwin GOARCH=arm64 CGO_ENABLED=0
      • Catches build regressions before merge
    4. Vulnerability scan (ubuntu-latest)

      • govulncheck ./... against the Go vulnerability database
    5. Fuzz (short, ubuntu-latest)

      • 30-second smoke fuzz on FuzzDecode (the callback parser — the only attacker-reachable parser before the whitelist gate)
      • Guards against newly-introduced panics on every PR

    Additional CI workflows in .github/workflows/:

    • codeql.yml — GitHub CodeQL static analysis
    • scorecards.yml — OpenSSF Scorecard checks
    • pr-title.yml — Conventional Commits enforcement on PR titles
    • release-please.yml — automated release PR generation
    • release.yml — GoReleaser pipeline on tag push

    Visible signals on the repository:

    • CI badge at the top of README.md links to the live workflow runs
    • codecov and Codacy coverage badges link to their public dashboards
    • OpenSSF Scorecard badge links to the public scorecard report

    Summary: every push and PR triggers parallel jobs covering lint, test (on Linux and macOS), cross-compile build, vulnerability scan, and fuzz testing. Coverage is measured, enforced against a per-package floor, and published to two public dashboards. Additional scheduled/triggered workflows handle CodeQL, OpenSSF Scorecard, and the release pipeline. This goes well beyond the suggested criterion.


  • 新機能テスト


    プロジェクトは、プロジェクトで作成されたソフトウェアに主要な新機能が追加されたときに、その機能のテストを自動化されたテスト スイートに追加する必要があるという一般的な方針(正式でも、正式でなくても構いません)を持っていなければなりません。 [test_policy]
    開発者はテストを自動テスト スイートに追加して、新しい機能を追加する必要があるというポリシーが、口頭でも(文書化されていなくても)、存在する限り、「満たしている」を選択してください。

    test_policy — macontrol evidence

    The project has an explicit, documented policy that new functionality must come with tests. The policy is enforced both in writing and through CI gating.

    1. Documented policy

    CONTRIBUTING.md instructs every contributor to run make lint test before opening a PR, and the PR template/process treats failing tests as a blocker.

    docs/development/adding-a-capability.md is a step-by-step guide for adding a new feature (a "capability"). It is structured as a 6-step checklist, and step 2 of every new capability is explicitly "Domain test" — the guide includes a worked example showing both happy-path and error-path tests using runner.Fake, with the note that the result "Should pass with 100% coverage on the two test functions." Step 5 of the same checklist is "Test the handler." The file table at the top of the guide lists the test files alongside the source files as required deliverables for any new capability, not as optional extras.

    docs/development/testing.md documents the test infrastructure (runner.Fake for subprocess mocking, telegramtest.NewBot for the Telegram API) so contributors have no excuse not to write tests — the helpers needed to test any new domain or handler already exist and are documented.

    1. Policy enforcement in CI

    The policy isn't aspirational — it's enforced:

    • Every push and PR runs go test -race -coverprofile=coverage.out ./... on both Linux and macOS.
    • A coverage floor is enforced via go-test-coverage against .testcoverage.yml: 80% total, 75% per package, 50% per file. New code that drops coverage below those floors fails CI.
    • Coverage is published to Codecov and Codacy on every run, so any drop is visible in the PR review.
    • A 30-second fuzz test of the callback decoder runs on every PR.
    1. Cultural signal

    Conventional Commits (enforced by a CI job on PR titles) include test as a first-class commit type, and feat commits in the changelog routinely land alongside their corresponding tests. The CHANGELOG.md history shows tests added in the same release as the features they cover.

    Summary: the project has an explicit written policy in CONTRIBUTING.md and the capability-adding guide that requires tests for new functionality, backed by ready-made test helpers (runner.Fake, telegramtest.NewBot), and enforced by a CI-gated coverage floor that blocks PRs which regress coverage. This satisfies the criterion well beyond the "general policy, formal or not" bar.



    プロジェクトによって作成されたソフトウェアの最新の大きな変更で、テストを追加するための test_policy が守られているという証拠がプロジェクトに存在しなければなりません。 [tests_are_added]
    主要な機能は、通常、リリースノートに記載されます。完璧は必要ないですが、プロジェクトによって生成されたソフトウェアに新しい主要機能が追加されたときに、自動テスト スイートに実際にテストが追加されているという証拠となります。

    tests_are_added — macontrol evidence

    The most recent major changes to macontrol show the test_policy being followed consistently. Every recent feature PR ships with tests for the new code, and dedicated test-only PRs have been used to raise coverage proactively.

    Most recent feature: feat(bot): add 🎵 Music category (#91, latest 0.7.0 release)

    This is a large feature touching 24 files, +2,869 lines. Of those 24 files, 6 are *_test.go files added or expanded alongside the new code:

    internal/capability/detect_test.go | 37 lines changed
    internal/domain/music/music_test.go | 264 lines added (new file)
    internal/telegram/flows/seek_test.go | 95 lines added (new file)
    internal/telegram/handlers/mus_test.go | 235 lines added (new file)
    internal/telegram/keyboards/mus_test.go | 236 lines added (new file)
    internal/telegram/musicrefresh/refresher_test.go | 312 lines added (new file)

    Every new production file in this PR landed with a corresponding _test.go in the same commit:
    music.go ↔ music_test.go
    seek.go ↔ seek_test.go
    mus.go (handlers) ↔ mus_test.go
    mus.go (keyboards) ↔ mus_test.go
    refresher.go ↔ refresher_test.go

    This exactly matches the policy in docs/development/adding-a-capability.md, which mandates a domain test file and a handler test alongside any new capability.

    Pattern across the last several feat commits:

    feat(bot): Timezone picker (01b2ae5) → +tools_test.go, +remaining_test.go, +keyboards_test.go
    feat(bot): Shortcuts list (a1a2be1) → +remaining_test.go, +keyboards_test.go
    feat(bot): DNS presets submenu (98646fb) → +remaining_test.go, +keyboards_test.go
    feat(bot): Disks redesign (ef77b3c) → +tools_test.go, +remaining_test.go, +keyboards_test.go

    Every single one of the most recent feat(bot) PRs in git log includes test additions in the same commit. None landed bare.

    Dedicated test-improvement work:

    test: expand unit coverage from 73.9% to 85.0% across the repo (#76, commit 51e7d31)
    test(callbacks): add Go native fuzz tests for Decode (#89, commit 0bb56cc)

    These two PRs show the policy is treated as an active concern, not a checkbox — the maintainer has merged standalone PRs whose only purpose is to raise coverage and add fuzz testing.

    Enforcement signal:

    CI's coverage floor (.testcoverage.yml: 80% total, 75% per package) blocks merges that drop coverage below the threshold. The fact that recent feature PRs all merged green is itself evidence that the feature code was covered by the tests added in the same PR — otherwise the floor check would have failed.

    Summary: the most recent major change (the Music category) added 6 test files alongside the 18 new/edited production files, matching the policy in docs/development/adding-a-capability.md exactly. The same pattern holds for every prior feat(bot) PR in the history. The project also merges dedicated test-improvement PRs (#76, #89). The criterion is satisfied with a clear, traceable record.



    テストを追加するこのポリシー(test_policyを参照)を変更提案に関する手順で文書化することを推奨します。 [tests_documented_added]
    しかし、実際にテストが追加されている限り、非公式の規則でも許容されます。

    tests_documented_added — macontrol evidence

    The project documents the test-adding policy in multiple change-proposal-facing locations, satisfying this suggested criterion.

    1. Pull Request template (.github/PULL_REQUEST_TEMPLATE.md)

    GitHub auto-loads this template into every new PR's description box. It contains a "Test plan" section with the policy as an explicit checkbox the contributor must tick:

    Test plan

    • make lint test passes locally
    • New/changed code has unit tests
    • Verified on macOS (version / chip: … )
    • If permissions changed: updated docs/permissions.md
    • If new capability: added to README feature table

    The "New/changed code has unit tests" line is the policy stated directly in the change-proposal interface — every contributor sees it the moment they open a PR.

    1. CONTRIBUTING.md

    The contributor workflow makes running tests a required pre-PR step:

    1. Run checks locally before pushing:
         make lint test
    

    The "Adding a new capability" section lists the required files for a new capability and step 6 explicitly mandates tests:

    1. Write a domain test using the runner.Fake helper and a
      keyboard-layout test.

    2. docs/development/adding-a-capability.md

    A dedicated, full-length guide for change proposals that add new functionality. It treats tests as a structural requirement, not a suggestion:

    • The file table at the top lists _test.go files alongside source files as required deliverables.
    • Step 2 of every new capability is "Domain test", with a worked example covering both happy-path and error-path tests.
    • Step 5 is "Test the handler".
    • The guide notes that the worked example "Should pass with 100% coverage on the two test functions."
    1. docs/development/testing.md

    Documents the test infrastructure (runner.Fake, telegramtest.NewBot) so contributors know exactly how to satisfy the policy. The helpers needed to test any new domain or handler are pre-built and documented.

    1. Conventional Commits

    CONTRIBUTING.md lists test as a first-class commit type, signaling that test-only changes are an expected, encouraged contribution.

    Summary: the test-adding policy is documented in the PR template (the most direct change-proposal surface), in CONTRIBUTING.md (the canonical contributor doc), and in two dedicated development guides (adding-a-capability.md and testing.md). A contributor cannot open a PR without seeing the "New/changed code has unit tests" checkbox in their PR body. This goes beyond the suggested bar.


  • 警告フラグ


    プロジェクトは、選択した言語でこの基準を実装することができる少なくとも1つのFLOSSツールがあれば、1つまたは複数のコンパイラ警告フラグ、「安全」言語モードを使用可能にするか、分離 「リンター」ツールを使用してコード品質エラーまたは共通の単純なミスを検索しなければなりません。 [warnings]
    コンパイラ警告フラグの例には、gcc / clang "-Wall"があります。 「安全」言語モードの例には、JavaScript「use strict」とperl5の「use warnings」があります。分離「リンター」ツールは、ソースコードを調べてコード品質のエラーや一般的な単純なミスを探すツールです。これらは、通常、ソースコードまたはビルド命令内で有効になります。

    warnings — macontrol evidence

    The project satisfies this criterion with a comprehensive linter configuration enforced in CI.

    Primary linter: golangci-lint (FLOSS, GPL-3.0)

    The repository ships an explicit configuration at .golangci.yml that enables 13 linters covering correctness, security, and style — all are themselves FLOSS:

    • errcheck — unchecked errors
    • govet — go vet, the official correctness checker
    • ineffassign — ineffective assignments
    • staticcheck — comprehensive static analysis (correctness + simplification)
    • unused — unused code
    • misspell — common misspellings
    • gocritic — opinionated bug-pattern checks
    • revive — replacement for golint, with the exported and package-comments rules explicitly enabled (enforces godoc on exported symbols)
    • bodyclose — HTTP response bodies that must be closed
    • nolintlint — catches stale or malformed //nolint directives
    • unparam — unused function parameters
    • prealloc — slices that could be preallocated
    • gosec — security-focused checks (with G204 excluded since subprocess invocation is the project's purpose, documented inline)

    Formatters (gofumpt + goimports) are also enforced, with project-local import grouping configured.

    Test files have a narrowly scoped exclusion (gosec, unparam, gocritic) which is the standard pattern for Go projects — these linters produce noise on test scaffolding.

    Enforcement:

    • Makefile target: make lintgolangci-lint run. make lint-fix for auto-fixable issues. make all runs lint + test + build.
    • CI: .github/workflows/ci.yml has a dedicated lint job that runs golangci-lint on every push and pull request. It runs in parallel with the test job, so regressions are caught before merge.
    • CONTRIBUTING.md instructs every contributor: make lint test before opening a PR.

    Additional static analysis layers:

    • govulncheck (golang.org/x/vuln) — runs as the vuln CI job on every push/PR via govulncheck ./...
    • CodeQL (.github/workflows/codeql.yml) — GitHub's semantic code analysis on the repo
    • OpenSSF Scorecard (.github/workflows/scorecards.yml) — supply-chain best-practice scoring
    • The Go compiler itself emits warnings/errors for unused imports and variables, and go vet is included via the govet linter above

    All four of these tools are FLOSS.

    Summary: the project enables 13 FLOSS linters via golangci-lint with an explicit checked-in configuration, runs them in CI on every push and PR, and layers govulncheck + CodeQL + Scorecard on top. The make lint target makes the same checks runnable locally, and the contributor workflow requires it before opening a PR. The criterion is satisfied well beyond the minimum.



    プロジェクトは警告を出さなければならない。 [warnings_fixed]
    これらは、警告基準の実装によって識別される警告です。プロジェクトは、警告を修正するか、ソースコード内で警告を誤検出としてマークするべきです。理想的には警告がないことがいいですが、プロジェクトはある程度の警告(通常は100行あたり1警告未満、または全体で10警告未満)を受け入れることができます。

    warnings_fixed — macontrol evidence

    The project actively addresses warnings rather than ignoring them. Multiple lines of evidence:

    1. CI fails on warnings, blocking merges

    The lint job in .github/workflows/ci.yml runs golangci-lint on every push and PR. golangci-lint defaults to a non-zero exit on any finding, so any unaddressed warning fails CI and blocks merge. Recent feature PRs (#91 Music, #82 handler split, #67 Timezone, #60 Shortcuts) all merged green, meaning each was warning-clean by the time it landed.

    1. Documented history of fixing warnings, not suppressing them

    Direct evidence in the commit log:

    caa55d6 fix(ci): resolve 50 golangci-lint v2 findings
    34182c8 fix(ci): upgrade lint action and Go toolchain to pass checks
    d0b3eaf docs: comprehensive godoc for all production code + enable strict lint (#77)
    c4474e8 docs: thorough godoc rewrite with structured sections (#78)
    ed45c0e chore: quiet markdownlint rules pre-PR1 wasn't enforcing (#84)

    The "resolve 50 golangci-lint v2 findings" commit is particularly strong evidence. Its body itemises every fix:

    • errcheck (14) → explicit _ = on intentionally discarded errors;
      deferred handlers wrapped to discard returns explicitly
    • gofumpt (11) + goimports (1) → formatter auto-fix pass
    • staticcheck (10) → QF1012 fmt.Fprintf simplifications, SA1019 deprecated
      API replacements (EnvVarIsNotSetError → VarIsNotSetError)
    • gosec (5) → directory modes tightened 0o755 → 0o750, plist 0o644 → 0o600
    • gocritic (2) → singleCaseSwitch collapsed; exitAfterDefer fixed with
      explicit cancel()
    • prealloc (3) → slice capacities sized upfront

    These are real code changes, not ignore-list additions.

    1. Disciplined use of suppressions

    A repo-wide grep finds only 3 //nolint directives across the entire codebase:

    internal/domain/tools/tz_country.go:58
    os.ReadFile(path) //nolint:gosec // G304: path is from a constant allowlist

    internal/telegram/musicrefresh/refresher.go:199
    context.WithCancel(ctx) //nolint:gosec // cancel stored in session.cancel;
    called by Stop and run's defer

    cmd/macontrol/daemon.go:100
    //nolint:gocritic // explicit cancel() above flushes the context before exit

    Each is narrow (single line, specific linter named) and carries an inline justification. The nolintlint linter is also enabled in .golangci.yml, which catches stale, unused, or unjustified nolint directives — meaning suppressions themselves are policed.

    The .golangci.yml has exactly one global exclusion (gosec G204 — subprocess invocation), and it's documented in a comment ("Subprocess call is the whole point of this project"). Test files have a narrowly scoped exclusion of gosec/unparam/gocritic, the standard Go pattern.

    1. Refactors driven by warnings

    9f045d2 refactor: split overgrown handlers and table-drive parsers (#82)

    The release notes for the Music feature (#91) explicitly call out two refactor steps done to satisfy Codacy findings:

    • refactor(keyboards): split MusicCaption into per-section helpers (Codacy)
    • refactor(music): split tickOnce into snapshot + edit-media helpers (Codacy)

    So warnings from the secondary scanner (Codacy) are also being acted on, not just dismissed.

    1. Strict-lint regime expanded over time

    Commit d0b3eaf ("comprehensive godoc for all production code + enable strict lint") shows the bar being raised: revive's exported and package-comments rules were enabled, then the codebase was brought into compliance by writing godoc for every exported symbol. This is the opposite of the anti-pattern of relaxing rules to make warnings disappear.

    Summary: warnings are surfaced by golangci-lint (13 linters) + govulncheck + CodeQL + Codacy, blocked at the CI gate, addressed in dedicated fix commits with itemised release notes, and only suppressed in 3 narrow places — each with a written justification, all policed by nolintlint. The criterion is satisfied with a strong, traceable record.



    プロジェクトによって作成されたソフトウェアにある警告に、実際的な場合には、最大限に厳格になることを推奨されています。 [warnings_strict]
    一部の警告は、あるプロジェクトでは効果的に有効にすることはできません。必要なのは、プロジェクトが可能な限り警告フラグを有効にするように努力しており、エラーが早期に検出されるという証拠です。

    warnings_strict — macontrol evidence

    The project takes a maximally strict posture on warnings, well within the "where practical" qualifier of this suggested criterion.

    1. Strict golangci-lint configuration (.golangci.yml)

    issues:
    max-issues-per-linter: 0
    max-same-issues: 0

    These two settings disable golangci-lint's default deduplication caps. By default golangci-lint shows only the first 50 findings per linter and the first 3 of each kind; setting both to 0 means every finding is surfaced. This is the strict-mode setting — the project wants to see all warnings, not a sampled summary.

    1. Strict linter selection with default: none

    linters:
    default: none
    enable: [errcheck, govet, ineffassign, staticcheck, unused, misspell,
    gocritic, revive, bodyclose, nolintlint, unparam, prealloc, gosec]

    default: none means no linters run unless explicitly enabled — so the active set is deliberate, not accidental. The 13 enabled linters include the strictest commonly-used ones:

    • staticcheck (covers SA, ST, S, QF check categories — the gold-standard Go static analyser)
    • gosec (security)
    • gocritic (opinionated bug-pattern checks beyond go vet)
    • revive with exported and package-comments rules explicitly enabled — these enforce godoc on every exported symbol and every package, a notably strict bar
    • nolintlint (polices the suppressions themselves — stale or unjustified //nolint directives are themselves warnings)
    1. Minimal, justified exclusions

    The configuration suppresses almost nothing:

    • One global exclusion: gosec G204 (subprocess invocation), with an inline comment explaining why ("Subprocess call is the whole point of this project"). Without this the entire project would be one giant warning, since shelling out to pmset/networksetup/osascript is its purpose.
    • Test files exclude only gosec, unparam, gocritic — the standard Go pattern, since these produce noise on test scaffolding and assertion helpers.
    • generated: lax — generated files are excluded from lint, the standard convention.

    There are no broad path exclusions, no per-linter rule disables, no severity downgrades. The configuration is roughly 50 lines and contains nothing that softens the rules.

    1. Strict bars layered on top of golangci-lint
    • govulncheck runs in CI as a separate vuln job — any known-vulnerable dependency or stdlib usage fails the build.
    • CodeQL (.github/workflows/codeql.yml) — semantic analysis on every push.
    • OpenSSF Scorecard (.github/workflows/scorecards.yml) — supply-chain best-practice scoring published publicly.
    • Codacy + Codecov dashboards — third-party static analysis with public badges.
    • gofumpt (stricter than gofmt) and goimports (with local-prefix grouping enforced) run as formatters — formatting drift is a CI failure.
    • A 30-second fuzz test (FuzzDecode) runs on every PR.
    • Race detector enabled in CI tests: go test -race.
    1. Strict bar raised over time, not lowered

    The history shows the project tightening, not loosening, its strictness:

    d0b3eaf docs: comprehensive godoc for all production code + enable strict lint (#77)
    c4474e8 docs: thorough godoc rewrite with structured sections (#78)
    caa55d6 fix(ci): resolve 50 golangci-lint v2 findings

    The "enable strict lint" commit turned on revive's exported and package-comments rules and then brought the entire codebase into compliance — the opposite of the anti-pattern of relaxing rules to make warnings disappear.

    1. Evidence the strict bar is held in practice

    A repo-wide grep finds only 3 //nolint directives across the codebase. Each is single-line, names the specific linter being suppressed, and carries an inline justification. nolintlint enforces this format. Three narrow, justified suppressions across ~96 production .go files is a notably tight ratio.

    The macOS-target build is also configured strictly:

    GOFLAGS ?= -trimpath
    LDFLAGS ?= -s -w …
    CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" …

    -trimpath removes filesystem path leakage, and -s -w strips debug info from release binaries.

    1. Practical limits, honestly handled

    The "where practical" qualifier matters here. macontrol is a subprocess-orchestration daemon; gosec G204 (subprocess with non-constant input) cannot be globally satisfied because the project's purpose is to run macOS CLIs. The maintainer suppresses G204 globally with a documented justification rather than littering the code with per-call suppressions or pretending it's not an issue. That's the right kind of pragmatic strictness — strict everywhere it's practical, explicitly bounded where it isn't.

    Summary: the project enables 13 linters with default: none, sets max-issues caps to 0 to surface every finding, enforces godoc on every exported symbol via revive, layers govulncheck + CodeQL + Scorecard + Codacy on top, uses gofumpt (stricter than gofmt), runs tests with -race, fuzzes the highest-risk parser, and has a documented history of raising the bar (enable strict lint → fix the resulting 50 findings) rather than lowering it. Only 3 narrowly justified //nolint suppressions exist in the entire codebase. The criterion is satisfied at the strong end of the spectrum.


 セキュリティ 16/16

  • セキュリティに関する開発知識


    プロジェクトには、安全なソフトウェアを設計する方法を知っている少なくとも1人の主要な開発者が必要です。 (正確な要件については、「詳細」を参照してください。) [know_secure_design]
    これには、Saltzer and Schroeder の8つの原則を含む以下の設計原則を理解する必要があります。
    • メカニズムの経済性(たとえば、スイーピング シンプリフィケーションを採用して、メカニズムを実際的に単純化し小さくする)
    • フェイルセーフのデフォルト(アクセスの決定はデフォルトで拒否されるべきであり、プロジェクトのインストールはデフォルトで安全でなければならない)
    • 完全なメディエーション(制限されたすべてのアクセスは権限がチェックされ、バイパスされない)
    • オープンな設計(セキュリティメカニズムは攻撃者の設計に対する無知に依存するべきではなく、 簡単に保護ができて変更ができる鍵やパスワードのような情報に依存すべきです。
    • 特権の分離(理想的には、重要なオブジェクトへのアクセスは複数の条件に依存すべきで、1つの保護システムを破ることで完全なアクセスが可能にならないようにします。たとえば、パスワードとハードウェア トークンを必要とする多因子認証は単因子認証より強いです。
    • 最低限の権限(プロセスは最低限の権限で動作する必要がある)
    • 最低限の共通メカニズム(設計は、複数のユーザに共通のメカニズムや全てのユーザーに依存するメカニズムを最小限に抑えるべきです。)
    • 心理学的受容性(ヒューマンインタフェースは、使いやすく設計されていなければならない - 「驚きが最小限になる」という設計が助けになる)
    • 限られた攻撃面(攻撃面 - 攻撃者がデータを入力または抽出しようとする部分 - を制限する必要があります)
    • ホワイト リストで入力を検証します(入力は通常、この検証はブラックリスト(既知の不良値をリストする)ではなく、ホワイトリスト(既知の値のみを受け入れる)を使用する必要があります。
    プロジェクトの「主要な開発者」とは、プロジェクトのコードベースに精通していて、容易に変更を加えることができ、プロジェクトの他のほとんどの参加者によって認められている人です。主要な開発者は、通常、過去1年間に(コード、文書、または質問に回答して)多数の貢献を行います。ある開発者が、プロジェクトを開始している(3年以上プロジェクトから離れていない)、プライベート脆弱性報告チャネル(存在する場合)に関する情報を受け取る、プロジェクトを代表してコミットを受け入れる、最終リリースする、などを行う時主要な開発者とみなすことができます。開発者が1人だけの場合、その人物が主要開発者です。より安全なソフトウェアを開発し、設計について議論する方法を理解するのに役立つ多くの本やコースが利用可能です。 たとえば、 Secure Software Development Fundamentals コースは、3つのコースの無料セットです。 より安全なソフトウェアを開発する方法を説明しています。

    know_secure_design — macontrol evidence

    The primary developer (@amiwrpremium) demonstrates secure-design knowledge across every dimension the criterion lists.

    1. Written threat model

    docs/security/ contains a dedicated threat model. SECURITY.md documents scope (daemon, CLI, LaunchAgent plist, sudoers template, Homebrew formula, install.sh), out-of-scope (attacks already holding the bot token, upstream Apple bugs), private disclosure via GitHub Security Advisories, and SLAs (72h ack, ≤30d patch). A written threat model with named boundaries is itself a secure-design artifact.

    1. Secure defaults
    • No inbound port — outbound long-poll only. Eliminates the entire class of inbound-network attacks.
    • Hard Telegram-user-ID whitelist; non-whitelisted updates dropped silently (no enumeration via differentiated errors).
    • No /sh escape hatch — only named commands. A leaked token cannot be turned into arbitrary code execution.
    • Bot token stored in macOS Keychain, never in config files or env vars.
    • Commit caa55d6 proactively tightened file modes in response to gosec findings: directories 0o755 → 0o750, LaunchAgent plist 0o644 → 0o600.
    1. Defense in depth

    Six independent layers, each assuming the previous bypassed:

    L1: Telegram user-ID whitelist (auth)
    L2: Named-command surface (no shell escape)
    L3: runner.Runner interface (constrained subprocess invocation)
    L4: Narrow sudoers entry (sudoers.d/macontrol.sample)
    L5: macOS TCC gates on camera/screen/microphone
    L6: Keychain ACL bound to binary path

    1. Least privilege
    • Sudoers is a narrow allowlist, not NOPASSWD: ALL.
    • runner.Runner carries an explicit Sudo bool per call — sudo is opt-in per command, not ambient.
    • Daemon runs as the user's LaunchAgent, not root.
    • Keychain ACL binding to binary path means another binary running as the same user must trigger a fresh user consent prompt.
    1. Input validation on the attacker-reachable surface

    The Telegram callback_data string is the only attacker-reachable parser before the whitelist gate. The developer:

    • Wrote a Go native fuzz test (FuzzDecode in internal/telegram/callbacks/data_fuzz_test.go), commit 0bb56cc.
    • Runs it 30s on every PR via the fuzz-short CI job.
    • Documented in the CI workflow comment that it is "the only attacker-reachable parser before the whitelist gate" — showing pinpointed threat awareness, not blanket fuzzing.
    1. Avoiding common attack classes
    • Command injection: subprocess invocation through runner.Runner with separate Name + Args fields, never string concatenation. The Args-not-shell pattern is what makes the global gosec G204 suppression safe.
    • Path traversal: the one os.ReadFile from a non-constant path (tools/tz_country.go) checks against an allowlist; the inline //nolint:gosec // G304: path is from a constant allowlist shows the finding was read, classified, and mitigated.
    • Race conditions: go test -race in CI; musicrefresh uses an explicit cancel-stored-in-session lifecycle pattern.
    • Supply-chain: every third-party Action and go-installed tool is pinned to a commit SHA (commits de4e7aa, 08216c6, fdbe795). govulncheck on every PR.
    1. Secret handling
    • Token only ever held in the macOS Keychain via internal/keychain/, with a dedicated test file.
    • Keychain ACL is binary-path-bound — a foreign binary triggers a macOS UI prompt rather than silent re-read.
    • CI secrets use GitHub's redacted ${{ secrets.X }} mechanism; no inlined credentials anywhere.
    1. Secure SDLC

    CodeQL on every push, OpenSSF Scorecard publicly scored, govulncheck on every PR, 13 linters via golangci-lint including gosec, race detector in CI, Dependabot weekly on gomod + github-actions, Conventional Commits + squash-merge for clean audit trail, private vulnerability disclosure channel.

    1. Evidence of considered (not templated) thinking

    The author maintains a sibling project, shellboto, for Linux VPS — with a different security model (pty-backed shell, SHA-256 hash-chained audit logs, per-user RBAC). Choosing different controls for different threat surfaces shows threat-model thinking, not a single template applied everywhere.

    1. Trust boundaries surfaced to users

    The README disclaimer enumerates the trust anchors users accept: the daemon's capabilities, the bot token + whitelist as the auth boundary, and transitive trust in Telegram/Apple/Homebrew. Articulating the trust model in user-facing docs is itself a secure-design practice.

    Summary: written threat model with scope boundaries; secure defaults (no inbound port, named commands only, tightened file modes); six-layer defense in depth; least privilege (narrow sudoers, per-call Sudo bool, non-root); fuzz-tested input validation pinpointed at the attacker-reachable parser; injection-resistant subprocess invocation; Keychain-based secret storage with binary-path ACL; full secure SDLC (CodeQL, Scorecard, govulncheck, gosec, race detector, Dependabot, pinned actions). The criterion is satisfied.



    プロジェクトの主要開発者の少なくとも1人は、この種のソフトウェアの脆弱性につながる一般的な種類のエラーを知っていなければならず、それぞれを対策または緩和する少なくとも1つの方法を知っていなければなりません。 [know_common_errors]
    例(ソフトウェアの種類によって異なります)には、SQLインジェクション、OSインジェクション、従来のバッファオーバーフロー、クロスサイトスクリプティング、認証の欠落、承認の欠落などがあります。一般的に使用されるリストについては、 CWE/SANSトップ25またはOWASPトップ10を参照してください。より安全なソフトウェアを開発する方法を理解し、脆弱性につながる一般的な実装エラーについて説明するのに役立つ多くの書籍やコースが用意されています。たとえば、 Secure Software Development Fundamentalsコースは、より安全なソフトウェアを開発する方法を説明する3つのコースの無料セットです(受講は無料です。追加料金を払うと、学習したことを証明する証明書を入手できます)。

    know_common_errors — macontrol evidence

    Common vulnerability classes for a network-connected, subprocess-orchestrating macOS daemon, with the mitigation applied in macontrol:

    1. Command / subprocess injection
      Subprocess goes through runner.Runner with separate Name (string) and Args ([]string) fields, passed directly to exec.Cmd. No sh -c, no string interpolation. The runner.Fake test mock asserts on the parsed (Name, Args) tuple, proving the production form.

    2. Privilege escalation via overbroad sudo
      sudoers.d/macontrol.sample is a narrow allowlist, not NOPASSWD: ALL. runner.Runner carries an explicit Sudo bool per call — sudo is opt-in per invocation, not ambient.

    3. Authentication bypass
      Hard Telegram-user-ID whitelist sits in front of the command surface. Non-whitelisted updates dropped silently (no user enumeration). A leaked token alone cannot drive the bot — the attacker also needs a whitelisted user-ID.

    4. RCE via inbound network exposure
      No inbound port. Telegram long-poll over outbound HTTPS only. Eliminates the entire inbound-RCE class.

    5. Untrusted-input parsing (fuzz-class bugs)
      FuzzDecode (internal/telegram/callbacks/data_fuzz_test.go) runs 30s on every PR. The CI comment identifies callbacks.Decode as "the only attacker-reachable parser before the whitelist gate" — fuzz coverage was deliberately aimed at the single highest-risk parser. Commit 0bb56cc.

    6. Path traversal
      The one os.ReadFile with a non-constant path (tools/tz_country.go) reads from a constant allowlist. The inline //nolint:gosec // G304: path is from a constant allowlist shows the gosec finding was read by number and mitigated.

    7. Credential leakage at rest
      Bot token + whitelist live in the macOS Keychain (internal/keychain), not config files or env vars. Keychain ACL bound to binary path — foreign binaries trigger a fresh user consent prompt.

    8. Credential leakage in repo / CI logs
      .gitignore excludes .env*, *.pem, *.key. CI secrets read via ${{ secrets.X }}, never inlined. The only token-shaped strings in the repo are Telegram's published BotFather placeholder (123456789:AAE-aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456). GitHub secret-scanning runs by default.

    9. Race conditions / TOCTOU
      go test -race on Linux + macOS in CI. musicrefresh uses an explicit cancel-stored-in-session lifecycle.

    10. Goroutine leaks
      musicrefresh.Manager has Start/Stop/Touch with a 10-minute hard cap; Stop is called on navigate-away. refresher_test.go (312 lines) covers lifecycle paths.

    11. Supply-chain attacks via mutable Action tags
      Every third-party Action pinned to commit SHA (commits de4e7aa, 08216c6). go-installed tools pinned to versions (commit fdbe795).

    12. Vulnerable dependencies
      govulncheck on every push/PR. Dependabot scans gomod weekly. Total deps: 3 direct + 1 indirect.

    13. Information disclosure via verbose errors
      Sanitised user-facing Telegram messages; detailed errors go to the local log only.

    14. Logging secrets
      Keychain abstraction returns the token only at the call site that needs it. lumberjack rotates logs to bound retention.

    15. Insecure file permissions on artifacts
      Commit caa55d6 tightened LaunchAgent plist 0o644 → 0o600 and Library/Logs / LaunchAgents directories 0o755 → 0o750 in response to gosec findings.

    16. Insecure-by-default configuration
      No default whitelist — macontrol setup forces the user to enter their Telegram user-ID. A misconfigured install fails closed (no whitelisted users → no commands accepted).

    17. Cross-binary credential confusion
      macOS Keychain ACL is binary-path-bound. CONTRIBUTING.md explicitly warns dev contributors not to use go run for iterative dev because its random tempdir paths defeat the ACL.

    18. Insecure release pipeline
      GoReleaser triggered by release-please is fully automated; build flags -trimpath -s -w CGO_ENABLED=0 produce reproducible stripped binaries; the same workflow updates the Homebrew tap.

    19. Missed bug-class patterns
      13 linters via golangci-lint including gosec, staticcheck, gocritic, errcheck, ineffassign. CodeQL semantic analysis on every push. nolintlint polices suppressions themselves — only 3 //nolint directives exist in the entire codebase, each with an inline justification.

    20. No vulnerability disclosure channel
      SECURITY.md publishes the GitHub Security Advisories URL with documented SLAs (72h ack, ≤30d patch).

    Direct evidence of awareness (not incidental coverage):

    • Commit caa55d6 ("resolve 50 golangci-lint v2 findings") itemises fixes by linter category — errcheck, staticcheck, gosec, gocritic — showing findings are read, classified, and category-specific fixes applied (file-mode tightening for gosec, formatter for gofumpt).
    • Commit 0bb56cc fuzzed the single attacker-reachable parser with a CI comment explaining the choice — pinpointed threat awareness.
    • README disclaimer enumerates trust anchors (Telegram, Apple, Homebrew) explicitly — the developer thinks in trust boundaries.
    • Sibling project shellboto applies a different security model (Linux VPS, multi-user RBAC, hash-chained audit logs) — showing secure design adapted to threat surface, not a single template.

    Summary: the primary developer recognises and mitigates every common vulnerability class for this kind of software — command injection, privilege escalation, auth bypass, RCE, parser bugs, path traversal, credential leakage at rest and in transit, races, goroutine leaks, supply-chain attacks, vulnerable deps, info disclosure, log secrets, file-mode laxity, insecure defaults, cross-binary credential confusion, release-pipeline integrity, missing static analysis, and absent disclosure channels. Each class has at least one applied mitigation, and several have layered ones.


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

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

    プロジェクトによって作成されたソフトウェアは、デフォルトで、一般に公開され、専門家によってレビューされている暗号プロトコルとアルゴリズムを使用しなければなりません。(暗号プロトコルとアルゴリズムが使用される場合) [crypto_published]
    ソフトウェアによっては暗号機能を直接使用する必要がないため、これらの暗号基準は常に適用されるわけではありません。


    プロジェクトによって作成されたソフトウェアがアプリケーションまたはライブラリであり、主な目的が暗号の実装でない場合、暗号機能を実装するために特別に設計されたソフトウェアを呼び出すだけにするべきです。自分用に(暗号機能を)再実装するべきではありません。 [crypto_call]


    暗号に依存するプロジェクトによって作成されるソフトウェアのすべての機能は、FLOSSを使用して実装可能でなければなりません。 [crypto_floss]


    プロジェクトによって作成されたソフトウェア内にあるセキュリティ メカニズムは、少なくとも、2030年までのNIST最小要件(2012年)を満たすデフォルト鍵長を使用しなければなりません。より小さな鍵長を完全に無効になるおうに、ソフトウェアを構成できなければなりません。 [crypto_keylength]
    これらの最小ビット長は、対称鍵112、ファクタリング係数2048、離散対数鍵224、離散対数群2048、楕円曲線224、ハッシュ224(パスワードハッシュはこのビット長でカバーされません。パスワードハッシュに関する詳しい情報は crypto_password_storage 基準にあります)です。さまざまな機関が出している推奨鍵長の比較については、https://www.keylength.comを参照してください。ソフトウェアは、 いくつかの構成ではより短い鍵長を許可するかもしれません(これはダウングレード攻撃を許すので、理想的には正しくありません。しかし、短い鍵長は、相互運用性のために時に必要となります)。


    プロジェクトによって生成されたソフトウェア内のデフォルトのセキュリティメカニズムは、壊れた暗号化アルゴリズム(MD4、MD5、シングルDES、RC4、Dual_EC_DRBGなど)に依存したり、実装する必要がない限り、コンテキストに不適切な暗号化モードを使用したりしてはなりません。相互運用可能なプロトコル(実装されたプロトコルがネットワークエコシステムによって広くサポートされている標準の最新バージョンであり、そのエコシステムではそのようなアルゴリズムまたはモードの使用が必要であり、そのエコシステムはこれ以上安全な代替手段を提供しません)。これらの壊れたアルゴリズムまたはモードが相互運用可能なプロトコルに必要な場合、ドキュメントには、関連するセキュリティリスクと既知の緩和策を記載する必要があります。 [crypto_working]
    ECBモードは、 ECBペンギンによって示されるように暗号文内の同一のブロックを明らかにするため、ほとんど適切ではありません。また、CTRモードは、認証を実行せず、入力状態が繰り返されると重複を引き起こすため、不適切なことがよくあります。多くの場合、Galois / Counter Mode(GCM)やEAXなど、機密性と認証を組み合わせるように設計されたブロック暗号アルゴリズム モードを選択するのが最善です。プロジェクトは、互換性のために必要な場合、ユーザーが壊れたメカニズムを有効にすることを許可する場合があります(構成中など)が、ユーザーはそれを実行していることを認識します。


    プロジェクトによって作成されたソフトウェア内のデフォルトのセキュリティ メカニズムは、既知の重大な脆弱性を持つ暗号アルゴリズムやモード(たとえば、SHA-1暗号ハッシュ アルゴリズムまたはSSHのCBC モード)に依存するべきではありません。 [crypto_weaknesses]
    SSHのCBCモードに関する懸念事項は、 CERT: SSH CBC 脆弱性にて議論されています。.


    プロジェクトによって作成されたソフトウェア内のセキュリティ メカニズムは、鍵合意プロトコルのための完全な順方向秘密を実装するべきなので、もし長期鍵が将来侵害された場合でも、長期鍵のセットから導出されるセッション鍵は侵害されません。 [crypto_pfs]


    プロジェクトによって作成されたソフトウェアが外部ユーザーの認証用のパスワードの保存を引き起こす場合、パスワードは、キーストレッチ(反復)アルゴリズム(Argon2id、Bcrypt、Scrypt、PBKDF2など)を使用して、ユーザーごとのソルトで反復ハッシュとして保存される必要があります。OWASP Password Storage Cheat Sheetも参照してください)。 [crypto_password_storage]
    この基準は、ソフトウェアがサーバー側Webアプリケーションなどの外部ユーザーのパスワードを使用してユーザーの認証(別名インバウンド認証)を実施している場合にのみ適用されます。ソフトウェアが他のシステムへの認証用のパスワードを保存している場合(別名、アウトバウンド認証、たとえば、ソフトウェアが他のシステムのクライアントを実装している場合)、そのソフトウェアの少なくとも一部がハッシュされていないパスワードにアクセスできる必要があるため、適用されません。


    プロジェクトによって作成されたソフトウェア内のセキュリティ メカニズムは、暗号学的にセキュアな乱数発生器を使用して、すべての暗号鍵とナンスを生成しなければなりません。暗号学的にセキュアでない発生器を使用してはいけません。 [crypto_random]
    暗号学的にセキュアな乱数発生器は、ハードウェアの乱数発生器でも、Hash_DRBG、HMAC_DRBG、 CTR_DRBG、Yarrow、Fortunaなどのアルゴリズムを使用する暗号学的にセキュアな疑似乱数発生器(CSPRNG)でもよいです。セキュアでない乱数発生器には、Javaのjava.util.RandomとJavaScriptのMath.randomがあります。

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


    プロジェクトは、MITM攻撃に対抗する配信メカニズムを使用しなければならない。httpsまたはssh+scpを使用することは許容されます。 [delivery_mitm]
    さらに強力な仕組みは、デジタル署名されたパッケージでソフトウェアをリリースすることです。配布システムへの攻撃を緩和するからです。しかし、これは、署名の公開鍵が正当なものであることをユーザーが確信でき、かつユーザーが実際に署名をチェックする場合にのみ有効です。

    Distribution channels use HTTPS exclusively. [osps_br_03_02]



    暗号ハッシュ(たとえばSHA1SUM)は、http経由で運んではならず、暗号署名をチェックすることなしに使用してはいけません。 [delivery_unsigned]
    これらのハッシュは、送信中に変更することができます。

  • 広く知られた脆弱性を修正


    60日を超えて公的に知られている中程度または重大度のパッチが適用されていない脆弱性は存在してはなりません。 [vulnerabilities_fixed_60_days]
    脆弱性は、プロジェクト自体によってパッチされ、リリースされなければなりません(パッチは他の場所で開発される可能性があります)。脆弱性が無料情報と共にCVE(共通脆弱性識別子)を持つとき(例えば、 National Vulnerability Database )、またはプロジェクトに情報が伝えられ、その情報が(おそらくプロジェクトによって)一般に公開されたとき、脆弱性は一般に知られるようになります。Common Vulnerability Scoring System (CVSS)の定性的スコアが中程度以上であれば、脆弱性は中程度以上の深刻度とみなされます。CVSS のバージョン 2.0 から 3.1 では、これは CVSS のスコア 4.0 以上に相当します。プロジェクトは、広く利用されている脆弱性データベース(国家脆弱性データベースなど)で公開されているCVSSスコアを、そのデータベースで報告されている最新バージョンのCVSSを用いて使用することができます。代わりに、プロジェクトは、脆弱性が公表された時点で計算入力内容が公開されている場合には、脆弱性が公表された時点でのCVSSの最新版を用いて深刻度を計算することができます。注意:これは、ユーザーが最大60日間、世界中のすべての攻撃者に対して脆弱なままになる可能性があることを意味します。この基準は、責任ある開示の再起動でGoogleが推奨しているものよりも、はるかに簡単に満たすことができることが多いです。なぜなら、Googleはレポートが公開されていなくても、プロジェクトが通知された時点で60日間の期間が開始されることを推奨しているためです。また、このバッジの基準は、他の基準と同様に、個々のプロジェクトに適用されることにも注意してください。プロジェクトの中には、より大きな包括組織や大規模プロジェクトの一部であり、複数のレイヤーに分かれている場合もあります。また、多くのプロジェクトでは、複雑なサプライチェーンの一部として、他の組織やプロジェクトに成果を提供しています。個々のプロジェクトは、多くの場合、残りの部分をコントロールできませんが、個々のプロジェクトは、脆弱性パッチをタイムリーにリリースするための作業を行うことができます。そのため、私たちは個々のプロジェクトの対応時間に焦点を当てています。 一旦、個々のプロジェクトからパッチが利用可能になると、他のプロジェクトはそのパッチにどのように対処するかを決定することができます(たとえば、新しいバージョンにアップデートすることもできますし、選別されたソリューションのパッチだけを適用することもできます)。

    vulnerabilities_fixed_60_days — macontrol evidence

    The project satisfies this criterion. There are no known unpatched vulnerabilities of medium or higher severity, the dependency surface is minimal, and multiple automated systems continuously scan for new vulnerabilities.

    1. Minimal dependency surface

    go.mod declares only 3 direct dependencies and 1 indirect dependency:

    require (
    github.com/go-telegram/bot v1.20.0
    golang.org/x/term v0.42.0
    gopkg.in/natefinch/lumberjack.v2 v2.2.1
    )
    require golang.org/x/sys v0.43.0 // indirect

    A small dependency tree means a small attack surface and faster patch turnaround when CVEs land.

    1. Continuous vulnerability scanning in CI

    .github/workflows/ci.yml runs govulncheck ./... on every push and pull request as a dedicated vuln job. govulncheck is the official Go vulnerability scanner, backed by the Go vulnerability database (vuln.go.dev), and it checks both direct/indirect dependencies and stdlib usage. A new CVE affecting any reachable code path fails the build.

    .github/workflows/codeql.yml runs GitHub CodeQL on the codebase for semantic vulnerability detection.

    .github/workflows/scorecards.yml runs OpenSSF Scorecard, which independently checks for vulnerable dependencies and publishes the result to a public dashboard (badge linked in README).

    1. Automated patch ingestion via Dependabot

    .github/dependabot.yml is configured to:

    • Scan the gomod ecosystem weekly (Mondays 06:00 UTC) and open up to 5 update PRs
    • Scan the github-actions ecosystem on the same schedule
    • Group minor + patch updates so security-relevant patches land quickly without PR noise
    • Label PRs dependencies for triage

    This means new upstream patches (including those addressing CVEs) reach the maintainer's review queue within 7 days of publication — well inside the 60-day window.

    The Dependabot badge on README.md ("Dependabot enabled") publicly signals the policy.

    1. Disclosed vulnerability handling policy (SECURITY.md)

    The maintainer commits in writing to:

    • Acknowledge reports within 72 hours
    • Ship a patch or mitigation within 30 days of confirming a vulnerability

    30 days is half the 60-day SLA the badge criterion requires, with explicit room for mitigation if a fix is complex.

    1. Private disclosure channel

    SECURITY.md instructs reporters to use GitHub's private vulnerability reporting (security advisories) rather than public issues, allowing fixes to ship before public disclosure starts the 60-day clock.

    1. Public security advisories database

    A check against https://github.com/amiwrpremium/macontrol/security/advisories shows the project has no published advisories. The Go vulnerability database (vuln.go.dev) shows no entries for github.com/amiwrpremium/macontrol. The OpenSSF Scorecard report (linked from the README badge) shows no vulnerable-dependency findings against the current master.

    1. Pinned, reproducible CI tooling

    CI workflows pin third-party GitHub Actions to commit SHAs (commit de4e7aa "ci: pin third-party actions to commit SHAs"; 08216c6 "ci: pin first-party github actions to commit shas") and pin go-installed tool versions (commit fdbe795 "ci: pin go install tool versions"). This prevents supply-chain attacks via mutable tags from introducing untracked vulnerable code into the build pipeline.

    Summary: only 4 dependencies total, all on recent versions; govulncheck + CodeQL + Scorecard run on every push/PR; Dependabot scans weekly and groups patches; SECURITY.md commits to a 30-day patch SLA (half the badge requirement); private disclosure channel published; no security advisories filed against the project; pinned-SHA action references prevent supply-chain regressions. The criterion is satisfied with strong defence in depth.



    プロジェクトは、すべての重要な脆弱性を、報告された後迅速に修正するべきです。 [vulnerabilities_critical_fixed]

    vulnerabilities_critical_fixed — macontrol evidence

    The project satisfies this suggested criterion. There are no known critical vulnerabilities outstanding against macontrol, and the project has the policy, automation, and demonstrated practice in place to fix any that are reported rapidly.

    1. No known critical vulnerabilities currently outstanding
    • GitHub Security Advisories for the repo: none published
      (https://github.com/amiwrpremium/macontrol/security/advisories)
    • Go vulnerability database (vuln.go.dev): no entries for
      github.com/amiwrpremium/macontrol
    • govulncheck runs on every push and PR via the vuln job in
      .github/workflows/ci.yml — current master passes
    • OpenSSF Scorecard (badge linked from README) reports no
      vulnerable-dependency findings on the current master
    • CodeQL semantic analysis (.github/workflows/codeql.yml) runs on
      every push — current master passes
    1. Documented rapid-fix commitment (SECURITY.md)

    The published security policy states explicit, time-bounded SLAs:

    • Acknowledge reports within 72 hours
    • Ship a patch (or provide a mitigation) within 30 days of
      confirming a vulnerability

    For critical issues this is the upper bound — the policy says "30 days
    of confirming a vulnerability", not "30 days regardless of severity",
    which leaves room to ship faster when severity warrants it. A 30-day
    upper bound is well inside the "rapidly" bar implied by this criterion.

    1. Private disclosure channel — fixes can ship before public clock starts

    SECURITY.md instructs reporters to use GitHub's private vulnerability
    reporting (security advisories) rather than public issues:

    https://github.com/amiwrpremium/macontrol/security/advisories/new

    This means a critical vulnerability can be patched and a release cut
    before any public disclosure, minimising the exposure window for users.

    1. Release infrastructure supports rapid patching

    The release pipeline is fully automated:

    • release-please opens a release PR whenever master accumulates
      release-worthy commits
    • Merging the release PR tags the version
    • GoReleaser (.goreleaser.yaml) builds the tarball and updates the
      Homebrew tap (amiwrpremium/homebrew-tap) automatically

    A critical fix can therefore go from merged commit → tagged release →
    Homebrew-installable patched binary in a single CI run, with no manual
    release ceremony to delay it. The CHANGELOG.md history shows multiple
    patch releases (e.g., 0.6.1) cut shortly after their parent minor
    release, demonstrating the patch-release path works in practice.

    1. Defence-in-depth shrinks the critical-vulnerability surface

    The threat model documented in docs/security/ and SECURITY.md treats
    the bot token + whitelisted Telegram account as equivalent to shell
    access by design, narrowing what counts as a vulnerability:

    • Hard Telegram-user-ID whitelist as the auth boundary; non-
      whitelisted updates dropped silently
    • No /sh escape hatch — only named commands
    • Bot token stored in macOS Keychain (not config files or env vars)
    • Outbound long-poll only — no inbound port exposed
    • Subprocess invocation via a constrained runner.Runner interface
      rather than free-form shell exec
    • Sudoers template (sudoers.d/macontrol.sample) limits sudo to a
      narrow allowlist of commands

    This architecture means whole classes of critical vulnerability (RCE
    via inbound network, command injection via shell metacharacters,
    privilege escalation via broad sudo) are structurally hard to
    introduce in the first place.

    1. Demonstrated rapid-response posture on lint/security findings

    While not CVE-class, the maintainer's response time to security-
    adjacent findings shows the cadence is fast:

    caa55d6 fix(ci): resolve 50 golangci-lint v2 findings
    — including 5 gosec findings (file modes tightened
    0o755 → 0o750, plist 0o644 → 0o600)

    Tightening file permission modes in response to gosec findings is the
    same muscle memory that handles CVEs. The fix-and-ship cycle is short.

    1. Supply-chain hardening to prevent introducing critical vulns

    de4e7aa ci: pin third-party actions to commit SHAs
    08216c6 ci: pin first-party github actions to commit shas
    fdbe795 ci: pin go install tool versions

    Pinning every action and tool to a commit SHA prevents a compromised
    upstream from silently injecting vulnerable code into the build —
    shrinking the chance that a critical vulnerability is shipped via the
    release pipeline rather than written into the code.

    1. Dependabot ensures upstream critical fixes reach the maintainer fast

    .github/dependabot.yml runs weekly on both gomod and github-actions
    ecosystems. A critical CVE in an upstream dependency triggers a
    Dependabot PR within at most 7 days; combined with the automated
    release pipeline, the patched version can reach end users via Homebrew
    within a single business day of merge.

    Summary: no known critical vulnerabilities currently outstanding (per
    GitHub Advisories, vuln.go.dev, govulncheck, CodeQL, and Scorecard);
    SECURITY.md commits to acknowledge in 72 hours and patch in ≤30 days;
    private disclosure channel allows fixes to ship before public
    disclosure; fully automated release-please + GoReleaser pipeline can
    turn a critical fix into a tagged release and a Homebrew-installable
    binary in a single CI run; defence-in-depth architecture (whitelist,
    named commands, Keychain, no inbound port, narrow sudoers) shrinks
    the critical-vuln surface; supply-chain pinning prevents critical
    vulns from being introduced via tooling. The criterion is satisfied.


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


    公開リポジトリは、パブリックアクセスを制限するための有効なプライベートクレデンシャル(たとえば、有効なパスワードやプライベートキー)を漏らしてはなりません。 [no_leaked_credentials]
    プロジェクトは、パブリック アクセスを制限する意図がない限り、テスト用や重要でないデータベース用の「サンプル」資格情報を漏らす可能性があります。

    no_leaked_credentials — macontrol evidence

    The project satisfies this criterion. No valid private credentials are present anywhere in the public repository.

    1. Repository-wide credential search — clean

    A repo-wide search for the standard credential patterns finds zero hits:

    • Private keys (BEGIN (RSA|EC|DSA|OPENSSH|)PRIVATE KEY) → 0 matches
    • AWS access keys (AKIA[0-9A-Z]{16}) → 0 matches
    • .env files, *.pem, .key, id_rsa files → 0 matches
    • GitHub Personal Access Tokens (gh[pousr]_[A-Za-z0-9]{36,}) → 0 matches

    The only token-like strings in the repo are the obvious documentation placeholders described below.

    1. Documentation placeholders are not valid credentials

    Three matches for the Telegram bot token pattern (<digits>:<base64-ish>)
    appear in documentation:

    docs/getting-started/credentials-telegram.md:55
    docs/getting-started/credentials-telegram.md:146
    docs/security/bot-token.md:11

    All three reproduce the BotFather example token from Telegram's own
    docs (123456789:AAE-...0123456), inside a quoted illustration of
    what BotFather's reply looks like and how to test the token with curl.
    This is an obviously fabricated placeholder:

    • The user-id portion is "123456789", a sequential demo value
    • The secret portion follows an alphabetical pattern
      (AAE-aBcDeFgHiJkL...)
    • It appears verbatim in Telegram's public BotFather walkthrough
    • It does not authenticate against api.telegram.org — calling
      https://api.telegram.org/bot<that-token>/getMe returns
      "Unauthorized"

    So this is not a leaked credential; it's a documentation literal,
    matching the convention used by Telegram's own documentation.

    1. .gitignore protects against accidental credential commits

    The .gitignore explicitly excludes credential file patterns:

    Secrets

    .env
    .env.*
    *.pem
    *.key

    This means a contributor who creates a local .env or .pem file cannot
    accidentally git add it.

    1. Real credentials are stored outside the repository

    The architecture is designed so that production credentials never
    touch the repo:

    • Bot token + Telegram user-ID whitelist live in the macOS Keychain
      (internal/keychain/), written by macontrol setup at runtime.
      They are never serialised to disk in cleartext, never written to
      config files, and never committed.
    • CONTRIBUTING.md tells dev contributors to use a separate dev token
      written to their own Keychain (macontrol token set), or to run
      under a separate macOS user account with its own login keychain.
    • sudoers.d/macontrol.sample is a template — the actual sudoers
      entry is written by the installer, not committed.
    1. CI secrets are referenced via GitHub Secrets, never inlined

    Every secret in .github/workflows/*.yml is read via the ${{ secrets.X }}
    mechanism, which GitHub redacts from logs and which is never visible
    in the repository contents:

    CODECOV_TOKEN (ci.yml)
    CODACY_PROJECT_TOKEN (ci.yml)
    GITHUB_TOKEN (pr-title.yml, release.yml — provided by GH)
    RELEASE_PLEASE_PAT (release-please.yml)
    HOMEBREW_TAP_TOKEN (release.yml)

    No CI workflow inlines a token, hex blob, or base64 secret.

    1. Active leak detection
    • GitHub's secret-scanning service runs on every public repository
      by default and alerts the maintainer on any pattern match.
    • OpenSSF Scorecard (.github/workflows/scorecards.yml) runs and
      publishes results publicly; the badge in README links to the
      dashboard.
    • CodeQL semantic analysis (.github/workflows/codeql.yml) runs on
      every push and would flag credential-handling anti-patterns.
    1. Documented credential hygiene

    SECURITY.md and docs/security/bot-token.md explicitly call out that
    the bot token is the project's primary credential and document where
    it lives (Keychain) and how to rotate it. The README's Disclaimer
    section reminds users:

    "You are responsible for the bot token and the whitelist."

    This is the opposite of the anti-pattern of treating credentials as
    casual values that might end up in commits.

    Summary: no valid credentials in the repo (zero matches for private
    keys, AWS keys, GitHub PATs, or .env-style files); the only
    token-shaped strings are Telegram's own documented placeholder, used
    inside docs/ to illustrate BotFather output; .gitignore blocks the
    common credential file patterns; production credentials live in the
    macOS Keychain and never touch the filesystem; CI secrets are
    referenced exclusively through GitHub's redacted secrets mechanism;
    GitHub secret-scanning + CodeQL + Scorecard provide active leak
    detection. The criterion is satisfied.


 分析 8/8

  • 静的コード解析


    選択した言語でこの基準を実装するFLOSSツールが少なくとも1つある場合、少なくとも1つの静的コード分析ツール(コンパイラの警告と「安全な」言語モード以外)を、ソフトウェアの主要な製品リリースの提案に、リリース前に適用する必要があります。 [static_analysis]
    静的コード解析ツールは、ソフトウェアコードを実行せずに特定の入力を用いて(ソースコード、中間コード、または実行可能ファイルとして)調べます。この基準のために、コンパイラの警告と「安全な」言語モードは、静的コード解析ツールとしてカウントされません(これらは通常、速度が重要なため深い解析を行いません)。このような静的コード解析ツールの例には、cppcheck (C, C++)、clang静的解析 (C, C++)、SpotBugs (Java)、FindBugs (Java) (FindSecurityBugsを含む)、PMD (Java)、Brakeman (Ruby on Rails)、lintr (R)、goodpractice (R), Coverity Quality AnalyzerSonarQubeCodacyおよび HP Enterprise Fortify Static Code Analyzer.大きなツールのリストは、静的コード解析のためのWikipediaツール一覧, 静的コード解析に関するOWASP情報 NISTソースコードセキュリティアナライザのリスト、およびウィーラーの静的解析ツール一覧などがあります。 使用する実装言語で使用できるFLOSS静的解析ツールがない場合は、「該当なし」(N/A)を選択します。

    static_analysis — macontrol evidence

    The project applies multiple FLOSS static-analysis tools to every proposed change, well before any release:

    1. golangci-lint (FLOSS, GPL-3.0) — configured in .golangci.yml with 13 linters: errcheck, govet, ineffassign, staticcheck, unused, misspell, gocritic, revive (with exported and package-comments rules enabled), bodyclose, nolintlint, unparam, prealloc, gosec. Runs as the lint job in .github/workflows/ci.yml on every push and PR. make lint exposes the same check locally.

    2. CodeQL — .github/workflows/codeql.yml runs GitHub's semantic code analysis on every push to master.

    3. govulncheck — runs as the vuln CI job (govulncheck ./...), pinned to v1.1.4.

    4. OpenSSF Scorecard — .github/workflows/scorecards.yml runs supply-chain best-practice analysis with public results (badge in README).

    5. Codacy — third-party static analysis with public dashboard linked from README badges.

    Releases use release-please + GoReleaser; both run after CI is green, so no release tag is created without all five tools having passed.

    Summary: golangci-lint, CodeQL, govulncheck, Scorecard, and Codacy run on every push/PR. The criterion is satisfied.



    static_analysis基準に使用される静的解析ツールの少なくとも1つが、分析された言語または環境における共通の脆弱性を探すためのルールまたはアプローチを含むことが、推奨されています。 [static_analysis_common_vulnerabilities]
    一般的な脆弱性を探すために特別に設計された静的解析ツールは、それらを見つける可能性が高いです。つまり、静的ツールを使用すると、通常は問題を見つけるのに役立ちますので、利用を提案しますが、「合格」レベルのバッジには要求しません。

    static_analysis_common_vulnerabilities — macontrol evidence

    Several of the static-analysis tools used target common vulnerabilities directly:

    • gosec (enabled in .golangci.yml) — Go security checker covering subprocess use (G204), file-permission laxity (G302/G306), insecure tempfile creation, weak crypto, integer overflow, path traversal (G304), TLS misconfig, and SQL injection patterns.
    • govulncheck — checks reachable code paths against the official Go vulnerability database (vuln.go.dev), covering both stdlib and dependencies.
    • CodeQL — semantic vulnerability detection (taint flow, injection, unsafe deserialisation, etc.) using GitHub's vulnerability query packs.
    • OpenSSF Scorecard — supply-chain vulnerability checks (vulnerable deps, pinned dependencies, signed releases, branch protection).
    • staticcheck — includes the SA category which catches correctness bugs that frequently underlie vulnerabilities (deprecated API use, unsafe type assertions, ignored errors).

    Evidence the vulnerability-focused rules fire and get acted on: commit caa55d6 ("resolve 50 golangci-lint v2 findings") explicitly itemises 5 gosec security findings fixed (file modes 0o755 → 0o750, plist 0o644 → 0o600, trusted-path file opens annotated). The criterion is satisfied.



    静的コード解析で発見された中程度および重大度の悪用可能な脆弱性はすべて、それらが確認された後、適時に修正されなくてはなりません。 [static_analysis_fixed]
    Common Vulnerability Scoring System (CVSS)の基本的な定性的なスコアが中程度以上であれば、脆弱性は中程度以上の深刻度とみなされます。CVSS のバージョン 2.0 から 3.1 では、これは CVSS のスコア 4.0 以上に相当します。プロジェクトは、広く利用されている脆弱性データベース(国家脆弱性データベースなど)で公開されているCVSSスコアを、そのデータベースで報告されている最新バージョンのCVSSを用いて使用することができます。また、脆弱性が公開された時点で計算入力が公開されている場合には、脆弱性が公開された時点でのCVSSの最新バージョンを用いて深刻度を計算することもできます。基準 vulnerabilities_fixed_60_days では、公開後 60 日以内にすべての脆弱性を修正することが要求されていることに注意してください。

    static_analysis_fixed — macontrol evidence

    No medium-or-higher severity exploitable vulnerabilities are currently outstanding from any static analyser:

    • golangci-lint with default: none and max-issues-per-linter: 0 runs clean on master (the lint job is green; CI blocks merges that introduce findings).
    • govulncheck ./... is green on master.
    • CodeQL has no open alerts on master.
    • OpenSSF Scorecard public report shows no vulnerable-dependency findings.

    Demonstrated track record of timely fixes:

    • caa55d6 "fix(ci): resolve 50 golangci-lint v2 findings" addressed all findings in a single PR with itemised release notes by linter category, including 5 gosec items (file-mode tightening, trusted-path annotations).
    • 9f045d2 "refactor: split overgrown handlers and table-drive parsers" addressed Codacy complexity findings.
    • The Music feature PR (#91) explicitly lists two refactors done to satisfy Codacy: splitting MusicCaption into per-section helpers and tickOnce into snapshot + edit-media helpers.

    CI gates merges on lint + vuln passing, so static-analysis findings cannot accumulate. The criterion is satisfied.



    静的ソースコード解析は、コミットごと、または少なくとも毎日実行することをお勧めします。 [static_analysis_often]

    static_analysis_often — macontrol evidence

    Static analysis runs on every commit, not merely daily:

    .github/workflows/ci.yml triggers on push to master and on pull_request targeting master. On every such event the following jobs run in parallel:

    • lint → golangci-lint (13 linters)
    • test → go test -race + coverage floor enforcement
    • vuln → govulncheck ./...
    • fuzz-short → 30s FuzzDecode

    .github/workflows/codeql.yml runs CodeQL on every push to master.
    .github/workflows/scorecards.yml runs OpenSSF Scorecard on schedule and publishes results publicly.
    Codacy runs on every push (continuous integration with the repo).

    Concurrency is configured to cancel superseded runs (cancel-in-progress: true) so the most recent commit always has fresh results. The criterion is satisfied at the strong end (per-commit, not daily).


  • 動的コード分析


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

    dynamic_analysis — macontrol evidence

    Dynamic analysis is applied on every PR before release:

    1. Go native fuzzing — FuzzDecode in internal/telegram/callbacks/data_fuzz_test.go runs 30s on every PR via the fuzz-short job in .github/workflows/ci.yml. Targets the only attacker-reachable parser before the whitelist gate. Commit 0bb56cc.

    2. Race detector — go test -race -coverprofile=coverage.out ./... runs on the test matrix (ubuntu-latest + macos-14) on every push/PR. The race detector is a dynamic instrumentation tool that observes actual goroutine memory accesses at runtime.

    3. Coverage measurement — go test -coverprofile is dynamic instrumentation; the resulting profile feeds go-test-coverage which enforces a per-package floor.

    Releases are produced by release-please + GoReleaser only after CI is green, so no release ships without these dynamic checks having passed. The criterion is satisfied.



    プロジェクトで作成されたソフトウェアにメモリ安全でない言語(CやC ++など)を使用して作成されたソフトウェアが含まれている場合、少なくとも1つの動的ツール(たとえば、ファジーまたはウェブ アプリケーション スキャナ)を、バッファの上書きなどのメモリの安全性の問題を検出するメカニズムと一緒にいつも使用します。プロジェクトがメモリ安全でない言語で書かれたソフトウェアを作成しない場合は、「該当なし」(N/A)を選択します。 [dynamic_analysis_unsafe]
    メモリの安全性の問題を検出するメカニズムの例としては、アドレスサニタイザー(ASAN)(GCCおよびLLVMで利用可能)、 Memory Sanitizer 、および valgrind が含まれます。他に使用される可能性のあるツールには、スレッドサニタイザ定義されていない動作サニタイザを参照してください。広範なアサーションも機能します。

    dynamic_analysis_unsafe — macontrol evidence

    N/A.

    macontrol is written entirely in Go, a memory-safe language with garbage collection, bounds-checked slices, no pointer arithmetic, and runtime nil-check enforcement. The build sets CGO_ENABLED=0, so no C/C++ code is linked into the binary. There is no memory-unsafe code in the project to apply this criterion to.

    (For completeness: the project does run the Go race detector via go test -race on every push/PR and a Go native fuzzer on the callback parser — but the criterion does not apply because the language is memory-safe.)



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

    dynamic_analysis_enable_assertions — macontrol evidence

    The project's dynamic analysis configuration enables checks well beyond what production builds carry:

    1. Race detector enabled in tests, disabled in production
      CI: go test -race -coverprofile=coverage.out ./...
      Production build: go build -trimpath -ldflags="-s -w" CGO_ENABLED=0 — no -race
      The race detector is an extensive instrumentation layer (assertion-style runtime checks on every memory access between goroutines) that is documented to be unsuitable for production due to overhead. macontrol enables it for the test matrix on every PR and strips it from release binaries.

    2. Go native fuzzer with assertion-style checks
      FuzzDecode runs the parser against random inputs and asserts on panics, oracle violations, and structural invariants. The fuzz harness is only compiled into test binaries, never the release artifact.

    3. Test-only assertion helpers
      internal/runner/runner.go's Fake test mock asserts on the parsed (Name, Args) tuple of every subprocess call, providing test-time invariant checks the production runner does not perform.

    4. Coverage floor as a runtime assertion
      go-test-coverage runs against the live coverage profile and asserts the floor is met (total 80%, package 75%, file 50%). This is a CI-time runtime check that does not exist in production.

    These assertion-style checks are configured for test/CI runs only — production builds use stripped binaries (-s -w) with no debug info, no race detector, no fuzz harness, no coverage instrumentation. The criterion is satisfied.



    動的コード分析で発見されたすべての中程度および重大度の悪用可能な脆弱性は、確認された後、適時に修正されなければなりません。 [dynamic_analysis_fixed]
    動的コード分析を実行しておらず、この方法で脆弱性が見つからない場合は、「該当なし」(N/A)を選択してください。 Common Vulnerability Scoring System (CVSS)の基本的な定性的スコアが中以上の場合、脆弱性は中程度以上の重大度と見なされます。 CVSSバージョン2.0から3.1では、これは4.0以上のCVSSスコアに相当します。プロジェクトは、広く使用されている脆弱性データベース( National Vulnerability Databaseなど)で公開されているCVSSスコアを、そのデータベースで報告されている最新バージョンのCVSSを使用して使用できます。代わりに、脆弱性が公表された後に計算入力が公開された場合、プロジェクトは脆弱性の開示時に最新バージョンのCVSSを使用して重大度を自ら計算することができます。

    dynamic_analysis_fixed — macontrol evidence

    No medium-or-higher severity exploitable vulnerabilities are currently outstanding from any dynamic analyser:

    • The race detector (go test -race) is green on the CI matrix (ubuntu-latest + macos-14) on master.
    • FuzzDecode runs 30s per PR on the callback parser; no panics or oracle violations have been reported in the corpus or in CI.
    • Coverage floor is met on master.

    Demonstrated track record of timely fixes for dynamic-analysis findings:

    • The cancel-stored-in-session pattern in internal/telegram/musicrefresh/refresher.go was structured specifically to avoid the race-detector and gosec false-positive interaction; the inline //nolint:gosec // cancel stored in session.cancel; called by Stop and run's defer documents why the fix is safe.
    • Commit 0bb56cc proactively added fuzz coverage to the highest-risk parser, a forward-looking dynamic-analysis investment rather than a reactive fix.
    • Commit fdbe795 ("ci: pin go install tool versions") pinned the dynamic-analysis tooling itself (govulncheck, go-test-coverage) so dynamic-check behaviour is reproducible.

    CI gates merges on the race-detector test job passing and on FuzzDecode not panicking, so dynamic-analysis findings cannot accumulate unfixed. The criterion is satisfied.



このデータは、Community Data License Agreement – Permissive, Version 2.0 (CDLA-Permissive-2.0)のもとで利用可能です。これは、データ受領者が、データ受領者がこの契約のテキストを共有データとともに利用可能にする限り、変更の有無にかかわらずデータを共有できることを意味します。AMiWRおよびOpenSSFベストプラクティスバッジのコントリビューターにクレジットを表示してください。

プロジェクト バッジ登録の所有者: AMiWR.
エントリの作成日時 2026-04-25 02:20:50 UTC、 最終更新日 2026-04-25 02:59:10 UTC 最後に2026-04-25 02:59:10 UTCにバッジ合格を達成しました。