A build repository or cache is reached over plain HTTP, so what it hands out can be replaced on the way

tx0/kotlin:insecure-build-repositoryrecommendedwarningsecurity/configurationdepth fastsecurity, cwe-494, cwe-319

What it finds

A repository reached over http:// hands out the libraries and plugins of the build without encryption or authentication of the server. Anyone on the network path, a public hotspot or a proxy, can replace a downloaded artifact with one that runs code in the build and ships in the product. allowInsecureProtocol = true exists only to permit exactly that.

Reported for http:// addresses in maven and ivy repositories of a repositories block, and for allowInsecureProtocol set to true, which also covers remote build caches. Addresses of the local machine are left alone.

From the rule's source, insecure_repository.rs.

Example from the rule's tests
repositories {    mavenCentral()    maven("http://repo.example.com/maven2")tx0 reports: the repository is reached over plain HTTP    maven {        url = uri("http://nexus.example.com/repository/public")tx0 reports: plain HTTP        isAllowInsecureProtocol = truetx0 reports: plain HTTP is allowed for this repository or build cache    }    maven("https://repo.example.com/maven2")    maven("http://localhost:8081/repository")} val docs = "http://example.com/docs"
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:insecure-build-repository" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/kotlin:insecure-build-repository] reason="..."

tx0 explain tx0/kotlin:insecure-build-repository shows the same in the terminal. Found a false positive? Report it.