catocli 3.0.14__py3-none-any.whl → 3.0.22__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.

Potentially problematic release.


This version of catocli might be problematic. Click here for more details.

Files changed (192) hide show
  1. catocli/Utils/clidriver.py +16 -8
  2. catocli/Utils/formatter_account_metrics.py +544 -0
  3. catocli/Utils/formatter_app_stats.py +184 -0
  4. catocli/Utils/formatter_app_stats_timeseries.py +377 -0
  5. catocli/Utils/formatter_events_timeseries.py +459 -0
  6. catocli/Utils/formatter_socket_port_metrics.py +189 -0
  7. catocli/Utils/formatter_socket_port_metrics_timeseries.py +339 -0
  8. catocli/Utils/formatter_utils.py +251 -0
  9. catocli/Utils/help_formatter.py +1 -1
  10. catocli/__init__.py +1 -1
  11. catocli/clisettings.json +37 -5
  12. catocli/parsers/custom/query_eventsFeed/README.md +94 -0
  13. catocli/parsers/custom/scim/README.md +346 -0
  14. catocli/parsers/custom/scim/scim_client.py +132 -26
  15. catocli/parsers/custom/scim/scim_commands.py +14 -56
  16. catocli/parsers/customParserApiClient.py +213 -65
  17. catocli/parsers/mutation_policy/__init__.py +405 -405
  18. catocli/parsers/mutation_site/__init__.py +15 -15
  19. catocli/parsers/mutation_sites/__init__.py +15 -15
  20. catocli/parsers/query_accountMetrics/README.md +99 -9
  21. catocli/parsers/query_accountMetrics/__init__.py +6 -0
  22. catocli/parsers/query_appStats/README.md +11 -11
  23. catocli/parsers/query_appStats/__init__.py +4 -2
  24. catocli/parsers/query_appStatsTimeSeries/README.md +10 -10
  25. catocli/parsers/query_appStatsTimeSeries/__init__.py +4 -2
  26. catocli/parsers/query_auditFeed/README.md +9 -9
  27. catocli/parsers/query_events/README.md +9 -9
  28. catocli/parsers/query_eventsTimeSeries/README.md +289 -9
  29. catocli/parsers/query_eventsTimeSeries/__init__.py +6 -0
  30. catocli/parsers/query_policy/__init__.py +42 -42
  31. catocli/parsers/query_socketPortMetrics/README.md +53 -9
  32. catocli/parsers/query_socketPortMetrics/__init__.py +6 -0
  33. catocli/parsers/query_socketPortMetricsTimeSeries/README.md +92 -9
  34. catocli/parsers/query_socketPortMetricsTimeSeries/__init__.py +4 -2
  35. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/METADATA +1 -1
  36. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/RECORD +187 -183
  37. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/top_level.txt +0 -1
  38. models/mutation.policy.antiMalwareFileHash.addRule.json +20 -0
  39. models/mutation.policy.antiMalwareFileHash.addSection.json +103 -0
  40. models/mutation.policy.antiMalwareFileHash.createPolicyRevision.json +123 -0
  41. models/mutation.policy.antiMalwareFileHash.discardPolicyRevision.json +123 -0
  42. models/mutation.policy.antiMalwareFileHash.moveRule.json +20 -0
  43. models/mutation.policy.antiMalwareFileHash.moveSection.json +103 -0
  44. models/mutation.policy.antiMalwareFileHash.publishPolicyRevision.json +123 -0
  45. models/mutation.policy.antiMalwareFileHash.removeRule.json +20 -0
  46. models/mutation.policy.antiMalwareFileHash.removeSection.json +103 -0
  47. models/mutation.policy.antiMalwareFileHash.updatePolicy.json +123 -0
  48. models/mutation.policy.antiMalwareFileHash.updateRule.json +20 -0
  49. models/mutation.policy.antiMalwareFileHash.updateSection.json +103 -0
  50. models/mutation.policy.appTenantRestriction.addRule.json +20 -0
  51. models/mutation.policy.appTenantRestriction.addSection.json +103 -0
  52. models/mutation.policy.appTenantRestriction.createPolicyRevision.json +123 -0
  53. models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +123 -0
  54. models/mutation.policy.appTenantRestriction.moveRule.json +20 -0
  55. models/mutation.policy.appTenantRestriction.moveSection.json +103 -0
  56. models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +123 -0
  57. models/mutation.policy.appTenantRestriction.removeRule.json +20 -0
  58. models/mutation.policy.appTenantRestriction.removeSection.json +103 -0
  59. models/mutation.policy.appTenantRestriction.updatePolicy.json +123 -0
  60. models/mutation.policy.appTenantRestriction.updateRule.json +20 -0
  61. models/mutation.policy.appTenantRestriction.updateSection.json +103 -0
  62. models/mutation.policy.applicationControl.addRule.json +20 -0
  63. models/mutation.policy.applicationControl.addSection.json +103 -0
  64. models/mutation.policy.applicationControl.createPolicyRevision.json +123 -0
  65. models/mutation.policy.applicationControl.discardPolicyRevision.json +123 -0
  66. models/mutation.policy.applicationControl.moveRule.json +20 -0
  67. models/mutation.policy.applicationControl.moveSection.json +103 -0
  68. models/mutation.policy.applicationControl.publishPolicyRevision.json +123 -0
  69. models/mutation.policy.applicationControl.removeRule.json +20 -0
  70. models/mutation.policy.applicationControl.removeSection.json +103 -0
  71. models/mutation.policy.applicationControl.updatePolicy.json +123 -0
  72. models/mutation.policy.applicationControl.updateRule.json +20 -0
  73. models/mutation.policy.applicationControl.updateSection.json +103 -0
  74. models/mutation.policy.dynamicIpAllocation.addRule.json +20 -0
  75. models/mutation.policy.dynamicIpAllocation.addSection.json +103 -0
  76. models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +123 -0
  77. models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +123 -0
  78. models/mutation.policy.dynamicIpAllocation.moveRule.json +20 -0
  79. models/mutation.policy.dynamicIpAllocation.moveSection.json +103 -0
  80. models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +123 -0
  81. models/mutation.policy.dynamicIpAllocation.removeRule.json +20 -0
  82. models/mutation.policy.dynamicIpAllocation.removeSection.json +103 -0
  83. models/mutation.policy.dynamicIpAllocation.updatePolicy.json +123 -0
  84. models/mutation.policy.dynamicIpAllocation.updateRule.json +20 -0
  85. models/mutation.policy.dynamicIpAllocation.updateSection.json +103 -0
  86. models/mutation.policy.internetFirewall.addRule.json +20 -0
  87. models/mutation.policy.internetFirewall.addSection.json +103 -0
  88. models/mutation.policy.internetFirewall.createPolicyRevision.json +123 -0
  89. models/mutation.policy.internetFirewall.discardPolicyRevision.json +123 -0
  90. models/mutation.policy.internetFirewall.moveRule.json +20 -0
  91. models/mutation.policy.internetFirewall.moveSection.json +103 -0
  92. models/mutation.policy.internetFirewall.publishPolicyRevision.json +123 -0
  93. models/mutation.policy.internetFirewall.removeRule.json +20 -0
  94. models/mutation.policy.internetFirewall.removeSection.json +103 -0
  95. models/mutation.policy.internetFirewall.updatePolicy.json +123 -0
  96. models/mutation.policy.internetFirewall.updateRule.json +20 -0
  97. models/mutation.policy.internetFirewall.updateSection.json +103 -0
  98. models/mutation.policy.remotePortFwd.addRule.json +20 -0
  99. models/mutation.policy.remotePortFwd.addSection.json +103 -0
  100. models/mutation.policy.remotePortFwd.createPolicyRevision.json +123 -0
  101. models/mutation.policy.remotePortFwd.discardPolicyRevision.json +123 -0
  102. models/mutation.policy.remotePortFwd.moveRule.json +20 -0
  103. models/mutation.policy.remotePortFwd.moveSection.json +103 -0
  104. models/mutation.policy.remotePortFwd.publishPolicyRevision.json +123 -0
  105. models/mutation.policy.remotePortFwd.removeRule.json +20 -0
  106. models/mutation.policy.remotePortFwd.removeSection.json +103 -0
  107. models/mutation.policy.remotePortFwd.updatePolicy.json +123 -0
  108. models/mutation.policy.remotePortFwd.updateRule.json +20 -0
  109. models/mutation.policy.remotePortFwd.updateSection.json +103 -0
  110. models/mutation.policy.socketLan.addRule.json +40 -0
  111. models/mutation.policy.socketLan.addSection.json +103 -0
  112. models/mutation.policy.socketLan.createPolicyRevision.json +143 -0
  113. models/mutation.policy.socketLan.discardPolicyRevision.json +143 -0
  114. models/mutation.policy.socketLan.moveRule.json +40 -0
  115. models/mutation.policy.socketLan.moveSection.json +103 -0
  116. models/mutation.policy.socketLan.publishPolicyRevision.json +143 -0
  117. models/mutation.policy.socketLan.removeRule.json +40 -0
  118. models/mutation.policy.socketLan.removeSection.json +103 -0
  119. models/mutation.policy.socketLan.updatePolicy.json +143 -0
  120. models/mutation.policy.socketLan.updateRule.json +40 -0
  121. models/mutation.policy.socketLan.updateSection.json +103 -0
  122. models/mutation.policy.terminalServer.addRule.json +20 -0
  123. models/mutation.policy.terminalServer.addSection.json +103 -0
  124. models/mutation.policy.terminalServer.createPolicyRevision.json +123 -0
  125. models/mutation.policy.terminalServer.discardPolicyRevision.json +123 -0
  126. models/mutation.policy.terminalServer.moveRule.json +20 -0
  127. models/mutation.policy.terminalServer.moveSection.json +103 -0
  128. models/mutation.policy.terminalServer.publishPolicyRevision.json +123 -0
  129. models/mutation.policy.terminalServer.removeRule.json +20 -0
  130. models/mutation.policy.terminalServer.removeSection.json +103 -0
  131. models/mutation.policy.terminalServer.updatePolicy.json +123 -0
  132. models/mutation.policy.terminalServer.updateRule.json +20 -0
  133. models/mutation.policy.terminalServer.updateSection.json +103 -0
  134. models/mutation.policy.tlsInspect.addRule.json +20 -0
  135. models/mutation.policy.tlsInspect.addSection.json +103 -0
  136. models/mutation.policy.tlsInspect.createPolicyRevision.json +123 -0
  137. models/mutation.policy.tlsInspect.discardPolicyRevision.json +123 -0
  138. models/mutation.policy.tlsInspect.moveRule.json +20 -0
  139. models/mutation.policy.tlsInspect.moveSection.json +103 -0
  140. models/mutation.policy.tlsInspect.publishPolicyRevision.json +123 -0
  141. models/mutation.policy.tlsInspect.removeRule.json +20 -0
  142. models/mutation.policy.tlsInspect.removeSection.json +103 -0
  143. models/mutation.policy.tlsInspect.updatePolicy.json +123 -0
  144. models/mutation.policy.tlsInspect.updateRule.json +20 -0
  145. models/mutation.policy.tlsInspect.updateSection.json +103 -0
  146. models/mutation.policy.wanFirewall.addRule.json +20 -0
  147. models/mutation.policy.wanFirewall.addSection.json +103 -0
  148. models/mutation.policy.wanFirewall.createPolicyRevision.json +123 -0
  149. models/mutation.policy.wanFirewall.discardPolicyRevision.json +123 -0
  150. models/mutation.policy.wanFirewall.moveRule.json +20 -0
  151. models/mutation.policy.wanFirewall.moveSection.json +103 -0
  152. models/mutation.policy.wanFirewall.publishPolicyRevision.json +123 -0
  153. models/mutation.policy.wanFirewall.removeRule.json +20 -0
  154. models/mutation.policy.wanFirewall.removeSection.json +103 -0
  155. models/mutation.policy.wanFirewall.updatePolicy.json +123 -0
  156. models/mutation.policy.wanFirewall.updateRule.json +20 -0
  157. models/mutation.policy.wanFirewall.updateSection.json +103 -0
  158. models/mutation.policy.wanNetwork.addRule.json +20 -0
  159. models/mutation.policy.wanNetwork.addSection.json +103 -0
  160. models/mutation.policy.wanNetwork.createPolicyRevision.json +123 -0
  161. models/mutation.policy.wanNetwork.discardPolicyRevision.json +123 -0
  162. models/mutation.policy.wanNetwork.moveRule.json +20 -0
  163. models/mutation.policy.wanNetwork.moveSection.json +103 -0
  164. models/mutation.policy.wanNetwork.publishPolicyRevision.json +123 -0
  165. models/mutation.policy.wanNetwork.removeRule.json +20 -0
  166. models/mutation.policy.wanNetwork.removeSection.json +103 -0
  167. models/mutation.policy.wanNetwork.updatePolicy.json +123 -0
  168. models/mutation.policy.wanNetwork.updateRule.json +20 -0
  169. models/mutation.policy.wanNetwork.updateSection.json +103 -0
  170. models/mutation.xdr.analystFeedback.json +822 -87
  171. models/query.policy.antiMalwareFileHash.policy.json +123 -0
  172. models/query.policy.appTenantRestriction.policy.json +123 -0
  173. models/query.policy.applicationControl.policy.json +123 -0
  174. models/query.policy.dynamicIpAllocation.policy.json +123 -0
  175. models/query.policy.internetFirewall.policy.json +123 -0
  176. models/query.policy.remotePortFwd.policy.json +123 -0
  177. models/query.policy.socketLan.policy.json +143 -0
  178. models/query.policy.terminalServer.policy.json +123 -0
  179. models/query.policy.tlsInspect.policy.json +123 -0
  180. models/query.policy.wanFirewall.policy.json +123 -0
  181. models/query.policy.wanNetwork.policy.json +123 -0
  182. models/query.xdr.stories.json +822 -87
  183. models/query.xdr.story.json +822 -87
  184. schema/catolib.py +34 -17
  185. catocli/Utils/csv_formatter.py +0 -663
  186. scripts/catolib.py +0 -62
  187. scripts/export_if_rules_to_json.py +0 -188
  188. scripts/export_wf_rules_to_json.py +0 -111
  189. scripts/import_wf_rules_to_tfstate.py +0 -331
  190. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/WHEEL +0 -0
  191. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/entry_points.txt +0 -0
  192. {catocli-3.0.14.dist-info → catocli-3.0.22.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,94 @@
1
+
2
+ ## CATO-CLI - Enhanced query.eventsFeed:
3
+ [Click here](https://api.catonetworks.com/documentation/#query-query.eventsFeed) for documentation on this operation.
4
+
5
+ ### Basic Usage for query.eventsFeed:
6
+
7
+ ```bash
8
+ # Show help for all available options
9
+ catocli query eventsFeed -h
10
+
11
+ # Standard eventsFeed query (basic GraphQL mode)
12
+ catocli query eventsFeed '{"marker": ""}'
13
+
14
+ # Start from beginning of event queue
15
+ catocli query eventsFeed '{"marker": ""}' -p
16
+
17
+ # Use a JSON file for complex queries
18
+ catocli query eventsFeed "$(cat query.eventsFeed.json)"
19
+ ```
20
+
21
+ ### Enhanced Usage (with advanced features):
22
+
23
+ The enhanced eventsFeed supports additional features like marker persistence, continuous polling, filtering, and streaming.
24
+
25
+ ```bash
26
+ # Basic enhanced mode: fetch once and print events
27
+ catocli query eventsFeed --print-events --prettify
28
+
29
+ # Start from beginning with run mode (continuous polling)
30
+ catocli query eventsFeed --run --print-events -v
31
+
32
+ # Use marker file for persistent position tracking
33
+ catocli query eventsFeed --marker-file=./events-marker.txt --print-events
34
+
35
+ # Continuous mode with marker persistence
36
+ catocli query eventsFeed --run --marker-file=./events-marker.txt --print-events -v
37
+
38
+ # Filter by event types
39
+ catocli query eventsFeed --print-events --event-types="Connectivity,Security"
40
+
41
+ # Filter by event sub-types
42
+ catocli query eventsFeed --print-events --event-sub-types="Internet Firewall,WAN Firewall"
43
+
44
+ # Network streaming with newlines
45
+ catocli query eventsFeed --run -n 192.168.1.100:8000 --append-new-line -v
46
+
47
+ # Send to Azure Sentinel
48
+ catocli query eventsFeed --run -z "workspace-id:shared-key"
49
+
50
+ # Combined: display locally AND stream to network
51
+ catocli query eventsFeed --run --print-events --prettify -n 192.168.1.100:8000 -anl
52
+
53
+ # With fetch and runtime limits
54
+ catocli query eventsFeed --run --print-events --fetch-limit=50 --runtime-limit=3600
55
+
56
+ # Very verbose debugging
57
+ catocli query eventsFeed --marker-file=./marker.txt --print-events -vv
58
+ ```
59
+
60
+
61
+ #### Operation Arguments for query.eventsFeed ####
62
+
63
+ ##### Core GraphQL Arguments:
64
+ `accountIDs` [ID[]] - (required) List of Unique Account Identifiers.
65
+ `eventFeedFieldFilterInput` [EventFeedFieldFilterInput[]] - (required) N/A
66
+ `fieldNames` [EventFieldName[]] - (required) N/A Default Value: ['access_method', 'account_id', 'action', 'actions_taken', 'ad_name', 'alert_id', 'always_on_configuration', 'analyst_verdict', 'api_name', 'api_type', 'app_activity', 'app_activity_category', 'app_activity_type', 'app_stack', 'application_id', 'application_name', 'application_risk', 'auth_method', 'authentication_type', 'bgp_cato_asn', 'bgp_cato_ip', 'bgp_error_code', 'bgp_peer_asn', 'bgp_peer_ip', 'bgp_route_cidr', 'bgp_suberror_code', 'bypass_duration_sec', 'bypass_method', 'bypass_reason', 'categories', 'cato_app', 'classification', 'client_cert_expires', 'client_cert_name', 'client_class', 'client_version', 'collaborator_name', 'collaborators', 'confidence_level', 'configured_host_name', 'congestion_algorithm', 'connect_on_boot', 'connection_origin', 'connector_name', 'connector_status', 'connector_type', 'container_name', 'correlation_id', 'criticality', 'custom_category_id', 'custom_category_name', 'dest_country', 'dest_country_code', 'dest_group_id', 'dest_group_name', 'dest_ip', 'dest_is_site_or_vpn', 'dest_pid', 'dest_port', 'dest_process_cmdline', 'dest_process_parent_path', 'dest_process_parent_pid', 'dest_process_path', 'dest_site_id', 'dest_site_name', 'detection_name', 'detection_stage', 'device_categories', 'device_certificate', 'device_id', 'device_manufacturer', 'device_model', 'device_name', 'device_os_type', 'device_posture_profile', 'device_type', 'directory_host_name', 'directory_ip', 'directory_sync_result', 'directory_sync_type', 'disinfect_result', 'dlp_fail_mode', 'dlp_profiles', 'dlp_scan_types', 'dns_protection_category', 'dns_query', 'domain_name', 'egress_pop_name', 'egress_site_name', 'email_subject', 'endpoint_id', 'engine_type', 'epp_engine_type', 'epp_profile', 'event_count', 'event_id', 'event_message', 'event_sub_type', 'event_type', 'failure_reason', 'file_hash', 'file_name', 'file_operation', 'file_size', 'file_type', 'final_object_status', 'flows_cardinality', 'full_path_url', 'guest_user', 'host_ip', 'host_mac', 'http_request_method', 'incident_aggregation', 'incident_id', 'indication', 'indicator', 'initial_object_status', 'internalId', 'ip_protocol', 'is_admin', 'is_admin_activity', 'is_compliant', 'is_managed', 'is_sanctioned_app', 'is_sinkhole', 'ISP_name', 'key_name', 'labels', 'link_health_is_congested', 'link_health_jitter', 'link_health_latency', 'link_health_pkt_loss', 'link_type', 'logged_in_user', 'login_type', 'matched_data_types', 'mitre_attack_subtechniques', 'mitre_attack_tactics', 'mitre_attack_techniques', 'network_access', 'network_rule', 'notification_api_error', 'notification_description', 'object_id', 'object_name', 'object_type', 'office_mode', 'os_type', 'os_version', 'out_of_band_access', 'owner', 'pac_file', 'parent_connector_name', 'pop_name', 'precedence', 'processes_count', 'producer', 'projects', 'prompt_action', 'provider_name', 'public_ip', 'qos_priority', 'qos_reported_time', 'quarantine_folder_path', 'quarantine_uuid', 'raw_data', 'recommended_actions', 'reference_url', 'referer_url', 'region_name', 'registration_code', 'resource_id', 'risk_level', 'rule_id', 'rule_name', 'service_name', 'severity', 'sharing_scope', 'sign_in_event_types', 'signature_id', 'socket_interface', 'socket_interface_id', 'socket_new_version', 'socket_old_version', 'socket_reset', 'socket_role', 'socket_serial', 'socket_version', 'split_tunnel_configuration', 'src_country', 'src_country_code', 'src_ip', 'src_is_site_or_vpn', 'src_isp_ip', 'src_pid', 'src_port', 'src_process_cmdline', 'src_process_parent_path', 'src_process_parent_pid', 'src_process_path', 'src_site_id', 'src_site_name', 'static_host', 'status', 'story_id', 'subnet_name', 'subscription_name', 'targets_cardinality', 'tcp_acceleration', 'tenant_id', 'tenant_name', 'tenant_restriction_rule_name', 'threat_confidence', 'threat_name', 'threat_reference', 'threat_score', 'threat_type', 'threat_verdict', 'time', 'time_str', 'title', 'tls_certificate_error', 'tls_error_description', 'tls_error_type', 'tls_inspection', 'tls_rule_name', 'tls_version', 'traffic_direction', 'translated_client_ip', 'translated_server_ip', 'trigger', 'trust_type', 'trusted_networks', 'tunnel_ip_protocol', 'tunnel_protocol', 'upgrade_end_time', 'upgrade_initiated_by', 'upgrade_start_time', 'url', 'user_agent', 'user_awareness_method', 'user_id', 'user_name', 'user_reference_id', 'user_risk_level', 'vendor', 'vendor_collaborator_id', 'vendor_device_id', 'vendor_device_name', 'vendor_event_id', 'vendor_policy_description', 'vendor_policy_id', 'vendor_policy_name', 'vendor_user_id', 'visible_device_id', 'vpn_lan_access', 'vpn_user_email', 'windows_domain_name', 'xff']
67
+ `marker` [String] - (required) Marker to use to get results from
68
+
69
+ ##### Enhanced Features Arguments:
70
+ `--run` [Flag] - Enable run mode with continuous polling and advanced features
71
+ `--print-events` [Flag] - Print event records to console
72
+ `--prettify` [Flag] - Prettify JSON output
73
+ `--marker` [String] - Initial marker value (default: "", start of queue)
74
+ `--marker-file` [String] - Marker file location for persistence (default: ./events-marker.txt)
75
+ `--event-types` [String] - Comma-separated list of event types to filter on
76
+ `--event-sub-types` [String] - Comma-separated list of event sub types to filter on
77
+ `--fetch-limit` [Integer] - Stop if a fetch returns less than this number of events (default: 1)
78
+ `--runtime-limit` [Integer] - Stop after this many seconds (default: unlimited)
79
+ `-vv, --very-verbose` [Flag] - Print detailed debug information
80
+ `--append-new-line, -anl` [Flag] - Append newline character (\n) to events sent via -n or -z
81
+ `-n, --stream-events` [String] - Send events to host:port TCP
82
+ `-z, --sentinel` [String] - Send to Azure Sentinel customerid:sharedkey
83
+ `-v` [Flag] - Verbose output (inherited from catocli)
84
+ `-p` [Flag] - Pretty print (inherited from catocli)
85
+
86
+ ##### Key Features:
87
+ - **Native Authentication**: Uses ~/.cato profile credentials automatically
88
+ - **Compression**: Leverages catocli's built-in gzip compression for performance
89
+ - **Marker Persistence**: Automatically saves position in event queue
90
+ - **Continuous Polling**: Supports long-running event collection
91
+ - **Advanced Filtering**: Filter by event types and sub-types
92
+ - **Network Streaming**: Stream events to TCP endpoints
93
+ - **Azure Sentinel**: Direct integration with Microsoft Sentinel
94
+ - **Rate Limiting**: Built-in API rate limit handling
@@ -0,0 +1,346 @@
1
+ # SCIM (System for Cross-domain Identity Management) Commands
2
+
3
+ The Cato CLI provides comprehensive support for SCIM operations to manage users and groups via the Cato SCIM API. This enables automated user provisioning and group management for identity providers and custom integrations.
4
+
5
+ ## Prerequisites
6
+
7
+ Before using SCIM commands, you need to configure SCIM credentials in your profile:
8
+
9
+ 1. **SCIM URL**: The SCIM service endpoint provided by Cato
10
+ - Format: `https://scimservice.catonetworks.com:4443/scim/v2/{accountId}/{sourceId}`
11
+ - Example: `https://scimservice.catonetworks.com:4443/scim/v2/12345/67890`
12
+
13
+ 2. **SCIM Bearer Token**: Authentication token for SCIM access
14
+ - Example: `cfda146dc7c12345abcde`
15
+
16
+ ## Configuration
17
+
18
+ ### Add SCIM Credentials to Profile
19
+
20
+ ```bash
21
+ # Interactive configuration (recommended)
22
+ catocli configure set
23
+
24
+ # Non-interactive configuration
25
+ catocli configure set --scim-url "https://scimservice.catonetworks.com:4443/scim/v2/12345/67890" --scim-token "your-bearer-token"
26
+
27
+ # Add SCIM credentials to specific profile
28
+ catocli configure set --profile production --scim-url "your-scim-url" --scim-token "your-bearer-token"
29
+ ```
30
+
31
+ ### View Profile with SCIM Credentials
32
+
33
+ ```bash
34
+ catocli configure show
35
+ ```
36
+
37
+ For detailed setup instructions, see: [Using the Cato SCIM API for Custom SCIM Apps](https://support.catonetworks.com/hc/en-us/articles/29492743031581-Using-the-Cato-SCIM-API-for-Custom-SCIM-Apps)
38
+
39
+ ## User Management Commands
40
+
41
+ ### Get All Users
42
+
43
+ ```bash
44
+ # Get all SCIM users
45
+ catocli scim get_users
46
+
47
+ # With verbose output
48
+ catocli scim get_users --verbose
49
+
50
+ # With pretty-printed JSON
51
+ catocli scim get_users --pretty
52
+ ```
53
+
54
+ ### Get Specific User
55
+
56
+ ```bash
57
+ # Get user by SCIM ID
58
+ catocli scim get_user "6283630dfd7ec758a8bf4b61"
59
+
60
+ # With verbose output
61
+ catocli scim get_user "6283630dfd7ec758a8bf4b61" --verbose
62
+ ```
63
+
64
+ ### Find Users
65
+
66
+ ```bash
67
+ # Find users by email
68
+ catocli scim find_users email "john.doe@company.com"
69
+
70
+ # Find users by username
71
+ catocli scim find_users userName "john.doe"
72
+
73
+ # Find users by given name (first name)
74
+ catocli scim find_users givenName "John"
75
+
76
+ # Find users by family name (last name)
77
+ catocli scim find_users familyName "Doe"
78
+ ```
79
+
80
+ ### Create User
81
+
82
+ ```bash
83
+ # Create a new user (password will be auto-generated)
84
+ catocli scim create_user "jane.doe@company.com" "Jane" "Doe" "external123"
85
+
86
+ # Create user with specific password
87
+ catocli scim create_user "jane.doe@company.com" "Jane" "Doe" "external123" --password "SecurePass123!"
88
+
89
+ # Create inactive user
90
+ catocli scim create_user "jane.doe@company.com" "Jane" "Doe" "external123" --inactive
91
+
92
+ # Create active user (default behavior)
93
+ catocli scim create_user "jane.doe@company.com" "Jane" "Doe" "external123" --active
94
+ ```
95
+
96
+ ### Update User
97
+
98
+ ```bash
99
+ # Update user with complete user data (JSON format)
100
+ catocli scim update_user "6283630dfd7ec758a8bf4b61" '{
101
+ "userName": "john.doe@company.com",
102
+ "name": {
103
+ "givenName": "John",
104
+ "familyName": "Doe"
105
+ },
106
+ "emails": [
107
+ {
108
+ "primary": true,
109
+ "value": "john.doe@company.com",
110
+ "type": "work"
111
+ }
112
+ ],
113
+ "active": true
114
+ }'
115
+ ```
116
+
117
+ ### Disable User
118
+
119
+ ```bash
120
+ # Disable a user by SCIM ID
121
+ catocli scim disable_user "6283630dfd7ec758a8bf4b61"
122
+
123
+ # With verbose output
124
+ catocli scim disable_user "6283630dfd7ec758a8bf4b61" --verbose
125
+ ```
126
+
127
+ ## Group Management Commands
128
+
129
+ ### Get All Groups
130
+
131
+ ```bash
132
+ # Get all SCIM groups
133
+ catocli scim get_groups
134
+
135
+ # With verbose output
136
+ catocli scim get_groups --verbose
137
+
138
+ # With pretty-printed JSON
139
+ catocli scim get_groups --pretty
140
+ ```
141
+
142
+ ### Get Specific Group
143
+
144
+ ```bash
145
+ # Get group by SCIM ID
146
+ catocli scim get_group "6283630dfd7ec758a8bf4b62"
147
+
148
+ # With verbose output
149
+ catocli scim get_group "6283630dfd7ec758a8bf4b62" --verbose
150
+ ```
151
+
152
+ ### Find Groups
153
+
154
+ ```bash
155
+ # Find groups by display name
156
+ catocli scim find_group "Development Team"
157
+
158
+ # With verbose output
159
+ catocli scim find_group "Development Team" --verbose
160
+ ```
161
+
162
+ ### Create Group
163
+
164
+ ```bash
165
+ # Create a new group without members
166
+ catocli scim create_group "Marketing Team" "marketing-external-id"
167
+
168
+ # Create group with initial members
169
+ catocli scim create_group "Sales Team" "sales-external-id" '[
170
+ {"value": "6283630dfd7ec758a8bf4b61"},
171
+ {"value": "6283630dfd7ec758a8bf4b62"}
172
+ ]'
173
+ ```
174
+
175
+ ### Update Group
176
+
177
+ ```bash
178
+ # Update group with complete group data
179
+ catocli scim update_group "6283630dfd7ec758a8bf4b62" '{
180
+ "displayName": "Updated Team Name",
181
+ "members": [
182
+ {
183
+ "value": "6283630dfd7ec758a8bf4b61",
184
+ "display": "john.doe@company.com"
185
+ }
186
+ ]
187
+ }'
188
+ ```
189
+
190
+ ### Rename Group
191
+
192
+ ```bash
193
+ # Rename a group
194
+ catocli scim rename_group "6283630dfd7ec758a8bf4b62" "New Team Name"
195
+
196
+ # With verbose output
197
+ catocli scim rename_group "6283630dfd7ec758a8bf4b62" "New Team Name" --verbose
198
+ ```
199
+
200
+ ### Disable Group
201
+
202
+ ```bash
203
+ # Disable a group by SCIM ID
204
+ catocli scim disable_group "6283630dfd7ec758a8bf4b62"
205
+
206
+ # With verbose output
207
+ catocli scim disable_group "6283630dfd7ec758a8bf4b62" --verbose
208
+ ```
209
+
210
+ ## Group Membership Management
211
+
212
+ ### Add Members to Group
213
+
214
+ ```bash
215
+ # Add single member to group
216
+ catocli scim add_members "6283630dfd7ec758a8bf4b62" '[{"value": "6283630dfd7ec758a8bf4b61"}]'
217
+
218
+ # Add multiple members to group
219
+ catocli scim add_members "6283630dfd7ec758a8bf4b62" '[
220
+ {"value": "6283630dfd7ec758a8bf4b61"},
221
+ {"value": "6283630dfd7ec758a8bf4b63"},
222
+ {"value": "6283630dfd7ec758a8bf4b64"}
223
+ ]'
224
+
225
+ # With verbose output
226
+ catocli scim add_members "group-id" '[{"value": "user-id"}]' --verbose
227
+ ```
228
+
229
+ ### Remove Members from Group
230
+
231
+ ```bash
232
+ # Remove single member from group
233
+ catocli scim remove_members "6283630dfd7ec758a8bf4b62" '[{"value": "6283630dfd7ec758a8bf4b61"}]'
234
+
235
+ # Remove multiple members from group
236
+ catocli scim remove_members "6283630dfd7ec758a8bf4b62" '[
237
+ {"value": "6283630dfd7ec758a8bf4b61"},
238
+ {"value": "6283630dfd7ec758a8bf4b63"}
239
+ ]'
240
+ ```
241
+
242
+ ## Common Options
243
+
244
+ All SCIM commands support these common options:
245
+
246
+ - `--verbose` or `-v`: Show detailed output and progress information
247
+ - `--pretty` or `-p`: Pretty print JSON output for better readability
248
+
249
+ ## Error Handling
250
+
251
+ If SCIM credentials are missing or invalid, you'll see helpful error messages:
252
+
253
+ ```bash
254
+ $ catocli scim get_users
255
+ ERROR: Profile 'default' is missing SCIM credentials: scim_url, scim_token
256
+ Run 'catocli configure set --profile default' to add SCIM credentials.
257
+ For more information, see: https://support.catonetworks.com/hc/en-us/articles/29492743031581-Using-the-Cato-SCIM-API-for-Custom-SCIM-Apps
258
+ ```
259
+
260
+ ## JSON Format Examples
261
+
262
+ ### User JSON Structure
263
+
264
+ ```json
265
+ {
266
+ "id": "6283630dfd7ec758a8bf4b61",
267
+ "userName": "john.doe@company.com",
268
+ "name": {
269
+ "givenName": "John",
270
+ "familyName": "Doe"
271
+ },
272
+ "emails": [
273
+ {
274
+ "primary": true,
275
+ "value": "john.doe@company.com",
276
+ "type": "work"
277
+ }
278
+ ],
279
+ "active": true
280
+ }
281
+ ```
282
+
283
+ ### Group JSON Structure
284
+
285
+ ```json
286
+ {
287
+ "id": "6283630dfd7ec758a8bf4b62",
288
+ "displayName": "Development Team",
289
+ "members": [
290
+ {
291
+ "value": "6283630dfd7ec758a8bf4b61",
292
+ "display": "john.doe@company.com"
293
+ }
294
+ ]
295
+ }
296
+ ```
297
+
298
+ ### Member Array Format
299
+
300
+ ```json
301
+ [
302
+ {"value": "6283630dfd7ec758a8bf4b61"},
303
+ {"value": "6283630dfd7ec758a8bf4b62"}
304
+ ]
305
+ ```
306
+
307
+ ## Integration Examples
308
+
309
+ ### Bulk User Creation from CSV
310
+
311
+ ```bash
312
+ #!/bin/bash
313
+ # Read CSV file and create users
314
+ while IFS=',' read -r email given_name family_name; do
315
+ catocli scim create_user "$email" "$given_name" "$family_name" --verbose
316
+ done < users.csv
317
+ ```
318
+
319
+ ### Group Membership Sync
320
+
321
+ ```bash
322
+ #!/bin/bash
323
+ # Add users to a group
324
+ GROUP_ID="6283630dfd7ec758a8bf4b62"
325
+ USER_IDS=("6283630dfd7ec758a8bf4b61" "6283630dfd7ec758a8bf4b63")
326
+
327
+ # Build members JSON array
328
+ MEMBERS_JSON="["
329
+ for i in "${!USER_IDS[@]}"; do
330
+ if [ $i -ne 0 ]; then
331
+ MEMBERS_JSON+=","
332
+ fi
333
+ MEMBERS_JSON+="{\"value\": \"${USER_IDS[$i]}\"}"
334
+ done
335
+ MEMBERS_JSON+="]"
336
+
337
+ # Add members to group
338
+ catocli scim add_members "$GROUP_ID" "$MEMBERS_JSON" --verbose
339
+ ```
340
+
341
+ ## Support
342
+
343
+ For SCIM API setup and configuration assistance, refer to:
344
+ - [Using the Cato SCIM API for Custom SCIM Apps](https://support.catonetworks.com/hc/en-us/articles/29492743031581-Using-the-Cato-SCIM-API-for-Custom-SCIM-Apps)
345
+
346
+ For CLI-specific issues, use the `--verbose` flag to get detailed error information and check your profile configuration with `catocli configure show`.