VPC 서비스 제어는 데이터 무단 반출을 방지하기 위해 보안 경계를 설정할 수 있는 Google Cloud 기능입니다.
이 가이드는 VPC 서비스 제어 경계에 Cloud Scheduler 작업을 포함하는 방법을 보여줍니다.
제한사항
Cloud Scheduler의 VPC 서비스 제어 지원에는 다음과 같은 제한사항이 적용됩니다.
적용되는 작업
VPC 서비스 제어는 다음 작업에만 적용됩니다.
Cloud Scheduler 작업 생성
Cloud Scheduler 작업 업데이트
이 작업이 왜 중요한가요?
VPC 서비스 제어는 작업 만들기 및 작업 업데이트에만 적용되므로 VPC 서비스 제어는 Cloud Scheduler를 VPC 서비스 제어 경계에 추가하기 전에 생성된 작업에는 자동으로 적용되지 않습니다. 작업 대상이 VPC 서비스 제어 경계에 속하지 않거나 지원되는 대상이 아니더라도 작업은 계속 실행됩니다. 모든 Cloud Scheduler 작업에 VPC 서비스 제어를 적용하려면 다음을 수행합니다.
Cloud Scheduler를 VPC 서비스 제어 경계에 추가하기 전에 이러한 작업을 삭제하지 않으면 작업이 계속 실행되지만 VPC 서비스 제어가 적용되지 않습니다(참고:적용된 작업 참조하세요.
예를 들어 지원되지 않는 대상(예: Cloud Run 커스텀 도메인)을 타겟팅하는 Cloud Scheduler 작업이 있는 경우 VPC 서비스 제어 경계에 Cloud Scheduler를 추가한 후에도 작업이 계속 실행되지만 VPC 서비스 제어로 보호되지는 않습니다. VPC 서비스 제어 경계 외부에 대상이 있는 기존 작업에도 동일하게 적용됩니다.
필수 IAM 역할 추가
필수 항목입니다. VPC 서비스 제어를 사용하려면 Cloud Scheduler 서비스 계정에 Cloud Scheduler 서비스 에이전트 IAM 역할이 있어야 합니다. Cloud Scheduler 서비스 계정은 프로젝트에 대해 자동으로 생성됩니다. Cloud Scheduler 서비스 에이전트 IAM 역할이 있는지 확인하거나 이 역할을 부여하려면 다음 단계를 수행합니다.
Cloud Scheduler 서비스 계정 주 구성원의 역할 열을 확인합니다. 다음 역할이 나열되었으면 계속 진행할 수 있습니다.
Cloud Scheduler 서비스 에이전트
Cloud Scheduler 서비스 계정 역할이 없는 경우 수정 아이콘을 클릭하고 Cloud Scheduler 서비스 계정 주 구성원에 Cloud Scheduler 서비스 에이전트 역할을 부여합니다.
VPC 서비스 제어 경계 지정
필수 항목입니다. 기존 경계를 사용하거나 새 경계를 만들어 대상을 지원하는 Cloud Scheduler 작업을 보호할 수 있습니다. 두 가지 방법 모두 제한할 서비스를 지정할 수 있습니다.
Cloud Scheduler API를 지정합니다.
기존 경계: Cloud Scheduler를 포함하도록 기존 VPC 서비스 제어 경계를 업데이트하려면 서비스 경계 업데이트 단계를 수행합니다.
새 경계: Cloud Scheduler의 새 경계를 만들려면 서비스 경계 만들기의 단계를 따르세요.
기존 작업에 VPC 서비스 제어 적용
권장사항입니다. Cloud Scheduler를 VPC 서비스 제어 경계에 추가하기 전에 만든 Cloud Scheduler 작업에 VPC 서비스 제어를 적용하려면 작업에서 update를 실행합니다. 작업을 변경할 필요는 없지만 VPC 서비스 제어가 작업 및 이후 실행에 적용되도록 하려면 업데이트를 실행해야 합니다.
Google Cloud 콘솔(작업 선택 및 수정 버튼 사용), API 또는 gcloud CLI를 사용해서 작업 업데이트를 실행할 수 있습니다.
gcloud CLI를 사용하여 기존 작업에 VPC 서비스 제어를 적용하려면 다음을 실행합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[],[],null,["# Secure cron jobs with VPC Service Controls\n\n[VPC Service Controls](/vpc-service-controls/docs/overview) is a Google Cloud feature\nthat lets you set up a secure perimeter to guard against data exfiltration.\nThis guide shows how to include Cloud Scheduler jobs in a\nVPC Service Controls perimeter.\n\nLimitations\n-----------\n\nThe following limitations apply to VPC Service Controls support for\nCloud Scheduler.\n\n### Enforced actions\n\nVPC Service Controls is only enforced on the following actions:\n\n- Cloud Scheduler job creation\n- Cloud Scheduler job updates\n\n#### Why does this matter?\n\nBecause VPC Service Controls is only enforced on job creation and job updates,\nVPC Service Controls is not automatically enforced for jobs that were\ncreated before you added Cloud Scheduler to your VPC Service Controls\nperimeter. Jobs continue to execute even if the job targets aren't part of your\nVPC Service Controls perimeter or are not [supported targets](#targets). To\nenforce VPC Service Controls for all Cloud Scheduler jobs:\n\n- **Jobs with targets that are either unsupported or are outside your\n perimeter:** Delete the jobs. In this document, see [Delete non-compliant jobs](#non-compliant).\n- **Jobs with targets that are both supported and inside your perimeter:** Run an update on each job after adding Cloud Scheduler to your perimeter. In this document, see [Enforce VPC Service Controls on pre-existing jobs](#preexisting).\n\n### Supported targets\n\nThe Cloud Scheduler integration with VPC Service Controls supports\nthe following targets. HTTP endpoints are supported if listed; however,\narbitrary HTTP endpoints are *not* supported.\n\n- Cloud Run functions---on the `functions.net` URL\n- Cloud Run---on the `run.app` URL for Cloud Run services. Cloud Run job targets are not supported. To learn about the difference between Cloud Run service and job resources, see [Services and jobs: two ways to run your code](/run/docs/overview/what-is-cloud-run#services-and-jobs).\n- Dataflow API---must be in the same Google Cloud project as your Cloud Scheduler job\n- Data Pipelines---must be in the same Google Cloud project as your Cloud Scheduler job\n- Pub/Sub---must be in the same Google Cloud project as your Cloud Scheduler job\n\nDelete non-compliant jobs\n-------------------------\n\nRecommended. Delete Cloud Scheduler jobs with targets that are\neither:\n\n- Unsupported (see [Supported targets](#targets))\n- Outside of the VPC Service Controls perimeter you plan to use\n\nFor instructions on deleting jobs, see\n[Delete a job](/scheduler/docs/creating#delete).\n\nIf you don't delete these jobs before adding Cloud Scheduler to\nyour VPC Service Controls perimeter, the jobs continue to run, but\nVPC Service Controls is not enforced on them. In this document, see\n[Enforced actions](#enforced-actions).\n\nFor example, if you have a Cloud Scheduler job that targets an\nunsupported target (such as a Cloud Run custom domain), the job\ncontinues to run after you add Cloud Scheduler to your\nVPC Service Controls perimeter, but it is not protected by VPC Service Controls. The\nsame is true for a pre-existing job with a target outside of your\nVPC Service Controls perimeter.\n\nAdd required IAM roles\n----------------------\n\nRequired. In order to use VPC Service Controls, the Cloud Scheduler\nservice account must have the **Cloud Scheduler Service Agent**\nIAM role. The Cloud Scheduler service account is created\nfor your project automatically. To verify that it has the Cloud Scheduler\nService Agent IAM role, or to grant this role, take the following\nsteps:\n\n1. In the Google Cloud console, go to **IAM**.\n\n [Go to IAM](https://console.cloud.google.com/iam-admin)\n2. Select the **Include Google-provided role grants** checkbox.\n\n3. In the filter, type **Cloud Scheduler Service Account**, and select this\n principal.\n\n4. Look at the **Role** column for the **Cloud Scheduler Service Account**\n principal. You can proceed if the following role is listed:\n\n - **Cloud Scheduler Service Agent**\n\n If the Cloud Scheduler Service Account role is not listed, click the\n **Edit** icon and grant the **Cloud Scheduler Service Agent** role to the\n Cloud Scheduler Service Account principal.\n\nSpecify a VPC Service Controls perimeter\n----------------------------------------\n\nRequired. You can use an existing perimeter or create a new perimeter to\nprotect your Cloud Scheduler jobs that have supported\ntargets. Both approaches give you the chance to specify services to restrict.\nSpecify the **Cloud Scheduler API**.\n\n- **Existing perimeters:** To update an existing VPC Service Controls perimeter\n to include Cloud Scheduler, follow the steps for\n [updating a service perimeter](/vpc-service-controls/docs/manage-service-perimeters#update).\n\n- **New perimeters:** To create a new perimeter for Cloud Scheduler,\n follow the steps to\n [create a service perimeter](/vpc-service-controls/docs/create-service-perimeters).\n\nEnforce VPC Service Controls on pre-existing jobs\n-------------------------------------------------\n\nRecommended. To enforce VPC Service Controls on Cloud Scheduler jobs\nthat you created before you added Cloud Scheduler to your\nVPC Service Controls perimeter, run an `update` on the job. You don't have to\nchange the job, but you must run the update in order for VPC Service Controls to\napply to the job and its future executions.\n\nYou can run an update for the job from the Google Cloud console (select\nthe job and use the **Edit** button), using the API, or with the\ngcloud CLI.\n\nTo enforce VPC Service Controls on a pre-existing job by using the\ngcloud CLI, run the following: \n\n### HTTP targets\n\n```bash\ngcloud scheduler jobs update http JOB_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eJOB_ID\u003c/var\u003e: the ID of your job\n\n### Pub/Sub targets\n\n```bash\ngcloud scheduler jobs update pubsub JOB_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eJOB_ID\u003c/var\u003e: the ID of your job"]]