KSC Open API
Kaspersky Security Center API description
|
A hybrid gateway connection is a gateway connection that uses a tunnel from the primary server to the target secondary server. To create this kind of connection, follow the steps below:
Example:
curl -v -k -H "Authorization: KSCBasic user=\"USER\", pass=\"PASSWORD\", internal=\"0\"" -H "Content-Type: application/json" -d "{}" -k -X POST https://localhost:13299/api/v1.0/login -: -H "Content-Type: application/json" -H "Transfer-Encoding: chunked" -H "X-KSC-RequestId: AECC37AD18B74C4B_8846F01BF6AA6E2D" -d "{\"wstrTargetSlaveServerInstanceId\":\"c5ed323c-e074-4924-aa1e-f2e008db9d58\", \"wstrTargetHostId\":\"89fc81bc-d54c-4f8d-a5bb-faf82bfc6f91\",\"pTargetCertPub\":\"LS0tLS1.......o=\",\"nTargetPort\":12110}" -k -X POST https://localhost:13299/api/v1.0/GatewayConnection.PrepareHybridGatewayConnectionToSecondaryServerPort
{"PxgRetVal":"6CFA39478AC0FC1FBD339042A88F9A06"}
curl -v -H "Authorization: KSCBasic user=\"USER\", pass=\"PASSWORD\", internal=\"0\"" -H "x-ksc-t-session: 6CFA39478AC0FC1FBD339042A88F9A06" -H "Content-Type: application/json" -d "{}" -k -X POST https://localhost:13299/api/v1.0/Session.StartSession
{"PxgRetVal":"n9vunEemB7dO/JH/mT/Lb8Q=="}
curl -v -H "X-KSC-Session: nEfy5V6fmntufkJeyOoMNOg==" -H "x-ksc-t-session: 6CFA39478AC0FC1FBD339042A88F9A06" -H "Content-Type: application/json" -H "X-KSC-RequestId: 39C49236A51C334C_86659DDD6960D6E2" -d "{}" -k -X POST https://localhost:13299/api/v1.0/HostGroup.GetStaticInfo
{"PxgRetVal":{"KLADMSRV_APPLICATION_ID":1017,"KLADMSRV_B2B_CLOUD_MODE":false,......}}
curl -v -H "X-KSC-Session: nEfy5V6fmntufkJeyOoMNOg==" -H "x-ksc-t-session: 6CFA39478AC0FC1FBD339042A88F9A06" -H "Content-Type: application/json" -H "X-KSC-RequestId: 39C49236A51C334C_86659DDD6960D6E2" -d "{}" -k -X POST https://localhost:13299/api/v1.0/Session.EndSession
{}
curl -v -H "Authorization: KSCBasic user=\"USER\", pass=\"PASSWORD\", internal=\"0\"" -H "Content-Type: application/json" -d "{}" -k -X POST https://localhost:13299/api/v1.0/login -: -H "Content-Type: application/json" -H "Transfer-Encoding: chunked" -H "X-KSC-RequestId: AECC37AD18B74C4B_8846F01BF6AA6E2D" -d "{\"szwTSessionId\":\"116CC992BC8ECBD658C06D6D660331D5\"}" -k -X POST https://localhost:13299/api/v1.0/GatewayConnection.CloseHybridGatewayConnectionToSecondaryServerPort
{}