Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add an Ansible role to install the proxy as a hardened systemd service

オープン
#96 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ansible, docker, go, linux, rust

調査の方向性

The proxy's policy loading is in go/internal/policy/manager.go, and the README's systemd Service section shows the manual install that the role would automate. The work is a new Ansible collection under ansible/ with one role, plus tests in ansible/tests/ that run against a real Docker daemon. Done means the role installs and verifies the binary, writes policies and a hardened unit, restarts on change, and the test suite passes with ansible-lint and --syntax-check in CI.

索引モデルが issue の本文から書いたものです。

説明

Type: Feature

Is your feature request related to a problem?

There is no supported way to install the proxy on a host. The README's systemd Service section lists manual commands and a minimal unit. Every consumer must write the same install: the pinned binary and its checksum, the service account and its groups, the policy files and their modes, a hardened unit, log rotation, and a restart when a policy changes. Some details are easy to get wrong:

  • The proxy reads its policies only at startup (go/internal/policy/manager.go). A changed policy with no restart is a silent no-op.
  • The proxy ignores unknown policy keys. A misspelled key loads without an error and enforces nothing.
  • The proxy can give its socket only to a group that it belongs to. Without that membership, startup fails.
  • The proxy opens the audit log once and never reopens it. A rotation by rename leaves it writing to the rotated file.

lodestar-infrastructure is the first consumer (ChainSafe/lodestar-infrastructure#64, the spec in ChainSafe/lodestar-infrastructure#9). The install is not specific to Lodestar.

Describe the solution

Add an Ansible collection, chainsafe.docker_socket_policy, under ansible/. It contains one role, docker_socket_policy. Consumers install it from this repository at a release tag (git+https://github.com/ChainSafe/docker-socket-policy.git#/ansible/). The role:

  • installs the Go or Rust release binary for amd64 or arm64, and checks it against the sha256 digest that GitHub publishes for the asset;
  • creates a system account in the Docker group and the socket group;
  • writes one policy per entry, root:<group> 0640, and removes policy files that it does not manage;
  • rejects unknown or unenforced policy keys (ports, user_id, group_id), and rejects overlapping service or container names;
  • writes a unit with ProtectSystem=strict, RestrictAddressFamilies=AF_UNIX, an empty capability set, MemoryDenyWriteExecute=true and UMask=0027;
  • restarts the proxy when a policy, the binary or the unit changes;
  • writes a logrotate rule with copytruncate.

ansible/tests/ installs the role with two test policies that share one image, then sends real requests through the proxy to a real daemon on a disposable host. The tests cover denied mounts, groups, namespaces, capabilities, devices, inherited mounts, policy confusion, lifecycle on unmanaged containers, exec, update, path tricks and pulls. They also check the forced values and socket access by group. CI runs ansible-lint and --syntax-check.

Describe alternatives

  • A role in ChainSafe/ansible-collection (chainsafe.general). Rejected: the policy schema changes with proxy releases (container_names in v0.5.0, group_add in v0.6.0). A role in this repository is versioned and tested with the binary that it installs.
  • A role in lodestar-infrastructure's lodestar-collection. Rejected: the install is not specific to Lodestar.
  • Keep the README commands only. Rejected: every consumer repeats the details above.

Which implementation(s) would this affect?

  • Go (installs the Go binary)
  • Rust (installs the Rust binary)
  • TypeScript (released as a tarball that needs Node; the role does not install it)
  • Quint specification
  • All

Additional context

No proxy code changes. The first release that contains ansible/ would be the first version that consumers can pin.

主要言語
Rust
スター
2
フォーク
0
平均マージ
12時間 11分
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ChainSafe/docker-socket-policy のほかの issue

ChainSafe/docker-socket-policy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。