gitlabcis 1.3.2__py3-none-any.whl

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.
Files changed (218) hide show
  1. gitlabcis/__init__.py +12 -0
  2. gitlabcis/__main__.py +7 -0
  3. gitlabcis/benchmarks/__init__.py +8 -0
  4. gitlabcis/benchmarks/artifacts_4/__init__.py +4 -0
  5. gitlabcis/benchmarks/artifacts_4/access_to_artifacts_4_2.py +139 -0
  6. gitlabcis/benchmarks/artifacts_4/origin_traceability_4_4.py +11 -0
  7. gitlabcis/benchmarks/artifacts_4/package_registries_4_3.py +105 -0
  8. gitlabcis/benchmarks/artifacts_4/verification_4_1.py +83 -0
  9. gitlabcis/benchmarks/build_pipelines_2/__init__.py +4 -0
  10. gitlabcis/benchmarks/build_pipelines_2/build_environment_2_1.py +268 -0
  11. gitlabcis/benchmarks/build_pipelines_2/build_worker_2_2.py +129 -0
  12. gitlabcis/benchmarks/build_pipelines_2/pipeline_instructions_2_3.py +444 -0
  13. gitlabcis/benchmarks/build_pipelines_2/pipeline_integrity_2_4.py +146 -0
  14. gitlabcis/benchmarks/dependencies_3/__init__.py +2 -0
  15. gitlabcis/benchmarks/dependencies_3/third_party_packages_3_1.py +171 -0
  16. gitlabcis/benchmarks/dependencies_3/validate_packages_3_2.py +182 -0
  17. gitlabcis/benchmarks/deployment_5/__init__.py +2 -0
  18. gitlabcis/benchmarks/deployment_5/deployment_configuration_5_1.py +165 -0
  19. gitlabcis/benchmarks/deployment_5/deployment_environment_5_2.py +66 -0
  20. gitlabcis/benchmarks/source_code_1/__init__.py +6 -0
  21. gitlabcis/benchmarks/source_code_1/code_changes_1_1.py +665 -0
  22. gitlabcis/benchmarks/source_code_1/code_risks_1_5.py +506 -0
  23. gitlabcis/benchmarks/source_code_1/contribution_access_1_3.py +334 -0
  24. gitlabcis/benchmarks/source_code_1/repository_management_1_2.py +168 -0
  25. gitlabcis/benchmarks/source_code_1/third_party_1_4.py +139 -0
  26. gitlabcis/cli/__init__.py +0 -0
  27. gitlabcis/cli/log.py +30 -0
  28. gitlabcis/cli/main.py +541 -0
  29. gitlabcis/cli/output.py +151 -0
  30. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/external_auth_server.yml +51 -0
  31. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/limit_artifact_uploaders.yml +57 -0
  32. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/limit_certifying_artifacts.yml +53 -0
  33. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/minimum_package_registry_admins.yml +54 -0
  34. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/readme.md +14 -0
  35. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/require_mfa_to_package_registry.yml +52 -0
  36. gitlabcis/recommendations/artifacts_4/access_to_artifacts_4_2/restrict_anonymous_access.yml +67 -0
  37. gitlabcis/recommendations/artifacts_4/origin_traceability_4_4/artifact_origin_info.yml +56 -0
  38. gitlabcis/recommendations/artifacts_4/origin_traceability_4_4/readme.md +7 -0
  39. gitlabcis/recommendations/artifacts_4/package_registries_4_3/all_artifact_versions_signed.yml +70 -0
  40. gitlabcis/recommendations/artifacts_4/package_registries_4_3/audit_package_registry_config.yml +46 -0
  41. gitlabcis/recommendations/artifacts_4/package_registries_4_3/readme.md +12 -0
  42. gitlabcis/recommendations/artifacts_4/package_registries_4_3/secure_repo_webhooks.yml +50 -0
  43. gitlabcis/recommendations/artifacts_4/package_registries_4_3/validate_signed_artifacts_on_upload.yml +72 -0
  44. gitlabcis/recommendations/artifacts_4/readme.md +12 -0
  45. gitlabcis/recommendations/artifacts_4/verification_4_1/encrypt_artifacts_before_distribution.yml +47 -0
  46. gitlabcis/recommendations/artifacts_4/verification_4_1/only_authorized_platforms_can_decrypt_artifacts.yml +59 -0
  47. gitlabcis/recommendations/artifacts_4/verification_4_1/readme.md +11 -0
  48. gitlabcis/recommendations/artifacts_4/verification_4_1/sign_artifacts_in_build_pipeline.yml +40 -0
  49. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/authenticate_build_access.yml +55 -0
  50. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/build_automation.yml +54 -0
  51. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/build_env_admins.yml +55 -0
  52. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/build_logging.yml +49 -0
  53. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/disable_build_tools_default_passwords.yml +54 -0
  54. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/immutable_pipeline_infrastructure.yml +60 -0
  55. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/limit_build_access.yml +64 -0
  56. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/limit_build_secrets_scope.yml +56 -0
  57. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/readme.md +19 -0
  58. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/secure_build_env_webhooks.yml +43 -0
  59. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/single_responsibility_pipeline.yml +58 -0
  60. gitlabcis/recommendations/build_pipelines_2/build_environment_2_1/vuln_scanning.yml +64 -0
  61. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/build_worker_vuln_scanning.yml +58 -0
  62. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/monitor_worker_resource_consumption.yml +59 -0
  63. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/pass_worker_envs_and_commands.yml +48 -0
  64. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/readme.md +16 -0
  65. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/restrict_worker_connectivity.yml +61 -0
  66. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/segregate_worker_duties.yml +78 -0
  67. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/single_use_workers.yml +47 -0
  68. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/store_worker_config.yml +62 -0
  69. gitlabcis/recommendations/build_pipelines_2/build_worker_2_2/worker_runtime_security.yml +37 -0
  70. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/build_stage_io.yml +49 -0
  71. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/build_steps_as_code.yml +42 -0
  72. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/limit_pipeline_triggers.yml +76 -0
  73. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/pipeline_misconfiguration_scanning.yml +48 -0
  74. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/pipeline_secret_scanning.yml +56 -0
  75. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/pipeline_vuln_scanning.yml +44 -0
  76. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/readme.md +16 -0
  77. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/secure_pipeline_output.yml +52 -0
  78. gitlabcis/recommendations/build_pipelines_2/pipeline_instructions_2_3/track_pipeline_files.yml +48 -0
  79. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/create_reproducible_artifacts.yml +52 -0
  80. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/lock_dependencies.yml +59 -0
  81. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/pipeline_produces_sbom.yml +81 -0
  82. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/pipeline_signs_sbom.yml +38 -0
  83. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/readme.md +14 -0
  84. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/sign_artifacts.yml +35 -0
  85. gitlabcis/recommendations/build_pipelines_2/pipeline_integrity_2_4/validate_dependencies.yml +63 -0
  86. gitlabcis/recommendations/build_pipelines_2/readme.md +12 -0
  87. gitlabcis/recommendations/dependencies_3/readme.md +10 -0
  88. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/define_package_managers.yml +84 -0
  89. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/dependency_sbom.yml +84 -0
  90. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/monitor_dependencies.yml +61 -0
  91. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/packages_over_60_days_old.yml +95 -0
  92. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/pin_dependency_version.yml +48 -0
  93. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/readme.md +14 -0
  94. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/third_party_sbom_required.yml +70 -0
  95. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/verify_artifacts.yml +45 -0
  96. gitlabcis/recommendations/dependencies_3/third_party_packages_3_1/verify_signed_metadata.yml +41 -0
  97. gitlabcis/recommendations/dependencies_3/validate_packages_3_2/org_wide_dependency_policy.yml +47 -0
  98. gitlabcis/recommendations/dependencies_3/validate_packages_3_2/package_license_scanning.yml +47 -0
  99. gitlabcis/recommendations/dependencies_3/validate_packages_3_2/package_ownership_change.yml +42 -0
  100. gitlabcis/recommendations/dependencies_3/validate_packages_3_2/package_vuln_scanning.yml +62 -0
  101. gitlabcis/recommendations/dependencies_3/validate_packages_3_2/readme.md +10 -0
  102. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/audit_deployment_config.yml +46 -0
  103. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/limit_deployment_config_access.yml +51 -0
  104. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/pin_deployment_config_manifests.yml +59 -0
  105. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/readme.md +13 -0
  106. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/scan_iac.yml +72 -0
  107. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/secret_scan_deployment_config.yml +45 -0
  108. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/separate_deployment_config.yml +50 -0
  109. gitlabcis/recommendations/deployment_5/deployment_configuration_5_1/verify_deployment_config.yml +49 -0
  110. gitlabcis/recommendations/deployment_5/deployment_environment_5_2/automate_deployment.yml +47 -0
  111. gitlabcis/recommendations/deployment_5/deployment_environment_5_2/disable_default_passwords.yml +63 -0
  112. gitlabcis/recommendations/deployment_5/deployment_environment_5_2/limit_prod_access.yml +45 -0
  113. gitlabcis/recommendations/deployment_5/deployment_environment_5_2/readme.md +12 -0
  114. gitlabcis/recommendations/deployment_5/deployment_environment_5_2/reproducible_deployment.yml +50 -0
  115. gitlabcis/recommendations/deployment_5/readme.md +10 -0
  116. gitlabcis/recommendations/readme.md +24 -0
  117. gitlabcis/recommendations/source_code_1/code_changes_1_1/audit_branch_protections.yml +56 -0
  118. gitlabcis/recommendations/source_code_1/code_changes_1_1/auto_risk_scan_merges.yml +62 -0
  119. gitlabcis/recommendations/source_code_1/code_changes_1_1/branch_protections_for_admins.yml +60 -0
  120. gitlabcis/recommendations/source_code_1/code_changes_1_1/branches_updated_before_merging.yml +56 -0
  121. gitlabcis/recommendations/source_code_1/code_changes_1_1/checks_pass_before_merging.yml +57 -0
  122. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_approval_dismissals.yml +62 -0
  123. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_approvals.yml +65 -0
  124. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_changes_require_code_owners.yml +68 -0
  125. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_dismissal_restrictions.yml +69 -0
  126. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_owners.yml +61 -0
  127. gitlabcis/recommendations/source_code_1/code_changes_1_1/code_tracing.yml +52 -0
  128. gitlabcis/recommendations/source_code_1/code_changes_1_1/comments_resolved_before_merging.yml +59 -0
  129. gitlabcis/recommendations/source_code_1/code_changes_1_1/commits_must_be_signed_before_merging.yml +63 -0
  130. gitlabcis/recommendations/source_code_1/code_changes_1_1/default_branch_protected.yml +85 -0
  131. gitlabcis/recommendations/source_code_1/code_changes_1_1/deny_branch_deletions.yml +76 -0
  132. gitlabcis/recommendations/source_code_1/code_changes_1_1/ensure_force_push_is_denied.yml +59 -0
  133. gitlabcis/recommendations/source_code_1/code_changes_1_1/linear_history_required.yml +56 -0
  134. gitlabcis/recommendations/source_code_1/code_changes_1_1/merging_restrictions.yml +65 -0
  135. gitlabcis/recommendations/source_code_1/code_changes_1_1/readme.md +26 -0
  136. gitlabcis/recommendations/source_code_1/code_changes_1_1/stale_branch_reviews.yml +72 -0
  137. gitlabcis/recommendations/source_code_1/code_changes_1_1/version_control.yml +45 -0
  138. gitlabcis/recommendations/source_code_1/code_risks_1_5/dast_api_scanning.yml +50 -0
  139. gitlabcis/recommendations/source_code_1/code_risks_1_5/dast_web_scanning.yml +51 -0
  140. gitlabcis/recommendations/source_code_1/code_risks_1_5/dependency_scanning.yml +84 -0
  141. gitlabcis/recommendations/source_code_1/code_risks_1_5/enable_secret_detection.yml +45 -0
  142. gitlabcis/recommendations/source_code_1/code_risks_1_5/license_scanning.yml +47 -0
  143. gitlabcis/recommendations/source_code_1/code_risks_1_5/readme.md +14 -0
  144. gitlabcis/recommendations/source_code_1/code_risks_1_5/secure_iac_instructions.yml +81 -0
  145. gitlabcis/recommendations/source_code_1/code_risks_1_5/secure_pipeline_instructions.yml +62 -0
  146. gitlabcis/recommendations/source_code_1/code_risks_1_5/vulnerability_scanning.yml +48 -0
  147. gitlabcis/recommendations/source_code_1/contribution_access_1_3/domain_verification.yml +65 -0
  148. gitlabcis/recommendations/source_code_1/contribution_access_1_3/ensure_2_admins_per_repo.yml +56 -0
  149. gitlabcis/recommendations/source_code_1/contribution_access_1_3/limit_top_level_group_creation.yml +61 -0
  150. gitlabcis/recommendations/source_code_1/contribution_access_1_3/limit_user_registration_domain.yml +58 -0
  151. gitlabcis/recommendations/source_code_1/contribution_access_1_3/minimum_number_of_admins.yml +56 -0
  152. gitlabcis/recommendations/source_code_1/contribution_access_1_3/org_provided_ssh_certs.yml +70 -0
  153. gitlabcis/recommendations/source_code_1/contribution_access_1_3/readme.md +21 -0
  154. gitlabcis/recommendations/source_code_1/contribution_access_1_3/require_mfa_at_org_level.yml +89 -0
  155. gitlabcis/recommendations/source_code_1/contribution_access_1_3/require_mfa_for_contributors.yml +76 -0
  156. gitlabcis/recommendations/source_code_1/contribution_access_1_3/restrict_ip_addresses.yml +84 -0
  157. gitlabcis/recommendations/source_code_1/contribution_access_1_3/review_and_remove_inactive_users.yml +62 -0
  158. gitlabcis/recommendations/source_code_1/contribution_access_1_3/scm_notification_restriction.yml +46 -0
  159. gitlabcis/recommendations/source_code_1/contribution_access_1_3/strict_permissions_for_repo.yml +62 -0
  160. gitlabcis/recommendations/source_code_1/contribution_access_1_3/track_code_anomalies.yml +43 -0
  161. gitlabcis/recommendations/source_code_1/readme.md +13 -0
  162. gitlabcis/recommendations/source_code_1/repository_management_1_2/limit_issue_deletions.yml +57 -0
  163. gitlabcis/recommendations/source_code_1/repository_management_1_2/limit_repo_creations.yml +64 -0
  164. gitlabcis/recommendations/source_code_1/repository_management_1_2/limit_repo_deletions.yml +57 -0
  165. gitlabcis/recommendations/source_code_1/repository_management_1_2/public_repos_have_security_file.yml +59 -0
  166. gitlabcis/recommendations/source_code_1/repository_management_1_2/readme.md +15 -0
  167. gitlabcis/recommendations/source_code_1/repository_management_1_2/review_and_archive_stale_repos.yml +65 -0
  168. gitlabcis/recommendations/source_code_1/repository_management_1_2/track_forks.yml +74 -0
  169. gitlabcis/recommendations/source_code_1/repository_management_1_2/track_project_visibility_status.yml +74 -0
  170. gitlabcis/recommendations/source_code_1/third_party_1_4/README.md +12 -0
  171. gitlabcis/recommendations/source_code_1/third_party_1_4/admin_approval_for_app_installs.yml +83 -0
  172. gitlabcis/recommendations/source_code_1/third_party_1_4/least_privilge_app_permissions.yml +103 -0
  173. gitlabcis/recommendations/source_code_1/third_party_1_4/secure_webhooks.yml +73 -0
  174. gitlabcis/recommendations/source_code_1/third_party_1_4/stale_app_reviews.yml +66 -0
  175. gitlabcis/recommendations/template.yml +30 -0
  176. gitlabcis/tests/__init__.py +0 -0
  177. gitlabcis/tests/input/__init__.py +0 -0
  178. gitlabcis/tests/input/conftest.py +29 -0
  179. gitlabcis/tests/input/no_input_test.py +82 -0
  180. gitlabcis/tests/input/switch_test.py +19 -0
  181. gitlabcis/tests/input/version_test.py +7 -0
  182. gitlabcis/tests/unit/__init__.py +0 -0
  183. gitlabcis/tests/unit/benchmarks/artifacts_4/access_to_artifacts_4_2_test.py +131 -0
  184. gitlabcis/tests/unit/benchmarks/artifacts_4/origin_traceability_4_4_test.py +15 -0
  185. gitlabcis/tests/unit/benchmarks/artifacts_4/package_registries_4_3_test.py +102 -0
  186. gitlabcis/tests/unit/benchmarks/artifacts_4/verification_4_1_test.py +78 -0
  187. gitlabcis/tests/unit/benchmarks/build_pipelines_2/build_environment_2_1_test.py +239 -0
  188. gitlabcis/tests/unit/benchmarks/build_pipelines_2/build_worker_2_2_test.py +105 -0
  189. gitlabcis/tests/unit/benchmarks/build_pipelines_2/pipeline_instructions_2_3_test.py +340 -0
  190. gitlabcis/tests/unit/benchmarks/build_pipelines_2/pipeline_integrity_2_4_test.py +115 -0
  191. gitlabcis/tests/unit/benchmarks/conftest.py +47 -0
  192. gitlabcis/tests/unit/benchmarks/dependencies_3/third_party_packages_3_1_test.py +135 -0
  193. gitlabcis/tests/unit/benchmarks/dependencies_3/validate_packages_3_2_test.py +171 -0
  194. gitlabcis/tests/unit/benchmarks/deployment_5/deployment_configuration_5_1_test.py +140 -0
  195. gitlabcis/tests/unit/benchmarks/deployment_5/deployment_environment_5_2_test.py +60 -0
  196. gitlabcis/tests/unit/benchmarks/function_test.py +24 -0
  197. gitlabcis/tests/unit/benchmarks/source_code_1/code_changes_1_1_test.py +565 -0
  198. gitlabcis/tests/unit/benchmarks/source_code_1/code_risks_1_5_test.py +419 -0
  199. gitlabcis/tests/unit/benchmarks/source_code_1/contribution_access_1_3_test.py +265 -0
  200. gitlabcis/tests/unit/benchmarks/source_code_1/repository_management_1_2_test.py +142 -0
  201. gitlabcis/tests/unit/benchmarks/source_code_1/third_party_1_4_test.py +119 -0
  202. gitlabcis/tests/unit/conftest.py +94 -0
  203. gitlabcis/tests/unit/log/log_test.py +23 -0
  204. gitlabcis/tests/unit/utils/argfilters_test.py +9 -0
  205. gitlabcis/tests/unit/utils/ci_test.py +156 -0
  206. gitlabcis/tests/unit/utils/output_test.py +95 -0
  207. gitlabcis/tests/unit/utils/utils_general_test.py +149 -0
  208. gitlabcis/tests/unit/utils/version_test.py +11 -0
  209. gitlabcis/tests/unit/yaml/bad_file_test.py +15 -0
  210. gitlabcis/tests/unit/yaml/recommendation_test.py +123 -0
  211. gitlabcis/utils/__init__.py +146 -0
  212. gitlabcis/utils/ci.py +132 -0
  213. gitlabcis-1.3.2.dist-info/LICENSE +21 -0
  214. gitlabcis-1.3.2.dist-info/METADATA +241 -0
  215. gitlabcis-1.3.2.dist-info/RECORD +218 -0
  216. gitlabcis-1.3.2.dist-info/WHEEL +5 -0
  217. gitlabcis-1.3.2.dist-info/entry_points.txt +2 -0
  218. gitlabcis-1.3.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ id: 2.3.2
3
+ name: build_stage_io
4
+ title: Ensure steps have clearly defined build stage input and output
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Define clear expected input and output for each build stage.
10
+ rationale: >-
11
+ In order to have more control over data flow in the build pipeline, clearly define the input
12
+ and output of the pipeline steps. If anything malicious happens during the build stage, it
13
+ will be recognized more easily and stand out as an anomaly.
14
+ impact: >-
15
+ audit: |
16
+ For each build stage, verify that the expected input and output are clearly defined.
17
+ • On the left sidebar, select Code > Repository.
18
+ • Review the .gitlab-ci.yml file to check if the build stage job input and output are clearly defined.
19
+ remediation: |
20
+ For each build stage, clearly define what is expected for input and output.
21
+ • On the left sidebar, select Code > Repository.
22
+ • Ensure the .gitlab-ci.yml file has build stage job input and output clearly defined.
23
+ default_value:
24
+ references:
25
+ - https://docs.gitlab.com/ee/ci/pipelines/
26
+ cis_controls:
27
+ - id: 16.1
28
+ version: 8
29
+ name: Establish and Maintain a Secure Application Development Process
30
+ description: >-
31
+ Establish and maintain a secure application development process. In the
32
+ process, address such items as: secure application design standards, secure coding
33
+ practices, developer training, vulnerability management, security of third-party code,
34
+ and application security testing procedures. Review and update documentation
35
+ annually, or when significant enterprise changes occur that could impact this
36
+ Safeguard.
37
+ implementation_groups:
38
+ - IG2
39
+ - IG3
40
+ - id: 18.1
41
+ version: 7
42
+ name: Establish Secure Coding Practices
43
+ description: >-
44
+ Establish secure coding practices appropriate to the programming language and
45
+ development environment being used.
46
+ implementation_groups:
47
+ - IG2
48
+ - IG3
49
+ additional_info: >-
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: 2.3.1
3
+ name: build_steps_as_code
4
+ title: Ensure all build steps are defined as code
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Use pipeline as code for build pipelines and their defined steps.
10
+ rationale: >-
11
+ Storing pipeline instructions as code in a version control system means automation of
12
+ the build steps and less room for human error, which could potentially lead to a security
13
+ breach. Additionally, It creates the ability to revert back to a previous pipeline
14
+ configuration in order to pinpoint the affected change should a malicious incident occur.
15
+ impact: >-
16
+ audit: |
17
+ Verify that all build steps are defined as code and stored in a version control system.
18
+ • On the left sidebar, select Code > Repository.
19
+ • Check if a .gitlab-ci.yml file is at the root of your repository
20
+ remediation: |
21
+ Convert pipeline instructions into code-based syntax and upload them to the organization's version control platform.
22
+ • On the left sidebar, select Code > Repository.
23
+ • Above the file list, select the branch you want to commit to. If you're not sure, leave master or main. Then select the plus icon () and New file:
24
+ • For the Filename, type .gitlab-ci.yml.
25
+ • Select Commit changes.
26
+ default_value:
27
+ references:
28
+ - https://docs.gitlab.com/ee/ci/pipelines/
29
+ cis_controls:
30
+ - id: 0.0
31
+ version: 8
32
+ name: Explicitly Not Mapped
33
+ description: >-
34
+ Explicitly Not Mapped
35
+ implementation_groups:
36
+ - id: 0.0
37
+ version: 7
38
+ name: Explicitly Not Mapped
39
+ description: >-
40
+ Explicitly Not Mapped
41
+ implementation_groups:
42
+ additional_info: >-
@@ -0,0 +1,76 @@
1
+ ---
2
+ id: 2.3.5
3
+ name: limit_pipeline_triggers
4
+ title: Ensure access to build process triggering is minimized
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Restrict access to pipeline triggers.
10
+ rationale: >-
11
+ Build pipelines are used for multiple reasons. Some are very sensitive, such as
12
+ pipelines which deploy to production. In order to protect the environment from malicious
13
+ acts or human mistakes, such as a developer deploying a bug to production, it is
14
+ important to apply the Least Privilege principle to pipeline triggering. This principle
15
+ requires restrictions placed on which users can run which pipeline. It allows for sensitive
16
+ pipelines to only be run by administrators, who are generally the most trusted and
17
+ skilled members of the organization.
18
+ impact: >-
19
+ audit: |
20
+ For every pipeline in use, verify only the necessary users have permission to trigger it.
21
+ • On the left sidebar, select Search or go to and find your project.
22
+ • Select Manage > Members
23
+ • At the top of the member list, from the dropdown list, sort by Max role the members have in the group
24
+ • Review the members to ensure relevant members are allowed to trigger pipelines in protected environments.
25
+ remediation: |
26
+ For every pipeline in use, grant only the necessary users permission to trigger it.
27
+ • On the left sidebar, select Search or go to and find your project.
28
+ • Select Settings > CI/CD.
29
+ • Expand Protected environments.
30
+ • Select Protect an environment.
31
+ • From the Environment list, select the environment you want to protect.
32
+ • In the Allowed to deploy list, select the role, users, or groups you want to give deploy access to. Keep in mind that:
33
+ • There are two roles to choose from:
34
+ • Maintainers: Allows access to all of the project's users with the Maintainer role.
35
+ • Developers: Allows access to all of the project's users with the Maintainer and Developer role.
36
+ • You can only select groups that are already invited to the project.
37
+ • Users must have at least the Developer role to appear in the Allowed to deploy list.
38
+ • In the Approvers list, select the role, users, or groups you want to give deploy access to. Keep in mind that:
39
+ • There are two roles to choose from:
40
+ • Maintainers: Allows access to all of the project's users with the Maintainer role.
41
+ • Developers: Allows access to all of the project's users with the Maintainer and Developer role.
42
+ • You can only select groups that are already invited to the project.
43
+ • Users must have at least the Developer role to appear in the Approvers list.
44
+ • In the Approval rules section:
45
+ • Ensure that this number is less than or equal to the number of members in the rule.
46
+ • See Deployment Approvals for more information about this feature.
47
+ • Select Protect.
48
+ default_value:
49
+ references:
50
+ - https://docs.gitlab.com/ee/ci/environments/protected_environments.html
51
+ cis_controls:
52
+ - id: 3.3
53
+ version: 8
54
+ name: Configure Data Access Control Lists
55
+ description: >-
56
+ Configure data access control lists based on a user's need to know. Apply data
57
+ access control lists, also known as access permissions, to local and remote file
58
+ systems, databases, and applications.
59
+ implementation_groups:
60
+ - IG1
61
+ - IG2
62
+ - IG3
63
+ - id: 14.6
64
+ version: 7
65
+ name: Protect Information through Access Control Lists
66
+ description: >-
67
+ Protect all information stored on systems with file system, network share,
68
+ claims, application, or database specific access control lists. These controls will
69
+ enforce the principle that only authorized individuals should have access to the
70
+ information based on their need to access the information as a part of their
71
+ responsibilities.
72
+ implementation_groups:
73
+ - IG1
74
+ - IG2
75
+ - IG3
76
+ additional_info: >-
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: 2.3.6
3
+ name: pipeline_misconfiguration_scanning
4
+ title: Ensure pipelines are automatically scanned for misconfigurations
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Scan the pipeline for misconfigurations. It is recommended that this be performed
10
+ automatically.
11
+ rationale: >-
12
+ Automatic scans for misconfigurations detect human mistakes and misconfigured tasks.
13
+ This protects the environment from backdoors caused by such mistakes, which create
14
+ easier access for attackers. For example, a task that mistakenly configures credentials
15
+ to persist on the disk makes it easier for an attacker to steal them. This type of incident
16
+ can be prevented by auto-scanning.
17
+ impact: >-
18
+ audit: >-
19
+ For each pipeline, verify that it is automatically scanned for misconfigurations.
20
+ remediation: >-
21
+ For each pipeline, set automated misconfiguration scanning.
22
+ default_value:
23
+ references:
24
+ cis_controls:
25
+ - id: 4.1
26
+ version: 8
27
+ name: Establish and Maintain a Secure Configuration Process
28
+ description: >-
29
+ Establish and maintain a secure configuration process for enterprise assets
30
+ (end-user devices, including portable and mobile, non-computing/IoT devices, and
31
+ servers) and software (operating systems and applications). Review and update
32
+ documentation annually, or when significant enterprise changes occur that could
33
+ impact this Safeguard.
34
+ implementation_groups:
35
+ - IG1
36
+ - IG2
37
+ - IG3
38
+ - id: 5.1
39
+ version: 7
40
+ name: Establish Secure Configurations
41
+ description: >-
42
+ Maintain documented, standard security configuration standards for all
43
+ authorized operating systems and software.
44
+ implementation_groups:
45
+ - IG1
46
+ - IG2
47
+ - IG3
48
+ additional_info: >-
@@ -0,0 +1,56 @@
1
+ ---
2
+ id: 2.3.8
3
+ name: pipeline_secret_scanning
4
+ title: Ensure scanners are in place to identify and prevent sensitive data in pipeline files
5
+ profile: 2
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Detect and prevent sensitive data, such as confidential ID numbers, passwords, etc., in
10
+ pipelines.
11
+ rationale: >-
12
+ Sensitive data in pipeline configuration, such as cloud provider credentials or repository
13
+ credentials, create vulnerabilities with which malicious actors could steal such
14
+ information if they gain access to a pipeline. In order to mitigate this, set scanners that
15
+ will identify and prevent the existence of sensitive data in the pipeline.
16
+ impact: >-
17
+ audit: |
18
+ For every pipeline that is in use, verify that scanners are set to identify and prevent the existence of sensitive data within it.
19
+ • On the left sidebar, select Search or go to and find your project.
20
+ • Select Build > Pipeline editor.
21
+ • Ensure the following lines are present in your gitlab-ci.yml.
22
+ include:
23
+ - template: Jobs/Secret-Detection.gitlab-ci.yml
24
+ remediation: |
25
+ For every pipeline that is in use, set scanners that will identify and prevent sensitive data within it.
26
+ • On the left sidebar, select Search or go to and find your project.
27
+ • Select Build > Pipeline editor.
28
+ • Copy and paste the following to the bottom of the .gitlab-ci.yml file. If an include line already exists, add only the template line below it.
29
+ include:
30
+ - template: Jobs/Secret-Detection.gitlab-ci.yml
31
+ • Select the Validate tab, then select Validate pipeline. The message Simulation completed successfully indicates the file is valid.
32
+ • Select the Edit tab.
33
+ • Optional. In the Commit message text box, customize the commit message. In the Branch text box, enter the name of the default branch.
34
+ • Select Commit changes
35
+ default_value:
36
+ references:
37
+ - https://docs.gitlab.com/ee/user/application_security/secret_detection/
38
+ cis_controls:
39
+ - id: 3.14
40
+ version: 8
41
+ name: Log Sensitive Data Access
42
+ description: >-
43
+ Log sensitive data access, including modification and disposal.
44
+ implementation_groups:
45
+ - IG3
46
+ - id: 14.5
47
+ version: 7
48
+ name: Utilize an Active Discovery Tool to Identify Sensitive Data
49
+ description: >-
50
+ Utilize an active discovery tool to identify all sensitive information stored,
51
+ processed, or transmitted by the organization's technology systems, including
52
+ those located onsite or at a remote service provider and update the organization's
53
+ sensitive information inventory.
54
+ implementation_groups:
55
+ - IG3
56
+ additional_info: >-
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: 2.3.7
3
+ name: pipeline_vuln_scanning
4
+ title: Ensure pipelines are automatically scanned for vulnerabilities
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Scan pipelines for vulnerabilities. It is recommended that this be implemented
10
+ automatically.
11
+ rationale: >-
12
+ Automatic scanning for vulnerabilities detects known vulnerabilities in pipeline
13
+ instructions and components, allowing faster patching in case one is found. These
14
+ vulnerabilities can lead to a potentially massive breach if not handled as fast as
15
+ possible, as attackers might also be aware of such vulnerabilities.
16
+ impact: >-
17
+ audit: >-
18
+ For each pipeline, verify that it is automatically scanned for vulnerabilities.
19
+ remediation: >-
20
+ For each pipeline, set automated vulnerability scanning.
21
+ default_value:
22
+ references:
23
+ cis_controls:
24
+ - id: 7.5
25
+ version: 8
26
+ name: Perform Automated Vulnerability Scans of Internal Enterprise Assets
27
+ description: >-
28
+ Perform automated vulnerability scans of internal enterprise assets on a
29
+ quarterly, or more frequent, basis. Conduct both authenticated and
30
+ unauthenticated scans, using a SCAP-compliant vulnerability scanning tool.
31
+ implementation_groups:
32
+ - IG2
33
+ - IG3
34
+ - id: 3.1
35
+ version: 7
36
+ name: Run Automated Vulnerability Scanning Tools
37
+ description: >-
38
+ Utilize an up-to-date SCAP-compliant vulnerability scanning tool to
39
+ automatically scan all systems on the network on a weekly or more frequent basis
40
+ to identify all potential vulnerabilities on the organization's systems.
41
+ implementation_groups:
42
+ - IG2
43
+ - IG3
44
+ additional_info: >-
@@ -0,0 +1,16 @@
1
+ # 2.3 Pipeline Instructions
2
+
3
+ This section consists of security recommendations for pipeline instructions and commands.
4
+
5
+ Pipeline instructions are dedicated to taking raw files of source code and running a series of tasks on them to achieve some final artifact as output. They are most of the time written by third-party developers so they should be treated carefully and can also be vulnerable to attack in certain situations. Pipeline instructions files are considered very sensitive, and it is important to secure all their aspects - instructions, access, etc.
6
+
7
+ ## Recommendations
8
+
9
+ * [2.3.1 - build_steps_as_code.yml](./build_steps_as_code.yml)
10
+ * [2.3.2 - build_stage_io.yml](./build_stage_io.yml)
11
+ * [2.3.3 - secure_pipeline_output.yml](./secure_pipeline_output.yml)
12
+ * [2.3.4 - track_pipeline_files.yml](./track_pipeline_files.yml)
13
+ * [2.3.5 - limit_pipeline_triggers.yml](./limit_pipeline_triggers.yml)
14
+ * [2.3.6 - pipeline_misconfiguration_scanning.yml](./pipeline_misconfiguration_scanning.yml)
15
+ * [2.3.7 - pipeline_vuln_scanning.yml](./pipeline_vuln_scanning.yml)
16
+ * [2.3.8 - pipeline_secret_scanning.yml](./pipeline_secret_scanning.yml)
@@ -0,0 +1,52 @@
1
+ ---
2
+ id: 2.3.3
3
+ name: secure_pipeline_output
4
+ title: Ensure output is written to a separate, secured storage repository
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Write pipeline output artifacts to a secured storage repository.
10
+ rationale: >-
11
+ To maintain output artifacts securely and reduce the potential surface for attack, store
12
+ such artifacts separately in secure storage. This separation enforces the Single
13
+ Responsibility Principle by ensuring the orchestration platform will not be the same as
14
+ the artifact storage, which reduces the potential harm of an attack. Using the same
15
+ security considerations as the input (for example, the source code) will protect artifacts
16
+ stored and will make it harder for a malicious actor to successfully execute an attack.
17
+ impact: >-
18
+ audit: |
19
+ For each pipeline that produces output artifacts, ensure that they're written to a secured storage repository.
20
+ Review where job output artifacts are stored, either locally or in object storage. By default artifacts are stored locally in:
21
+ • Linux package (Omnibus): /var/opt/gitlab/gitlab-rails/shared/artifacts
22
+ • Self-compiled (source): /home/git/gitlab/shared/artifacts
23
+ remediation: >-
24
+ For each pipeline that produces output artifacts, write them to a secured storage repository.
25
+ One approach is to activate object storage and use an encrypted S3 bucket (or similar).
26
+
27
+ Once the storage is configured, these are the steps to activate it for job artifacts:
28
+
29
+ Linux package (Omnibus):
30
+ • Configure the object storage.
31
+ • Migrate the artifacts: sudo gitlab-rake gitlab:artifacts:migrate
32
+ • Verify that there are no files on disk in the artifacts directory: sudo find /var/opt/gitlab/gitlab-rails/shared/artifacts -type f | grep -v tmp | wc -l
33
+
34
+ Self-compiled (source):
35
+ • Configure the object storage.
36
+ • Migrate the artifacts: sudo -u git -H bundle exec rake gitlab:artifacts:migrate RAILS_ENV=production
37
+ • Verify that there are no files on disk in the artifacts directory: sudo find /home/git/gitlab/shared/artifacts -type f | grep -v tmp | wc -l
38
+ default_value:
39
+ references:
40
+ - https://docs.gitlab.com/ee/administration/job_artifacts.html?tab=Self-compiled+%28source%29#migrating-to-object-storage
41
+ cis_controls:
42
+ - id: 3.12
43
+ version: 8
44
+ name: Segment Data Processing and Storage Based on Sensitivity
45
+ description: >-
46
+ Segment data processing and storage based on the sensitivity of the data.
47
+ Do not process sensitive data on enterprise assets intended for lower sensitivity
48
+ data.
49
+ implementation_groups:
50
+ - IG2
51
+ - IG3
52
+ additional_info: >-
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: 2.3.4
3
+ name: track_pipeline_files
4
+ title: Ensure changes to pipeline files are tracked and reviewed
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_instructions
8
+ description: >-
9
+ Track and review changes to pipeline files.
10
+ rationale: >-
11
+ Pipeline files are sensitive files. They have the ability to access sensitive data and
12
+ control the build process, thus it is just as important to review changes to pipeline files
13
+ as it is to verify source code. Malicious actors can potentially add harmful code to these
14
+ files, which may lead to sensitive data exposure and hijacking of the build environment
15
+ or artifacts.
16
+ impact: >-
17
+ audit: |
18
+ For each pipeline file, ensure changes to it are being tracked and reviewed.
19
+ • On the left sidebar, select Code > Repository.
20
+ • Check if a .gitlab-ci.yml file is at the root of your repository
21
+ • If it exists, all changes will be tracked via Git.
22
+ • In the upper-right corner, select History to review the history of the gitlab-ci.yml file
23
+ remediation: |
24
+ For each pipeline file, track changes to it and review them.
25
+ • On the left sidebar, select Code > Repository.
26
+ • Above the file list, select the branch you want to commit to. If you're not sure, leave master or main. Then select the plus icon () and New file:
27
+ • For the Filename, type .gitlab-ci.yml.
28
+ • Select Commit changes
29
+ default_value:
30
+ references:
31
+ cis_controls:
32
+ - id: 3.14
33
+ version: 8
34
+ name: Log Sensitive Data Access
35
+ description: >-
36
+ Log sensitive data access, including modification and disposal.
37
+ implementation_groups:
38
+ - IG3
39
+ - id: 14.9
40
+ version: 7
41
+ name: Enforce Detail Logging for Access or Changes to Sensitive Data
42
+ description: >-
43
+ Enforce detailed audit logging for access to sensitive data or changes to
44
+ sensitive data (utilizing tools such as File Integrity Monitoring or Security
45
+ Information and Event Monitoring).
46
+ implementation_groups:
47
+ - IG3
48
+ additional_info: >-
@@ -0,0 +1,52 @@
1
+ ---
2
+ id: 2.4.4
3
+ name: create_reproducible_artifacts
4
+ title: Ensure the build pipeline creates reproducible artifacts
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_integrity
8
+ description: >-
9
+ Verify that the build pipeline creates reproducible artifacts, meaning that an artifact of
10
+ the build pipeline is the same in every run when given the same input.
11
+ rationale: >-
12
+ A reproducible build is a build that produces the same artifact when given the same
13
+ input data. Ensuring that the build pipeline produces the same artifact when given the
14
+ same input helps verify that no change has been made to the artifact. This action allows
15
+ an organization to trust that its artifacts are built only from safe code that has been
16
+ reviewed and tested and has not been tainted or changed abruptly.
17
+ impact: >-
18
+ audit: |
19
+ Ensure that build pipelines create reproducible artifacts.
20
+ • On the left sidebar, select Build > Artifacts.
21
+ • Review the artifacts associated to your build pipelines
22
+ remediation: |
23
+ Create build pipelines that produce the same artifact given the same input (for example, artifacts that do not rely on timestamps).
24
+ • On the left sidebar, select Code > Repository.
25
+ • Check if a .gitlab-ci.yml file is at the root of your repository
26
+ • To create job artifacts, use the artifacts keyword in your .gitlab-ci.yml file, as in this example:
27
+
28
+ pdf:
29
+ script: xelatex mycv.tex
30
+ artifacts:
31
+ paths:
32
+ - mycv.pdf
33
+
34
+ In this example, a job named pdf calls the xelatex command to build a PDF file from the LaTeX source file, mycv.tex.
35
+ The paths keyword determines which files to add to the job artifacts. All paths to files and directories are relative to the repository where the job was created.
36
+ default_value:
37
+ references:
38
+ - https://docs.gitlab.com/ee/ci/jobs/job_artifacts.html#create-job-artifacts
39
+ cis_controls:
40
+ - id: 0.0
41
+ version: 8
42
+ name: Explicitly Not Mapped
43
+ description: >-
44
+ Explicitly Not Mapped
45
+ implementation_groups:
46
+ - id: 0.0
47
+ version: 7
48
+ name: Explicitly Not Mapped
49
+ description: >-
50
+ Explicitly Not Mapped
51
+ implementation_groups:
52
+ additional_info: >-
@@ -0,0 +1,59 @@
1
+ ---
2
+ id: 2.4.2
3
+ name: lock_dependencies
4
+ title: Ensure all external dependencies used in the build process are locked
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_integrity
8
+ description: >-
9
+ External dependencies may be public packages needed in the pipeline, or perhaps the
10
+ public image being used for the build worker. Lock these external dependencies in
11
+ every build pipeline.
12
+ rationale: >-
13
+ External dependencies are sources of code that aren't under organizational control.
14
+ They might be intentionally or unintentionally infected with malicious code or have
15
+ known vulnerabilities, which could result in sensitive data exposure, data harvesting, or
16
+ the erosion of trust in an organization. Locking each external dependency to a specific,
17
+ safe version gives more control and less chance for risk.
18
+ impact: >-
19
+ audit: |
20
+ Ensure every external dependency being used in pipelines is locked.
21
+ • Go to Code > Repository in your project
22
+ • Review the following files at the root of your repository:
23
+ • Gemfiles
24
+ • package.jsons
25
+ • go.sum
26
+ • Review the versions of the external dependencies
27
+ remediation: |
28
+ For all external dependencies being used in pipelines, verify they are locked.
29
+ • Go to Code > Repository in your project
30
+ • Review the following files at the root of your repository:
31
+ • Gemfiles
32
+ • package.jsons
33
+ • go.sum
34
+ • Ensure the version of the external dependencies corresponds to your internal
35
+ policies
36
+ default_value:
37
+ references:
38
+ cis_controls:
39
+ - id: 16.5
40
+ version: 8
41
+ name: Use Up-to-Date and Trusted Third-Party Software Components
42
+ description: >-
43
+ Use up-to-date and trusted third-party software components. When possible,
44
+ choose established and proven frameworks and libraries that provide adequate
45
+ security. Acquire these components from trusted sources or evaluate the software
46
+ for vulnerabilities before use.
47
+ implementation_groups:
48
+ - IG2
49
+ - IG3
50
+ - id: 18.4
51
+ version: 7
52
+ name: Only Use Up-to-date And Trusted Third-Party Components
53
+ description: >-
54
+ Only use up-to-date and trusted third-party components for the software
55
+ developed by the organization.
56
+ implementation_groups:
57
+ - IG2
58
+ - IG3
59
+ additional_info: >-
@@ -0,0 +1,81 @@
1
+ ---
2
+ id: 2.4.5
3
+ name: pipeline_produces_sbom
4
+ title: Ensure pipeline steps produce a Software Bill of Materials (SBOM)
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_integrity
8
+ description: >-
9
+ SBOM (Software Bill of Materials) is a file that specifies each component of software or
10
+ a build process. Generate an SBOM after each run of a pipeline.
11
+ rationale: >-
12
+ Generating a Software Bill of Materials after each run of a pipeline will validate the
13
+ integrity and security of that pipeline. Recording every step or component role in the
14
+ pipeline ensures that no malicious acts have been committed during the pipeline's run.
15
+ impact: >-
16
+ audit: |
17
+ For each pipeline, ensure it produces a Software Bill of Materials on every run.
18
+ • Check if your gitlab-ci.yml file contains the following:
19
+ include:
20
+ - template: Jobs/Dependency-Scanning.gitlab-ci.yml
21
+ If your project has the following structure:
22
+ .
23
+ ├── ruby-project/
24
+ │ └── Gemfile.lock
25
+ ├── ruby-project-2/
26
+ │ └── Gemfile.lock
27
+ ├── php-project/
28
+ │ └── composer.lock
29
+ └── go-project/
30
+ └── go.sum
31
+ Then the Gemnasium scanner generates the following CycloneDX SBOMs:
32
+ .
33
+ ├── ruby-project/
34
+ │ ├── Gemfile.lock
35
+ │ └── gl-sbom-gem-bundler.cdx.json
36
+ ├── ruby-project-2/
37
+ │ ├── Gemfile.lock
38
+ │ └── gl-sbom-gem-bundler.cdx.json
39
+ ├── php-project/
40
+ │ ├── composer.lock
41
+ │ └── gl-sbom-packagist-composer.cdx.json
42
+ └── go-project/
43
+ ├── go.sum
44
+ └── gl-sbom-go-go.cdx.json
45
+ • Review if these files exists in your environment
46
+ remediation: |
47
+ For each pipeline, configure it to produce a Software Bill of Materials on every run.
48
+ • On the left sidebar, select Search or go to and find your project.
49
+ • Select Build > Pipeline editor.
50
+ • If no .gitlab-ci.yml file exists, select Configure pipeline, then delete the example content.
51
+ • Copy and paste the following to the bottom of the .gitlab-ci.yml file. If an include line already exists, add only the template line below it.
52
+ include:
53
+ - template: Jobs/Dependency-Scanning.gitlab-ci.yml
54
+ • Select the Validate tab, then select Validate pipeline. The message Simulation completed successfully confirms the file is valid.
55
+ • Select the Edit tab.
56
+ • Complete the fields. Do not use the default branch for the Branch field.
57
+ • Select the Start a new merge request with these changes checkbox, then select Commit changes.
58
+ • Complete the fields according to your standard workflow, then select Create merge request.
59
+ • Review and edit the merge request according to your standard workflow, then select Merge.
60
+
61
+ The CycloneDX SBOMs are:
62
+ • Named gl-sbom--.cdx.json.
63
+ • Available as job artifacts of the dependency scanning job.
64
+ • Saved in the same directory as the detected lock or build files.
65
+ default_value:
66
+ references:
67
+ - https://docs.gitlab.com/ee/user/application_security/dependency_scanning/
68
+ cis_controls:
69
+ - id: 0.0
70
+ version: 8
71
+ name: Explicitly Not Mapped
72
+ description: >-
73
+ Explicitly Not Mapped
74
+ implementation_groups:
75
+ - id: 0.0
76
+ version: 7
77
+ name: Explicitly Not Mapped
78
+ description: >-
79
+ Explicitly Not Mapped
80
+ implementation_groups:
81
+ additional_info: >-
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: 2.4.6
3
+ name: pipeline_sign_sbom
4
+ title: Ensure pipeline steps sign the Software Bill of Materials (SBOM) produced
5
+ profile: 1
6
+ category: build_pipelines
7
+ sub_category: pipeline_integrity
8
+ description: >-
9
+ SBOM (Software Bill of Materials) is a file that specifies each component of software or
10
+ a build process. It should be generated after every pipeline run. After it is generated, it
11
+ must then be signed.
12
+ rationale: >-
13
+ Software Bill of Materials (SBOM) is a file used to validate the integrity and security of a
14
+ build pipeline. Signing it ensures that no one tampered with the file when it was
15
+ delivered. Such interference can happen if someone tries to hide unusual activity.
16
+ Validating the SBOM signature can detect this activity and prevent much greater
17
+ incident.
18
+ impact: >-
19
+ audit: >-
20
+ For each pipeline, ensure it signs the Software Bill of Materials it produces on every run.
21
+ remediation: >-
22
+ For each pipeline, configure it to sign its produced Software Bill of Materials on every run.
23
+ default_value:
24
+ references:
25
+ cis_controls:
26
+ - id: 0.0
27
+ version: 8
28
+ name: Explicitly Not Mapped
29
+ description: >-
30
+ Explicitly Not Mapped
31
+ implementation_groups:
32
+ - id: 0.0
33
+ version: 7
34
+ name: Explicitly Not Mapped
35
+ description: >-
36
+ Explicitly Not Mapped
37
+ implementation_groups:
38
+ additional_info: >-