Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

蓝鲸7.1.2,蓝盾2.0,代码关联问题 #10329

Closed
pengkang1991 opened this issue May 13, 2024 · 5 comments
Closed

蓝鲸7.1.2,蓝盾2.0,代码关联问题 #10329

pengkang1991 opened this issue May 13, 2024 · 5 comments
Labels
question Needs more information

Comments

@pengkang1991
Copy link

【产品】蓝鲸7.1.2
【版本】蓝盾2.0
蓝盾里面的关联代码库这一块,能否直接使用账号密码或者公钥直接就能关联上gitlab 呀,我发现怎么除了账号密码还需要填写token?、

而gitlab里面tonken的最长有效期就是一年,岂不是每年都要更新一下token,几百个仓库更新起来会要人命的。能否直接使用账号密码就关联上gitlab???不要填token。

@pengkang1991 pengkang1991 added the kind/enhancement 功能改进特性 label May 13, 2024
@irwinsun
Copy link
Member

irwinsun commented May 20, 2024

gitlab是可以只使用accesstoken的, 你可以看看,不用ssh的方式。用accesstoken的方式, 这样你把accesstoken保存到【凭证管理】中 ,每年定期去更新这一个位置就可以了, 几百个仓库都引用这个accesstoken凭证,不就可以了?

image

以下图可以看看操作方式

image image image image

@irwinsun irwinsun added question Needs more information and removed kind/enhancement 功能改进特性 labels May 20, 2024
@pengkang1991
Copy link
Author

pengkang1991 commented May 20, 2024 via email

@irwinsun
Copy link
Member

其实这个是个管理的问题, 用户期望的只使用账号密码,而不希望用token,只是单纯从维护角度来考虑, 但没有站在安全上考虑。 密码不过期一直是个安全上的大隐患, 如果贵司哪天安全团队要求让所有人的密码每3个月轮换一次,那么一样要面临这个问题。

然后我刚才又看了一下,你说的gitlab仓库需要 帐号密码+token 这个场景。 我找了一下,gitlab仓库只有2种凭证方式
1、 SSH私钥+私有Token
2、 AccessToken
并没有你说的 账号密码+token的场景。

先说说第1种: SSH私钥+私有Token。 SSH私钥是负责拉代码, 而Token是gitlab api需要的认证方式,如果没有token,则无法实现通过gitlab api去注册 webhook注册回调、拉分支、tag等一序列的操作。 因此token是必需要的。

第2种: AccessToken , 这个就是gitlab官方推荐的拉代码和api的统一认证方式。

最后,如果涉及到数十个项目要更新,那么最便捷的方式,就是通过平台的api调用去更新凭证是一个更好的办法

https://docs.bkci.net/reference/rest-api/certificate-resources/edit-credentials

还有一个问题就是,几百个仓库要分几十个项目去控制权限,而凭证管理又没有公共凭证,岂不是每个项目都要新增一个凭证,到时候修改起来也麻烦。

------------------ 原始邮件 ------------------ 发件人: "TencentBlueKing/bk-ci" @.>; 发送时间: 2024年5月20日(星期一) 上午10:09 @.>; @.@.>; 主题: Re: [TencentBlueKing/bk-ci] 蓝鲸7.1.2,蓝盾2.0,代码关联问题 (Issue #10329) gitlab是可以只使用accesstoken的, 你可以看看,不用ssh的方式。用accesstoken的方式, 这样你把accesstoken保存到【凭证管理】中 ,每年定期去更新这一个位置就可以了, 几百个仓库都引用这个accesstoken凭证,不就可以了? 以下图可以看看操作方式 image.png (view on web) image.png (view on web) image.png (view on web) image.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

@irwinsun
Copy link
Member

补充一下,无论是用的哪个类型代码库,是github还是gitlab,本质上在关联时要求用哪种凭据,那都是目标代码库的要求, 不是用户所能决定要不要的

@pengkang1991
Copy link
Author

pengkang1991 commented May 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Needs more information
Projects
None yet
Development

No branches or pull requests

2 participants