gitlab-security_report_schemas 0.1.2.min15.0.0.max15.2.1 → 0.1.3.min15.0.0.max15.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61392ff385582c0bf996ac3499646ed14c1eea91803bd35fea7123785a495306
4
- data.tar.gz: d4590f557b834a2f1de55154af50a637f7f6fd434eda23fa5e395dcf3fd43d9b
3
+ metadata.gz: d69ed2a06ec3ed14840cb492a0fb999a6ea1ce02ae7359cac919d9e03fe86155
4
+ data.tar.gz: 482cad69c32ce1d46229b133eb9c536126572616eec770413ec1f7a1c22b2fa9
5
5
  SHA512:
6
- metadata.gz: 6fda21362754cdfc414aec3b6316302f7ff443d9c68aecff3cd53e269cae3caff17de09d39d843d422577f1e1152518b500209889530b25e3f859c0bba92142c
7
- data.tar.gz: ccb8b9ddda36069dddc45c4dad3503091a1691ce245db46280526ad86cd0fad6b60138223d4897e7a3c0b00607ae267cdb0094ed665a7081161b5c31ee566ba0
6
+ metadata.gz: 35a601473896abf26a5206ed96906c7b9516ed5dfa2086418eedcbc7b8c801e36d45e5d186ec6df86629db886e56543898a6dc2e0b7eed2b96a0ec42595c67d1
7
+ data.tar.gz: 55daaeaad381551d36108a09db9385bcbedaf9f3e2e497241a7d1dd3a7efca1d7972149c116c9fd9b3e66a8227e1316014f82e4760a2533a5ce4c551e71931c2
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-security_report_schemas (0.1.2.min15.0.0.max15.2.1)
4
+ gitlab-security_report_schemas (0.1.3.min15.0.0.max15.2.2)
5
5
  activesupport (>= 6, < 8)
6
6
  json_schemer (~> 2.3.0)
7
+ mutex_m (~> 0.3.0)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
@@ -31,6 +32,7 @@ GEM
31
32
  simpleidn (~> 0.2)
32
33
  method_source (1.0.0)
33
34
  minitest (5.16.2)
35
+ mutex_m (0.3.0)
34
36
  parallel (1.22.1)
35
37
  parser (3.1.2.0)
36
38
  ast (~> 2.4.1)
data/README.md CHANGED
@@ -8,6 +8,10 @@ Rubygem for https://gitlab.com/gitlab-org/security-products/security-report-sche
8
8
 
9
9
  This gem provides a Ruby and command line interface to validate the report artifact generated by the security analyzers.
10
10
 
11
+ ## Maintenance
12
+
13
+ See [`RUNBOOK.md`](./RUNBOOK.md) for common release and maintenance tasks.
14
+
11
15
  ## Installation
12
16
 
13
17
  Install the gem and add to the application's Gemfile by executing:
@@ -47,24 +51,17 @@ bundle exec security-reports-schemas $FILE_PATH
47
51
 
48
52
  #### Credentials
49
53
 
50
- | Key | Description |
51
- |-----------------------------|-----------------------------------------------------------------------------------------------|
52
- | `GITLAB_PUSH_ACCESS_TOKEN` | Own project access token used to push new schema versions. Requires `write_repository` scope. |
53
- | `GITLAB_ISSUE_ACCESS_TOKEN` | Project access token used to create an issue on `gitlab-org/gitlab`. Requires `api` scopes. |
54
- | `GEM_HOST_API_KEY` | rubygems.org API key |
54
+ | Key | Description |
55
+ |-----------------------------|---------------------------------------------------------------------------------------------------------------------|
56
+ | `GITLAB_PUSH_ACCESS_TOKEN` | Access token for the `gl-service-dev-govern-sec-report-schemas` service account of the top-level `gitlab-org` group |
57
+ | `GEM_HOST_API_KEY` | rubygems.org API key (inherited from parent group) |
55
58
 
56
59
  #### Configuration
57
60
 
58
- | Key | Default | Description |
59
- |---------------------------|--------------------------------------------------------|----------------------------------------|
60
- | `SCHEMAS_PATH` | `./schemas` | Schema storage location |
61
- | `SCHEMA_PROJECT` | `gitlab-org/security-products/security-report-schemas` | Where to source schemas |
62
- | `GITLAB_PROJECT` | `gitlab-org/gitlab` | Project to open MRs for |
63
- | `ISSUE_TARGET_PROJECT_ID` | `278964` (`gitlab-org/gitlab`) | Project ID for which to open an issue. |
64
-
65
- ## Maintenance
66
-
67
- See [`RUNBOOK.md`](./RUNBOOK.md) for solutions to common maintenance tasks.
61
+ | Key | Default | Description |
62
+ |---------------------------|--------------------------------------------------------|-------------------------|
63
+ | `SCHEMAS_PATH` | `./schemas` | Schema storage location |
64
+ | `SCHEMA_PROJECT` | `gitlab-org/security-products/security-report-schemas` | Where to source schemas |
68
65
 
69
66
  ## Development
70
67
 
