错误 : 错误: (gcloud.logging.sinks.create) 用户 [nataraj@somedomai



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

环境:我正在使用 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] (或可能不存在(:调用方没有权限。

应用程序接口

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&alt=json。这就是我们所知道的。

根据本文档澄清@Nataraj注释作为答案,

您必须具有父级的日志配置编写器 IAM 角色才能 创建接收器。

因此,给予

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

但是,此类权限可以更精细地按父级(组织(进行,本访问控制指南应该会有所帮助。另一方面,最佳做法是授予角色并配置对服务帐户(而不是用户(的所有权/访问权限。

最新更新