Repository navigation
feat(repo): owner-only DACL for .sc/local-key on Windows (#214) #279
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b8993f
feat(repo): owner-only DACL for .sc/local-key on Windows
tonibergholm-codento 709194a
ci: quote cache:: test filter (YAML)
tonibergholm-codento 6fa52f7
docs: owner-only local-key on Windows (THREAT-MODEL, ADR-0043, CLAUDE…
tonibergholm-codento 5c045d3
ci: windows check keeps going to list every failure
tonibergholm-codento c4c4122
fix: cfg-gate unix-only test and keygen code so the workspace checks …
tonibergholm-codento a44a8c6
fix(repo): review findings: no link-following on create, warn only af…
tonibergholm-codento f5e81c4
docs: list windows-sys in the third-party inventory
tonibergholm-codento dda866d
Merge origin/main into fix/214-windows-key-acl
tonibergholm-codento 0778eef
fix(repo,cli): warn at ACL fallback, long-path ACL, keygen never over…
tonibergholm-codento 2d74111
Merge branch 'main' into fix/214-windows-key-acl
tonibergholm-codento File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //! `sc keygen --out` must never overwrite an existing identity, on any | ||
| //! platform: the seed cannot be regenerated (#214 review). | ||
|
|
||
| use std::process::Command; | ||
|
|
||
| #[test] | ||
| fn keygen_refuses_to_overwrite_an_existing_identity() { | ||
| let dir = std::env::temp_dir().join(format!("scl-cli-keygen-{}", std::process::id())); | ||
| let _ = std::fs::remove_dir_all(&dir); | ||
| std::fs::create_dir_all(&dir).unwrap(); | ||
| let id = dir.join("alice.id"); | ||
| let keygen = || { | ||
| Command::new(env!("CARGO_BIN_EXE_sc")) | ||
| .args(["keygen", "--out", id.to_str().unwrap()]) | ||
| .current_dir(&dir) | ||
| .output() | ||
| .expect("sc runs") | ||
| }; | ||
|
|
||
| assert!(keygen().status.success()); | ||
| let first = std::fs::read(&id).unwrap(); | ||
|
|
||
| let again = keygen(); | ||
| assert!(!again.status.success(), "second keygen must fail"); | ||
| assert!( | ||
| String::from_utf8_lossy(&again.stderr).contains("refusing to overwrite"), | ||
| "{again:?}" | ||
| ); | ||
| assert_eq!(std::fs::read(&id).unwrap(), first, "identity untouched"); | ||
|
|
||
| std::fs::remove_dir_all(&dir).unwrap(); | ||
| assert!(!dir.exists()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes
windows-sysa direct dependency ofscl-repo, butdocs/security/third-party-inventory.mdstill lists only blake3, hex, libc, regex, serde, thiserror, and toml for that crate. The inventory's Maintenance section explicitly requires updating it in the same PR whenever a direct dependency is added, so includewindows-sysand its Windows ACL role to keep the security inventory accurate.Useful? React with 👍 / 👎.