简体   繁体   English

什么是基于 DNS 的 Maven 组 ID?

[英]What is a DNS-Based Maven Group Id?

I am studying if our Java application is vulnerable to Dependency Confusion and came over this link .我正在研究我们的 Java 应用程序是否容易受到Dependency Confusion的影响,并通过此链接访问。 The second condition says:第二个条件说:

There is a remote repository configured that lets anyone claim group ids without verification or you use internal packages with a group id that’s not DNS-based.

What does it mean to use a dependency that the group id is not DNS-based?使用组 ID 不是基于 DNS 的依赖关系是什么意思? How do you classify a dependency as DNS-based?您如何将依赖项分类为基于 DNS 的? Never heard anything like that before, I'd be glad if you can enlighten me.从来没有听说过这样的事情,如果你能启发我,我会很高兴。

It means, that the group ID should start with a reversed domain name you control.这意味着,组 ID 应该以您控制的反向域名开头。 Eg, if you control the domain example.com, you should choose com.example as group ID, or choose a group ID that starts with com.example.例如,如果您控制域 example.com,则应选择 com.example 作为组 ID,或者选择以 com.example 开头的组 ID。 The wording DNS may be a little bit misleading here, as this is more about the domain name, and less about the system (servers). DNS 的措辞在这里可能有点误导,因为这更多的是关于域名,而不是关于系统(服务器)。 See here: Maven - Guide to Naming Conventions请参阅此处: Maven - 命名约定指南

The Dependency Confusion attack is about an attacker who embeds malicious code into a new version of a (popular) piece of software and publishes it to a public repository, so that it will automatically be integrated into applications that always use the latest version of the software. Dependency Confusion 攻击是指攻击者将恶意代码嵌入到(流行)软件的新版本中并将其发布到公共存储库,以便自动集成到始终使用最新版本软件的应用程序中. Therefore, it is crucial that the repository can somehow verify that the person who posts a new software artifact is authorized to publish that particular artifact.因此,存储库能够以某种方式验证发布新软件工件的人是否有权发布该特定工件是至关重要的。 If, for example, reversed group ID of the artifacts and user email domain name don't match, then this could be an indication that the user should not be authorized to publish that artifact, as he is probably not part of the organization, that is responsible for maintaining the artifact.例如,如果工件的反向组 ID 和用户 email 域名不匹配,那么这可能表明用户不应被授权发布该工件,因为他可能不是组织的一部分,即负责维护工件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM