错误:错误:(gcloud.logging.sinks.create)用户[nataraj @ somedomaindonamehere]无权访问组织

时间:2018-05-23 05:22:07

标签: google-cloud-storage stackdriver

我正在尝试创建一个接收器来监视组织中所有项目的VPC_FLOW LOGS,并且我被拒绝许可,是否有其他人有类似的问题?错误很明显,它被允许拒绝,但我需要什么权限来创建它?

环境:我正在使用somebody@domainname.com(gsuite用户)

进行登录

从命令行:

gcloud beta logging sinks create somesinknamehere --include-children --log-filter='resource.type="gce_subnetwork"' storage.googleapis.com/somebuckethere   --organization=organizations/0000000000

错误:错误:(gcloud.logging.sinks.create)用户[nataraj @ somedomaindonamehere]无权访问组织[0000000000](或者可能不存在):调用者没有权限。

API

Request

POST https://logging.googleapis.com/v2/organizations/00000000000/sinks?key={YOUR_API_KEY}

{
 "destination": "storage.googleapis.com/somebucket",
 "filter": "resource.type=\"gce_subnetwork",
 "name": "somenamehere",
 "includeChildren": true
}

Response

403

- Show headers -

{
 "error": {
  "code": 403,
  "message": "The caller does not have permission",
  "status": "PERMISSION_DENIED"
 }
}

我尝试了测试版API,下面是回复

Request

POST https://logging.googleapis.com/v2beta1/organizations/0000000000/sinks?key={YOUR_API_KEY}

{
“destination”: “storage.googleapis.com/somebucketnamehere”,
“filter”: “resource.type=\“gce_subnetwork”,
“name”: “somesinknamehere”,
“includeChildren”: true
}

响应

404

Show headers -
<title>Error 404 (Not Found)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px} </style>
404. That’s an error.

在此服务器上找不到请求的URL / v2beta1 / organizations / 0000000000 / sinks?key = somekeynamehjere&amp; alt = json。这就是我们所知道的。

1 个答案:

答案 0 :(得分:0)

根据此document,将@Nataraj注释澄清为答案,

  

对于父级,您必须具有Logs Configuration Writer IAM角色   创建水槽。

因此,给出

  

1)组织管理员,2)计费管理员和3)   记录管理员角色

但是,每个父级(组织)的权限可能更精细,而此access control guide应该会有所帮助。另外,最好的做法是向service accounts(而不是用户)授予角色并配置所有权/访问权限。