LoginSignup
1
0

More than 3 years have passed since last update.

Access Context ManagerのAccess levelの設定してみる

Last updated at Posted at 2020-05-13

はじめに

Access Context Managerは、他のGCPのサービスと組み合わせて細かなアクセス制御を行う事ができるサービスです。組み合わせるサービスによってサポートされていなアクセスレベルもあるため整理してみます。

Access Context Managerと組み合わせることができるサービスは、HTTPS用のIdentity-Aware Proxy(≒Context-aware access)、VPC Service ControlでAccess levelが定義できます。
定義できるAccess levelの種類は以下になります。

  • IP Subnetworks
  • Regions
  • Device Policy
  • Access Level Dependency
  • Member

Identity-Aware Proxy(IAP)のAccess levelの定義方法は、IAM Conditionsの設定時に以下の様な形式で設定します。

image.png

図にすると以下の様なイメージです。
image.png

VPC Service Controlは、Ingress Policyとして設定します。

image.png

結論

一部だけしか実機確認できてませんが、✔がついているものは確認しました。残りはまた今度。

image.png

実機確認

③IAP HTTPS * Device policy

"accessPolicies/663588214084/accessLevels/device" in
request.auth.access_levels

Macからのアクセス許可
image.png

成功
image.png

Windowsからのアクセス許可
image.png

失敗
image.png

⑥VPC Service Control * IP Subnetworks

X.X.X.156からアクセス
image.png

True
image.png

成功

$ gsutil ls
gs://test-dafakslefgajlke/

False
image.png

失敗

$ gsutil ls
AccessDeniedException: 403 Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: 37a1883ec1a3d73c

⑩VPC Service Control * Member

image.png

image.png

成功

#-> member
$ gsutil ls
gs://test-dafakslefgajlke/

失敗

#-> not member
$ gsutil ls
AccessDeniedException: 403 Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: 15c946a79f0fc64e

⑦VPC Service Control * Region

Japan
image.png

成功

$ gsutil ls
gs://test-dafakslefgajlke/

US
image.png

失敗

$ gsutil ls
AccessDeniedException: 403 Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: 37a1883ec1a3d73c
1
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
1
0