0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

3日目:AWS無料枠使い倒し「IAMで安全な権限管理を始める」

0
Last updated at Posted at 2025-12-03

IAMで安全な権限管理を始める

AWSを使うなら、まずはセキュリティを固めることが重要です。3日目は「IAM(Identity and Access Management)」を使った安全な権限管理の基本を紹介します。


✅ この記事でやること

  • IAMの役割と重要性
  • ベストプラクティス(ルートユーザーを使わない、MFA必須)
  • IAMユーザー+グループ+ポリシーの設定
  • CLIでの作成例

1. IAMとは?

IAMはAWSリソースへのアクセスを管理するサービスです。誰が何をできるかを制御する仕組みで、セキュリティの要となります。


2. なぜルートユーザーを使わない?

  • ルートユーザーは全権限を持つ特権アカウント
  • 誤操作や漏洩時のリスクが最大
  • ベストプラクティス:
    • ルートユーザーは請求管理やアカウント設定のみ
    • 日常業務はIAMユーザーやロールで実施

3. IAMの基本構成

  • ユーザー:人やアプリに対応
  • グループ:複数ユーザーをまとめて権限付与
  • ポリシー:JSON形式で権限を定義
  • ロール:一時的な権限付与(EC2やLambdaで利用)

4. ベストプラクティス

  • MFA(多要素認証)を必須化
  • 最小権限の原則:必要な操作だけ許可
  • IAMアクセスキーは定期ローテーション
  • ポリシーはAWS管理ポリシーから始める

5. IAMユーザーを作成(CLI例)

✅ 管理者グループを作成

aws iam create-group --group-name AdminGroup

✅ 管理ポリシーをアタッチ

aws iam attach-group-policy   --group-name AdminGroup   --policy-arn arn:aws:iam::aws:policy/AdministratorAccess

✅ ユーザーを作成

aws iam create-user --user-name dev-user

✅ ユーザーをグループに追加

aws iam add-user-to-group   --user-name dev-user   --group-name AdminGroup

✅ コンソールログイン用パスワードを設定

aws iam create-login-profile   --user-name dev-user   --password 'StrongPassword123!'   --password-reset-required

✅ MFAを有効化(GUI操作)

  • IAMコンソール → ユーザー → セキュリティ認証情報 → MFAデバイスを割り当て
  • 仮想MFA(Google Authenticatorなど)推奨

✅ 今日のコスト

$0.00(IAMは無料)


✅ 運用のコツ

  • IAMユーザーは個人単位で作成(共有禁止)
  • アクセスキーは必要な場合のみ発行
  • CloudTrailで操作履歴を記録

✅ 次回予告(4日目)

「VPCの基礎:ネットワークを作る第一歩」

  • サブネット、ルートテーブル、インターネットゲートウェイ
  • CLIでVPCを構築

✅ まとめ

  • ルートユーザーは使わない
  • IAMで権限管理を徹底
  • MFA+最小権限でセキュリティ強化

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?