다양한 개발 워크플로 환경의 일반적인 보안 가이드라인
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 다양한 환경에서 보안을 위한 가장 중요한 권장사항을 설명하지만 보안 체크리스트에서 보안 및 Firebase에 대한 자세한 안내를 확인할 수 있습니다.
사전 프로덕션 환경을 위한 보안
여러 Firebase 프로젝트에서 환경을 분리하는 한 가지 이점은 사전 프로덕션 환경에 액세스할 수 있는 악의적인 행위자가 실제 사용자 데이터에 액세스할 수 없다는 것입니다. 다음은 사전 프로덕션 환경에서 취해야 할 가장 중요한 보안 주의 사항입니다.
사전 프로덕션 환경에 대한 액세스를 제한합니다. 모바일 앱의 경우 App Distribution(또는 유사한 앱)를 사용하여 소수의 특정 사용자에 앱을 배포합니다. 웹 애플리케이션은 제한하기 어렵습니다. 본인의 도메인에 해당하는 이메일 주소가 있는 사용자에게만 액세스를 한정하는 사전 프로덕션 환경용 차단 함수를 설정하는 것이 좋습니다. 또는 Firebase Hosting을 사용하고 있는 경우 임시 미리보기 URL을 사용하도록 사전 프로덕션 워크플로를 설정합니다.
환경을 유지할 필요가 없고 한 사람(또는 테스트의 경우 하나의 머신)만 사용하는 경우 Firebase Local Emulator Suite을 사용합니다. 이러한 에뮬레이터는 클라우드 리소스를 사용하는 대신 localhost에서 완전히 작동할 수 있으므로 더 안전하고 빠릅니다.
프로덕션에서와 마찬가지로 사전 프로덕션 환경에서 Firebase Security Rules를 설정했는지 확인합니다. 일반적으로 Rules는 환경 간에 동일해야 하며 코드에 따라 변경되므로 아직 프로덕션에 존재하지 않는 파이프라인의 초기 규칙이 있을 수 있다는 점에 유의해야 합니다.
프로덕션 환경을 위한 보안
앱이 숨겨져 있더라도 프로덕션 데이터는 항상 타겟이 됩니다. 이 가이드라인을 준수하더라도 악의적인 행위자가 데이터를 가져오는 것이 불가능하지는 않지만 더 어렵게 만들 수는 있습니다.
지원하는 경우 사용 중인 모든 제품에 대해 App Check를 사용 설정하고 실행합니다. App Check는 백엔드 서비스에 대한 요청이 정품 앱에서 전송되었는지 확인합니다. 이 기능을 사용하려면 App Check에 앱의 각 버전을 등록해야 합니다. 사용자가 생기기 전에 간편하게 설정할 수 있으므로 가능한 한 빨리 설정하세요.
강력한 Firebase Security Rules을 작성합니다. Realtime Database, Cloud Firestore, Cloud Storage 모두 개발자가 구성한 Rules을 사용하여 데이터에 액세스할 수 있는 사용자와 액세스할 수 없는 사용자에 적용합니다. 안전한 Rules를 작성하는 것은 보안에 중요합니다. 방법을 잘 모른다면 이 codelab부터 시작하세요.
프로덕션 환경의 보안에 관한 권장사항은 보안 체크리스트를 검토하세요.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-04(UTC)
[null,null,["최종 업데이트: 2025-08-04(UTC)"],[],[],null,["This page describes the most important best practices for security across\nenvironments, but review the\n[*Security checklist*](/support/guides/security-checklist) for more detailed and\nthorough guidance about security and Firebase.\n\nSecurity for pre-production environments\n\nOne benefit of separating environments in different Firebase projects is that a\nmalicious actor who is able to access your pre-prod environments won't be able\naccess real user data. Here are the most important security precautions to take\nfor pre-production environments:\n\n- Limit access to pre-prod environments. For mobile apps, use\n [App Distribution](/docs/app-distribution) (or something similar) to distribute\n an app to a specific set of people. Web applications are harder to restrict;\n consider setting up a\n [blocking function](https://cloud.google.com/identity-platform/docs/blocking-functions)\n for the pre-prod environments that restricts access to users with email\n addresses that are specific to your domain. Or, if you're using\n Firebase Hosting, set up your pre-prod workflows to use\n [temporary preview URLs](/docs/hosting/test-preview-deploy).\n\n- When an environment doesn't need to be persisted and is only being used by one\n person (or in the case of tests, by one machine) use the\n [Firebase Local Emulator Suite](/docs/emulator-suite). These emulators are safer\n and faster because they can work entirely on localhost instead of using cloud\n resources.\n\n- Make sure that you have [Firebase Security Rules](/docs/rules) set up in pre-production\n environments, just as you do in prod. In general, the Rules should\n be the same across environments, with the caveat that since rules change with\n code, there may be rules earlier in the pipeline that don't yet exist in\n production.\n\nSecurity for production environments\n\nProduction data is always a target, even if the app is obscure. Following these\nguidelines doesn't make it impossible for a malicious actor to get your data,\nbut it makes it more difficult:\n\n- Enable and enforce [App Check](/docs/app-check) for all the products\n you're using that support it. App Check makes sure that requests to your\n backend services are coming from your genuine apps. In order to use it, you\n need to register each version of your app with App Check. It's easier to\n set up before you have users, so set it up as soon as possible.\n\n- Write robust [Firebase Security Rules](/docs/rules). Realtime Database, Cloud Firestore, and\n Cloud Storage all rely on developer-configured Rules to\n enforce who should and shouldn't be able to access data. It's essential to\n your security that you write good Rules. If you're not sure how,\n start with this [codelab](/codelabs/firebase-rules).\n\n- Review the [*Security checklist*](/support/guides/security-checklist) for more\n recommendations about security for production environments.\n\nNext steps\n\n- Review the [Firebase launch checklist](/support/guides/launch-checklist)."]]