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,74 @@
1
+ ---
2
+ id: 1.2.5
3
+ name: track_forks
4
+ title: Ensure all copies (forks) of code are tracked and accounted for
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: repository_management
8
+ description: >-
9
+ Track every fork of code and ensure it is accounted for.
10
+ rationale: >-
11
+ A fork is a copy of a repository. On top of being a plain copy, any updates to the original
12
+ repository itself can be pulled and reflected by the fork under certain conditions. A large
13
+ number of repository copies (forks) become difficult to manage and properly secure.
14
+ New and sensitive changes can often be pushed into a critical repository without
15
+ developer knowledge of an updated copy of the very same repository. If there is no limit
16
+ on doing this, then it is recommended to track and delete copies of organization
17
+ repositories as needed.
18
+ impact: >-
19
+ Disabling forks completely may slow down the development process as more actions
20
+ will be necessary to take in order to fork a repository.
21
+ audit: |
22
+ Verify that the following steps are done regularly to track and examine forks.
23
+ • Navigate to the project home page.
24
+ • Find the 'Fork' button, and select the number next to it.
25
+ • Examine the forks listed there.
26
+ remediation: |
27
+ Track forks and examine them by performing the following on a regular basis:
28
+ • Navigate to the project home page.
29
+ • Find the 'Fork' button, and select the number next to it.
30
+ • Examine the forks listed there.
31
+ default_value:
32
+ references:
33
+ cis_controls:
34
+ - id: 2.1
35
+ version: 8
36
+ name: Establish and Maintain a Software Inventory
37
+ description: >-
38
+ Establish and maintain a detailed inventory of all licensed software installed on
39
+ enterprise assets. The software inventory must document the title, publisher, initial
40
+ install/use date, and business purpose for each entry; where appropriate, include
41
+ the Uniform Resource Locator (URL), app store(s), version(s), deployment
42
+ mechanism, and decommission date. Review and update the software inventory bi-
43
+ annually, or more frequently
44
+ implementation_groups:
45
+ - IG1
46
+ - IG2
47
+ - IG3
48
+ - id: 3.14
49
+ version: 8
50
+ name: Log Sensitive Data Access
51
+ description: >-
52
+ Log sensitive data access, including modification and disposal.
53
+ implementation_groups:
54
+ - IG3
55
+ - id: 2.4
56
+ version: 7
57
+ name: Track Software Inventory Information
58
+ description: >-
59
+ The software inventory system should track the name, version, publisher, and
60
+ install date for all software, including operating systems authorized by the
61
+ organization.
62
+ implementation_groups:
63
+ - IG2
64
+ - IG3
65
+ - id: 14.9
66
+ version: 7
67
+ name: Enforce Detail Logging for Access or Changes to Sensitive Data
68
+ description: >-
69
+ Enforce detailed audit logging for access to sensitive data or changes to
70
+ sensitive data (utilizing tools such as File Integrity Monitoring or Security Information
71
+ and Event Monitoring).
72
+ implementation_groups:
73
+ - IG3
74
+ additional_info: >-
@@ -0,0 +1,74 @@
1
+ ---
2
+ id: 1.2.6
3
+ name: track_project_visibility_status
4
+ title: Ensure all code projects are tracked for changes in visibility status
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: repository_management
8
+ description: >-
9
+ Ensure every change in visibility of projects is tracked.
10
+ rationale: >-
11
+ Visibility of projects determines who can access a project and/or fork it: anyone,
12
+ designated users, or only members of the organization. If a private project becomes
13
+ public, this may point to a potential attack, which can ultimately lead to data loss, the
14
+ leaking of sensitive information, and finally to a supply chain attack. It is crucial to track
15
+ these changes in order to prevent such incidents.
16
+ impact: >-
17
+ audit: |
18
+ Ensure that every change in project visibility is investigated by performing the following regularly. As an administrator:
19
+ • Navigate to the Admin Area.
20
+ • In the sidebar, select Monitoring > Audit Events.
21
+ • Review the log for Actions with the content 'Changed visibility from Private to Public' or 'Changed visibility from Internal to Public'.
22
+ • Ensure every change is reasonable and secure and is investigated if it is not.
23
+ remediation: |
24
+ Ensure that every change in project visibility is investigated by performing the following regularly. As an administrator:
25
+ • Navigate to the Admin Area.
26
+ • In the sidebar, select Monitoring > Audit Events.
27
+ • Review the log for Actions with the content 'Changed visibility from Private to Public' or 'Changed visibility from Internal to Public'.
28
+ • Ensure every change is reasonable and secure and is investigated if it is not.
29
+ • (Optional) Use Instance Audit Event Streaming (https://docs.gitlab.com/ee/administration/audit_event_streaming/#instance-streaming-destinations) to send visibility change events to a third party alerting tool. Integrate these alerts in to your change management and/or incident response processes.
30
+ default_value:
31
+ references:
32
+ - https://docs.gitlab.com/ee/administration/audit_event_streaming/audit_event_types.html#groups-and-projects
33
+ cis_controls:
34
+ - id: 2.1
35
+ version: 8
36
+ name: Establish and Maintain a Software Inventory
37
+ description: >-
38
+ Establish and maintain a detailed inventory of all licensed software installed on
39
+ enterprise assets. The software inventory must document the title, publisher, initial
40
+ install/use date, and business purpose for each entry; where appropriate, include
41
+ the Uniform Resource Locator (URL), app store(s), version(s), deployment
42
+ mechanism, and decommission date. Review and update the software inventory bi-
43
+ annually, or more frequently.
44
+ implementation_groups:
45
+ - IG1
46
+ - IG2
47
+ - IG3
48
+ - id: 3.14
49
+ version: 8
50
+ name: Log Sensitive Data Access
51
+ description: >-
52
+ Log sensitive data access, including modification and disposal.
53
+ implementation_groups:
54
+ - IG3
55
+ - id: 2.4
56
+ version: 7
57
+ name: Track Software Inventory Information
58
+ description: >-
59
+ The software inventory system should track the name, version, publisher, and
60
+ install date for all software, including operating systems authorized by the
61
+ organization.
62
+ implementation_groups:
63
+ - IG2
64
+ - IG3
65
+ - id: 14.9
66
+ version: 7
67
+ name: Enforce Detail Logging for Access or Changes to Sensitive Data
68
+ description: >-
69
+ Enforce detailed audit logging for access to sensitive data or changes to
70
+ sensitive data (utilizing tools such as File Integrity Monitoring or Security Information
71
+ and Event Monitoring).
72
+ implementation_groups:
73
+ - IG3
74
+ additional_info: >-
@@ -0,0 +1,12 @@
1
+ # 1.4 Third Party
2
+
3
+ This section consists of security recommendations for using third-party applications in the code repositories.
4
+
5
+ Applications are typically automated integrations that improve the workflow of an organization, for example, OAuth applications. Those applications are written by third-party developers and therefore should be reviewed carefully before use. It is important to monitor their use and permissions because unused applications or unnecessary high permissions can enlarge the attack surface.
6
+
7
+ ## Recommendations
8
+
9
+ * [1.4.1 - admin_approval_for_app_installs.yml](./admin_approval_for_app_installs.yml)
10
+ * [1.4.2 - stale_app_reviews.yml](./stale_app_reviews.yml)
11
+ * [1.4.3 - least_privilge_app_permissions.yml](./least_privilge_app_permissions.yml)
12
+ * [1.4.4 - secure_webhooks.yml](./secure_webhooks.yml)
@@ -0,0 +1,83 @@
1
+ ---
2
+ id: 1.4.1
3
+ name: admin_approval_for_app_installs
4
+ title: Ensure administrator approval is required for every installed application
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: third_party
8
+ description: >-
9
+ Ensure an administrator approval is required when installing applications.
10
+ rationale: >-
11
+ Applications are typically automated integrations that improve the workflow of an
12
+ organization. They are written by third-party developers, and therefore should be
13
+ validated before using in case they're malicious or not trustable. Because administrators
14
+ are expected to be the most qualified and trusted members of the organization, they
15
+ should review the applications being installed and decide whether they are both trusted
16
+ and necessary.
17
+ impact: >-
18
+ Applications will not be installed without administrator approval.
19
+ audit: |
20
+ Verify that applications are installed only after receiving administrator approval:
21
+ You are compliant by default. That is because by default only maintainers and owners
22
+ can integrate with external applications.
23
+
24
+ For OAuth Apps, perform the following:
25
+ • On the left sidebar, select your avatar.
26
+ • Select Edit profile and then select Applications.
27
+ • See the Authorized applications section.
28
+ • Review the scope level for the authorised applications with your credentials
29
+ remediation: |
30
+ Require an administrator approval for every installed application:
31
+ You are compliant by default. That is because by default only maintainers and owners
32
+ can integrate with external applications.
33
+
34
+ For OAuth Apps, perform the following:
35
+ • On the left sidebar, select your avatar.
36
+ • Select Edit profile and then select Applications.
37
+ • See the Authorized applications section.
38
+ • Update the scope level for the authorised applications with your credentials
39
+ default_value: Maintainers are organization owners.
40
+ references:
41
+ - https://docs.gitlab.com/ee/integration/oauth_provider.html#create-a-user-owned-application
42
+ - https://docs.gitlab.com/ee/integration/oauth_provider.html#view-all-authorized-applications
43
+ cis_controls:
44
+ - id: 2.5
45
+ version: 8
46
+ name: Allowlist Authorized Software
47
+ description: >-
48
+ Use technical controls, such as application allowlisting, to ensure that only
49
+ authorized software can execute or be accessed. Reassess bi-annually, or more
50
+ frequently.
51
+ implementation_groups:
52
+ - IG2
53
+ - IG3
54
+ - id: 2.6
55
+ version: 8
56
+ name: Allowlist Authorized Libraries
57
+ description: >-
58
+ Use technical controls to ensure that only authorized software libraries, such
59
+ as specific .dll, .ocx, .so, etc., files, are allowed to load into a system process.
60
+ Block unauthorized libraries from loading into a system process. Reassess bi-
61
+ annually, or more frequently.
62
+ implementation_groups:
63
+ - IG2
64
+ - IG3
65
+ - id: 2.7
66
+ version: 7
67
+ name: Utilize Application Whitelisting
68
+ description: >-
69
+ Utilize application whitelisting technology on all assets to ensure that only
70
+ authorized software executes and all unauthorized software is blocked from
71
+ executing on assets.
72
+ implementation_groups:
73
+ - IG3
74
+ - id: 2.8
75
+ version: 7
76
+ name: Implement Application Whitelisting of Libraries
77
+ description: >-
78
+ The organization's application whitelisting software must ensure that only
79
+ authorized software libraries (such as *.dll, *.ocx, *.so, etc) are allowed to load into
80
+ a system process.
81
+ implementation_groups:
82
+ - IG3
83
+ additional_info: >-
@@ -0,0 +1,103 @@
1
+ ---
2
+ id: 1.4.3
3
+ name: least_privilge_app_permissions
4
+ title: Ensure the access granted to each installed application is limited to the least privilege needed
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: third_party
8
+ description: >-
9
+ Ensure installed application permissions are limited to the lowest privilege level required.
10
+ rationale: >-
11
+ Applications are typically automated integrations that can improve the workflow of an
12
+ organization. They are written by third-party developers, and therefore should be
13
+ reviewed carefully before use. It is recommended to use the "least privilege" principle,
14
+ granting applications the lowest level of permissions required. This may prevent harm
15
+ from a potentially malicious application with unnecessarily high-level permissions
16
+ leaking data or modifying source code.
17
+ impact: >-
18
+ audit: |
19
+ Verify that each installed integration and application has the least privilege needed.
20
+
21
+ For each Project and each Group, perform the following:
22
+ • Navigate to the project or group homepage
23
+ • In the sidebar, select Settings > Integrations
24
+ • Next to every integration, select 'Configure'
25
+ • Review the integration's configuration and verify that it is limited to the least privilege needed
26
+
27
+ For each Group, perform the following:
28
+ • Navigate to the project or group homepage
29
+ • In the sidebar, select Settings > Applications
30
+ • Next to every Application, select Edit
31
+ • Review the Applications configuration and verify that it is limited to the least privilege needed
32
+
33
+ As an administrator, perform the following:
34
+ • Navigate to the Admin Area
35
+ • In the sidebar, select Applications
36
+ • Next to every Application, select Edit
37
+ • Review the Applications configuration and verify that it is limited to the least privilege needed
38
+ • In the sidebar, select Settings > Integrations
39
+ • Next to every integration, select 'Configure'
40
+ • Review the integration's configuration and verify that it is limited to the least privilege needed
41
+ • In the sidebar, select Overview > Users
42
+ • Select each user's first name
43
+ • On the users detail page, select 'Impersonate'
44
+ • Navigate to their Preferences page
45
+ • In the sidebar, select Applications
46
+ • Next to every Application under 'Authorized applications', review the scopes permitted
47
+ • Select the 'Stop impersonating' icon (next to the impersonated user's avatar)
48
+ • Repeat for each user
49
+ remediation: |
50
+ Grant permissions to applications by the "least privilege" principle, meaning the lowest possible permission necessary.
51
+
52
+ For any Integrations identified during the audit as needing modification:
53
+ • Next to the integration, select Configure.
54
+ • Edit the permissions or settings so that they grant the least possible privileges.
55
+
56
+ For example, restrict the branches it can access, or the features that are enabled.
57
+ • (Optionally) Select 'Test settings'
58
+ • Select 'Save changes'.
59
+
60
+ For any Applications identified during the audit as needing modification:
61
+ • Next to the application, select 'Edit'.
62
+ • Edit the permissions or settings so that they grant the least possible privileges.
63
+
64
+ For example, restrict the API scopes it can use.
65
+ • Select 'Save application'.
66
+
67
+ If any user authorized applications were identified during the audit as having overly permissive scopes, as an administrator perform the following:
68
+ • Navigate to the Admin Area
69
+ • In the sidebar, select Overview > Users
70
+ • Select the user's first name
71
+ • On the users detail page, select 'Impersonate'
72
+ • Navigate to their Preferences page
73
+ • In the sidebar, select Applications
74
+ • Under 'Authorized applications', re-identify the overly permissive application
75
+ • Select 'Revoke'
76
+ • Select the 'Stop impersonating' icon (next to the impersonated user's avatar)
77
+ default_value:
78
+ references:
79
+ cis_controls:
80
+ - id: 6.8
81
+ version: 8
82
+ name: Define and Maintain Role-Based Access Control
83
+ description: >-
84
+ Define and maintain role-based access control, through determining and
85
+ documenting the access rights necessary for each role within the enterprise to
86
+ successfully carry out its assigned duties. Perform access control reviews of
87
+ enterprise assets to validate that all privileges are authorized, on a recurring
88
+ schedule at a minimum annually, or more frequently.
89
+ implementation_groups:
90
+ - IG3
91
+ - id: 14.6
92
+ version: 7
93
+ name: Protect Information through Access Control Lists
94
+ description: >-
95
+ Protect all information stored on systems with file system, network share, claims,
96
+ application, or database specific access control lists. These controls will enforce the
97
+ principle that only authorized individuals should have access to the information
98
+ based on their need to access the information as a part of their responsibilities.
99
+ implementation_groups:
100
+ - IG1
101
+ - IG2
102
+ - IG3
103
+ additional_info: >-
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: 1.4.4
3
+ name: secure_webhooks
4
+ title: Ensure only secured webhooks are used
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: third_party
8
+ description: >-
9
+ Use only secured webhooks in the source code management platform.
10
+ rationale: >-
11
+ A webhook is an event listener, attached to critical and sensitive parts of the software
12
+ delivery process. It is triggered by a list of events (such as a new code being
13
+ committed), and when triggered, the webhook sends out a notification with some
14
+ payload to specific internet endpoints. Since the payload of the webhook contains
15
+ sensitive organization data, it's important all webhooks are directed to an endpoint
16
+ (URL) protected by SSL verification (HTTPS). This helps ensure that the data sent is
17
+ delivered to securely without any man-in-the-middle, who could easily access and even
18
+ alter the payload of the request.
19
+ impact: |
20
+ Perform the following to ensure all webhooks used are secured (HTTPS):
21
+ 1. Navigate to your organization or repository and select Settings.
22
+ 2. Select Webhooks on the side menu.
23
+ 3. Verify that each webhook URL starts with 'https'.
24
+ audit: |
25
+ Perform the following to secure all webhooks.
26
+
27
+ For each project and for each group:
28
+ • Navigate to the project or group
29
+ • Select Settings > Webhooks on the side menu.
30
+ • Ensure all webhooks starts with 'https'.
31
+ • Ensure all webhooks state 'SSL Verification: enabled'
32
+
33
+ As an Administrator:
34
+ • Navigate to the Admin Area
35
+ • Select System Hooks on the side menu.
36
+ • Ensure all webhooks starts with 'https'.
37
+ • Ensure all webhooks state 'SSL Verification: enabled'
38
+ remediation: |
39
+ Perform the following to secure all webhooks.
40
+
41
+ For each project and for each group:
42
+ • Navigate to the project or group
43
+ • Select Settings > Webhooks on the side menu.
44
+ • Find any webhooks that start with 'http' and not 'https', or which have 'SSL Verification: disabled'.
45
+ • Click Edit.
46
+ • Change the payload URL to begin with 'https'
47
+ • Select the 'Enable SSL verification' checkbox
48
+ • Click Update webhook.
49
+ As an Administrator:
50
+ • Navigate to the Admin Area
51
+ • Select System Hooks on the side menu.
52
+ • Find any webhooks that start with 'http' and not 'https', or which have 'SSL Verification: disabled'.
53
+ • Click Edit.
54
+ • Change the payload URL to begin with 'https'
55
+ • Select the 'Enable SSL verification' checkbox
56
+ • Click Update webhook.
57
+ default_value:
58
+ references:
59
+ - https://docs.gitlab.com/ee/user/project/integrations/webhooks.html
60
+ cis_controls:
61
+ - id: 0.0
62
+ version: 8
63
+ name: Explicitly Not Mapped
64
+ description: >-
65
+ Explicitly Not Mapped
66
+ implementation_groups:
67
+ - id: 0.0
68
+ version: 7
69
+ name: Explicitly Not Mapped
70
+ description: >-
71
+ Explicitly Not Mapped
72
+ implementation_groups:
73
+ additional_info: >-
@@ -0,0 +1,66 @@
1
+ ---
2
+ id: 1.4.2
3
+ name: stale_app_reviews
4
+ title: Ensure stale applications are reviewed and inactive ones are removed
5
+ profile: 1
6
+ category: source_code
7
+ sub_category: third_party
8
+ description: >-
9
+ Ensure stale (inactive) applications are reviewed and removed if no longer in use.
10
+ rationale: >-
11
+ Applications that have been inactive for a long period of time are enlarging the surface
12
+ of attack for data leaks. They are more likely to be improperly managed, and could
13
+ possibly be accessed by third-party developers as a tool for collecting internal data of
14
+ the organization or repository in which they are installed. It is important to remove these
15
+ inactive applications as soon as possible.
16
+ impact: >-
17
+ audit: >-
18
+ Verify that all the applications in the organization are actively used, and remove those
19
+ that are no longer in use. Ensure that Dependency scanning is enabled, which enables
20
+ Continuous Vulnerability scanning by default and identifies vulnerabilities applications,
21
+ even if they are stale.
22
+ remediation: |
23
+ 1. Review all stale applications and periodically remove them.
24
+ 2. Enable dependency scanning to automatically detect vulnerabilities in stale applications.
25
+ 3. Add the following to your .gitlab-ci.yml file:
26
+ include:
27
+ - template: Security/Dependency-Scanning.gitlab-ci.yml
28
+ default_value:
29
+ references:
30
+ cis_controls:
31
+ - id: 2.2
32
+ version: 8
33
+ name: Ensure Authorized Software is Currently Supported
34
+ description: >-
35
+ Ensure that only currently supported software is designated as authorized in the
36
+ software inventory for enterprise assets. If software is unsupported, yet necessary
37
+ for the fulfillment of the enterprise's mission, document an exception detailing
38
+ mitigating controls and residual risk acceptance. For any unsupported software
39
+ without an exception documentation, designate as unauthorized. Review the
40
+ software list to verify software support at least monthly, or more frequently.
41
+ implementation_groups:
42
+ - IG1
43
+ - IG2
44
+ - IG3
45
+ - id: 2.4
46
+ version: 8
47
+ name: Utilize Automated Software Inventory Tools
48
+ description: >-
49
+ Utilize software inventory tools, when possible, throughout the enterprise to
50
+ automate the discovery and documentation of installed software.
51
+ implementation_groups:
52
+ - IG2
53
+ - IG3
54
+ - id: 13.2
55
+ version: 7
56
+ name: Remove Sensitive Data or Systems Not Regularly Accessed by Organization
57
+ description: >-
58
+ Remove sensitive data or systems not regularly accessed by the organization
59
+ from the network. These systems shall only be used as stand alone systems
60
+ (disconnected from the network) by the business unit needing to occasionally use
61
+ the system or completely virtualized and powered off until needed.
62
+ implementation_groups:
63
+ - IG1
64
+ - IG2
65
+ - IG3
66
+ additional_info: >-
@@ -0,0 +1,30 @@
1
+ ---
2
+ id: 900000000001
3
+ name: example
4
+ title: example
5
+ profile: 1
6
+ category: example
7
+ sub_category: example
8
+ description: >-
9
+ example
10
+ rationale: >-
11
+ example
12
+ impact: >-
13
+ example
14
+ audit: >-
15
+ example
16
+ remediation: >-
17
+ example
18
+ default_value:
19
+ references:
20
+ - example
21
+ cis_controls:
22
+ - id: 2.3
23
+ version: 8
24
+ name: example
25
+ description: >-
26
+ example
27
+ implementation_groups:
28
+ - IG2
29
+ - IG3
30
+ additional_info: >-
File without changes
File without changes
@@ -0,0 +1,29 @@
1
+ # -----------------------------------------------------------------------------
2
+
3
+ import pytest
4
+
5
+ import sys
6
+
7
+ # -----------------------------------------------------------------------------
8
+
9
+
10
+ @pytest.fixture
11
+ def cmdline(capsys, monkeypatch):
12
+ def _cmdline(args):
13
+ # Patch sys.argv with the provided args
14
+ monkeypatch.setattr(sys, 'argv', args)
15
+
16
+ try:
17
+ with pytest.raises(SystemExit) as execCtx:
18
+ from gitlabcis.__main__ import main # noqa: F401
19
+ # return an exit code:
20
+ code = execCtx.value.code
21
+
22
+ except pytest.fail.Exception:
23
+ print('SystemExit was not raised')
24
+ code = 0
25
+
26
+ # return exec, capsys.readouterr()
27
+ return code, capsys.readouterr()
28
+
29
+ return _cmdline
@@ -0,0 +1,82 @@
1
+ # -----------------------------------------------------------------------------
2
+
3
+ import re
4
+
5
+ # -----------------------------------------------------------------------------
6
+
7
+
8
+ def test_no_token_value(cmdline):
9
+ exitCode, std = cmdline(
10
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub', '--token', ''])
11
+
12
+ assert re.match(
13
+ r'Error: The token provided failed to authenticate to*',
14
+ str(std.out))
15
+
16
+ # -----------------------------------------------------------------------------
17
+
18
+
19
+ def test_no_url(cmdline):
20
+ exitCode, std = cmdline(['gitlabcis', '--debug'])
21
+ assert exitCode == 2
22
+
23
+ # -----------------------------------------------------------------------------
24
+
25
+
26
+ def test_dodgy_token_value(cmdline):
27
+ exitCode, std = cmdline(
28
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub',
29
+ '--token', 'this-aint-no-token'])
30
+
31
+ assert re.match(
32
+ r'Error: The token provided failed to authenticate to*',
33
+ str(std.out))
34
+
35
+ # -----------------------------------------------------------------------------
36
+
37
+
38
+ def test_no_token_var(cmdline, monkeypatch):
39
+ # temporarily remove the token from the environment
40
+ monkeypatch.delenv('GITLAB_TOKEN', raising=False)
41
+
42
+ exitCode, std = cmdline(
43
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub'])
44
+
45
+ assert re.match(
46
+ r'Error: No access token found, you must either have the '
47
+ r'environment variable*',
48
+ str(std.out))
49
+
50
+
51
+ # -----------------------------------------------------------------------------
52
+
53
+
54
+ def test_no_output_file(cmdline):
55
+ exitCode, std = cmdline(
56
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub', '--format', 'json'])
57
+
58
+ assert ((exitCode == 1) or re.match(
59
+ r'Error: Output format provided but no output file provided',
60
+ str(std.out)))
61
+
62
+ # -----------------------------------------------------------------------------
63
+
64
+
65
+ def test_two_urls(cmdline):
66
+ exitCode, std = cmdline(
67
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub',
68
+ 'https://gitlab.com/nmcd/pub'])
69
+
70
+ _err = str(std.out)
71
+ assert (
72
+ re.match(r'Error: No access token found', _err) or
73
+ re.match(r'Error: Only one URL is currently supported', _err))
74
+
75
+ # -----------------------------------------------------------------------------
76
+
77
+
78
+ def test_fake_url(cmdline):
79
+ exitCode, std = cmdline(
80
+ ['gitlabcis', 'https://nmcd.gitlab.com/nmcd/pub'])
81
+
82
+ assert exitCode == 1
@@ -0,0 +1,19 @@
1
+ # -----------------------------------------------------------------------------
2
+
3
+
4
+ def test_enable_debug(cmdline):
5
+ exitCode, std = cmdline(
6
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub', '--debug', '--format',
7
+ 'json', '--output', 'results.json', '--omit-skipped',
8
+ '--remediations'])
9
+
10
+ assert exitCode == 1
11
+
12
+
13
+ def test_disable_debug(cmdline):
14
+ exitCode, std = cmdline(
15
+ ['gitlabcis', 'https://gitlab.com/nmcd/pub', '--format',
16
+ 'json', '--output', 'results.json', '--omit-skipped',
17
+ '--remediations'])
18
+
19
+ assert exitCode == 1
@@ -0,0 +1,7 @@
1
+ # -----------------------------------------------------------------------------
2
+
3
+
4
+ def test_version(cmdline):
5
+ exitCode, std = cmdline(['gitlabcis', '--version'])
6
+ print(std.out)
7
+ assert exitCode == 0
File without changes