本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)35k · #8061

implementing-immutable-backup-with-restic

できること

このツールは、一定期間削除や変更ができないバックアップを作成し、ランサムウェアや誤削除からデータを守ります。バックアップが壊れていないかを検証し、復元のテストも行います。

使う場面

  • ✓ランサムウェアに強いバックアップを設定するとき。
  • ✓変更できないデータのコピー(WORM)を用意したいとき。
  • ✓バックアップの検証と復元テストを自動化したいとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-immutable-backup-with-restic/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-immutable-backup-with-restic/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“重要なファイルについて、保持期間90日の変更不可バックアップを設定してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

Resticというプログラムを使い、データを暗号化して、Amazon S3やMinIOなどの安全な保存先に保存します。この設定により、一度保存されたデータは、定められた保持期間が終わるまで削除も変更もできなくなります。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Implementing Immutable Backup with Restic

When to Use

  • Establishing ransomware-resistant backup infrastructure with cryptographic integrity verification
  • Implementing 3-2-1-1-0 backup strategy where the extra 1 is an immutable copy
  • Automating backup verification workflows that test restore capability on a schedule
  • Protecting backup repositories from deletion or modification by compromised admin accounts
  • Meeting compliance requirements for data retention with tamper-proof storage

Do not use as the sole backup solution without also maintaining offline/air-gapped copies. Object lock protects against logical deletion but not physical storage failure.

Prerequisites

  • restic binary installed (https://restic.readthedocs.io/)
  • S3-compatible storage with Object Lock enabled (AWS S3, MinIO, Backblaze B2)
  • Python 3.8+ with subprocess module
  • AWS CLI or MinIO client (mc) configured for bucket access
  • Sufficient storage for backup repository (typically 2-3x source data with deduplication)

Workflow

Step 1: Initialize Restic Repository with Encryption

Create an encrypted restic repository on S3-compatible storage with object lock enabled. Restic uses AES-256-CTR for encryption with Poly1305-AES for authentication, ensuring backup data is both confidential and tamper-evident.

Step 2: Configure Object Lock Retention

Enable S3 Object Lock in Compliance mode on the backup bucket to prevent any principal (including root) from deleting or modifying objects during the retention period. Set retention to match your backup window requirements (typically 30-90 days).

Step 3: Automate Backup and Verification

Schedule backup operations with post-backup integrity verification using restic check --read-data which downloads and verifies every data blob against its stored checksum. Log results and alert on any integrity failures.

Step 4: Test Restore Procedures

Periodically restore random files from backup snapshots to a temporary location and compare checksums against the original to validate end-to-end backup integrity. Document restore times for RTO planning.

Key Concepts

Term Definition
Object Lock S3 feature that prevents object deletion or overwrite for a specified retention period
Compliance Mode Object Lock mode where even the root account cannot delete objects before retention expires
Deduplication Restic stores data in content-addressable chunks, deduplicating across all snapshots
3-2-1-1-0 3 copies, 2 media types, 1 offsite, 1 immutable, 0 errors in verification

Tools & Systems

  • restic: Fast, secure, cross-platform backup tool with built-in encryption and deduplication
  • resticpy: Python wrapper for restic CLI operations
  • AWS S3 Object Lock: WORM storage for tamper-proof backup retention
  • MinIO: Self-hosted S3-compatible storage with Object Lock support

Output Format

BACKUP VERIFICATION REPORT
===========================
Repository: s3:s3.amazonaws.com/company-backups-immutable
Snapshots: 45
Total Size: 2.3 TiB (deduplicated from 8.7 TiB)
Last Backup: 2026-03-11T02:00:00Z
Integrity Check: PASSED (all packs verified)
Object Lock: Compliance mode, 90-day retention
Restore Test: PASSED (15 files verified)
よくある質問

「イミュータブル(変更不可)」とは何ですか?

一度保存されたデータを、一定期間削除も変更もできないことです。石に刻んだように、後から書き換えられない状態を指します。

Object Lockとは何ですか?

Amazon S3などの一部のストレージサービスが持つ機能で、こうした変更不可のバックアップを作成できるようにします。

ほかにもバックアップは必要ですか?

はい。このツールは追加の保護層です。オフラインの場所や別の場所にもコピーを保管する、3-2-1戦略をお勧めします。

詳細

作者による元の説明

Implements ransomware-resistant backups using restic with S3-compatible Object Lock (AWS S3, MinIO, Backblaze B2), automating backup creation, integrity checks via restic check --read-data, retention enforcement, and restore testing. Use when building immutable backup infrastructure, adding a WORM copy to a 3-2-1-1-0 strategy, or automating scheduled backup-verification workflows. '

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8061
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル