Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Northy
Contributor

Generic Data Center Object unique UID

Hi All, 

 

I'm hoping someone can help or point to some appropriate documentation. I want to make use of the generic data center object however reading through the sk167210.it clearly states that each object needs to have a unique UID. 

I'm trying to find out how i go about getting a unique UID to be able to be used for the objects within the GDO. I've highlighted below just for clarity. 

Any assistance is appreciated.

{
      "version": "1.0",     
      "description": "Generic Data Center file example",
      "objects": [
                          {
                               "name": "Object A name",
                               "id": "e7f18b60-f22d-4f42-8dc2-050490ecf6d5",
                               "description": "Example for IPv4 addresses",
                               "ranges": [
                                                     "91.198.174.192",
                                                     "20.0.0.0/24",                        
                                                     "10.1.1.2-10.1.1.10"
                               ]              
                          },
                          {
                                "name": "Object B name",
                                "id": "a46f02e6-af56-48d2-8bfb-f9e8738f2bd0",
                                "description": "Example for IPv6 addresses",
                                "ranges": [
                                                     "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
                                                     "0064:ff9b:0000:0000:0000:0000:1234:5678/96"            
                                ]
                          }
     ]
}

Generic Data Center feature (checkpoint.com)

0 Kudos
3 Replies
Nir_Shamir
Employee Employee
Employee

Hi,

those numbers can be whatever you want:

0000-0000-0001

23232323

33-333-33

you choose :-).

Greg_Dunlap
Participant

one thing i found handy was generating the json via some python scripts

 

import uuid

 

uid = str(uuid.uuid4())

 

will auto generate a id of the correct format for this.

Sorin_Gogean
Advisor

hey,

 

just not to forget, YOU HAVE TO KEEP THOSE UUID's THE SAME, OHERWISE THE OBJECTS WILL "EXPIRE" (sorry for yelling but I want to make sure you remember this!!!!!)

so, you have your JSON file, and you just added the objects into policies - all good. Next time you update the content of the JSON, the UUID needs to remain the same, otherwise the objects are seen as new ones so it will not match with the old one, and then you will need to do the rule association again, and so on....

On your question, like others pointed, depends where you run your script.

We have an Linux script that runs in bash so we use smth like this.

UUID=$(cat /proc/sys/kernel/random/uuid)

 

Tnx,

 

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.