firestore-security-rules-auditor
Firestore 보안 규칙 감사
Firestore 보안 규칙을 수동으로 검토하는 것은 시간이 많이 소요되고 오류가 발생하기 쉽습니다. 이 스킬은 Firebase 규칙의 취약점을 식별하기 위해 종합적인 침투 테스트 체크리스트를 사용하여 보안 감사를 자동화합니다.
스킬 ZIP 다운로드
Claude에서 업로드
설정 → 기능 → 스킬 → 스킬 업로드로 이동
토글을 켜고 사용 시작
테스트해 보기
"firestore-security-rules-auditor" 사용 중입니다. rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /users/{userId} { allow read: if request.auth != null; allow write: if request.auth.uid == userId; } } }
예상 결과:
Score: 4 (Minor)
Findings:
- check: 'Resource Exhaustion'
severity: minor
issue: 'No string length limits on user data fields'
recommendation: 'Add max() constraints for text fields'
- check: 'Type Safety'
severity: minor
issue: 'No type validation for fields like displayName'
recommendation: 'Use is string, is int checks'
"firestore-security-rules-auditor" 사용 중입니다. rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /posts/{postId} { allow read: if true; allow write: if request.auth != null; } } }
예상 결과:
Score: 2 (Major)
Findings:
- check: 'Authority Source'
severity: major
issue: 'Any authenticated user can write to any post'
recommendation: 'Add ownership check: resource.data.authorId == request.auth.uid'
- check: 'Business Logic'
severity: major
issue: 'No restrictions prevent users from deleting others posts'
recommendation: 'Require ownership for delete operations'
보안 감사
안전All 8 static findings evaluated as false positives. The skill is a legitimate Firebase security auditing tool that uses security testing terminology (e.g., 'find the hole in the wall', 'red team', 'penetration testing'). No external commands, cryptographic operations, or system reconnaissance code exists. The file contains only markdown documentation for an AI auditor skill.
감지된 패턴
품질 점수
만들 수 있는 것
배포 전에 새로운 보안 규칙 검토
업데이트된 Firestore 규칙을 출시하기 전에 Claude에 붙여넣고 보안 감사를 요청하세요. 몇 초 만에 점수와 실행 가능한 권장 사항을 얻을 수 있습니다.
보안 모범 사례 학습
감사 체크리스트와 발견 사항을 연구하여 일반적인 Firestore 보안 실수와 해결 방법을 이해하세요. Firebase 보안에 익숙하지 않은 개발자에게 좋습니다.
보안 코드 리뷰 지원
정식 보안 코드 리뷰의 출발점으로 이 스킬을 사용하세요. AI 발견 사항은 어떤 취약점을 먼저 처리할지 우선순위를 정하는 데 도움이 됩니다.
이 프롬프트를 사용해 보세요
Firestore 보안 규칙을 감사해야 합니다. 다음은 규칙입니다: [paste your firestore.rules] 보안 감사 체크리스트를 사용하여 평가하고 점수와 발견 사항을 제공해 주세요.
협업 앱용 Firestore 보안 규칙을 검토해 주세요. 규칙은 공동 작업자가 공유 문서를 읽을 수 있어야 하지만 삭제할 수 있는 사람은 소유자뿐이어야 합니다. 다음은 제 규칙입니다: [paste rules] 제 구현이 이러한 요구 사항과 일치합니까?
Firestore 규칙에 업데이트 바이패스 취약점이 있는지 확인해 주세요. 특히 사용자가 문서를 생성한 다음 'role' 또는 'isAdmin' 필드를 업데이트하여 무단 권한을 얻을 수 있는지 확인해야 합니다. 다음은 규칙입니다: [paste rules] 'create' 및 'update' 규칙을 주의 깊게 분석해 주세요.
프로덕션에 배포하기 전에 Firestore 규칙의 전체 보안 감사를 수행해 주세요. 감사 체크리스트의 모든 6개 항목을 확인하고 1-5점에서 점수를 매겨주세요.
모범 사례
- 문서 쓰기에 항상 소유권 확인 추가: resource.data.uid == request.auth.uid
- 데이터 손상을 방지하기 위해 모든 사용자 제공 필드에 유형 유효성 검사(is string, is int) 사용
- 리소스 소진 공격을 방지하기 위해 문자열 및 배열 필드에 크기 제한 설정
피하기
- 'role' 또는 'isAdmin'과 같은 민감한 필드에 request.resource.data를 사용하지 마세요
- 추가 인증 확인 없이 request.auth != null만 사용하지 마세요
- 사용자별 데이터가 포함된 문서에 'allow read: if true'를 그대로 두지 마세요