support signing omni.jar, system addons, and language packs
Categories
(Cloud Services :: Operations: Autograph, enhancement)
Tracking
(Not tracked)
People
(Reporter: u581815, Unassigned)
References
(Blocks 1 open bug)
Details
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Updated•6 years ago
|
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
rhelmer, mdeboer,
Would either of you have context as to the priority of the omni.jar signing piece? Or know who could get me that information?
I'm trying to determine where it should fit on Release Engineering's roadmap. e.g.
- Why it's important?
- Is there a hard or soft deadline?
- What happens if we don't do it?
Thanks!
Updated•6 years ago
|
Reporter | ||
Comment 10•6 years ago
|
||
Trying to turn COSE signing in AMO, but QA found a bug with Fx treating langpacks w/ COSE signatures as corrupt: https://github.com/mozilla/addons-server/issues/10588
-
Does Firefox treat langpacks like regular XPIs? If not, then it's probably a bug in autograph.
-
Does it follow the
security.signed_app_signatures.policy
pref to accept and validate COSE signatures when present or use a different pref? -
Do langpacks need a certain CN or OU in their PKCS7 cert?
-
Comment 11•6 years ago
|
||
(In reply to Greg Guthe [:g-k] [:gguthe] from comment #10)
Trying to turn COSE signing in AMO, but QA found a bug with Fx treating langpacks w/ COSE signatures as corrupt: https://github.com/mozilla/addons-server/issues/10588
Does Firefox treat langpacks like regular XPIs? If not, then it's probably a bug in autograph.
Does it follow the
security.signed_app_signatures.policy
pref to accept and validate COSE signatures when present or use a different pref?Do langpacks need a certain CN or OU in their PKCS7 cert?
Comment 12•6 years ago
|
||
(In reply to Robert Helmer [:rhelmer] from comment #11)
(In reply to Greg Guthe [:g-k] [:gguthe] from comment #10)
Trying to turn COSE signing in AMO, but QA found a bug with Fx treating langpacks w/ COSE signatures as corrupt: https://github.com/mozilla/addons-server/issues/10588
- Does Firefox treat langpacks like regular XPIs? If not, then it's probably a bug in autograph.
Yes, signatures on langpacks are validated in the same way as signatures on extensions, themes, etc.
- Does it follow the
security.signed_app_signatures.policy
pref to accept and validate COSE signatures when present or use a different pref?
I'm not sure, it calls this function:
https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/security/manager/ssl/nsIX509CertDB.idl#263-266
I don't know much about what happens inside that function, I would suggest checking with keeler.
- Do langpacks need a certain CN or OU in their PKCS7 cert?
Yes, they need to have the addon id as the CN. It gets a trickier for addons with ids that are longer than the CN field, there is a little more information here:
https://wiki.mozilla.org/Add-ons/Extension_Signing
Reporter | ||
Comment 13•6 years ago
|
||
(In reply to Andrew Swan [:aswan] from comment #12)
Thanks :aswan!
- Does it follow the
security.signed_app_signatures.policy
pref to accept and validate COSE signatures when present or use a different pref?I'm not sure, it calls this function:
https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/security/manager/ssl/nsIX509CertDB.idl#263-266
I don't know much about what happens inside that function, I would suggest checking with keeler.
:keeler any idea why adding a COSE ES256 signature would break signature verification but only for langpacks? :cgrebs has a test one in https://github.com/mozilla/addons-server/issues/10588#issuecomment-461300120
Comment 14•6 years ago
|
||
Stepping through verifying that file, what I'm seeing is it's complaining about lines in META-INF/manifest.mf being too long. Apparently there's a line limit of 72 bytes.(although it looks like you can essentially wrap them to the next line by prepending it with a space?) (this is all in https://searchfox.org/mozilla-central/source/security/apps/AppSignatureVerification.cpp#279 ). It looks like it's been that way for a while, though, so I don't see why switching to COSE would have an effect, unless the new signing implementation isn't careful about line lengths.
Reporter | ||
Comment 15•6 years ago
|
||
(In reply to Dana Keeler (she/her) (use needinfo) (:keeler for reviews) from comment #14)
Stepping through verifying that file, what I'm seeing is it's complaining about lines in META-INF/manifest.mf being too long. Apparently there's a line limit of 72 bytes.(although it looks like you can essentially wrap them to the next line by prepending it with a space?) (this is all in https://searchfox.org/mozilla-central/source/security/apps/AppSignatureVerification.cpp#279 ). It looks like it's been that way for a while, though, so I don't see why switching to COSE would have an effect, unless the new signing implementation isn't careful about line lengths.
Aha! Thanks :keeler!
Autograph is in fact not careful about line lengths. We fixed this for APK JARs https://github.com/mozilla-services/autograph/pull/145/files#diff-38e4bd38907085f68f0624f5485466eeR23 but weren't sure if Fx checked that part of the spec too.
Reporter | ||
Comment 16•6 years ago
|
||
Yep that was the issue. Dana++
Just to update everyone on the autograph side of things:
-
the AMO team is testing 100% of traffic with backwards compatible COSE signatures in -stage this week. Assuming that goes well we'll start testing AMO -prod in the next few weeks per https://groups.google.com/a/mozilla.com/forum/#!topic/autograph-users/h94cxEbdOso (let me know if you want an invite to that mailing list)
-
we deployed an XPI signer to the autograph -stage HSM environment and have the config changes in place for -prod (bug 1518642). Assuming we sign system addons for each release and they don't need to be backwards compatible with old Fx versions, we can use SHA2 signatures across the board (bug 1501307) and sign with taskcluster, signingscript, and autograph. I think the next step would be adding system addon support to signingscript.
:Callek,
- Are system addons and omni.jar currently signed as system addons using the addon-shipper lambda?
- Do they need to be backwards compatible with old Fx versions (in which case we should use AMO) or can we switch to taskcluster and the SHA2 signatures?
- Are we planning on signing lang packs with AMO since they're web extensions? (I'm assuming so, but want to confirm)
Comment 17•6 years ago
|
||
(In reply to Greg Guthe [:g-k] [:gguthe] from comment #16)
- Are system addons and omni.jar currently signed as system addons using the addon-shipper lambda?
- Do they need to be backwards compatible with old Fx versions (in which case we should use AMO) or can we switch to taskcluster and the SHA2 signatures?
:Rehan do you know the answers to Greg's questions about system addons here? If you don't do you know a name to redirect this to whom would know
- Are we planning on signing lang packs with AMO since they're web extensions? (I'm assuming so, but want to confirm)
Greg, so "today" yes language packs will be signed in AMO via sending them through AMO api's. in the near future (within 2019) we hope to get off AMO's APIs for this piece of release process and instead sign them directly with autograph via scriptworker, and these will need to maintain the same CN as they do when submitted through AMO. (and I suspect but don't know for sure, the same cert type that Firefox currently accepts). So it does have some requirements we should think about here.
This near future is part of what this bug was filed about, but is presumably less urgent than the omni.ja signing pieces.
Comment 18•6 years ago
|
||
Jason Thomas (:jason) usually handles the signing of system addons and can probably answer some (if not all) of these questions.
Comment 19•6 years ago
|
||
I am going to redirect this to :wezhou since I don't work with add-on signing anymore.
Comment 20•6 years ago
|
||
Are system addons and omni.jar currently signed as system addons using the addon-shipper lambda?
System addons are signed manually using the steps documented in [1]
I don't know if omni.jar is an system addon or not. Usually, the signing requester tells us an addon is to be signed as an system addon, and we will sign it as such.
I'm not sure what "addon-shipper" lambda is. But, there is a lambda known as "addon-signxpi" lambda, which is used to sign what's called "internal addon/extension". Information about signing this type of addon is in [2] and [3]. If omni.jar were considered as an internal addon, someone would have followed those docs and signed it (cloudops rarely get involved signing internal addons).
Do they need to be backwards compatible with old Fx versions (in which case we should use AMO) or can we switch to taskcluster and the SHA2 signatures?
Sorry but I don't how to answer this question. I assume someone who owns the omni.jar file should know.
Comment 21•6 years ago
•
|
||
(In reply to :wezhou from comment #20)
Are system addons and omni.jar currently signed as system addons using the addon-shipper lambda?
System addons are signed manually using the steps documented in [1]
I don't know if omni.jar is an system addon or not. Usually, the signing requester tells us an addon is to be signed as an system addon, and we will sign it as such.
omni JAR(s) and any XPI files (such as bundled system add-ons) shipped with Firefox have never been signed AFAIK.
The tl;dr is that "default" system add-ons are packaged as XPI files and bundled with Firefox and persist in the (read-only) application directory, and "updates" are signed by Mozilla and are delivered to the users (read/write) profile directory. :wezhou has been doing signatures for "updates" but not "defaults".
The distinction between default and updates for system add-ons is documented further at https://firefox-source-docs.mozilla.org/toolkit/mozapps/extensions/addon-manager/SystemAddons.html#default-built-in-system-add-ons
I'm not sure what "addon-shipper" lambda is. But, there is a lambda known as "addon-signxpi" lambda, which is used to sign what's called "internal addon/extension". Information about signing this type of addon is in [2] and [3]. If omni.jar were considered as an internal addon, someone would have followed those docs and signed it (cloudops rarely get involved signing internal addons).
Do they need to be backwards compatible with old Fx versions (in which case we should use AMO) or can we switch to taskcluster and the SHA2 signatures?
Sorry but I don't how to answer this question. I assume someone who owns the omni.jar file should know.
I don't think we need to worry about backwards compatibility for files that are shipped with Firefox since they'll only be verified by new code (bug 1515712). We'll need to take more care around updates but I think we can handle that separately without trouble.
Comment 22•6 years ago
|
||
Bug 1515712 has landed and we're starting to see data from Nightly users, so I think we're ready to go whenever signed omni ja and XPIs start shipping as well. Thanks!
Comment 23•6 years ago
|
||
I estimated end of April for this work, but I think signing omni.ja may slip until May 7'th give or take. I was blocked a bit on a longer-tail of py3 and some bikeshedding in build-team about the code we use to read the omni.ja files (to support the preloading/etc)
I appreciate your patience, let me know if there is any issues from product with the timeline shift.
Comment 24•5 years ago
|
||
This work is done, with the exception of sysaddon signing (which was dropped per discussion with :aswan and :rhelmer over e-mail)
Description
•