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.fsight.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.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.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>0</minLength>
  <minAge>0</minAge>
  <maxAge>0</maxAge>
  <restrictUserName>0</restrictUserName>
  <restrictFullUserName>0</restrictFullUserName>
  <requireDifferentChars>0</requireDifferentChars>
  <uniquenessDegree>0</uniquenessDegree>
  <requireDifferentLetterCase>0</requireDifferentLetterCase>
  <forbiddenStrings />
  <checkForbiddenStrings>0</checkForbiddenStrings>
  <maxRepeatedCharCount>0</maxRepeatedCharCount>
  <historyLength>0</historyLength>
<hashing>
  <isON>0</isON>
  <excludeAdmin>0</excludeAdmin>
  </hashing>
  <requireDigitsAndChars>0</requireDigitsAndChars>
  <requireNonAlphabeticChars>0</requireNonAlphabeticChars>
  <warningMaxAge>0</warningMaxAge>
  </passwordPolicy>
<settings>
  <objectsIdFormat />
  <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>1</supportUserPrivateFolder>
  <screenshotWithoutSecurity>0</screenshotWithoutSecurity>
  <copyToClipboardAllowed>1</copyToClipboardAllowed>
  <auditClipboardOperations>1</auditClipboardOperations>
  <allowUserQueries>1</allowUserQueries>
  <forceCleanMemory>0</forceCleanMemory>
  <enforceApplicationRole>0</enforceApplicationRole>
  <checkUserPassword>0</checkUserPassword>
  <allowCreateUserGrant>0</allowCreateUserGrant>
  <lockIdentifiersPeriod>0</lockIdentifiersPeriod>
  <autoLockPeriod>0</autoLockPeriod>
  <createDeferredSubjects>0</createDeferredSubjects>
  <maxFailedLogons>0</maxFailedLogons>
  <failedLogonsCounterResetPeriod>0</failedLogonsCounterResetPeriod>
  <isaPresent>0</isaPresent>
  <chkObjVerOnUpdFromPef>0</chkObjVerOnUpdFromPef>
  <mbId />
  </settings>
  </policy>
  <bisearchEnable>Full</bisearchEnable>
<apply>
<onCredentialsRequired>
<logonParams>
  <descr>Enter user name and password of the user who has permissions to create tables in the 'Database' database</descr>
  <realm>OBJ21909</realm>
  <toAdmin>1</toAdmin>
<logonData>
  <driver>MSSQL2012</driver>
  <server>v-nrspo-mssql.dev.fs.fsight.world</server>
  <database>p7repository</database>
  </logonData>
  </logonParams>
  </onCredentialsRequired>
  </apply>
  </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" : "0",
"minAge" : "0",
"maxAge" : "0",
"restrictUserName" : "0",
"restrictFullUserName" : "0",
"requireDifferentChars" : "0",
"uniquenessDegree" : "0",
"requireDifferentLetterCase" : "0",
"forbiddenStrings" : "",
"checkForbiddenStrings" : "0",
"maxRepeatedCharCount" : "0",
"historyLength" : "0",
"hashing" :
{
"isON" : "0",
"excludeAdmin" : "0"
},
"requireDigitsAndChars" : "0",
"requireNonAlphabeticChars" : "0",
"warningMaxAge" : "0"
},
"settings" :
{
"objectsIdFormat" : "",
"allowedDocumentFormats" : "",
"mandatoryAccessControl" : "None",
"restrictAdminAccess" : "0",
"restrictIsaAccess" : "0",
"restrictUserDeletion" : "0",
"restrictGroupDeletion" : "0",
"discretionaryAccessControl" : "1",
"attributeBasedAccessControl" : "0",
"methodsCombineAlgorithm" : "Default",
"supportUserPrivateFolder" : "1",
"screenshotWithoutSecurity" : "0",
"copyToClipboardAllowed" : "1",
"auditClipboardOperations" : "1",
"allowUserQueries" : "1",
"forceCleanMemory" : "0",
"enforceApplicationRole" : "0",
"checkUserPassword" : "0",
"allowCreateUserGrant" : "0",
"lockIdentifiersPeriod" : "0",
"autoLockPeriod" : "0",
"createDeferredSubjects" : "0",
"maxFailedLogons" : "0",
"failedLogonsCounterResetPeriod" : "0",
"isaPresent" : "0",
"chkObjVerOnUpdFromPef" : "0",
"mbId" : ""
}
},
"bisearchEnable" : "Full",
"apply" :
{
"onCredentialsRequired" :
{
"logonParams" :
{
"descr" : "Enter user name and password of the user who has permissions to create tables in the 'Database' database",
"realm" : "OBJ21909",
"toAdmin" : "1",
"logonData" :
{
"driver" : "MSSQL2012",
"server" : "v-nrspo-mssql.dev.fs.fsight.world",
"database" : "p7repository"
}
}
}
}
}
}
}
}
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