cloudg 0.3.0__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 (75) hide show
  1. cloudg/__init__.py +21 -0
  2. cloudg/api.py +613 -0
  3. cloudg/cli.py +934 -0
  4. cloudg/collectors/__init__.py +5 -0
  5. cloudg/collectors/aws.py +830 -0
  6. cloudg/collectors/azure.py +362 -0
  7. cloudg/collectors/base.py +44 -0
  8. cloudg/collectors/gcp.py +170 -0
  9. cloudg/collectors/multi.py +329 -0
  10. cloudg/config.py +261 -0
  11. cloudg/coverage.py +93 -0
  12. cloudg/credentials.py +451 -0
  13. cloudg/graph/__init__.py +6 -0
  14. cloudg/graph/builder.py +336 -0
  15. cloudg/graph/ontology.py +914 -0
  16. cloudg/graph/rag_export.py +533 -0
  17. cloudg/graph/reachability.py +237 -0
  18. cloudg/normaliser.py +390 -0
  19. cloudg/policies/custodian-aws-security.yml +139 -0
  20. cloudg/policies/custodian-azure.yml +95 -0
  21. cloudg/policies/custodian-gcp.yml +87 -0
  22. cloudg/policies/custodian.yml +131 -0
  23. cloudg/region_discovery.py +330 -0
  24. cloudg/registry.py +142 -0
  25. cloudg/renderers/__init__.py +1 -0
  26. cloudg/renderers/html_report.py +430 -0
  27. cloudg/renderers/json_export.py +65 -0
  28. cloudg/renderers/svg.py +689 -0
  29. cloudg/renderers/terraform_export.py +666 -0
  30. cloudg/retry.py +103 -0
  31. cloudg/rules/cis_aws_v3.yaml +148 -0
  32. cloudg/rules/cis_azure_v2.yaml +142 -0
  33. cloudg/rules/cis_gcp_v3.yaml +133 -0
  34. cloudg/rules/frameworks/aws_foundational_security_best_practices_aws.yaml +1286 -0
  35. cloudg/rules/frameworks/cis_5.0_aws.yaml +280 -0
  36. cloudg/rules/frameworks/cis_5.0_azure.yaml +475 -0
  37. cloudg/rules/frameworks/cis_5.0_gcp.yaml +327 -0
  38. cloudg/rules/frameworks/gdpr_aws.yaml +95 -0
  39. cloudg/rules/frameworks/hipaa_aws.yaml +461 -0
  40. cloudg/rules/frameworks/hipaa_azure.yaml +504 -0
  41. cloudg/rules/frameworks/hipaa_gcp.yaml +211 -0
  42. cloudg/rules/frameworks/iso27001_2022_aws.yaml +789 -0
  43. cloudg/rules/frameworks/iso27001_2022_azure.yaml +477 -0
  44. cloudg/rules/frameworks/iso27001_2022_gcp.yaml +240 -0
  45. cloudg/rules/frameworks/mitre_attack_aws.yaml +596 -0
  46. cloudg/rules/frameworks/mitre_attack_azure.yaml +418 -0
  47. cloudg/rules/frameworks/mitre_attack_gcp.yaml +300 -0
  48. cloudg/rules/frameworks/nist_800_53_revision_5_aws.yaml +3234 -0
  49. cloudg/rules/frameworks/nist_csf_2.0_aws.yaml +828 -0
  50. cloudg/rules/frameworks/pci_4.0_aws.yaml +7108 -0
  51. cloudg/rules/frameworks/pci_4.0_azure.yaml +4696 -0
  52. cloudg/rules/frameworks/pci_4.0_gcp.yaml +5405 -0
  53. cloudg/rules/frameworks/soc2_aws.yaml +421 -0
  54. cloudg/rules/frameworks/soc2_azure.yaml +477 -0
  55. cloudg/rules/frameworks/soc2_gcp.yaml +342 -0
  56. cloudg/rules/gdpr.yaml +56 -0
  57. cloudg/rules/hipaa_security_rule.yaml +83 -0
  58. cloudg/rules/iso_27001_2022.yaml +88 -0
  59. cloudg/rules/nist_800_53.yaml +134 -0
  60. cloudg/rules/pci_dss_v4.yaml +108 -0
  61. cloudg/rules/soc2_tsc.yaml +93 -0
  62. cloudg/scanners/__init__.py +1 -0
  63. cloudg/scanners/checkov.py +174 -0
  64. cloudg/scanners/iam_linter.py +200 -0
  65. cloudg/scanners/prowler.py +237 -0
  66. cloudg/scanners/scoutsuite.py +163 -0
  67. cloudg/scanners/trivy.py +339 -0
  68. cloudg/schema/__init__.py +25 -0
  69. cloudg/schema/models.py +260 -0
  70. cloudg/templates/report.html.j2 +828 -0
  71. cloudg-0.3.0.dist-info/METADATA +330 -0
  72. cloudg-0.3.0.dist-info/RECORD +75 -0
  73. cloudg-0.3.0.dist-info/WHEEL +4 -0
  74. cloudg-0.3.0.dist-info/entry_points.txt +14 -0
  75. cloudg-0.3.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,300 @@
