Skip to content

Create Dast::Profile model

What does this MR do?

adds a new model called Dast::Profile that is used to group a DastSiteProfile and a DastScannerProfile by giving them a name and a description.

Why?

this will enable customers to run scans without always having to select a DastSiteProfile and DastScannerProfile combination that makes sense e.g. they might create a Dast::Profile for their staging environment, which has all the respective details in the associated profiles.

Issue(s)

Migrations

% rails db:migrate:up VERSION=20210111051045 && rails db:migrate:up VERSION=20210111053308                                                                                                                                                                                                                                                                                      
== 20210111051045 CreateDastProfiles: migrating ===============================
-- create_table(:dast_profiles, {:comment=>"{\"owner\":\"group::dynamic analysis\",\"description\":\"Profile used to run a DAST on-demand scan\"}"})
-- quote_column_name(:name)
   -> 0.0000s
-- quote_column_name(:description)
   -> 0.0000s
   -> 0.0154s
-- quote_table_name("check_5fcf73bf61")
   -> 0.0000s
-- quote_table_name("check_c34e505c24")
   -> 0.0000s
-- quote_table_name(:dast_profiles)
   -> 0.0000s
-- execute("ALTER TABLE \"dast_profiles\"\nADD CONSTRAINT \"check_5fcf73bf61\" CHECK (char_length(\"name\") <= 255),\nADD CONSTRAINT \"check_c34e505c24\" CHECK (char_length(\"description\") <= 255)\n")
   -> 0.0005s
== 20210111051045 CreateDastProfiles: migrated (0.0211s) ======================

== 20210111053308 AddProjectFkForDastProfile: migrating =======================
-- transaction_open?()
   -> 0.0000s
-- foreign_keys(:dast_profiles)
   -> 0.0034s
-- execute("ALTER TABLE dast_profiles\nADD CONSTRAINT fk_aa76ef30e9\nFOREIGN KEY (project_id)\nREFERENCES projects (id)\nON DELETE CASCADE\nNOT VALID;\n")
   -> 0.0018s
-- execute("SET statement_timeout TO 0")
   -> 0.0002s
-- execute("ALTER TABLE dast_profiles VALIDATE CONSTRAINT fk_aa76ef30e9;")
   -> 0.0037s
-- execute("RESET ALL")
   -> 0.0002s
== 20210111053308 AddProjectFkForDastProfile: migrated (0.0129s) ==============

% rails db:migrate:down VERSION=20210111053308 && rails db:migrate:down VERSION=20210111051045                                                                                                                                                                                                                                                                                    
== 20210111053308 AddProjectFkForDastProfile: reverting =======================
-- remove_foreign_key(:dast_profiles, {:column=>:project_id})
   -> 0.0056s
== 20210111053308 AddProjectFkForDastProfile: reverted (0.0109s) ==============

== 20210111051045 CreateDastProfiles: reverting ===============================
-- drop_table(:dast_profiles)
   -> 0.0023s
== 20210111051045 CreateDastProfiles: reverted (0.0054s) ======================

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