Skip to content

Commit e8fe462

Browse files
committed
CI example
1 parent ea82527 commit e8fe462

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

text/0000-cargo-asymmetric-tokens.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Persistent shared secrets are rife with opportunities for things to go wrong.
1919
For some examples:
2020
- The user can unintentionally share the file containing the token. This was unfortunately common when it was stored in `.cargo/config`, which is why it is now stored in `credentials.toml` by default.
2121
- The file containing the token can be read at rest. File permissions are used to protect it, but can only go so far. [Credential processes](https://github.com/rust-lang/rfcs/blob/161ce8a26e70226a88e0d4d43c7914a714050330/text/2730-cargo-token-from-process.md) can do better *if* they are used.
22+
- If the token is ever logged and the logs are public, then the token is public. This is fairly easy to do accidentally in CI contexts. Cargo now redacts the token in its own logging, but if network traffic is logged there is still an issue.
2223
- If a user configures a custom registry to use `http` instead of `https`, then anyone on the network can see the token go by.
2324
- If a user misconfigures a token to go to the wrong registry (typosquatting, homoglyph, or copy-paste error), then the recipient has the token.
2425
- If a registry does not adequately protect its copy of the tokens then a database disclosure can leak all the users' tokens. ([cc: crates.io security advisory](https://blog.rust-lang.org/2020/07/14/crates-io-security-advisory.html))
@@ -129,6 +130,10 @@ If a registry were set up to exclusively use the new asymmetric tokens, how well
129130
130131
Many more kinds of security hardware devices can protect a private key then can protect an arbitrary secret token. Hardware devices can store a private key and only perform operations using that key, without making the key itself available.
131132

133+
> If the token is ever logged and the logs are public, then the token is public. This is fairly easy to do accidentally in CI contexts. Cargo now redacts the token in its own logging, but if network traffic is logged there is still an issue.
134+
135+
It is still possible for someone to log the private key. However, the signed asymmetric token is not secret. So all other things (like network traffic) can be logged safely.
136+
132137
> If a user configures a custom registry to use `http` instead of `https`, then anyone on the network can see the token go by.
133138
134139
Content shared over the network is not secret. The opportunity for replay attacks is significantly limited. If the operation is mutating then the token can only be used for the intended operation. If it is a read operation, if the request returns meaningful results then the attacker can already see it without reusing the token. But, as the token includes the URL it can not be used on the `https` address.

0 commit comments

Comments
 (0)