Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Shay_V
Explorer

Running API commands on mds level

I'm wondering if it is possible to run API commands on mds level.

One of the arguments of mgmt_cli command is targets.

Specifying the MDS name as a target returns "Object not found".

 

My use-case: I am trying to upload a SNORT file using "put-file" command to the MDS to enforce it in the global domain.

 

Thanks in advance.

0 Kudos
6 Replies
PhoneBoy
Admin
Admin

What does your login API call look like?
Pretty sure you need to log into the "System Data" domain to make changes at the MDS level.

0 Kudos
Shay_V
Explorer

When logged in into MDS, The command used is:

mgmt_cli -r true put-file file-name "my_snorts.rules" file-path "/home/admin" file-content "<one_snort_rule>"  targets cp-r81-mds

Then I get:

code: "generic_err_object_not_found"
message: "Requested object [cp-r81-mds] not found""


My goal is to create a snort file which will be uploaded to the global domain so I will assign it to all domain.

When I tried to add -d "MDS" to the command, it did not work as well.

I am not sure if running API commands on MDS level where the MDS itself is a target is supported or not, hope to get an answer here.

 

 

0 Kudos
Jim_Oqvist
Employee
Employee

Hi Shay, try to run the API call to a domain on the specific MDS you want to create the file and set your target to be the domain management server (DMS) running on the MDS for that domain, this should create the file on the MDS in /home/var directory. 

For example, in my MDS (MDS1) I have a domain called Stockholm in that domain there is a Domain Management server called Stockholm-dms running in the Stockholm domain on MDS1. By executing the following API call:

mgmt_cli -r true -f json -d Stockholm put-file file-name "my_snorts.rules" file-path "/home/admin" file-content "<one_snort_rule>"  targets Stockholm-dms

 

I would expect this to create the file my_snorts.rules under /home/admin in MDS1

 

Shay_V
Explorer

Hi @Jim_Oqvist 
Thank you very much for your reply.

Your explanation is great when you want to put the file on every domain separately.
In my case, I have 13 different domains that are managed globally.
Therefore, I was looking for a way to put the file on the MDS level and then I will be able to assign it to all domains at once.

0 Kudos
Jim_Oqvist
Employee
Employee

Hi,

The "file-content" API is just a way to put the file on the server or gateway, for this you need a target object in the API call to in this case reach the MDS server. once the file is there you can call it with another API call from any domain as well as the global domain to load the snort rules.

0 Kudos
Amir_Senn
Employee
Employee

For MDS domain you don't need a domain flag at all or used -d "System Data"

For global domain you can use -d "Global"

For other domains use domain name.

 

Not all the operations are available on MDS level though.

Kind regards, Amir Senn

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events