Setting Up Security Policy

Below is the example of using the SetMbSec operation to change security policy settings. The request contains a list of changed password policy and access protocol settings. The response contains the updated list of all security policy and access protocol settings.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetMbSec xmlns="http://www.prognoz.ru/PP.SOM.Som">
<tMbSec xmlns=" ">
  <id>S1!M</id>
  </tMbSec>
<tArg xmlns=" ">
<pattern>
<policy>
  <passwordPolicy>true</passwordPolicy>
  <settings>true</settings>
  </policy>
  </pattern>
<meta>
<policy>
<passwordPolicy>
  <minLength>5</minLength>
  <requireDifferentChars>true</requireDifferentChars>
  <requireDifferentLetterCase>true</requireDifferentLetterCase>
<forbiddenStrings>
  <s>admin</s>
  <s>user</s>
  <s>qwerty</s>
  </forbiddenStrings>
  <checkForbiddenStrings>true</checkForbiddenStrings>
  <historyLength>5</historyLength>
  </passwordPolicy>
<settings>
<allowedDocumentFormats>
  <s>XLS</s>
  <s>DOC</s>
  <s>PDF</s>
  </allowedDocumentFormats>
  <screenshotWithoutSecurity>true</screenshotWithoutSecurity>
  <copyToClipboardAllowed>false</copyToClipboardAllowed>
  <forceCleanMemory>true</forceCleanMemory>
  <maxFailedLogons>10</maxFailedLogons>
  </settings>
  </policy>
  </meta>
<metaGet>
<pattern>
<policy>
  <passwordPolicy>true</passwordPolicy>
  <settings>true</settings>
  </policy>
  </pattern>
  </metaGet>
  </tArg>
  </SetMbSec>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMbSecResult xmlns="http://www.prognoz.ru/PP.SOM.Som" xmlns:q1="http://www.prognoz.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns=" ">
  <id>S1!M</id>
  </id>
<metaGet xmlns=" ">
<id>
  <id>S1!M</id>
  </id>
<meta>
<policy>
<passwordPolicy>
  <minLength>5</minLength>
  <minAge>0</minAge>
  <maxAge>0</maxAge>
  <restrictUserName>0</restrictUserName>
  <restrictFullUserName>0</restrictFullUserName>
  <requireDifferentChars>1</requireDifferentChars>
  <uniquenessDegree>0</uniquenessDegree>
  <requireDifferentLetterCase>1</requireDifferentLetterCase>
<forbiddenStrings>
  <s>admin</s>
  <s>user</s>
  <s>qwerty</s>
  </forbiddenStrings>
  <checkForbiddenStrings>1</checkForbiddenStrings>
  <maxRepeatedCharCount>0</maxRepeatedCharCount>
  <historyLength>5</historyLength>
<hashing>
  <isON>0</isON>
  <excludeAdmin>0</excludeAdmin>
  </hashing>
  <requireDigitsAndChars>0</requireDigitsAndChars>
  <requireNonAlphabeticChars>0</requireNonAlphabeticChars>
  <warningMaxAge>1</warningMaxAge>
  </passwordPolicy>
<settings>
  <objectsIdFormat />
<allowedDocumentFormats>
  <s>XLS</s>
  <s>DOC</s>
  <s>PDF</s>
  </allowedDocumentFormats>
  <mandatoryAccessControl>None</mandatoryAccessControl>
  <restrictAdminAccess>0</restrictAdminAccess>
  <restrictIsaAccess>0</restrictIsaAccess>
  <restrictUserDeletion>0</restrictUserDeletion>
  <restrictGroupDeletion>0</restrictGroupDeletion>
  <discretionaryAccessControl>1</discretionaryAccessControl>
  <attributeBasedAccessControl>0</attributeBasedAccessControl>
  <methodsCombineAlgorithm>Default</methodsCombineAlgorithm>
  <supportUserPrivateFolder>0</supportUserPrivateFolder>
  <screenshotWithoutSecurity>1</screenshotWithoutSecurity>
  <copyToClipboardAllowed>0</copyToClipboardAllowed>
  <auditClipboardOperations>0</auditClipboardOperations>
  <allowUserQueries>1</allowUserQueries>
  <forceCleanMemory>1</forceCleanMemory>
  <enforceApplicationRole>0</enforceApplicationRole>
  <checkUserPassword>0</checkUserPassword>
  <allowCreateUserGrant>0</allowCreateUserGrant>
  <lockIdentifiersPeriod>0</lockIdentifiersPeriod>
  <autoLockPeriod>0</autoLockPeriod>
  <createDeferredSubjects>0</createDeferredSubjects>
  <maxFailedLogons>10</maxFailedLogons>
  <failedLogonsCounterResetPeriod>0</failedLogonsCounterResetPeriod>
  <isaPresent>0</isaPresent>
  <chkObjVerOnUpdFromPef>0</chkObjVerOnUpdFromPef>
  <mbId />
  </settings>
  </policy>
  <bisearchEnable>Disable</bisearchEnable>
  </meta>
  </metaGet>
  </SetMbSecResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMbSec" :
{
"tMbSec" :
{
"id" : "S1!M"
},
"tArg" :
{
"pattern" :
{
"policy" :
{
"passwordPolicy" : "true",
"settings" : "true"
}
},
"meta" :
{
"policy" :
{
"passwordPolicy" :
{
"minLength" : "5",
"requireDifferentChars" : "true",
"requireDifferentLetterCase" : "true",
"forbiddenStrings" :
{
"s" :
[
"admin",
"user",
"qwerty"
]
},
"checkForbiddenStrings" : "true",
"historyLength" : "5"
},
"settings" :
{
"allowedDocumentFormats" :
{
"s" :
[
"XLS",
"DOC",
"PDF"
]
},
"screenshotWithoutSecurity" : "true",
"copyToClipboardAllowed" : "false",
"forceCleanMemory" : "true",
"maxFailedLogons" : "10"
}
}
},
"metaGet" :
{
"pattern" :
{
"policy" :
{
"passwordPolicy" : "true",
"settings" : "true"
}
}
}
}
}
}

