Skip to content

feat: Verify upstream image#102

Open
Venefilyn wants to merge 1 commit intoublue-os:mainfrom
Venefilyn:feat/verify-upstream
Open

feat: Verify upstream image#102
Venefilyn wants to merge 1 commit intoublue-os:mainfrom
Venefilyn:feat/verify-upstream

Conversation

@Venefilyn
Copy link
Copy Markdown
Contributor

If the upstream image is tampered with we should automatically fail the
image build and prevent any futher security breaches.

This is not foolproof as the implementation grabs the public key from a
git repository instead of locally, but it will ensure that the key from
the git repository did sign the image.

Fixes: #25
Co-authored-by: XLion xlion@xlion.tw
Signed-off-by: Freya Gustavsson freya@venefilyn.se

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 5, 2025
If the upstream image is tampered with we should automatically fail the
image build and prevent any futher security breaches.

This is not foolproof as the implementation grabs the public key from a
git repository instead of locally, but it will ensure that the key from
the git repository did sign the image.

Fixes: ublue-os#25
Co-authored-by: XLion <xlion@xlion.tw>
Signed-off-by: Freya Gustavsson <freya@venefilyn.se>
@Venefilyn Venefilyn force-pushed the feat/verify-upstream branch from 3f4e9f6 to a42a285 Compare May 5, 2025 15:07
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 5, 2025
# This can fail through a key mismatch or upstream image not being signed.
#
# We find the upstream image by checking the 'FROM' field.
- name: Verify upstream container image
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitating to do this in the workflow.

If we are doing this in the workflow, we could reuse our cosign verify action that RJ made. https://github.com/EyeCantCU/cosign-action/blob/main/verify/action.yml

That said, it hasn't been updated in months.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we could make this owned by the org or some org at least to reduce bus factor. Can check with the repo maintainer maybe?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put this in the org but someone should check to see if this should live in the sigstore space? Surely we can't be the only one who needs this? cc @EyeCantCU

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey all. The actions there are still up to date and leverage the latest version of cosign. There hasn't been much of a reason to expand on what's there. I'll check in with folks at sigstore and see if they want to host these actions in their org. If not, we can move them in org

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @EyeCantCU! Would reduce bus factor for sure :D

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any news here @EyeCantCU? Think this PR here sounds worthwhile.

Copy link
Copy Markdown

@rugk rugk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great idea, IMHO!

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

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify upstream cosign keys

5 participants