Skip to content

Commit 19c04d7

Browse files
authored
Merge pull request #3 from chkp-edenbr/master
connect all domains
2 parents e04bc12 + 873967f commit 19c04d7

File tree

7 files changed

+412
-62
lines changed

7 files changed

+412
-62
lines changed

README.md

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,5 @@ or by clicking the _‘Download ZIP’_ button.
1414
Download and install the [Check Point API Python SDK](https://github.com/CheckPointSW/cp_mgmt_api_python_sdk)
1515
repository, follow the instructions in the SDK repository.
1616

17-
## AddTagToObjects.py
18-
Tool to add a tag to multiple objects.
19-
<br>The tool supports three modes of tagging by given partial-name:
20-
* Add tag to all objects.
21-
* Add tag to the unused objects.
22-
* Add tag to the used objects.
23-
24-
<br>If partial name is not supplied the tool will tag all unused objects.
25-
26-
#### Main Options
27-
*__More options and details can be found with the '-h' option by running:__ python AddTagToObjects.py –h*
28-
29-
* [--tag, -t]&emsp; The tag name that will be added to the objects.
30-
* [--partial-name , -pn]&emsp; Add tag to objects shown in object explorer by the provided partial-name.
31-
This field required in case of using \'--mode\' flag. The default is to add tag to all unused objects in the domain.
32-
* [--mode, -md]&emsp; Whether to consider if the objects are used or unused when adding the tag by name.
33-
<br>&emsp;&emsp;There are three modes, the default is \'unused\':<br>
34-
* unused: add tag only to unused objects with the given partial-name.
35-
* used: add tag only to used objects with the given partial-name.
36-
* all: add tag to all objects with the given partial-name.
37-
38-
#### Examples
39-
* Running the tool on a remote management server:
40-
<br>```python AddTagToObjects.py --tag TagForUnusedObjects -m 172.23.78.160 -u James -p MySecretPassword!```
41-
<br>The tool runs on a remote management server with IP address 172.23.78.160 and the tag "MyTag" will be added to all unused objects.
42-
43-
* Running the tool on a Multi-Domain Server for a specific domain:
44-
<br>```python AddTagToObjects.py -t MyTag -d local_domain -u James -p MySecretPassword!```
45-
46-
* Running the tool on a Security Management Server with partial name:
47-
<br>```python AddTagToObjects.py --tag my_host --partial-name "host_" -u James -p MySecretPassword!```
48-
<br>The tool will add "my_host" tag to all the unused objects that are found in the explorer with the given partial-name.
49-
50-
* Running the tool on a Security Management Server with partial name of unused objects:
51-
<br>```python AddTagToObjects.py --tag my_host --partial-name "host_" --mode all -u James -p MySecretPassword!```
52-
<br>The tool will add "my_host" tag to all the objects that are found in the explorer with the given partial-name.
53-
54-
55-
## ReplaceReference.py
56-
Replace references of two given objects.
57-
The tool supports replacement in Access, Threat and Nat rules, and in groups and service-groups.
58-
59-
#### Main Options
60-
*__More options and details can be found with the '-h' option by running:__ python ReplaceReference.py –h*
61-
62-
* [--original-reference, -o]&emsp; The full name of the replaced object, must be unique name.
63-
* [--new-reference, -n]&emsp; The full name of the new object, must be unique name.
64-
65-
#### Examples
66-
* Running the tool on a remote management server:
67-
<br>```python ReplaceReference.py --original-reference old_host --new-reference new_host -m 172.23.78.160 -u James -p MySecretPassword!```
68-
<br>The tool runs on a remote management server with IP address 172.23.78.160 and replaces references from old_host to new_host.
69-
70-
* Running the tool on a Multi-Domain Server for a specific domain:
71-
<br>```python ReplaceReference.py -o Global_object -n local_object -d local_domain -u James -p MySecretPassword!```
72-
<br>The tool can replace references to a Global object with references to a local object.
73-
74-
7517
## Development Environment
7618
The tool is developed using Python language version 2.7, version 3.7 and [Check Point API Python SDK](https://github.com/CheckPointSW/cp_mgmt_api_python_sdk).
77-
78-
79-
80-

connect/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# connect_all_domains
2+
3+
The following script connects all domains of a tenant's MDS to the cloud-services portal.
4+
5+
## Instructions
6+
Clone the repository with this command:
7+
```git
8+
git clone https://github.com/CheckPointSW/UsefulManagementApiTools
9+
```
10+
or by clicking the Download ZIP button.
11+
12+
Download and install the [Check Point API Python SDK](https://github.com/CheckPointSW/cp_mgmt_api_python_sdk)
13+
repository, follow the instructions in the SDK repository.
14+
15+
To create the required keys, you must go to [Check Point Infinity Portal](https://portal.checkpoint.com) -> Settings -> API Keys -> New -> New Account API Key.
16+
Then choose "Security Management" as the service.
17+
18+
## Usage Syntax
19+
20+
• --client_id: Required. The Client ID.
21+
22+
• --access_key: Required. The Access Key.
23+
24+
• --region: Required. The region. Choices are [ap, us, eu, uae, in].
25+
26+
• --server: The server IP address or hostname, required when running from remote.
27+
28+
• --api_key: The API Key, required when running from remote.
29+
30+
• --api_port: The API Port, required if running from remote, and it isn't the default value (443).
31+
32+
• --debug_file: API calls debug file name.
33+
34+
##Examples
35+
36+
• Running the script on the Multi-Domain Server:
37+
`python connect_all_domains.py --client_id <tenant_client_id> --access_key <tenant_access_key> --region eu --debug_file api_calls.json`
38+
39+
• Running the script from remote:
40+
`python connect_all_domains.py --client_id <tenant_client_id> --access_key <tenant_access_key> --region eu --server 192.168.1.1 --api_key <your_api_key> --api_port 8080`
41+
42+
## Development Environment
43+
44+
The tool is developed using Python language version 3.7 and [Check Point API Python SDK.](https://github.com/CheckPoint-APIs-Team/cpapi-python-sdk)
45+
46+
##Note
47+
48+
In order to run the script, explicit consent must be given.
49+
The connect_all_domains.log and api debug files will be created in project location.

0 commit comments

Comments
 (0)