Skip to content

Conversation

@caarlos0
Copy link
Contributor

@caarlos0 caarlos0 commented Dec 7, 2021

Summary

  • create certificates and signature with less permissions (0600 vs 0666 - the default of os.Create
  • improve error handling a bit by wrapping the errors

Ticket Link

n/a

Release Note

--output-signature and --output-certificate now created with 0600 permissions

Signed-off-by: Carlos A Becker <[email protected]>
@dekkagaijin dekkagaijin merged commit 96c02ba into sigstore:main Dec 7, 2021
@github-actions github-actions bot added this to the v1.4.0 milestone Dec 7, 2021
@caarlos0 caarlos0 deleted the perms branch December 7, 2021 01:30
@cpanato cpanato modified the milestones: v1.4.0, v1.4.1 Dec 7, 2021
vszakats added a commit to curl/curl-for-win that referenced this pull request May 14, 2025
install cosign

pass cosign key to GHA dev builds (temp)

cosign requires debian trixie

cosign zip/tar artifacts

cosign test 2

try cosign 3

do not fail if cosign is missing

clenaups/fixes

clenaups/fixes more

scope vars

try retrofitting to bookworm

another fix for no cosign

add to README, add public key

gen cosign sig and pem

README more

bookworm fixup

try cleanup key path

debug cosign sig permissions

```
Collecting artifacts...
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.zip.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.tar.xz.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.zip.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.zip.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.zip.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.tar.xz.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.tar.xz' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.zip.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.tar.xz.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.zip.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.zip' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win32-mingw-test.tar.xz.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.tar.xz' matching '*-*-mingw*.*' path
Found artifact 'all-mingw-8.14.0-DEV_3.zip.txt' matching 'all-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.tar.xz' matching '*-*-mingw*.*' path
Found artifact 'all-mingw-8.14.0-DEV_3.zip.cosign.sig' matching 'all-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.zip' matching '*-*-mingw*.*' path
Found artifact 'all-mingw-8.14.0-DEV_3.zip' matching 'all-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.tar.xz.cosign.sig' matching '*-*-mingw*.*' path
Found artifact 'all-mingw-8.14.0-DEV_3.zip.asc' matching 'all-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64-mingw-test.tar.xz.txt' matching '*-*-mingw*.*' path
Found artifact 'curl-8.14.0-DEV_3-win64a-mingw-test.zip' matching '*-*-mingw*.*' path
Uploading artifacts...
[1/22] curl-8.14.0-DEV_3-win32-mingw-test.zip.txt (130 bytes)...100%
[2/22] curl-8.14.0-DEV_3-win32-mingw-test.tar.xz.txt (133 bytes)...100%
System.Exception: Error uploading artifact to the storage: Access to the path '/home/appveyor/projects/curl-for-win/curl-8.14.0-DEV_3-win32-mingw-test.zip.cosign.sig' is denied.
 ---> System.UnauthorizedAccessException: Access to the path '/home/appveyor/projects/curl-for-win/curl-8.14.0-DEV_3-win32-mingw-test.zip.cosign.sig' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at Appveyor.Utilities.WebTransferUtility.UploadWithProgress(String filePath, String uploadUrl, Int32 timeout, Dictionary`2 headers, Action`3 progressCallback, Boolean ignoreInvalidSsl, Int64 grandTotalBytes, Int64 initialUploadedBytes)
   at Appveyor.BuildAgent.Service.ArtifactService.UploadArtifact(Int32 totalArtifacts, Int32 artifactNumber, BuildArtifactModel artifact)
   --- End of inner exception stack trace ---
   at Appveyor.BuildAgent.Service.ArtifactService.UploadArtifact(Int32 totalArtifacts, Int32 artifactNumber, BuildArtifactModel artifact)
   at Appveyor.BuildAgent.Service.ArtifactService.Package()
   at Appveyor.BuildAgent.Service.BuildRunner.RunAsync()
Build failed
```
https://ci.appveyor.com/project/curlorg/curl-for-win/builds/52053704?fullLog=true#L18255

_ci-linux-debian.sh: fix URL

_sign-pkg-cosign.sh: workaround for 0600 sig files

https://github.com/sigstore/cosign/blob/56d51141bdcfddc45609f17c73fd90fc40e965f3/cmd/cosign/cli/sign/sign_blob.go#L219
sigstore/cosign#1151

alpine try srm fix

simplify to .cosign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants