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.
{
"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"
}
}
}
}
}
}
{
"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: