Skip to content

Add secret detection token revocation columns

rossfuhrman requested to merge 270208-add-application-settings-columns into master

What does this MR do?

Adds columns necessary for #270208 (closed)

Application logic will be added with !45955 (closed)

Migration output

rake db:migrate

...
== 20201021152210 AddSecretDetectionTokenRevocationApplicationSettings: migrating
-- add_column(:application_settings, :secret_detection_token_revocation_enabled, :boolean, {:default=>false, :null=>false})
   -> 0.0018s
-- add_column(:application_settings, :secret_detection_token_revocation_url, :text, {:null=>true})
   -> 0.0005s
-- add_column(:application_settings, :encrypted_secret_detection_token_revocation_token, :text)
   -> 0.0005s
-- add_column(:application_settings, :encrypted_secret_detection_token_revocation_token_iv, :text)
   -> 0.0005s
== 20201021152210 AddSecretDetectionTokenRevocationApplicationSettings: migrated (0.0034s)

== 20201021190539 AddTextLimitToSecretDetectionTokenRevocationApplicationSettings: migrating
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE application_settings\nADD CONSTRAINT check_9a719834eb\nCHECK ( char_length(secret_detection_token_revocation_url) <= 255 )\nNOT VALID;\n")
   -> 0.0012s
-- current_schema()
   -> 0.0002s
-- execute("ALTER TABLE application_settings VALIDATE CONSTRAINT check_9a719834eb;")
   -> 0.0007s
== 20201021190539 AddTextLimitToSecretDetectionTokenRevocationApplicationSettings: migrated (0.0094s)
...

rake db:rollback STEP=5

...
== 20201021190539 AddTextLimitToSecretDetectionTokenRevocationApplicationSettings: reverting
-- execute("ALTER TABLE application_settings\nDROP CONSTRAINT IF EXISTS check_9a719834eb\n")
   -> 0.0010s
== 20201021190539 AddTextLimitToSecretDetectionTokenRevocationApplicationSettings: reverted (0.0025s)

== 20201021152210 AddSecretDetectionTokenRevocationApplicationSettings: reverting
-- remove_column(:application_settings, :secret_detection_token_revocation_enabled)
   -> 0.0012s
-- remove_column(:application_settings, :secret_detection_token_revocation_url)
   -> 0.0005s
-- remove_column(:application_settings, :encrypted_secret_detection_token_revocation_token)
   -> 0.0005s
-- remove_column(:application_settings, :encrypted_secret_detection_token_revocation_token_iv)
   -> 0.0006s
== 20201021152210 AddSecretDetectionTokenRevocationApplicationSettings: reverted (0.0029s)

...

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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

Related to #270208 (closed)

Edited by rossfuhrman

Merge request reports

Loading