JSON response:

{
"SetMbSecResult" :
{
"id" :
{
"id" : "S1!M"
},
"metaGet" :
{
"id" :
{
"id" : "S1!M"
},
"meta" :
{
"policy" :
{
"passwordPolicy" :
{
"minLength" : "5",
"minAge" : "0",
"maxAge" : "0",
"restrictUserName" : "0",
"restrictFullUserName" : "0",
"requireDifferentChars" : "1",
"uniquenessDegree" : "0",
"requireDifferentLetterCase" : "1",
"forbiddenStrings" :
{
"s" :
[
"admin",
"user",
"qwerty"
]
},
"checkForbiddenStrings" : "1",
"maxRepeatedCharCount" : "0",
"historyLength" : "5",
"hashing" :
{
"isON" : "0",
"excludeAdmin" : "0"
},
"requireDigitsAndChars" : "0",
"requireNonAlphabeticChars" : "0",
"warningMaxAge" : "1"
},
"settings" :
{
"objectsIdFormat" : "",
"allowedDocumentFormats" :
{
"s" :
[
"XLS",
"DOC",
"PDF"
]
},
"mandatoryAccessControl" : "None",
"restrictAdminAccess" : "0",
"restrictIsaAccess" : "0",
"restrictUserDeletion" : "0",
"restrictGroupDeletion" : "0",
"discretionaryAccessControl" : "1",
"attributeBasedAccessControl" : "0",
"methodsCombineAlgorithm" : "Default",
"supportUserPrivateFolder" : "0",
"screenshotWithoutSecurity" : "1",
"copyToClipboardAllowed" : "0",
"auditClipboardOperations" : "0",
"allowUserQueries" : "1",
"forceCleanMemory" : "1",
"enforceApplicationRole" : "0",
"checkUserPassword" : "0",
"allowCreateUserGrant" : "0",
"lockIdentifiersPeriod" : "0",
"autoLockPeriod" : "0",
"createDeferredSubjects" : "0",
"maxFailedLogons" : "10",
"failedLogonsCounterResetPeriod" : "0",
"isaPresent" : "0",
"chkObjVerOnUpdFromPef" : "0",
"mbId" : ""
}
},
"bisearchEnable" : "Disable"
}
}
}
}
public static SetMbSecResult ChangeSecuritySettings(string mb)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var setMbSec = new SetMbSec()
{
tArg = new SetMbSecArg()
{
//Operation execution pattern
pattern = new MbSecMdPattern()
{
policy = new MbSecPolicyPattern()
{
passwordPolicy = true,
settings = true
}
},
//Metadata with new security policy parameters
meta = new MbSecMd()
{
policy = new MbSecPolicy()
{
passwordPolicy = new MbSecPasswordPolicy() //Password policy
{
minLength = 5, //Minimum password length
requireDifferentChars = true, //Deny password consisting of equal characters
requireDifferentLetterCase = true, //Deny password consisting of letters of one case
checkForbiddenStrings = true, //Check password for forbidden strings
forbiddenStrings = new string[3] {"admin", "user", "qwerty"},
historyLength = 5 //Number of old passwords, with which the new one cannot match
},
settings = new MbSecPolicySettings() //Access control
{
allowedDocumentFormats = new string[3] { "XLS", "DOC", "PDF" }, //Allowed document formats
screenshotWithoutSecurity = true, //Display extra-large icons without taking into account access permissions
copyToClipboardAllowed = false, //Deny copy to clipboard
forceCleanMemory = true, //Clean memory
maxFailedLogons = 10 //Maximum number of password failures
}
}
},
//Parameters for updating information after operation execution
metaGet = new GetMbSecArg()
{
pattern = new MbSecMdPattern()
{
policy = new MbSecPolicyPattern()
{
passwordPolicy = true,
settings = true
}
}
}
},
//Repository moniker
tMbSec = new MbId() { id = mb }
};
//Change security policy
var result = somClient.SetMbSec(setMbSec);
return result;
}

See also:

SetMbSec: Operation