data/RUNBOOK.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Common maintenance tasks
2
2
 
3
- ### Problem
3
+ ## Manually release a new RubyGem version
4
4
 
5
5
  * an upstream [security-report-schemas](https://gitlab.com/gitlab-org/security-products/security-report-schemas) pipeline failed to trigger the release pipeline
6
6
  * you want to add, remove or deprecate support for report schema versions
@@ -22,6 +22,40 @@
22
22
  variable.
23
23
  3. Trigger the manual `manual-release` job in the resulting pipeline.
24
24
 
25
+ ## Jobs fail to self-push due to an expired service account access token
26
+
27
+ To self-push commits, we use an access token of a service account which
28
+ belongs to the top-level `gitlab-org` group. This token is kept in this project's
29
+ `GITLAB_PUSH_ACCESS_TOKEN` CI variable and the token expires yearly.
30
+
31
+ The service account access token [should get automatically rotated](https://gitlab.com/gitlab-com/team-member-epics/access-requests/-/issues/29595#note_2433504597)
32
+ and the CI variable should get updated with the updated token.
33
+
34
+ Should auto-rotation fail or the access token become invalid for another
35
+ reason, the `add-schema-version` and `manual-release` jobs fail:
36
+
37
+ ```
38
+ $ git push origin $CI_COMMIT_REF_NAME
39
+ remote: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped.
40
+ ```
41
+
42
+ ### Solution: Manually rotate the service account access token
43
+
44
+ Owners of the top-level `gitlab-org` group can manually
45
+ [rotate the service account access token](https://docs.gitlab.com/user/profile/service_accounts/#rotate-the-personal-access-token)
46
+ and update this project's `GITLAB_PUSH_ACCESS_TOKEN` CI variable with the
47
+ renewed token.
48
+
49
+ ### Workaround: Use a temporary personal access token
50
+
51
+ To release urgently without Owner access to `gitlab-org`:
52
+
53
+ 1. update the default branch protection so that you can push
54
+ 2. create a short-lived personal access token and rerun the failed `manual-release`
55
+ job, setting the CI variable `GITLAB_PUSH_ACCESS_TOKEN` to your short-lived token
56
+ 3. after the job succeeded, revoke your short-lived token and restore the default
57
+ branch protection so that you can no longer push
58
+
25
59
  ## Find the commit SHA for a RubyGem version
26
60
 
27
61
  Before a rubygems.org release is created, a git tag referencing the full
data/Rakefile CHANGED
@@ -41,15 +41,6 @@ task integrity_check: :prepare_schemas do
41
41
  end
42
42
  end
43
43
 
44
- namespace :release do
45
- desc "Open patch Issue on gitlab-org/gitlab to update its Gemfile to use the current gem version"
46
- task :issue do
47
- require "gitlab/security_report_schemas"
48
-
49
- Gitlab::SecurityReportSchemas::Release::Workflow.execute
50
- end
51
- end
52
-
53
44
  def cleanup_schema_dir
54
45
  puts "Cleaning the schemas directory..."
55
46
 
data/gem_version CHANGED
@@ -1 +1 @@
1
- 0.1.2.min15.0.0.max15.2.1
1
+ 0.1.3.min15.0.0.max15.2.2
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_dependency "activesupport", ">= 6", "< 8"
32
32
  spec.add_dependency "json_schemer", "~> 2.3.0"
33
+ spec.add_dependency "mutex_m", "~> 0.3.0"
33
34
  end
@@ -8,9 +8,6 @@ module Gitlab
8
8
  schemas_path: -> { SecurityReportSchemas.root_path.join("schemas") },
9
9
  deprecated_versions: -> { [] },
10
10
  schema_project: -> { "gitlab-org/security-products/security-report-schemas" },
11
- gitlab_project: -> { "gitlab-org/gitlab" },
12
- issue_target_project_id: -> { "278964" }, # gitlab-org/gitlab
13
- gitlab_issue_access_token: nil,
14
11
  ci_server_host: nil
15
12
  }.freeze
16
13
 
@@ -5,7 +5,7 @@ module Gitlab
5
5
  # Represents the version of the gem
6
6
  class Version
7
7
  VERSION_SPEC = "%<gem_version>s.min%<min_schema>s.max%<max_schema>s"
8
- GEM_VERSION = "0.1.2"
8
+ GEM_VERSION = "0.1.3"
9
9
  MISSING_SCHEMA_VERSION = "0.0.0"
10
10
 
11
11
  class << self
@@ -6,10 +6,6 @@ require_relative "security_report_schemas/configuration"
6
6
  require_relative "security_report_schemas/schema_ver"
7
7
  require_relative "security_report_schemas/version"
8
8
  require_relative "security_report_schemas/validator"
9
- require_relative "security_report_schemas/release/bundler"
10
- require_relative "security_report_schemas/release/gemfile"
11
- require_relative "security_report_schemas/release/issue"
12
- require_relative "security_report_schemas/release/workflow"
13
9
 
14
10
  module Gitlab
15
11
  # The `gitlab-security_report_schemas` gem contains JSON schemas and utilities