Skip to content
gcp-iam logo

GCP IAM Management

gcp-iam

GCP IAM 서비스 계정 및 권한 관리

SKILL.md

Full skill instructions

GCP IAM Management

서비스 계정 생성, 역할 부여, 키 관리를 수행합니다.

사용법

/​gcp-iam                           # 서비스 계정 목록
/​gcp-iam create my-service         # 서비스 계정 생성
/​gcp-iam grant viewer              # 역할 부여
/​gcp-iam key my-service            # JSON 키 생성

Workflow

1. 서비스 계정 목록

PROJECT_ID=$(gcloud config get-value project)
gcloud iam service-accounts list --project=$PROJECT_ID \
  --format="table(email,displayName,disabled)"

2. 서비스 계정 생성

gcloud iam service-accounts create SA_NAME \
  --display-name="SA_DISPLAY_NAME" \
  --description="Description" \
  --project=$PROJECT_ID

3. 역할 부여

# 프로젝트 수준 역할
gcloud projects add-iam-policy-binding $PROJECT_ID \
  --member="serviceAccount:SA_NAME@$PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/​storage.objectViewer"

# 여러 역할 부여
for role in roles/​storage.objectViewer roles/​logging.logWriter; do
  gcloud projects add-iam-policy-binding $PROJECT_ID \
    --member="serviceAccount:SA_EMAIL" \
    --role="$role"
done

4. 역할 제거

gcloud projects remove-iam-policy-binding $PROJECT_ID \
  --member="serviceAccount:SA_EMAIL" \
  --role="roles/​ROLE_NAME"

5. JSON 키 생성

gcloud iam service-accounts keys create ./​sa-key.json \
  --iam-account=SA_EMAIL

6. 서비스 계정 삭제

gcloud iam service-accounts delete SA_EMAIL

자주 쓰는 역할

조회 전용

역할설명
roles/​viewer프로젝트 전체 읽기
roles/​storage.objectViewerStorage 객체 읽기
roles/​bigquery.dataViewerBigQuery 데이터 읽기
roles/​logging.viewer로그 읽기

쓰기 포함

역할설명
roles/​editor프로젝트 전체 편집
roles/​storage.objectAdminStorage 객체 관리
roles/​cloudsql.clientCloud SQL 접속
roles/​secretmanager.secretAccessorSecret 읽기

Cloud Run / Functions

역할설명
roles/​run.invokerCloud Run 호출
roles/​cloudfunctions.invokerFunctions 호출
roles/​run.adminCloud Run 관리

출력 형식

## 서비스 계정 목록

| 이메일 | 이름 | 상태 |
|--------|------|------|
| [email protected] | My Service Account | 활성 |
| [email protected] | Compute Engine SA | 활성 |

---

### [email protected] 역할

| 역할 | 범위 |
|------|------|
| roles/​storage.objectViewer | 프로젝트 |
| roles/​logging.logWriter | 프로젝트 |

현재 계정의 역할 확인

# 프로젝트 IAM 정책 조회
gcloud projects get-iam-policy $PROJECT_ID \
  --flatten="bindings[].members" \
  --format="table(bindings.role)" \
  --filter="bindings.members:SA_EMAIL"

모범 사례

  1. 최소 권한: 필요한 역할만 부여
  2. 서비스 계정 분리: 용도별로 별도 생성
  3. 키 관리:
    • 가능하면 키 대신 Workload Identity 사용
    • 키는 90일마다 순환
  4. 비활성화: 미사용 계정은 비활성화 후 삭제

주의사항

  • roles/​owner는 부여하지 않음 (보안 위험)
  • JSON 키는 안전하게 보관 (Git 커밋 금지!)
  • 키 유출 시 즉시 삭제 후 재생성

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View