Endpoint: /sites/{siteId}/networkAndSecurity
Returns and update the network and security settings.
-
GET
-
PATCH
Method & URL
GET https://[server URL]:[port]/admin/v2/sites/{siteId}/networkandsecurity/
GET Body Sample
Copy
### GET Site Network and Security Settings ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/networkandsecurity/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
GET Response Body Sample
Copy
{
"data": {
"type": "site",
"id": "892b16dc-24a8-473f-a74e-c597b824c879",
"attributes": {
"connectionLimits": {
"maxTransferSpeed": false,
"maxConcurrentSocketConnections": false,
"maxConcurrentLogins": false,
"maxConnectionsPerUser": false,
"maxConnectionFromSameIP": false
},
"autoBan": {
"enabled": true,
"value": {
"banIfExcessiveInvalidCmdsReceived": true,
"banIpsPermanently": false,
"numberOfInvalidCmds": 5,
"sensitivityLevel": "Medium"
}
}
}
},
"links": {
"self": "/admin/v2/sites/892b16dc-24a8-473f-a74e-c597b824c879/networkAndSecurity"
}
}
GET PowerShell Sample
Copy
####Added 2/03/2022
### GET Site Network and Security Settings###
### User must obtain the SiteID from Get Sites
Write-Output "GET Site Network and Security Settings"
Write-Output "----"
#$siteID = Enter SiteID here
$siteList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/networkandsecurity" -Method 'GET' -Headers $authHeader
Write-Output $siteList | ConvertTo-Json
Method & URL
PATCH https://[server URL]:[port]/admin/v2/sites/{siteId}/1networkandsecurity/
PATCH Body Sample
Copy
PATCH https://{{host}}/admin/v2/sites/{{Siteid}}/networkandsecurity/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"attributes": {
"connectionLimits": {
"maxConcurrentLogins": true,
"maxConcurrentSocketConnections": true,
"maxConnectionFromSameIP": true,
"maxConnectionsPerUser": true,
"maxTransferSpeed": true
},
"denialOfService": {
"autoBan": {
"enabled": true,
"value": {
"banIfExcessiveInvalidCmdsReceived": true,
"numberOfInvalidCmds": true,
"sensitivityLevel": "Low",
"banIpsPermenantly": true
}
}
}
}
}
}
PATCH Response Body Sample
The response will return the same response as the GET request, however, it will now include the updated PATCH request(s).
Copy
HTTP/1.1 200 OK Date: Thu, 25 Aug 2022 18:58:06 GMT Content-Type: application/vnd.api+json ETag: "88131696"
Content-Length: 663 Cache-Control: no-cache, no-store, must-revalidate Expires: -1
X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:;
Referrer-Policy: no-referrer { "data": { "type": "site", "id":
"c9551b5d-f904-4612-b690-d51bfde2eb1f", "attributes": { "connectionLimits": { "maxTransferSpeed": true,
"maxTransferSpeedValue": 820, "maxConcurrentSocketConnections": true, "maxConcurrentSocketConnectionsValue": 10,
"maxConcurrentLogins": true, "maxConcurrentLoginsValue": 10, "maxConnectionsPerUser": true,
"maxConnectionsPerUserValue": 1, "maxConnectionFromSameIP": true, "maxConnectionFromSameIPValue": 1 },
"autoBan": { "enabled": true, "value": { "banIfExcessiveInvalidCmdsReceived": true,
"banIpsPermanently": false, "numberOfInvalidCmds": 5, "sensitivityLevel": "Medium" } } } },
"links": { "self": "/admin/v2/sites/c9551b5d-f904-4612-b690-d51bfde2eb1f/networkAndSecurity" } }
PATCH PowerShell Sample
Copy
##Patch SITE Network Security settings
Write-Output "Site Network Security PATCH"
Write-Output "-----"
$update =
'{
"data": {
"attributes": {
"connectionLimits": {
"maxConcurrentLogins": true,
"maxConcurrentSocketConnections": true,
"maxConnectionFromSameIP": true,
"maxConnectionsPerUser": true,
"maxTransferSpeed": true
},
"denialOfService": {
"autoBan": {
"enabled": true,
"value": {
"banIfExcessiveInvalidCmdsReceived": true,
"numberOfInvalidCmds": true,
"sensitivityLevel": "Low",
"banIpsPermenantly": true
}
}
}
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$patchNSReturn = Invoke-RestMethod -Uri
"$baseURL/v2/sites/$siteID/networkandsecurity"
-Method 'PATCH' -Headers $authHeader -Body $update
Write-Output $patchNSReturn | ConvertTo-Json