Skip to content

Add models for DAST site profiles

Philip Cunningham requested to merge add-models-for-site-profiles-225404 into master

What does this MR do?

adds DastSiteProfile and DastSite models as part of the work on being able to run on-demand scans via site profiles (#225404 (closed)).

Migration Output

% be rake db:migrate; be rake db:rollback; be rake db:rollback; be rake db:rollback                                                                                                                                                                                                                                                                                               ✹
== 20200712084655 CreateDastSites: migrating ==================================
-- create_table(:dast_sites)
   -> 0.0053s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:dast_sites, [:project_id, :url], {:unique=>true, :algorithm=>:concurrently})
   -> 0.0014s
-- add_index(:dast_sites, [:project_id, :url], {:unique=>true, :algorithm=>:concurrently})
   -> 0.0023s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE dast_sites\nADD CONSTRAINT check_46df8b449c\nCHECK ( char_length(url) <= 255 )\nNOT VALID;\n")
   -> 0.0006s
-- execute("ALTER TABLE dast_sites VALIDATE CONSTRAINT check_46df8b449c;")
   -> 0.0004s
== 20200712084655 CreateDastSites: migrated (0.0216s) =========================

== 20200712235622 CreateDastSiteProfiles: migrating ===========================
-- create_table(:dast_site_profiles)
   -> 0.0061s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:dast_site_profiles, [:project_id, :name], {:unique=>true, :algorithm=>:concurrently})
   -> 0.0014s
-- add_index(:dast_site_profiles, [:project_id, :name], {:unique=>true, :algorithm=>:concurrently})
   -> 0.0020s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE dast_site_profiles\nADD CONSTRAINT check_6cfab17b48\nCHECK ( char_length(name) <= 255 )\nNOT VALID;\n")
   -> 0.0003s
-- execute("ALTER TABLE dast_site_profiles VALIDATE CONSTRAINT check_6cfab17b48;")
   -> 0.0004s
== 20200712235622 CreateDastSiteProfiles: migrated (0.0146s) ==================

== 20200713071042 ConfirmProjectBotUsers: migrating ===========================
== 20200713071042 ConfirmProjectBotUsers: migrated (0.0210s) ==================

== 20200713071042 ConfirmProjectBotUsers: reverting ===========================
== 20200713071042 ConfirmProjectBotUsers: reverted (0.0000s) ==================

== 20200712235622 CreateDastSiteProfiles: reverting ===========================
-- drop_table(:dast_site_profiles)
   -> 0.0042s
== 20200712235622 CreateDastSiteProfiles: reverted (0.0042s) ==================

== 20200712084655 CreateDastSites: reverting ==================================
-- drop_table(:dast_sites)
   -> 0.0041s
== 20200712084655 CreateDastSites: reverted (0.0042s) =========================

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
Edited by Philip Cunningham

Merge request reports