Skip to content

Add signed_file to Debian distributions

What does this MR do?

We need to store:

  • the unsigned Release file (in file+file_store),
  • the detached signature Release.gpg (in file_signature, in DB),
  • the inline-signed InRelease file (in signed_file+signed_file_store) 👈 This MR.

This MR also removes the unused encrypted_signing_keys, which are now in a separate table.

(Discussed here).

Fixes: #335994 (closed).

Migrations

Up :

== 20210720170913 UpdatePackagesDebianGroupDistributions: migrating ===========
-- add_column(:packages_debian_group_distributions, :signed_file, :text)
   -> 0.0048s
-- add_column(:packages_debian_group_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0030s
-- remove_column(:packages_debian_group_distributions, :encrypted_signing_keys)
   -> 0.0024s
-- remove_column(:packages_debian_group_distributions, :encrypted_signing_keys_iv)
   -> 0.0022s
== 20210720170913 UpdatePackagesDebianGroupDistributions: migrated (0.0129s) ==

== 20210720170914 UpdatePackagesDebianProjectDistributions: migrating =========
-- add_column(:packages_debian_project_distributions, :signed_file, :text)
   -> 0.0037s
-- add_column(:packages_debian_project_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0023s
-- remove_column(:packages_debian_project_distributions, :encrypted_signing_keys)
   -> 0.0020s
-- remove_column(:packages_debian_project_distributions, :encrypted_signing_keys_iv)
   -> 0.0016s
== 20210720170914 UpdatePackagesDebianProjectDistributions: migrated (0.0099s) 

== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: migrating 
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0003s
-- execute("ALTER TABLE packages_debian_project_distributions\nADD CONSTRAINT check_9e5e22b7ff\nCHECK ( char_length(signed_file) <= 255 )\nNOT VALID;\n")
   -> 0.0008s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE packages_debian_project_distributions VALIDATE CONSTRAINT check_9e5e22b7ff;")
   -> 0.0029s
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: migrated (0.0151s) 

== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: migrating 
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0003s
-- execute("ALTER TABLE packages_debian_group_distributions\nADD CONSTRAINT check_0007e0bf61\nCHECK ( char_length(signed_file) <= 255 )\nNOT VALID;\n")
   -> 0.0009s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE packages_debian_group_distributions VALIDATE CONSTRAINT check_0007e0bf61;")
   -> 0.0028s
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: migrated (0.0133s) 

Down:

== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: reverting 
-- execute("ALTER TABLE packages_debian_group_distributions\nDROP CONSTRAINT IF EXISTS check_0007e0bf61\n")
   -> 0.0030s
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: reverted (0.0193s) 

== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: reverting 
-- execute("ALTER TABLE packages_debian_project_distributions\nDROP CONSTRAINT IF EXISTS check_9e5e22b7ff\n")
   -> 0.0027s
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: reverted (0.0129s) 

== 20210720170914 UpdatePackagesDebianProjectDistributions: reverting =========
-- add_column(:packages_debian_project_distributions, :encrypted_signing_keys_iv, :text)
   -> 0.0066s
-- add_column(:packages_debian_project_distributions, :encrypted_signing_keys, :text)
   -> 0.0028s
-- remove_column(:packages_debian_project_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0027s
-- remove_column(:packages_debian_project_distributions, :signed_file, :text)
   -> 0.0030s
== 20210720170914 UpdatePackagesDebianProjectDistributions: reverted (0.0191s) 

== 20210720170913 UpdatePackagesDebianGroupDistributions: reverting ===========
-- add_column(:packages_debian_group_distributions, :encrypted_signing_keys_iv, :text)
   -> 0.0054s
-- add_column(:packages_debian_group_distributions, :encrypted_signing_keys, :text)
   -> 0.0037s
-- remove_column(:packages_debian_group_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0045s
-- remove_column(:packages_debian_group_distributions, :signed_file, :text)
   -> 0.0039s
== 20210720170913 UpdatePackagesDebianGroupDistributions: reverted (0.0211s) ==

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Mathieu Parent

Merge request reports

Loading