1
+ # Generated by scripts/import_prowler_compliance.py — do not edit by hand.
2
+ # Framework: MITRE-ATTACK (GCP)
3
+ # Data source: Prowler (https://github.com/prowler-cloud/prowler), Apache-2.0.
4
+ framework: MITRE-ATTACK-GCP
5
+ version: null
6
+ source: Prowler compliance data (mitre_attack_gcp.json), Apache-2.0, https://github.com/prowler-cloud/prowler
7
+ provider: gcp
8
+ controls:
9
+ - id: T1190
10
+ title: Adversaries may attempt to exploit a weakness in an Internet-facing host
11
+ or system to initially access a network. The weakness in the system can be a software
12
+ bug, a temporary glitch, or a misconfiguration.
13
+ checks:
14
+ - cloudsql_instance_public_access
15
+ - cloudsql_instance_public_ip
16
+ - cloudstorage_bucket_public_access
17
+ - compute_firewall_rdp_access_from_the_internet_allowed
18
+ - compute_firewall_ssh_access_from_the_internet_allowed
19
+ - compute_instance_public_ip
20
+ - compute_public_address_shodan
21
+ - kms_key_not_publicly_accessible
22
+ - id: T1199
23
+ title: Adversaries may breach or otherwise leverage organizations who have access
24
+ to intended victims. Access through trusted third party relationship abuses an
25
+ existing connection that may not be protected or receives less scrutiny than standard
26
+ mechanisms of gaining access to a network.
27
+ checks:
28
+ - compute_firewall_rdp_access_from_the_internet_allowed
29
+ - compute_firewall_ssh_access_from_the_internet_allowed
30
+ - id: T1078
31
+ title: Adversaries may obtain and abuse credentials of existing accounts as a means
32
+ of gaining Initial Access, Persistence, Privilege Escalation, or Defense Evasion.
33
+ Compromised credentials may be used to bypass access controls placed on various
34
+ resources on systems within the network and may even be used…
35
+ checks:
36
+ - apikeys_api_restricted_with_gemini_api
37
+ - apikeys_api_restrictions_configured
38
+ - apikeys_key_rotated_in_90_days
39
+ - iam_account_access_approval_enabled
40
+ - iam_no_service_roles_at_project_level
41
+ - iam_organization_essential_contacts_configured
42
+ - iam_role_kms_enforce_separation_of_duties
43
+ - iam_role_sa_enforce_separation_of_duties
44
+ - iam_sa_no_administrative_privileges
45
+ - iam_sa_no_user_managed_keys
46
+ - iam_sa_user_managed_key_rotate_90_days
47
+ - iam_sa_user_managed_key_unused
48
+ - iam_service_account_unused
49
+ - id: T1059
50
+ title: Adversaries may abuse command and script interpreters to execute commands,
51
+ scripts, or binaries. These interfaces and languages provide ways of interacting
52
+ with computer systems and are a common feature across many different platforms.
53
+ Most systems come with some built-in command-line interface and…
54
+ checks:
55
+ - compute_instance_shielded_vm_enabled
56
+ - id: T1204
57
+ title: An adversary may rely upon specific actions by a user in order to gain execution.
58
+ Users may be subjected to social engineering to get them to execute malicious
59
+ code by, for example, opening a malicious document file or link. These user actions
60
+ will typically be observed as follow-on behavior from f…
61
+ checks:
62
+ - compute_instance_shielded_vm_enabled
63
+ - id: T1098
64
+ title: Adversaries may manipulate accounts to maintain access to victim systems.
65
+ Account manipulation may consist of any action that preserves adversary access
66
+ to a compromised account, such as modifying credentials or permission groups.
67
+ These actions could also include account activity designed to subver…
68
+ checks:
69
+ - apikeys_key_exists
70
+ - apikeys_key_rotated_in_90_days
71
+ - iam_account_access_approval_enabled
72
+ - iam_cloud_asset_inventory_enabled
73
+ - iam_no_service_roles_at_project_level
74
+ - iam_organization_essential_contacts_configured
75
+ - iam_role_kms_enforce_separation_of_duties
76
+ - iam_role_sa_enforce_separation_of_duties
77
+ - iam_sa_no_administrative_privileges
78
+ - iam_sa_no_user_managed_keys
79
+ - iam_sa_user_managed_key_rotate_90_days
80
+ - id: T1525
81
+ title: Adversaries may implant cloud or container images with malicious code to
82
+ establish persistence after gaining access to an environment. Amazon Web Services
83
+ (AWS) Amazon Machine Images (AMIs), Google Cloud Platform (GCP) Images, and Azure
84
+ Images as well as popular container runtimes such as Docker ca…
85
+ checks:
86
+ - artifacts_container_analysis_enabled
87
+ - id: T1556
88
+ title: Adversaries may modify authentication mechanisms and processes to access
89
+ user credentials or enable otherwise unwarranted access to accounts. The authentication
90
+ process is handled by mechanisms, such as the Local Security Authentication Server
91
+ (LSASS) process and the Security Accounts Manager (SAM)…
92
+ checks:
93
+ - iam_account_access_approval_enabled
94
+ - iam_no_service_roles_at_project_level
95
+ - iam_role_kms_enforce_separation_of_duties
96
+ - iam_role_sa_enforce_separation_of_duties
97
+ - iam_sa_no_administrative_privileges
98
+ - iam_sa_no_user_managed_keys
99
+ - id: T1562
100
+ title: Adversaries may maliciously modify components of a victim environment in
101
+ order to hinder or disable defensive mechanisms. This not only involves impairing
102
+ preventative defenses, such as firewalls and anti-virus, but also detection capabilities
103
+ that defenders can use to audit activity and identify m…
104
+ checks:
105
+ - compute_instance_shielded_vm_enabled
106
+ - logging_sink_created
107
+ - id: T1578
108
+ title: An adversary may attempt to modify a cloud account's compute service infrastructure
109
+ to evade defenses. A modification to the compute service infrastructure can include
110
+ the creation, deletion, or modification of one or more components such as compute
111
+ instances, virtual machines, and snapshots.
112
+ checks:
113
+ - iam_account_access_approval_enabled
114
+ - iam_no_service_roles_at_project_level
115
+ - iam_role_kms_enforce_separation_of_duties
116
+ - iam_role_sa_enforce_separation_of_duties
117
+ - iam_sa_no_administrative_privileges
118
+ - iam_sa_no_user_managed_keys
119
+ - id: T1550
120
+ title: Adversaries may use alternate authentication material, such as password hashes,
121
+ Kerberos tickets, and application access tokens, in order to move laterally within
122
+ an environment and bypass normal system access controls.
123
+ checks:
124
+ - apikeys_api_restricted_with_gemini_api
125
+ - gemini_api_disabled
126
+ - iam_account_access_approval_enabled
127
+ - iam_no_service_roles_at_project_level
128
+ - iam_role_kms_enforce_separation_of_duties
129
+ - iam_role_sa_enforce_separation_of_duties
130
+ - iam_sa_no_administrative_privileges
131
+ - iam_sa_no_user_managed_keys
132
+ - id: T1606
133
+ title: Adversaries may forge credential materials that can be used to gain access
134
+ to web applications or Internet services. Web applications and services (hosted
135
+ in cloud SaaS environments or on-premise servers) often use session cookies, tokens,
136
+ or other materials to authenticate and authorize user acces…
137
+ checks:
138
+ - iam_account_access_approval_enabled
139
+ - iam_no_service_roles_at_project_level
140
+ - iam_role_kms_enforce_separation_of_duties
141
+ - iam_role_sa_enforce_separation_of_duties
142
+ - iam_sa_no_administrative_privileges
143
+ - id: T1040
144
+ title: Adversaries may sniff network traffic to capture information about an environment,
145
+ including authentication material passed over the network. Network sniffing refers
146
+ to using the network interface on a system to monitor or capture information sent
147
+ over a wired or wireless connection. An adversary m…
148
+ checks:
149
+ - bigquery_dataset_cmk_encryption
150
+ - bigquery_table_cmk_encryption
151
+ - cloudsql_instance_ssl_connections
152
+ - dataproc_encrypted_with_cmks_disabled
153
+ - dns_rsasha1_in_use_to_key_sign_in_dnssec
154
+ - dns_rsasha1_in_use_to_zone_sign_in_dnssec
155
+ - iam_account_access_approval_enabled
156
+ - iam_no_service_roles_at_project_level
157
+ - iam_role_kms_enforce_separation_of_duties
158
+ - iam_role_sa_enforce_separation_of_duties
159
+ - iam_sa_no_administrative_privileges
160
+ - id: T1048
161
+ title: Adversaries may steal data by exfiltrating it over a different protocol than
162
+ that of the existing command and control channel. The data may also be sent to
163
+ an alternate network location from the main command and control server.
164
+ checks:
165
+ - compute_firewall_rdp_access_from_the_internet_allowed
166
+ - compute_firewall_ssh_access_from_the_internet_allowed
167
+ - id: T1530
168
+ title: Adversaries may collect sensitive data from these cloud storage solutions.
169
+ Providers typically offer security guides to help end users configure systems,
170
+ though misconfigurations are a common problem.[5][6][7] There have been numerous
171
+ incidents where cloud storage has been improperly secured, typic…
172
+ checks:
173
+ - apikeys_api_restricted_with_gemini_api
174
+ - bigquery_dataset_cmk_encryption
175
+ - bigquery_table_cmk_encryption
176
+ - cloudsql_instance_ssl_connections
177
+ - dataproc_encrypted_with_cmks_disabled
178
+ - dns_rsasha1_in_use_to_key_sign_in_dnssec
179
+ - dns_rsasha1_in_use_to_zone_sign_in_dnssec
180
+ - id: T1485
181
+ title: Adversaries may destroy data and files on specific systems or in large numbers
182
+ on a network to interrupt availability to systems, services, and network resources.
183
+ Data destruction is likely to render stored data irrecoverable by forensic techniques
184
+ through overwriting files or data on local and rem…
185
+ checks:
186
+ - logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled
187
+ - logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled
188
+ - logging_log_metric_filter_and_alert_for_custom_role_changes_enabled
189
+ - logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled
190
+ - logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled
191
+ - logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled
192
+ - logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled
193
+ - logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled
194
+ - id: T1499
195
+ title: Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade
196
+ or block the availability of services to users. Endpoint DoS can be performed
197
+ by exhausting the system resources those services are hosted on or exploiting
198
+ the system to cause a persistent crash condition. Example services …
199
+ checks:
200
+ - logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled
201
+ - logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled
202
+ - logging_log_metric_filter_and_alert_for_custom_role_changes_enabled
203
+ - logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled
204
+ - logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled
205
+ - logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled
206
+ - logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled
207
+ - logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled
208
+ - id: T1496
209
+ title: Adversaries may leverage the resources of co-opted systems in order to solve
210
+ resource intensive problems, which may impact system and/or hosted service availability.
211
+ checks:
212
+ - logging_log_metric_filter_and_alert_for_audit_configuration_changes_enabled
213
+ - logging_log_metric_filter_and_alert_for_bucket_permission_changes_enabled
214
+ - logging_log_metric_filter_and_alert_for_custom_role_changes_enabled
215
+ - logging_log_metric_filter_and_alert_for_project_ownership_changes_enabled
216
+ - logging_log_metric_filter_and_alert_for_sql_instance_configuration_changes_enabled
217
+ - logging_log_metric_filter_and_alert_for_vpc_firewall_rule_changes_enabled
218
+ - logging_log_metric_filter_and_alert_for_vpc_network_changes_enabled
219
+ - logging_log_metric_filter_and_alert_for_vpc_network_route_changes_enabled
220
+ - id: T1498
221
+ title: Adversaries may perform Network Denial of Service (DoS) attacks to degrade
222
+ or block the availability of targeted resources to users. Network DoS can be performed
223
+ by exhausting the network bandwidth services rely on. Example resources include
224
+ specific websites, email services, DNS, and web-based app…
225
+ checks:
226
+ - compute_firewall_rdp_access_from_the_internet_allowed
227
+ - compute_firewall_ssh_access_from_the_internet_allowed
228
+ - compute_network_not_legacy
229
+ - id: T1087
230
+ title: Adversaries may attempt to get a listing of valid accounts, usernames, or
231
+ email addresses on a system or within a compromised environment. This information
232
+ can help adversaries determine which accounts exist, which can aid in follow-on
233
+ behavior such as brute-forcing, spear-phishing attacks, or acco…
234
+ checks:
235
+ - iam_account_access_approval_enabled
236
+ - iam_role_kms_enforce_separation_of_duties
237
+ - iam_role_sa_enforce_separation_of_duties
238
+ - iam_sa_no_administrative_privileges
239
+ - id: T1580
240
+ title: An adversary may attempt to discover infrastructure and resources that are
241
+ available within an infrastructure-as-a-service (IaaS) environment. This includes
242
+ compute service resources such as instances, virtual machines, and snapshots as
243
+ well as resources of other services including the storage and …
244
+ checks:
245
+ - iam_account_access_approval_enabled
246
+ - iam_cloud_asset_inventory_enabled
247
+ - iam_no_service_roles_at_project_level
248
+ - iam_role_kms_enforce_separation_of_duties
249
+ - iam_role_sa_enforce_separation_of_duties
250
+ - iam_sa_no_administrative_privileges
251
+ - iam_sa_no_user_managed_keys
252
+ - id: T1538
253
+ title: An adversary may use a cloud service dashboard GUI with stolen credentials
254
+ to gain useful information from an operational cloud environment, such as specific
255
+ services, resources, and features. For example, the GCP Command Center can be
256
+ used to view all assets, findings of potential security risks, …
257
+ checks:
258
+ - iam_account_access_approval_enabled
259
+ - iam_no_service_roles_at_project_level
260
+ - iam_role_kms_enforce_separation_of_duties
261
+ - iam_role_sa_enforce_separation_of_duties
262
+ - iam_sa_no_administrative_privileges
263
+ - iam_sa_no_user_managed_keys
264
+ - id: T1046
265
+ title: Adversaries may attempt to get a listing of services running on remote hosts
266
+ and local network infrastructure devices, including those that may be vulnerable
267
+ to remote software exploitation. Common methods to acquire this information include
268
+ port and/or vulnerability scans using tools that are brou…
269
+ checks:
270
+ - compute_firewall_rdp_access_from_the_internet_allowed
271
+ - compute_firewall_ssh_access_from_the_internet_allowed
272
+ - compute_network_default_in_use
273
+ - compute_network_dns_logging_enabled
274
+ - compute_network_not_legacy
275
+ - id: T1049
276
+ title: Adversaries may attempt to get a listing of network connections to or from
277
+ the compromised system they are currently accessing or from remote systems by
278
+ querying for information over the network.
279
+ checks:
280
+ - compute_instance_shielded_vm_enabled
281
+ - logging_sink_created
282
+ - id: T1082
283
+ title: An adversary may attempt to get detailed information about the operating
284
+ system and hardware, including version, patches, hotfixes, service packs, and
285
+ architecture. Adversaries may use the information from System Information Discovery
286
+ during automated discovery to shape follow-on behaviors, includi…
287
+ checks:
288
+ - compute_instance_shielded_vm_enabled
289
+ - id: T1069
290
+ title: Adversaries may attempt to discover group and permission settings. This information
291
+ can help adversaries determine which user accounts and groups are available, the
292
+ membership of users in particular groups, and which users and groups have elevated
293
+ permissions.
294
+ checks:
295
+ - iam_account_access_approval_enabled
296
+ - iam_no_service_roles_at_project_level
297
+ - iam_role_kms_enforce_separation_of_duties
298
+ - iam_role_sa_enforce_separation_of_duties
299
+ - iam_sa_no_administrative_privileges
300
+ - iam_sa_no_user_managed_keys