amt-0.2.0.js 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  1. /**
  2. * @fileoverview Intel(r) AMT Communication Stack
  3. * @author Ylian Saint-Hilaire
  4. * @version v0.2.0b
  5. */
  6. /**
  7. * Construct a AmtStackCreateService object, this ia the main Intel AMT communication stack.
  8. * @constructor
  9. */
  10. function AmtStackCreateService(wsmanStack) {
  11. var obj = new Object();
  12. obj.wsman = wsmanStack;
  13. obj.pfx = ["http://intel.com/wbem/wscim/1/amt-schema/1/", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/", "http://intel.com/wbem/wscim/1/ips-schema/1/"];
  14. obj.PendingEnums = [];
  15. obj.PendingBatchOperations = 0;
  16. obj.ActiveEnumsCount = 0;
  17. obj.MaxActiveEnumsCount = 1; // Maximum number of enumerations that can be done at the same time.
  18. obj.onProcessChanged = null;
  19. var _MaxProcess = 0;
  20. var _LastProcess = 0;
  21. // Return the number of pending actions
  22. obj.GetPendingActions = function () { return (obj.PendingEnums.length * 2) + (obj.ActiveEnumsCount) + obj.wsman.comm.PendingAjax.length + obj.wsman.comm.ActiveAjaxCount + obj.PendingBatchOperations; }
  23. // Private Method, Update the current processing status, this gives the application an idea of what progress is being done by the WSMAN stack
  24. function _up() {
  25. var x = obj.GetPendingActions();
  26. if (_MaxProcess < x) _MaxProcess = x;
  27. if (obj.onProcessChanged != null && _LastProcess != x) {
  28. //console.log("Process Old=" + _LastProcess + ", New=" + x + ", PEnums=" + obj.PendingEnums.length + ", AEnums=" + obj.ActiveEnumsCount + ", PAjax=" + obj.wsman.comm.PendingAjax.length + ", AAjax=" + obj.wsman.comm.ActiveAjaxCount + ", PBatch=" + obj.PendingBatchOperations);
  29. _LastProcess = x;
  30. obj.onProcessChanged(x, _MaxProcess);
  31. }
  32. if (x == 0) _MaxProcess = 0;
  33. }
  34. // Perform a WSMAN "SUBSCRIBE" operation.
  35. obj.Subscribe = function (name, delivery, url, callback, tag, pri, selectors, opaque, user, pass) { obj.wsman.ExecSubscribe(obj.CompleteName(name), delivery, url, function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri, selectors, opaque, user, pass); _up(); }
  36. // Perform a WSMAN "UNSUBSCRIBE" operation.
  37. obj.UnSubscribe = function (name, callback, tag, pri, selectors) { obj.wsman.ExecUnSubscribe(obj.CompleteName(name), function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri, selectors); _up(); }
  38. // Perform a WSMAN "GET" operation.
  39. obj.Get = function (name, callback, tag, pri) { obj.wsman.ExecGet(obj.CompleteName(name), function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri); _up(); }
  40. // Perform a WSMAN "PUT" operation.
  41. obj.Put = function (name, putobj, callback, tag, pri, selectors) { obj.wsman.ExecPut(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri, selectors); _up(); }
  42. // Perform a WSMAN "CREATE" operation.
  43. obj.Create = function (name, putobj, callback, tag, pri) { obj.wsman.ExecCreate(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri); _up(); }
  44. // Perform a WSMAN "DELETE" operation.
  45. obj.Delete = function (name, putobj, callback, tag, pri) { obj.wsman.ExecDelete(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback(obj, name, response, xstatus, tag); }, 0, pri); _up(); }
  46. // Perform a WSMAN method call operation.
  47. obj.Exec = function (name, method, args, callback, tag, pri, selectors) { obj.wsman.ExecMethod(obj.CompleteName(name), method, args, function (ws, resuri, response, xstatus) { _up(); callback(obj, name, obj.CompleteExecResponse(response), xstatus, tag); }, 0, pri, selectors); _up(); }
  48. // Perform a WSMAN method call operation.
  49. obj.ExecWithXml = function (name, method, args, callback, tag, pri, selectors) { obj.wsman.ExecMethodXml(obj.CompleteName(name), method, execArgumentsToXml(args), function (ws, resuri, response, xstatus) { _up(); callback(obj, name, obj.CompleteExecResponse(response), xstatus, tag); }, 0, pri, selectors); _up(); }
  50. // Perform a WSMAN "ENUMERATE" operation.
  51. obj.Enum = function (name, callback, tag, pri) {
  52. if (obj.ActiveEnumsCount < obj.MaxActiveEnumsCount) {
  53. obj.ActiveEnumsCount++; obj.wsman.ExecEnum(obj.CompleteName(name), function (ws, resuri, response, xstatus, tag0) { _up(); _EnumStartSink(name, response, callback, resuri, xstatus, tag0); }, tag, pri);
  54. } else {
  55. obj.PendingEnums.push([name, callback, tag, pri]);
  56. }
  57. _up();
  58. }
  59. // Private method
  60. function _EnumStartSink(name, response, callback, resuri, status, tag, pri) {
  61. if (status != 200) { callback(obj, name, null, status, tag); _EnumDoNext(1); return; }
  62. if (response == null || response.Header["Method"] != "EnumerateResponse" || !response.Body["EnumerationContext"]) { callback(obj, name, null, 603, tag); _EnumDoNext(1); return; }
  63. var enumctx = response.Body["EnumerationContext"];
  64. obj.wsman.ExecPull(resuri, enumctx, function (ws, resuri, response, xstatus) { _EnumContinueSink(name, response, callback, resuri, [], xstatus, tag, pri); });
  65. }
  66. // Private method
  67. function _EnumContinueSink(name, response, callback, resuri, items, status, tag, pri) {
  68. if (status != 200) { callback(obj, name, null, status, tag); _EnumDoNext(1); return; }
  69. if (response == null || response.Header["Method"] != "PullResponse") { callback(obj, name, null, 604, tag); _EnumDoNext(1); return; }
  70. for (var i in response.Body["Items"]) {
  71. if (response.Body["Items"][i] instanceof Array) {
  72. for (var j in response.Body["Items"][i]) { items.push(response.Body["Items"][i][j]); }
  73. } else {
  74. items.push(response.Body["Items"][i]);
  75. }
  76. }
  77. if (response.Body["EnumerationContext"]) {
  78. var enumctx = response.Body["EnumerationContext"];
  79. obj.wsman.ExecPull(resuri, enumctx, function (ws, resuri, response, xstatus) { _EnumContinueSink(name, response, callback, resuri, items, xstatus, tag, 1); });
  80. } else {
  81. _EnumDoNext(1);
  82. callback(obj, name, items, status, tag);
  83. _up();
  84. }
  85. }
  86. // Private method
  87. function _EnumDoNext(dec) {
  88. obj.ActiveEnumsCount -= dec;
  89. if (obj.ActiveEnumsCount >= obj.MaxActiveEnumsCount || obj.PendingEnums.length == 0) return;
  90. var x = obj.PendingEnums.shift();
  91. obj.Enum(x[0], x[1], x[2]);
  92. _EnumDoNext(0);
  93. }
  94. // Perform a batch of WSMAN "ENUM" operations.
  95. obj.BatchEnum = function (batchname, names, callback, tag, continueOnError, pri) {
  96. obj.PendingBatchOperations += (names.length * 2);
  97. _BatchNextEnum(batchname, Clone(names), callback, tag, {}, continueOnError, pri); _up();
  98. }
  99. // Request each enum in the batch, stopping if something does not return status 200
  100. function _BatchNextEnum(batchname, names, callback, tag, results, continueOnError, pri) {
  101. obj.PendingBatchOperations -= 2;
  102. var n = names.shift(), f = obj.Enum;
  103. if (n[0] == '*') { f = obj.Get; n = n.substring(1); } // If the name starts with a star, do a GET instead of an ENUM. This will reduce round trips.
  104. //console.log((f == obj.Get?'Get ':'Enum ') + n);
  105. // Perform a GET/ENUM action
  106. f(n, function (stack, name, responses, status, tag0) {
  107. tag0[2][name] = { response: (responses==null?null:responses.Body), responses: responses, status: status };
  108. if (tag0[1].length == 0 || status == 401 || (continueOnError != true && status != 200 && status != 400)) { obj.PendingBatchOperations -= (names.length * 2); _up(); callback(obj, batchname, tag0[2], status, tag); }
  109. else { _up(); _BatchNextEnum(batchname, names, callback, tag, tag0[2], pri); }
  110. }, [batchname, names, results], pri);
  111. _up();
  112. }
  113. // Perform a batch of WSMAN "GET" operations.
  114. obj.BatchGet = function (batchname, names, callback, tag, pri) {
  115. _FetchNext({ name: batchname, names: names, callback: callback, current: 0, responses: {}, tag: tag, pri: pri }); _up();
  116. }
  117. // Private method
  118. function _FetchNext(batch) {
  119. if (batch.names.length <= batch.current) {
  120. batch.callback(obj, batch.name, batch.responses, 200, batch.tag);
  121. } else {
  122. obj.wsman.ExecGet(obj.CompleteName(batch.names[batch.current]), function (ws, resuri, response, xstatus) { _Fetched(batch, response, xstatus); }, batch.pri);
  123. batch.current++;
  124. }
  125. _up();
  126. }
  127. // Private method
  128. function _Fetched(batch, response, status) {
  129. if (response == null || status != 200) {
  130. batch.callback(obj, batch.name, null, status, batch.tag);
  131. } else {
  132. batch.responses[response.Header["Method"]] = response;
  133. _FetchNext(batch);
  134. }
  135. }
  136. // Private method
  137. obj.CompleteName = function(name) {
  138. if (name.indexOf("AMT_") == 0) return obj.pfx[0] + name;
  139. if (name.indexOf("CIM_") == 0) return obj.pfx[1] + name;
  140. if (name.indexOf("IPS_") == 0) return obj.pfx[2] + name;
  141. }
  142. obj.CompleteExecResponse = function (resp) {
  143. if (resp && resp != null && resp.Body && resp.Body["ReturnValue"]) resp.Body.ReturnValueStr = obj.AmtStatusToStr(resp.Body["ReturnValue"]);
  144. return resp;
  145. }
  146. obj.RequestPowerStateChange = function (PowerState, callback_func) {
  147. obj.CIM_PowerManagementService_RequestPowerStateChange(PowerState, "<Address xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><ResourceURI xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\"><Selector Name=\"CreationClassName\">CIM_ComputerSystem</Selector><Selector Name=\"Name\">ManagedSystem</Selector></SelectorSet></ReferenceParameters>", null, null, callback_func);
  148. }
  149. obj.SetBootConfigRole = function (Role, callback_func) {
  150. obj.CIM_BootService_SetBootConfigRole("<Address xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><ResourceURI xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\"><Selector Name=\"InstanceID\">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>", Role, callback_func);
  151. }
  152. // Cancel all pending queries with given status
  153. obj.CancelAllQueries = function (s) {
  154. obj.wsman.CancelAllQueries(s);
  155. }
  156. // Auto generated methods
  157. obj.AMT_AgentPresenceWatchdog_RegisterAgent = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "RegisterAgent", {}, callback_func); }
  158. obj.AMT_AgentPresenceWatchdog_AssertPresence = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertPresence", { "SequenceNumber": SequenceNumber }, callback_func); }
  159. obj.AMT_AgentPresenceWatchdog_AssertShutdown = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertShutdown", { "SequenceNumber": SequenceNumber }, callback_func); }
  160. obj.AMT_AgentPresenceWatchdog_AddAction = function (OldState, NewState, EventOnTransition, ActionSd, ActionEac, callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "AddAction", { "OldState": OldState, "NewState": NewState, "EventOnTransition": EventOnTransition, "ActionSd": ActionSd, "ActionEac": ActionEac }, callback_func, tag, pri, selectors); }
  161. obj.AMT_AgentPresenceWatchdog_DeleteAllActions = function (callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "DeleteAllActions", {}, callback_func, tag, pri, selectors); }
  162. obj.AMT_AgentPresenceWatchdogAction_GetActionEac = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdogAction", "GetActionEac", {}, callback_func); }
  163. obj.AMT_AgentPresenceWatchdogVA_RegisterAgent = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "RegisterAgent", {}, callback_func); }
  164. obj.AMT_AgentPresenceWatchdogVA_AssertPresence = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AssertPresence", { "SequenceNumber": SequenceNumber }, callback_func); }
  165. obj.AMT_AgentPresenceWatchdogVA_AssertShutdown = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AssertShutdown", { "SequenceNumber": SequenceNumber }, callback_func); }
  166. obj.AMT_AgentPresenceWatchdogVA_AddAction = function (OldState, NewState, EventOnTransition, ActionSd, ActionEac, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AddAction", { "OldState": OldState, "NewState": NewState, "EventOnTransition": EventOnTransition, "ActionSd": ActionSd, "ActionEac": ActionEac }, callback_func); }
  167. obj.AMT_AgentPresenceWatchdogVA_DeleteAllActions = function (_method_dummy, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "DeleteAllActions", { "_method_dummy": _method_dummy }, callback_func); }
  168. obj.AMT_AuditLog_ClearLog = function (callback_func) { obj.Exec("AMT_AuditLog", "ClearLog", {}, callback_func); }
  169. obj.AMT_AuditLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_AuditLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  170. obj.AMT_AuditLog_ReadRecords = function (StartIndex, callback_func, tag) { obj.Exec("AMT_AuditLog", "ReadRecords", { "StartIndex": StartIndex }, callback_func, tag); }
  171. obj.AMT_AuditLog_SetAuditLock = function (LockTimeoutInSeconds, Flag, Handle, callback_func) { obj.Exec("AMT_AuditLog", "SetAuditLock", { "LockTimeoutInSeconds": LockTimeoutInSeconds, "Flag": Flag, "Handle": Handle }, callback_func); }
  172. obj.AMT_AuditLog_ExportAuditLogSignature = function (SigningMechanism, callback_func) { obj.Exec("AMT_AuditLog", "ExportAuditLogSignature", { "SigningMechanism": SigningMechanism }, callback_func); }
  173. obj.AMT_AuditLog_SetSigningKeyMaterial = function (SigningMechanismType, SigningKey, LengthOfCertificates, Certificates, callback_func) { obj.Exec("AMT_AuditLog", "SetSigningKeyMaterial", { "SigningMechanismType": SigningMechanismType, "SigningKey": SigningKey, "LengthOfCertificates": LengthOfCertificates, "Certificates": Certificates }, callback_func); }
  174. obj.AMT_AuditPolicyRule_SetAuditPolicy = function (Enable, AuditedAppID, EventID, PolicyType, callback_func) { obj.Exec("AMT_AuditPolicyRule", "SetAuditPolicy", { "Enable": Enable, "AuditedAppID": AuditedAppID, "EventID": EventID, "PolicyType": PolicyType }, callback_func); }
  175. obj.AMT_AuditPolicyRule_SetAuditPolicyBulk = function (Enable, AuditedAppID, EventID, PolicyType, callback_func) { obj.Exec("AMT_AuditPolicyRule", "SetAuditPolicyBulk", { "Enable": Enable, "AuditedAppID": AuditedAppID, "EventID": EventID, "PolicyType": PolicyType }, callback_func); }
  176. obj.AMT_AuthorizationService_AddUserAclEntryEx = function (DigestUsername, DigestPassword, KerberosUserSid, AccessPermission, Realms, callback_func) { obj.Exec("AMT_AuthorizationService", "AddUserAclEntryEx", { "DigestUsername": DigestUsername, "DigestPassword": DigestPassword, "KerberosUserSid": KerberosUserSid, "AccessPermission": AccessPermission, "Realms": Realms }, callback_func); }
  177. obj.AMT_AuthorizationService_EnumerateUserAclEntries = function (StartIndex, callback_func) { obj.Exec("AMT_AuthorizationService", "EnumerateUserAclEntries", { "StartIndex": StartIndex }, callback_func); }
  178. obj.AMT_AuthorizationService_GetUserAclEntryEx = function (Handle, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "GetUserAclEntryEx", { "Handle": Handle }, callback_func, tag); }
  179. obj.AMT_AuthorizationService_UpdateUserAclEntryEx = function (Handle, DigestUsername, DigestPassword, KerberosUserSid, AccessPermission, Realms, callback_func) { obj.Exec("AMT_AuthorizationService", "UpdateUserAclEntryEx", { "Handle": Handle, "DigestUsername": DigestUsername, "DigestPassword": DigestPassword, "KerberosUserSid": KerberosUserSid, "AccessPermission": AccessPermission, "Realms": Realms }, callback_func); }
  180. obj.AMT_AuthorizationService_RemoveUserAclEntry = function (Handle, callback_func) { obj.Exec("AMT_AuthorizationService", "RemoveUserAclEntry", { "Handle": Handle }, callback_func); }
  181. obj.AMT_AuthorizationService_SetAdminAclEntryEx = function (Username, DigestPassword, callback_func) { obj.Exec("AMT_AuthorizationService", "SetAdminAclEntryEx", { "Username": Username, "DigestPassword": DigestPassword }, callback_func); }
  182. obj.AMT_AuthorizationService_GetAdminAclEntry = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminAclEntry", {}, callback_func); }
  183. obj.AMT_AuthorizationService_GetAdminAclEntryStatus = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminAclEntryStatus", {}, callback_func); }
  184. obj.AMT_AuthorizationService_GetAdminNetAclEntryStatus = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminNetAclEntryStatus", {}, callback_func); }
  185. obj.AMT_AuthorizationService_SetAclEnabledState = function (Handle, Enabled, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "SetAclEnabledState", { "Handle": Handle, "Enabled": Enabled }, callback_func, tag); }
  186. obj.AMT_AuthorizationService_GetAclEnabledState = function (Handle, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "GetAclEnabledState", { "Handle": Handle }, callback_func, tag); }
  187. obj.AMT_EndpointAccessControlService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  188. obj.AMT_EndpointAccessControlService_GetPosture = function (PostureType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetPosture", { "PostureType": PostureType }, callback_func); }
  189. obj.AMT_EndpointAccessControlService_GetPostureHash = function (PostureType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetPostureHash", { "PostureType": PostureType }, callback_func); }
  190. obj.AMT_EndpointAccessControlService_UpdatePostureState = function (UpdateType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "UpdatePostureState", { "UpdateType": UpdateType }, callback_func); }
  191. obj.AMT_EndpointAccessControlService_GetEacOptions = function (callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetEacOptions", {}, callback_func); }
  192. obj.AMT_EndpointAccessControlService_SetEacOptions = function (EacVendors, PostureHashAlgorithm, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "SetEacOptions", { "EacVendors": EacVendors, "PostureHashAlgorithm": PostureHashAlgorithm }, callback_func); }
  193. obj.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy = function (Policy, callback_func) { obj.Exec("AMT_EnvironmentDetectionSettingData", "SetSystemDefensePolicy", { "Policy": Policy }, callback_func); }
  194. obj.AMT_EnvironmentDetectionSettingData_EnableVpnRouting = function (Enable, callback_func) { obj.Exec("AMT_EnvironmentDetectionSettingData", "EnableVpnRouting", { "Enable": Enable }, callback_func); }
  195. obj.AMT_EthernetPortSettings_SetLinkPreference = function (LinkPreference, Timeout, callback_func) { obj.Exec("AMT_EthernetPortSettings", "SetLinkPreference", { "LinkPreference": LinkPreference, "Timeout": Timeout }, callback_func); }
  196. obj.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats = function (SelectedStatistics, callback_func) { obj.Exec("AMT_HeuristicPacketFilterStatistics", "ResetSelectedStats", { "SelectedStatistics": SelectedStatistics }, callback_func); }
  197. obj.AMT_KerberosSettingData_GetCredentialCacheState = function (callback_func) { obj.Exec("AMT_KerberosSettingData", "GetCredentialCacheState", {}, callback_func); }
  198. obj.AMT_KerberosSettingData_SetCredentialCacheState = function (Enable, callback_func) { obj.Exec("AMT_KerberosSettingData", "SetCredentialCacheState", { "Enable": Enable }, callback_func); }
  199. obj.AMT_MessageLog_CancelIteration = function (IterationIdentifier, callback_func) { obj.Exec("AMT_MessageLog", "CancelIteration", { "IterationIdentifier": IterationIdentifier }, callback_func); }
  200. obj.AMT_MessageLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_MessageLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  201. obj.AMT_MessageLog_ClearLog = function (callback_func) { obj.Exec("AMT_MessageLog", "ClearLog", { }, callback_func); }
  202. obj.AMT_MessageLog_GetRecords = function (IterationIdentifier, MaxReadRecords, callback_func, tag) { obj.Exec("AMT_MessageLog", "GetRecords", { "IterationIdentifier": IterationIdentifier, "MaxReadRecords": MaxReadRecords }, callback_func, tag); }
  203. obj.AMT_MessageLog_GetRecord = function (IterationIdentifier, PositionToNext, callback_func) { obj.Exec("AMT_MessageLog", "GetRecord", { "IterationIdentifier": IterationIdentifier, "PositionToNext": PositionToNext }, callback_func); }
  204. obj.AMT_MessageLog_PositionAtRecord = function (IterationIdentifier, MoveAbsolute, RecordNumber, callback_func) { obj.Exec("AMT_MessageLog", "PositionAtRecord", { "IterationIdentifier": IterationIdentifier, "MoveAbsolute": MoveAbsolute, "RecordNumber": RecordNumber }, callback_func); }
  205. obj.AMT_MessageLog_PositionToFirstRecord = function (callback_func, tag) { obj.Exec("AMT_MessageLog", "PositionToFirstRecord", {}, callback_func, tag); }
  206. obj.AMT_MessageLog_FreezeLog = function (Freeze, callback_func) { obj.Exec("AMT_MessageLog", "FreezeLog", { "Freeze": Freeze }, callback_func); }
  207. obj.AMT_PublicKeyManagementService_AddCRL = function (Url, SerialNumbers, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddCRL", { "Url": Url, "SerialNumbers": SerialNumbers }, callback_func); }
  208. obj.AMT_PublicKeyManagementService_ResetCRLList = function (_method_dummy, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "ResetCRLList", { "_method_dummy": _method_dummy }, callback_func); }
  209. obj.AMT_PublicKeyManagementService_AddCertificate = function (CertificateBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddCertificate", { "CertificateBlob": CertificateBlob }, callback_func); }
  210. obj.AMT_PublicKeyManagementService_AddTrustedRootCertificate = function (CertificateBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddTrustedRootCertificate", { "CertificateBlob": CertificateBlob }, callback_func); }
  211. obj.AMT_PublicKeyManagementService_AddKey = function (KeyBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddKey", { "KeyBlob": KeyBlob }, callback_func); }
  212. obj.AMT_PublicKeyManagementService_GeneratePKCS10Request = function (KeyPair, DNName, Usage, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GeneratePKCS10Request", { "KeyPair": KeyPair, "DNName": DNName, "Usage": Usage }, callback_func); }
  213. obj.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx = function (KeyPair, SigningAlgorithm, NullSignedCertificateRequest, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GeneratePKCS10RequestEx", { "KeyPair": KeyPair, "SigningAlgorithm": SigningAlgorithm, "NullSignedCertificateRequest": NullSignedCertificateRequest }, callback_func); }
  214. obj.AMT_PublicKeyManagementService_GenerateKeyPair = function (KeyAlgorithm, KeyLength, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GenerateKeyPair", { "KeyAlgorithm": KeyAlgorithm, "KeyLength": KeyLength }, callback_func); }
  215. obj.AMT_RedirectionService_RequestStateChange = function (RequestedState, callback_func) { obj.Exec("AMT_RedirectionService", "RequestStateChange", { "RequestedState": RequestedState }, callback_func); }
  216. obj.AMT_RedirectionService_TerminateSession = function (SessionType, callback_func) { obj.Exec("AMT_RedirectionService", "TerminateSession", { "SessionType": SessionType }, callback_func); }
  217. obj.AMT_RemoteAccessService_AddMpServer = function (AccessInfo, InfoFormat, Port, AuthMethod, Certificate, Username, Password, CN, callback_func) { obj.Exec("AMT_RemoteAccessService", "AddMpServer", { "AccessInfo": AccessInfo, "InfoFormat": InfoFormat, "Port": Port, "AuthMethod": AuthMethod, "Certificate": Certificate, "Username": Username, "Password": Password, "CN": CN }, callback_func); }
  218. obj.AMT_RemoteAccessService_AddRemoteAccessPolicyRule = function (Trigger, TunnelLifeTime, ExtendedData, MpServer, callback_func) { obj.Exec("AMT_RemoteAccessService", "AddRemoteAccessPolicyRule", { "Trigger": Trigger, "TunnelLifeTime": TunnelLifeTime, "ExtendedData": ExtendedData, "MpServer": MpServer }, callback_func); }
  219. obj.AMT_RemoteAccessService_CloseRemoteAccessConnection = function (_method_dummy, callback_func) { obj.Exec("AMT_RemoteAccessService", "CloseRemoteAccessConnection", { "_method_dummy": _method_dummy }, callback_func); }
  220. obj.AMT_SetupAndConfigurationService_CommitChanges = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "CommitChanges", { "_method_dummy": _method_dummy }, callback_func); }
  221. obj.AMT_SetupAndConfigurationService_Unprovision = function (ProvisioningMode, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "Unprovision", { "ProvisioningMode": ProvisioningMode }, callback_func); }
  222. obj.AMT_SetupAndConfigurationService_PartialUnprovision = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "PartialUnprovision", { "_method_dummy": _method_dummy }, callback_func); }
  223. obj.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "ResetFlashWearOutProtection", { "_method_dummy": _method_dummy }, callback_func); }
  224. obj.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod = function (Duration, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "ExtendProvisioningPeriod", { "Duration": Duration }, callback_func); }
  225. obj.AMT_SetupAndConfigurationService_SetMEBxPassword = function (Password, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "SetMEBxPassword", { "Password": Password }, callback_func); }
  226. obj.AMT_SetupAndConfigurationService_SetTLSPSK = function (PID, PPS, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "SetTLSPSK", { "PID": PID, "PPS": PPS }, callback_func); }
  227. obj.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetProvisioningAuditRecord", {}, callback_func); }
  228. obj.AMT_SetupAndConfigurationService_GetUuid = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetUuid", {}, callback_func); }
  229. obj.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetUnprovisionBlockingComponents", {}, callback_func); }
  230. obj.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2 = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetProvisioningAuditRecordV2", {}, callback_func); }
  231. obj.AMT_SystemDefensePolicy_GetTimeout = function (callback_func) { obj.Exec("AMT_SystemDefensePolicy", "GetTimeout", {}, callback_func); }
  232. obj.AMT_SystemDefensePolicy_SetTimeout = function (Timeout, callback_func) { obj.Exec("AMT_SystemDefensePolicy", "SetTimeout", { "Timeout": Timeout }, callback_func); }
  233. obj.AMT_SystemDefensePolicy_UpdateStatistics = function (NetworkInterface, ResetOnRead, callback_func, tag, pri, selectors) { obj.Exec("AMT_SystemDefensePolicy", "UpdateStatistics", { "NetworkInterface": NetworkInterface, "ResetOnRead": ResetOnRead }, callback_func, tag, pri, selectors); }
  234. obj.AMT_SystemPowerScheme_SetPowerScheme = function (callback_func, schemeInstanceId, tag) { obj.Exec("AMT_SystemPowerScheme", "SetPowerScheme", {}, callback_func, tag, 0, { "InstanceID": schemeInstanceId }); }
  235. obj.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch = function (callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "GetLowAccuracyTimeSynch", {}, callback_func, tag); }
  236. obj.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch = function (Ta0, Tm1, Tm2, callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "SetHighAccuracyTimeSynch", { "Ta0": Ta0, "Tm1": Tm1, "Tm2": Tm2 }, callback_func, tag); }
  237. obj.AMT_UserInitiatedConnectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_UserInitiatedConnectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  238. obj.AMT_WebUIService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_WebUIService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  239. obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); }
  240. obj.AMT_WiFiPortConfigurationService_UpdateWiFiSettings = function (WiFiEndpointSettings, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "UpdateWiFiSettings", { "WiFiEndpointSettings": WiFiEndpointSettings, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); }
  241. obj.AMT_WiFiPortConfigurationService_DeleteAllITProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllITProfiles", { "_method_dummy": _method_dummy }, callback_func); }
  242. obj.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllUserProfiles", { "_method_dummy": _method_dummy }, callback_func); }
  243. obj.CIM_Account_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Account", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  244. obj.CIM_AccountManagementService_CreateAccount = function (System, AccountTemplate, callback_func) { obj.Exec("CIM_AccountManagementService", "CreateAccount", { "System": System, "AccountTemplate": AccountTemplate }, callback_func); }
  245. obj.CIM_BootConfigSetting_ChangeBootOrder = function (Source, callback_func) { obj.Exec("CIM_BootConfigSetting", "ChangeBootOrder", { "Source": Source }, callback_func); }
  246. obj.CIM_BootService_SetBootConfigRole = function (BootConfigSetting, Role, callback_func) { obj.Exec("CIM_BootService", "SetBootConfigRole", { "BootConfigSetting": BootConfigSetting, "Role": Role }, callback_func, 0, 1); }
  247. obj.CIM_Card_ConnectorPower = function (Connector, PoweredOn, callback_func) { obj.Exec("CIM_Card", "ConnectorPower", { "Connector": Connector, "PoweredOn": PoweredOn }, callback_func); }
  248. obj.CIM_Card_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_Card", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
  249. obj.CIM_Chassis_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_Chassis", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
  250. obj.CIM_Fan_SetSpeed = function (DesiredSpeed, callback_func) { obj.Exec("CIM_Fan", "SetSpeed", { "DesiredSpeed": DesiredSpeed }, callback_func); }
  251. obj.CIM_KVMRedirectionSAP_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_KVMRedirectionSAP", "RequestStateChange", { "RequestedState": RequestedState/*, "TimeoutPeriod": TimeoutPeriod */}, callback_func); }
  252. obj.CIM_MediaAccessDevice_LockMedia = function (Lock, callback_func) { obj.Exec("CIM_MediaAccessDevice", "LockMedia", { "Lock": Lock }, callback_func); }
  253. obj.CIM_MediaAccessDevice_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_MediaAccessDevice", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  254. obj.CIM_MediaAccessDevice_Reset = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "Reset", {}, callback_func); }
  255. obj.CIM_MediaAccessDevice_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_MediaAccessDevice", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  256. obj.CIM_MediaAccessDevice_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_MediaAccessDevice", "OnlineDevice", { "Online": Online }, callback_func); }
  257. obj.CIM_MediaAccessDevice_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_MediaAccessDevice", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  258. obj.CIM_MediaAccessDevice_SaveProperties = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "SaveProperties", {}, callback_func); }
  259. obj.CIM_MediaAccessDevice_RestoreProperties = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "RestoreProperties", {}, callback_func); }
  260. obj.CIM_MediaAccessDevice_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_MediaAccessDevice", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  261. obj.CIM_PhysicalFrame_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_PhysicalFrame", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
  262. obj.CIM_PhysicalPackage_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_PhysicalPackage", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
  263. obj.CIM_PowerManagementService_RequestPowerStateChange = function (PowerState, ManagedElement, Time, TimeoutPeriod, callback_func) { obj.Exec("CIM_PowerManagementService", "RequestPowerStateChange", { "PowerState": PowerState, "ManagedElement": ManagedElement, "Time": Time, "TimeoutPeriod": TimeoutPeriod }, callback_func, 0, 1); }
  264. obj.CIM_PowerSupply_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_PowerSupply", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  265. obj.CIM_PowerSupply_Reset = function (callback_func) { obj.Exec("CIM_PowerSupply", "Reset", {}, callback_func); }
  266. obj.CIM_PowerSupply_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_PowerSupply", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  267. obj.CIM_PowerSupply_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_PowerSupply", "OnlineDevice", { "Online": Online }, callback_func); }
  268. obj.CIM_PowerSupply_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_PowerSupply", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  269. obj.CIM_PowerSupply_SaveProperties = function (callback_func) { obj.Exec("CIM_PowerSupply", "SaveProperties", {}, callback_func); }
  270. obj.CIM_PowerSupply_RestoreProperties = function (callback_func) { obj.Exec("CIM_PowerSupply", "RestoreProperties", {}, callback_func); }
  271. obj.CIM_PowerSupply_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_PowerSupply", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  272. obj.CIM_Processor_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Processor", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  273. obj.CIM_Processor_Reset = function (callback_func) { obj.Exec("CIM_Processor", "Reset", {}, callback_func); }
  274. obj.CIM_Processor_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Processor", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  275. obj.CIM_Processor_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Processor", "OnlineDevice", { "Online": Online }, callback_func); }
  276. obj.CIM_Processor_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Processor", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  277. obj.CIM_Processor_SaveProperties = function (callback_func) { obj.Exec("CIM_Processor", "SaveProperties", {}, callback_func); }
  278. obj.CIM_Processor_RestoreProperties = function (callback_func) { obj.Exec("CIM_Processor", "RestoreProperties", {}, callback_func); }
  279. obj.CIM_Processor_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Processor", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  280. obj.CIM_RecordLog_ClearLog = function (callback_func) { obj.Exec("CIM_RecordLog", "ClearLog", {}, callback_func); }
  281. obj.CIM_RecordLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_RecordLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  282. obj.CIM_RedirectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_RedirectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  283. obj.CIM_Sensor_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Sensor", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  284. obj.CIM_Sensor_Reset = function (callback_func) { obj.Exec("CIM_Sensor", "Reset", {}, callback_func); }
  285. obj.CIM_Sensor_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Sensor", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  286. obj.CIM_Sensor_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Sensor", "OnlineDevice", { "Online": Online }, callback_func); }
  287. obj.CIM_Sensor_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Sensor", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  288. obj.CIM_Sensor_SaveProperties = function (callback_func) { obj.Exec("CIM_Sensor", "SaveProperties", {}, callback_func); }
  289. obj.CIM_Sensor_RestoreProperties = function (callback_func) { obj.Exec("CIM_Sensor", "RestoreProperties", {}, callback_func); }
  290. obj.CIM_Sensor_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Sensor", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  291. obj.CIM_StatisticalData_ResetSelectedStats = function (SelectedStatistics, callback_func) { obj.Exec("CIM_StatisticalData", "ResetSelectedStats", { "SelectedStatistics": SelectedStatistics }, callback_func); }
  292. obj.CIM_Watchdog_KeepAlive = function (callback_func) { obj.Exec("CIM_Watchdog", "KeepAlive", {}, callback_func); }
  293. obj.CIM_Watchdog_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Watchdog", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  294. obj.CIM_Watchdog_Reset = function (callback_func) { obj.Exec("CIM_Watchdog", "Reset", {}, callback_func); }
  295. obj.CIM_Watchdog_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Watchdog", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  296. obj.CIM_Watchdog_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Watchdog", "OnlineDevice", { "Online": Online }, callback_func); }
  297. obj.CIM_Watchdog_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Watchdog", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  298. obj.CIM_Watchdog_SaveProperties = function (callback_func) { obj.Exec("CIM_Watchdog", "SaveProperties", {}, callback_func); }
  299. obj.CIM_Watchdog_RestoreProperties = function (callback_func) { obj.Exec("CIM_Watchdog", "RestoreProperties", {}, callback_func); }
  300. obj.CIM_Watchdog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Watchdog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  301. obj.CIM_WiFiPort_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_WiFiPort", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
  302. obj.CIM_WiFiPort_Reset = function (callback_func) { obj.Exec("CIM_WiFiPort", "Reset", {}, callback_func); }
  303. obj.CIM_WiFiPort_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_WiFiPort", "EnableDevice", { "Enabled": Enabled }, callback_func); }
  304. obj.CIM_WiFiPort_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_WiFiPort", "OnlineDevice", { "Online": Online }, callback_func); }
  305. obj.CIM_WiFiPort_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_WiFiPort", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
  306. obj.CIM_WiFiPort_SaveProperties = function (callback_func) { obj.Exec("CIM_WiFiPort", "SaveProperties", {}, callback_func); }
  307. obj.CIM_WiFiPort_RestoreProperties = function (callback_func) { obj.Exec("CIM_WiFiPort", "RestoreProperties", {}, callback_func); }
  308. obj.CIM_WiFiPort_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_WiFiPort", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  309. obj.IPS_HostBasedSetupService_Setup = function (NetAdminPassEncryptionType, NetworkAdminPassword, McNonce, Certificate, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "Setup", { "NetAdminPassEncryptionType": NetAdminPassEncryptionType, "NetworkAdminPassword": NetworkAdminPassword, "McNonce": McNonce, "Certificate": Certificate, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
  310. obj.IPS_HostBasedSetupService_AddNextCertInChain = function (NextCertificate, IsLeafCertificate, IsRootCertificate, callback_func) { obj.Exec("IPS_HostBasedSetupService", "AddNextCertInChain", { "NextCertificate": NextCertificate, "IsLeafCertificate": IsLeafCertificate, "IsRootCertificate": IsRootCertificate }, callback_func); }
  311. obj.IPS_HostBasedSetupService_AdminSetup = function (NetAdminPassEncryptionType, NetworkAdminPassword, McNonce, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "AdminSetup", { "NetAdminPassEncryptionType": NetAdminPassEncryptionType, "NetworkAdminPassword": NetworkAdminPassword, "McNonce": McNonce, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
  312. obj.IPS_HostBasedSetupService_UpgradeClientToAdmin = function (McNonce, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "UpgradeClientToAdmin", { "McNonce": McNonce, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
  313. obj.IPS_HostBasedSetupService_DisableClientControlMode = function (_method_dummy, callback_func) { obj.Exec("IPS_HostBasedSetupService", "DisableClientControlMode", { "_method_dummy": _method_dummy }, callback_func); }
  314. obj.IPS_KVMRedirectionSettingData_TerminateSession = function (callback_func) { obj.Exec("IPS_KVMRedirectionSettingData", "TerminateSession", {}, callback_func); }
  315. obj.IPS_OptInService_StartOptIn = function (callback_func) { obj.Exec("IPS_OptInService", "StartOptIn", {}, callback_func); }
  316. obj.IPS_OptInService_CancelOptIn = function (callback_func) { obj.Exec("IPS_OptInService", "CancelOptIn", {}, callback_func); }
  317. obj.IPS_OptInService_SendOptInCode = function (OptInCode, callback_func) { obj.Exec("IPS_OptInService", "SendOptInCode", { "OptInCode": OptInCode }, callback_func); }
  318. obj.IPS_OptInService_StartService = function (callback_func) { obj.Exec("IPS_OptInService", "StartService", {}, callback_func); }
  319. obj.IPS_OptInService_StopService = function (callback_func) { obj.Exec("IPS_OptInService", "StopService", {}, callback_func); }
  320. obj.IPS_OptInService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_OptInService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  321. obj.IPS_ProvisioningRecordLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_ProvisioningRecordLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  322. obj.IPS_ProvisioningRecordLog_ClearLog = function (_method_dummy, callback_func) { obj.Exec("IPS_ProvisioningRecordLog", "ClearLog", { "_method_dummy": _method_dummy }, callback_func); }
  323. obj.IPS_SecIOService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_SecIOService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
  324. obj.AmtStatusToStr = function (code) { if (obj.AmtStatusCodes[code]) return obj.AmtStatusCodes[code]; else return "UNKNOWN_ERROR" }
  325. obj.AmtStatusCodes = {
  326. 0x0000: "SUCCESS",
  327. 0x0001: "INTERNAL_ERROR",
  328. 0x0002: "NOT_READY",
  329. 0x0003: "INVALID_PT_MODE",
  330. 0x0004: "INVALID_MESSAGE_LENGTH",
  331. 0x0005: "TABLE_FINGERPRINT_NOT_AVAILABLE",
  332. 0x0006: "INTEGRITY_CHECK_FAILED",
  333. 0x0007: "UNSUPPORTED_ISVS_VERSION",
  334. 0x0008: "APPLICATION_NOT_REGISTERED",
  335. 0x0009: "INVALID_REGISTRATION_DATA",
  336. 0x000A: "APPLICATION_DOES_NOT_EXIST",
  337. 0x000B: "NOT_ENOUGH_STORAGE",
  338. 0x000C: "INVALID_NAME",
  339. 0x000D: "BLOCK_DOES_NOT_EXIST",
  340. 0x000E: "INVALID_BYTE_OFFSET",
  341. 0x000F: "INVALID_BYTE_COUNT",
  342. 0x0010: "NOT_PERMITTED",
  343. 0x0011: "NOT_OWNER",
  344. 0x0012: "BLOCK_LOCKED_BY_OTHER",
  345. 0x0013: "BLOCK_NOT_LOCKED",
  346. 0x0014: "INVALID_GROUP_PERMISSIONS",
  347. 0x0015: "GROUP_DOES_NOT_EXIST",
  348. 0x0016: "INVALID_MEMBER_COUNT",
  349. 0x0017: "MAX_LIMIT_REACHED",
  350. 0x0018: "INVALID_AUTH_TYPE",
  351. 0x0019: "AUTHENTICATION_FAILED",
  352. 0x001A: "INVALID_DHCP_MODE",
  353. 0x001B: "INVALID_IP_ADDRESS",
  354. 0x001C: "INVALID_DOMAIN_NAME",
  355. 0x001D: "UNSUPPORTED_VERSION",
  356. 0x001E: "REQUEST_UNEXPECTED",
  357. 0x001F: "INVALID_TABLE_TYPE",
  358. 0x0020: "INVALID_PROVISIONING_STATE",
  359. 0x0021: "UNSUPPORTED_OBJECT",
  360. 0x0022: "INVALID_TIME",
  361. 0x0023: "INVALID_INDEX",
  362. 0x0024: "INVALID_PARAMETER",
  363. 0x0025: "INVALID_NETMASK",
  364. 0x0026: "FLASH_WRITE_LIMIT_EXCEEDED",
  365. 0x0027: "INVALID_IMAGE_LENGTH",
  366. 0x0028: "INVALID_IMAGE_SIGNATURE",
  367. 0x0029: "PROPOSE_ANOTHER_VERSION",
  368. 0x002A: "INVALID_PID_FORMAT",
  369. 0x002B: "INVALID_PPS_FORMAT",
  370. 0x002C: "BIST_COMMAND_BLOCKED",
  371. 0x002D: "CONNECTION_FAILED",
  372. 0x002E: "CONNECTION_TOO_MANY",
  373. 0x002F: "RNG_GENERATION_IN_PROGRESS",
  374. 0x0030: "RNG_NOT_READY",
  375. 0x0031: "CERTIFICATE_NOT_READY",
  376. 0x0400: "DISABLED_BY_POLICY",
  377. 0x0800: "NETWORK_IF_ERROR_BASE",
  378. 0x0801: "UNSUPPORTED_OEM_NUMBER",
  379. 0x0802: "UNSUPPORTED_BOOT_OPTION",
  380. 0x0803: "INVALID_COMMAND",
  381. 0x0804: "INVALID_SPECIAL_COMMAND",
  382. 0x0805: "INVALID_HANDLE",
  383. 0x0806: "INVALID_PASSWORD",
  384. 0x0807: "INVALID_REALM",
  385. 0x0808: "STORAGE_ACL_ENTRY_IN_USE",
  386. 0x0809: "DATA_MISSING",
  387. 0x080A: "DUPLICATE",
  388. 0x080B: "EVENTLOG_FROZEN",
  389. 0x080C: "PKI_MISSING_KEYS",
  390. 0x080D: "PKI_GENERATING_KEYS",
  391. 0x080E: "INVALID_KEY",
  392. 0x080F: "INVALID_CERT",
  393. 0x0810: "CERT_KEY_NOT_MATCH",
  394. 0x0811: "MAX_KERB_DOMAIN_REACHED",
  395. 0x0812: "UNSUPPORTED",
  396. 0x0813: "INVALID_PRIORITY",
  397. 0x0814: "NOT_FOUND",
  398. 0x0815: "INVALID_CREDENTIALS",
  399. 0x0816: "INVALID_PASSPHRASE",
  400. 0x0818: "NO_ASSOCIATION",
  401. 0x081B: "AUDIT_FAIL",
  402. 0x081C: "BLOCKING_COMPONENT",
  403. 0x0821: "USER_CONSENT_REQUIRED",
  404. 0x1000: "APP_INTERNAL_ERROR",
  405. 0x1001: "NOT_INITIALIZED",
  406. 0x1002: "LIB_VERSION_UNSUPPORTED",
  407. 0x1003: "INVALID_PARAM",
  408. 0x1004: "RESOURCES",
  409. 0x1005: "HARDWARE_ACCESS_ERROR",
  410. 0x1006: "REQUESTOR_NOT_REGISTERED",
  411. 0x1007: "NETWORK_ERROR",
  412. 0x1008: "PARAM_BUFFER_TOO_SHORT",
  413. 0x1009: "COM_NOT_INITIALIZED_IN_THREAD",
  414. 0x100A: "URL_REQUIRED"
  415. }
  416. //
  417. // Methods used for getting the event log
  418. //
  419. obj.GetMessageLog = function (func, tag) {
  420. obj.AMT_MessageLog_PositionToFirstRecord(_GetMessageLog0, [func, tag, []]);
  421. }
  422. function _GetMessageLog0(stack, name, responses, status, tag) {
  423. if (status != 200 || responses.Body["ReturnValue"] != '0') { tag[0](obj, null, tag[2]); return; }
  424. obj.AMT_MessageLog_GetRecords(responses.Body["IterationIdentifier"], 390, _GetMessageLog1, tag);
  425. }
  426. function _GetMessageLog1(stack, name, responses, status, tag) {
  427. if (status != 200 || responses.Body["ReturnValue"] != '0') { tag[0](obj, null, tag[2]); return; }
  428. var i, j, x, e, AmtMessages = tag[2], t = new Date(), TimeStamp, ra = responses.Body["RecordArray"];
  429. if (typeof ra === 'string') { responses.Body["RecordArray"] = [responses.Body["RecordArray"]]; }
  430. for (i in ra) {
  431. e = null;
  432. try { e = window.atob(ra[i]); } catch (ex) { }
  433. if (e != null) {
  434. TimeStamp = ReadIntX(e, 0);
  435. if ((TimeStamp > 0) && (TimeStamp < 0xFFFFFFFF)) {
  436. x = { 'DeviceAddress': e.charCodeAt(4), 'EventSensorType': e.charCodeAt(5), 'EventType': e.charCodeAt(6), 'EventOffset': e.charCodeAt(7), 'EventSourceType': e.charCodeAt(8), 'EventSeverity': e.charCodeAt(9), 'SensorNumber': e.charCodeAt(10), 'Entity': e.charCodeAt(11), 'EntityInstance': e.charCodeAt(12), 'EventData': [], 'Time': new Date((TimeStamp + (t.getTimezoneOffset() * 60)) * 1000) };
  437. for (j = 13; j < 21; j++) { x['EventData'].push(e.charCodeAt(j)); }
  438. x['EntityStr'] = _SystemEntityTypes[x['Entity']];
  439. x['Desc'] = _GetEventDetailStr(x['EventSensorType'], x['EventOffset'], x['EventData'], x['Entity']);
  440. if (!x['EntityStr']) x['EntityStr'] = "Unknown";
  441. AmtMessages.push(x);
  442. }
  443. }
  444. }
  445. if (responses.Body["NoMoreRecords"] != true) { obj.AMT_MessageLog_GetRecords(responses.Body["IterationIdentifier"], 390, _GetMessageLog1, [tag[0], AmtMessages, tag[2]]); } else { tag[0](obj, AmtMessages, tag[2]); }
  446. }
  447. var _EventTrapSourceTypes = "Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split('|');
  448. var _SystemFirmwareError = "Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split('|');
  449. var _SystemFirmwareProgress = "Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split('|');
  450. var _SystemEntityTypes = "Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split('|');
  451. obj.RealmNames = "||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split('|');
  452. obj.WatchdogCurrentStates = { 1: 'Not Started', 2: 'Stopped', 4: 'Running', 8: 'Expired', 16: 'Suspended' };
  453. function _GetEventDetailStr(eventSensorType, eventOffset, eventDataField, entity) {
  454. if (eventSensorType == 15)
  455. {
  456. if (eventDataField[0] == 235) return "Invalid Data";
  457. if (eventOffset == 0) return _SystemFirmwareError[eventDataField[1]];
  458. return _SystemFirmwareProgress[eventDataField[1]];
  459. }
  460. if (eventSensorType == 18 && eventDataField[0] == 170) // System watchdog event
  461. {
  462. return "Agent watchdog " + char2hex(eventDataField[4]) + char2hex(eventDataField[3]) + char2hex(eventDataField[2]) + char2hex(eventDataField[1]) + "-" + char2hex(eventDataField[6]) + char2hex(eventDataField[5]) + "-... changed to " + obj.WatchdogCurrentStates[eventDataField[7]];
  463. }
  464. /*
  465. if (eventSensorType == 5 && eventOffset == 0) // System chassis
  466. {
  467. return "Case intrusion";
  468. }
  469. if (eventSensorType == 192 && eventOffset == 0 && eventDataField[0] == 170 && eventDataField[1] == 48)
  470. {
  471. if (eventDataField[2] == 0) return "A remote Serial Over LAN session was established.";
  472. if (eventDataField[2] == 1) return "Remote Serial Over LAN session finished. User control was restored.";
  473. if (eventDataField[2] == 2) return "A remote IDE-Redirection session was established.";
  474. if (eventDataField[2] == 3) return "Remote IDE-Redirection session finished. User control was restored.";
  475. }
  476. if (eventSensorType == 36)
  477. {
  478. long handle = ((long)(eventDataField[1]) << 24) + ((long)(eventDataField[2]) << 16) + ((long)(eventDataField[3]) << 8) + (long)(eventDataField[4]);
  479. string nic = string.Format("#{0}", eventDataField[0]);
  480. if (eventDataField[0] == 0xAA) nic = "wired"; // TODO: Add wireless *****
  481. //if (eventDataField[0] == 0xAA) nic = "wireless";
  482. if (handle == 4294967293) { return string.Format("All received packet filter was matched on {0} interface.", nic); }
  483. if (handle == 4294967292) { return string.Format("All outbound packet filter was matched on {0} interface.", nic); }
  484. if (handle == 4294967290) { return string.Format("Spoofed packet filter was matched on {0} interface.", nic); }
  485. return string.Format("Filter {0} was matched on {1} interface.", handle, nic);
  486. }
  487. if (eventSensorType == 192)
  488. {
  489. if (eventDataField[2] == 0) return "Security policy invoked. Some or all network traffic (TX) was stopped.";
  490. if (eventDataField[2] == 2) return "Security policy invoked. Some or all network traffic (RX) was stopped.";
  491. return "Security policy invoked.";
  492. }
  493. if (eventSensorType == 193)
  494. {
  495. if (eventDataField[0] == 0xAA && eventDataField[1] == 0x30 && eventDataField[2] == 0x00 && eventDataField[3] == 0x00) { return "User request for remote connection."; }
  496. if (eventDataField[0] == 0xAA && eventDataField[1] == 0x20 && eventDataField[2] == 0x03 && eventDataField[3] == 0x01) { return "EAC error: attempt to get posture while NAC in Intel® AMT is disabled."; // eventDataField = 0xAA20030100000000 }
  497. if (eventDataField[0] == 0xAA && eventDataField[1] == 0x20 && eventDataField[2] == 0x04 && eventDataField[3] == 0x00) { return "Certificate revoked. "; }
  498. }
  499. */
  500. if (eventSensorType == 6) return "Authentication failed " + (eventDataField[1] + (eventDataField[2] << 8)) + " times. The system may be under attack.";
  501. if (eventSensorType == 30) return "No bootable media";
  502. if (eventSensorType == 32) return "Operating system lockup or power interrupt";
  503. if (eventSensorType == 35) {
  504. if (eventDataField[0] == 64) return "BIOS POST (Power On Self-Test) Watchdog Timeout."; // 64,2,252,84,89,0,0,0
  505. return "System boot failure";
  506. }
  507. if (eventSensorType == 37) return "System firmware started (at least one CPU is properly executing).";
  508. return "Unknown Sensor Type #" + eventSensorType;
  509. }
  510. // ###BEGIN###{AuditLog}
  511. // Useful link: https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Fsecurityadminevents.htm
  512. var _AmtAuditStringTable =
  513. {
  514. 16: 'Security Admin',
  515. 17: 'RCO',
  516. 18: 'Redirection Manager',
  517. 19: 'Firmware Update Manager',
  518. 20: 'Security Audit Log',
  519. 21: 'Network Time',
  520. 22: 'Network Administration',
  521. 23: 'Storage Administration',
  522. 24: 'Event Manager',
  523. 25: 'Circuit Breaker Manager',
  524. 26: 'Agent Presence Manager',
  525. 27: 'Wireless Configuration',
  526. 28: 'EAC',
  527. 29: 'KVM',
  528. 30: 'User Opt-In Events',
  529. 32: 'Screen Blanking',
  530. 33: 'Watchdog Events',
  531. 1600: 'Provisioning Started',
  532. 1601: 'Provisioning Completed',
  533. 1602: 'ACL Entry Added',
  534. 1603: 'ACL Entry Modified',
  535. 1604: 'ACL Entry Removed',
  536. 1605: 'ACL Access with Invalid Credentials',
  537. 1606: 'ACL Entry State',
  538. 1607: 'TLS State Changed',
  539. 1608: 'TLS Server Certificate Set',
  540. 1609: 'TLS Server Certificate Remove',
  541. 1610: 'TLS Trusted Root Certificate Added',
  542. 1611: 'TLS Trusted Root Certificate Removed',
  543. 1612: 'TLS Preshared Key Set',
  544. 1613: 'Kerberos Settings Modified',
  545. 1614: 'Kerberos Main Key Modified',
  546. 1615: 'Flash Wear out Counters Reset',
  547. 1616: 'Power Package Modified',
  548. 1617: 'Set Realm Authentication Mode',
  549. 1618: 'Upgrade Client to Admin Control Mode',
  550. 1619: 'Unprovisioning Started',
  551. 1700: 'Performed Power Up',
  552. 1701: 'Performed Power Down',
  553. 1702: 'Performed Power Cycle',
  554. 1703: 'Performed Reset',
  555. 1704: 'Set Boot Options',
  556. 1800: 'IDER Session Opened',
  557. 1801: 'IDER Session Closed',
  558. 1802: 'IDER Enabled',
  559. 1803: 'IDER Disabled',
  560. 1804: 'SoL Session Opened',
  561. 1805: 'SoL Session Closed',
  562. 1806: 'SoL Enabled',
  563. 1807: 'SoL Disabled',
  564. 1808: 'KVM Session Started',
  565. 1809: 'KVM Session Ended',
  566. 1810: 'KVM Enabled',
  567. 1811: 'KVM Disabled',
  568. 1812: 'VNC Password Failed 3 Times',
  569. 1900: 'Firmware Updated',
  570. 1901: 'Firmware Update Failed',
  571. 2000: 'Security Audit Log Cleared',
  572. 2001: 'Security Audit Policy Modified',
  573. 2002: 'Security Audit Log Disabled',
  574. 2003: 'Security Audit Log Enabled',
  575. 2004: 'Security Audit Log Exported',
  576. 2005: 'Security Audit Log Recovered',
  577. 2100: 'Intel&reg; ME Time Set',
  578. 2200: 'TCPIP Parameters Set',
  579. 2201: 'Host Name Set',
  580. 2202: 'Domain Name Set',
  581. 2203: 'VLAN Parameters Set',
  582. 2204: 'Link Policy Set',
  583. 2205: 'IPv6 Parameters Set',
  584. 2300: 'Global Storage Attributes Set',
  585. 2301: 'Storage EACL Modified',
  586. 2302: 'Storage FPACL Modified',
  587. 2303: 'Storage Write Operation',
  588. 2400: 'Alert Subscribed',
  589. 2401: 'Alert Unsubscribed',
  590. 2402: 'Event Log Cleared',
  591. 2403: 'Event Log Frozen',
  592. 2500: 'CB Filter Added',
  593. 2501: 'CB Filter Removed',
  594. 2502: 'CB Policy Added',
  595. 2503: 'CB Policy Removed',
  596. 2504: 'CB Default Policy Set',
  597. 2505: 'CB Heuristics Option Set',
  598. 2506: 'CB Heuristics State Cleared',
  599. 2600: 'Agent Watchdog Added',
  600. 2601: 'Agent Watchdog Removed',
  601. 2602: 'Agent Watchdog Action Set',
  602. 2700: 'Wireless Profile Added',
  603. 2701: 'Wireless Profile Removed',
  604. 2702: 'Wireless Profile Updated',
  605. 2800: 'EAC Posture Signer SET',
  606. 2801: 'EAC Enabled',
  607. 2802: 'EAC Disabled',
  608. 2803: 'EAC Posture State',
  609. 2804: 'EAC Set Options',
  610. 2900: 'KVM Opt-in Enabled',
  611. 2901: 'KVM Opt-in Disabled',
  612. 2902: 'KVM Password Changed',
  613. 2903: 'KVM Consent Succeeded',
  614. 2904: 'KVM Consent Failed',
  615. 3000: 'Opt-In Policy Change',
  616. 3001: 'Send Consent Code Event',
  617. 3002: 'Start Opt-In Blocked Event'
  618. }
  619. // Return human readable extended audit log data
  620. // TODO: Just put some of them here, but many more still need to be added, helpful link here:
  621. // https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Fsecurityadminevents.htm
  622. obj.GetAuditLogExtendedDataStr = function (id, data) {
  623. if ((id == 1602 || id == 1604) && data.charCodeAt(0) == 0) { return data.substring(2, 2 + data.charCodeAt(1)); } // ACL Entry Added/Removed (Digest)
  624. if (id == 1603) { if (data.charCodeAt(1) == 0) { return data.substring(3); } return null; } // ACL Entry Modified
  625. if (id == 1605) { return ["Invalid ME access", "Invalid MEBx access"][data.charCodeAt(0)]; } // ACL Access with Invalid Credentials
  626. if (id == 1606) { var r = ["Disabled", "Enabled"][data.charCodeAt(0)]; if (data.charCodeAt(1) == 0) { r += ", " + data.substring(3); } return r;} // ACL Entry State
  627. if (id == 1607) { return "Remote " + ["NoAuth", "ServerAuth", "MutualAuth"][data.charCodeAt(0)] + ", Local " + ["NoAuth", "ServerAuth", "MutualAuth"][data.charCodeAt(1)]; } // TLS State Changed
  628. if (id == 1617) { return obj.RealmNames[ReadInt(data, 0)] + ", " + ["NoAuth", "Auth", "Disabled"][data.charCodeAt(4)]; } // Set Realm Authentication Mode
  629. if (id == 1619) { return ["BIOS", "MEBx", "Local MEI", "Local WSMAN", "Remote WSAMN"][data.charCodeAt(0)]; } // Intel AMT Unprovisioning Started
  630. if (id == 1900) { return "From " + ReadShort(data, 0) + "." + ReadShort(data, 2) + "." + ReadShort(data, 4) + "." + ReadShort(data, 6) + " to " + ReadShort(data, 8) + "." + ReadShort(data, 10) + "." + ReadShort(data, 12) + "." + ReadShort(data, 14); } // Firmware Updated
  631. if (id == 2100) { var t4 = new Date(); t4.setTime(ReadInt(data, 0) * 1000 + (new Date().getTimezoneOffset() * 60000)); return t4.toLocaleString(); } // Intel AMT Time Set
  632. if (id == 3000) { return "From " + ["None", "KVM", "All"][data.charCodeAt(0)] + " to " + ["None", "KVM", "All"][data.charCodeAt(1)]; } // Opt-In Policy Change
  633. if (id == 3001) { return ["Success", "Failed 3 times"][data.charCodeAt(0)]; } // Send Consent Code Event
  634. return null;
  635. }
  636. obj.GetAuditLog = function (func) {
  637. obj.AMT_AuditLog_ReadRecords(1, _GetAuditLog0, [func, []]);
  638. }
  639. function _GetAuditLog0(stack, name, responses, status, tag) {
  640. if (status != 200) { tag[0](obj, [], status); return; }
  641. var ptr, i, e, x, r = tag[1], t = new Date(), TimeStamp;
  642. if (responses.Body['RecordsReturned'] > 0) {
  643. responses.Body['EventRecords'] = MakeToArray(responses.Body['EventRecords']);
  644. for (i in responses.Body['EventRecords']) {
  645. e = null;
  646. try {
  647. e = window.atob(responses.Body['EventRecords'][i]);
  648. } catch (e) {
  649. console.log(e + " " + responses.Body['EventRecords'][i])
  650. }
  651. x = { 'AuditAppID': ReadShort(e, 0), 'EventID': ReadShort(e, 2), 'InitiatorType': e.charCodeAt(4) };
  652. x['AuditApp'] = _AmtAuditStringTable[x['AuditAppID']];
  653. x['Event'] = _AmtAuditStringTable[(x['AuditAppID'] * 100) + x['EventID']];
  654. if (!x['Event']) x['Event'] = '#' + x['EventID'];
  655. // Read and process the initiator
  656. if (x['InitiatorType'] == 0) {
  657. // HTTP digest
  658. var userlen = e.charCodeAt(5);
  659. x['Initiator'] = e.substring(6, 6 + userlen);
  660. ptr = 6 + userlen;
  661. }
  662. if (x['InitiatorType'] == 1) {
  663. // Kerberos
  664. x['KerberosUserInDomain'] = ReadInt(e, 5);
  665. var userlen = e.charCodeAt(9);
  666. x['Initiator'] = GetSidString(e.substring(10, 10 + userlen));
  667. ptr = 10 + userlen;
  668. }
  669. if (x['InitiatorType'] == 2) {
  670. // Local
  671. x['Initiator'] = '<i>Local</i>';
  672. ptr = 5;
  673. }
  674. if (x['InitiatorType'] == 3) {
  675. // KVM Default Port
  676. x['Initiator'] = '<i>KVM Default Port</i>';
  677. ptr = 5;
  678. }
  679. // Read timestamp
  680. TimeStamp = ReadInt(e, ptr);
  681. x['Time'] = new Date((TimeStamp + (t.getTimezoneOffset() * 60)) * 1000);
  682. ptr += 4;
  683. // Read network access
  684. x['MCLocationType'] = e.charCodeAt(ptr++);
  685. var netlen = e.charCodeAt(ptr++);
  686. x['NetAddress'] = e.substring(ptr, ptr + netlen);
  687. // Read extended data
  688. ptr += netlen;
  689. var exlen = e.charCodeAt(ptr++);
  690. x['Ex'] = e.substring(ptr, ptr + exlen);
  691. x['ExStr'] = obj.GetAuditLogExtendedDataStr((x['AuditAppID'] * 100) + x['EventID'], x['Ex']);
  692. r.push(x);
  693. }
  694. }
  695. if (responses.Body['TotalRecordCount'] > r.length) {
  696. obj.AMT_AuditLog_ReadRecords(r.length + 1, _GetAuditLog0, [tag[0], r]);
  697. } else {
  698. tag[0](obj, r, status);
  699. }
  700. }
  701. // ###END###{AuditLog}
  702. return obj;
  703. }
  704. // ###BEGIN###{Certificates}
  705. // Forge MD5
  706. function hex_md5(str) { if (str == null) { str = ''; } return forge.md.md5.create().update(str).digest().toHex(); }
  707. // ###END###{Certificates}
  708. // ###BEGIN###{!Certificates}
  709. // TinyMD5 from https://github.com/jbt/js-crypto
  710. // Perform MD5 setup
  711. var md5_k = [];
  712. for (var i = 0; i < 64;) { md5_k[i] = 0 | (Math.abs(Math.sin(++i)) * 4294967296); }
  713. // Perform MD5 on raw string and return hex
  714. function hex_md5(str) {
  715. if (str == null) { str = ''; }
  716. var b, c, d, j,
  717. x = [],
  718. str2 = unescape(encodeURI(str)),
  719. a = str2.length,
  720. h = [b = 1732584193, c = -271733879, ~b, ~c],
  721. i = 0;
  722. for (; i <= a;) x[i >> 2] |= (str2.charCodeAt(i) || 128) << 8 * (i++ % 4);
  723. x[str = (a + 8 >> 6) * 16 + 14] = a * 8;
  724. i = 0;
  725. for (; i < str; i += 16) {
  726. a = h; j = 0;
  727. for (; j < 64;) {
  728. a = [
  729. d = a[3],
  730. ((b = a[1] | 0) +
  731. ((d = (
  732. (a[0] +
  733. [
  734. b & (c = a[2]) | ~b & d,
  735. d & b | ~d & c,
  736. b ^ c ^ d,
  737. c ^ (b | ~d)
  738. ][a = j >> 4]
  739. ) +
  740. (md5_k[j] +
  741. (x[[
  742. j,
  743. 5 * j + 1,
  744. 3 * j + 5,
  745. 7 * j
  746. ][a] % 16 + i] | 0)
  747. )
  748. )) << (a = [
  749. 7, 12, 17, 22,
  750. 5, 9, 14, 20,
  751. 4, 11, 16, 23,
  752. 6, 10, 15, 21
  753. ][4 * a + j++ % 4]) | d >>> 32 - a)
  754. ),
  755. b,
  756. c
  757. ];
  758. }
  759. for (j = 4; j;) h[--j] = h[j] + a[j];
  760. }
  761. str = '';
  762. for (; j < 32;) str += ((h[j >> 3] >> ((1 ^ j++ & 7) * 4)) & 15).toString(16);
  763. return str;
  764. }
  765. // ###END###{!Certificates}
  766. // Perform MD5 on raw string and return raw string result
  767. function rstr_md5(str) { return hex2rstr(hex_md5(str)); }
  768. /*
  769. Convert arguments into selector set and body XML. Used by AMT_WiFiPortConfigurationService_UpdateWiFiSettings.
  770. args = {
  771. "WiFiEndpoint": {
  772. __parameterType: 'reference',
  773. __resourceUri: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint',
  774. Name: 'WiFi Endpoint 0'
  775. },
  776. "WiFiEndpointSettingsInput":
  777. {
  778. __parameterType: 'instance',
  779. __namespace: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings',
  780. ElementName: document.querySelector('#editProfile-profileName').value,
  781. InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + document.querySelector('#editProfile-profileName').value,
  782. AuthenticationMethod: document.querySelector('#editProfile-networkAuthentication').value,
  783. //BSSType: 3, // Intel(r) AMT supports only infrastructure networks
  784. EncryptionMethod: document.querySelector('#editProfile-encryption').value,
  785. SSID: document.querySelector('#editProfile-networkName').value,
  786. Priority: 100,
  787. PSKPassPhrase: document.querySelector('#editProfile-passPhrase').value
  788. },
  789. "IEEE8021xSettingsInput": null,
  790. "ClientCredential": null,
  791. "CACredential": null
  792. },
  793. */
  794. function execArgumentsToXml(args) {
  795. if(args === undefined || args === null) return null;
  796. var result = '';
  797. for(var argName in args) {
  798. var arg = args[argName];
  799. if(!arg) continue;
  800. if(arg['__parameterType'] === 'reference') result += referenceToXml(argName, arg);
  801. else result += instanceToXml(argName, arg);
  802. //if(arg['__isInstance']) result += instanceToXml(argName, arg);
  803. }
  804. return result;
  805. }
  806. /**
  807. * Convert JavaScript object into XML
  808. <r:WiFiEndpointSettingsInput xmlns:q="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings">
  809. <q:ElementName>Wireless-Profile-Admin</q:ElementName>
  810. <q:InstanceID>Intel(r) AMT:WiFi Endpoint Settings Wireless-Profile-Admin</q:InstanceID>
  811. <q:AuthenticationMethod>6</q:AuthenticationMethod>
  812. <q:EncryptionMethod>4</q:EncryptionMethod>
  813. <q:Priority>100</q:Priority>
  814. <q:PSKPassPhrase>P@ssw0rd</q:PSKPassPhrase>
  815. </r:WiFiEndpointSettingsInput>
  816. */
  817. function instanceToXml(instanceName, inInstance) {
  818. if(inInstance === undefined || inInstance === null) return null;
  819. var hasNamespace = !!inInstance['__namespace'];
  820. var startTag = hasNamespace ? '<q:' : '<';
  821. var endTag = hasNamespace ? '</q:' : '</';
  822. var namespaceDef = hasNamespace ? (' xmlns:q="' + inInstance['__namespace'] + '"' ): '';
  823. var result = '<r:' + instanceName + namespaceDef + '>';
  824. if (typeof inInstance == 'string') {
  825. result += inInstance;
  826. } else {
  827. for (var prop in inInstance) {
  828. if (!inInstance.hasOwnProperty(prop) || prop.indexOf('__') === 0) continue;
  829. if (typeof inInstance[prop] === 'function' || Array.isArray(inInstance[prop])) continue;
  830. if (typeof inInstance[prop] === 'object') {
  831. //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>';
  832. console.error('only convert one level down...');
  833. }
  834. else {
  835. result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>';
  836. }
  837. }
  838. }
  839. result += '</r:' + instanceName + '>';
  840. return result;
  841. }
  842. /**
  843. * Convert a selector set into XML. Expect no nesting.
  844. * {
  845. * selectorName : selectorValue,
  846. * selectorName : selectorValue,
  847. * ... ...
  848. * }
  849. <r:WiFiEndpoint>
  850. <a:Address>http://192.168.1.103:16992/wsman</a:Address>
  851. <a:ReferenceParameters>
  852. <w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint</w:ResourceURI>
  853. <w:SelectorSet>
  854. <w:Selector Name="Name">WiFi Endpoint 0</w:Selector>
  855. </w:SelectorSet>
  856. </a:ReferenceParameters>
  857. </r:WiFiEndpoint>
  858. */
  859. function referenceToXml(referenceName, inReference) {
  860. if(inReference === undefined || inReference === null ) return null;
  861. var result = '<r:' + referenceName + '><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>'+ inReference['__resourceUri']+'</w:ResourceURI><w:SelectorSet>';
  862. for(var selectorName in inReference) {
  863. if (!inReference.hasOwnProperty(selectorName) || selectorName.indexOf('__') === 0) continue;
  864. if (typeof inReference[selectorName] === 'function' ||
  865. typeof inReference[selectorName] === 'object' ||
  866. Array.isArray(inReference[selectorName]) )
  867. continue;
  868. result += '<w:Selector Name="' + selectorName +'">' + inReference[selectorName].toString() + '</w:Selector>';
  869. }
  870. result += '</w:SelectorSet></a:ReferenceParameters></r:' + referenceName + '>';
  871. return result;
  872. }
  873. // Convert a byte array of SID into string
  874. function GetSidString(sid) {
  875. var r = "S-" + sid.charCodeAt(0) + "-" + sid.charCodeAt(7);
  876. for (var i = 2; i < (sid.length / 4) ; i++) r += "-" + ReadIntX(sid, i * 4);
  877. return r;
  878. }
  879. // Convert a SID readable string into bytes
  880. function GetSidByteArray(sidString) {
  881. if (!sidString || sidString == null) return null;
  882. var sidParts = sidString.split('-');
  883. // Make sure the SID has at least 4 parts and starts with 'S'
  884. if (sidParts.length < 4 || (sidParts[0] != 's' && sidParts[0] != 'S')) return null;
  885. // Check that each part of the SID is really an integer
  886. for (var i = 1; i < sidParts.length; i++) { var y = parseInt(sidParts[i]); if (y != sidParts[i]) return null; sidParts[i] = y; }
  887. // Version (8 bit) + Id count (8 bit) + 48 bit in big endian -- DO NOT use bitwise right shift operator. JavaScript converts the number into a 32 bit integer before shifting. In real world, it's highly likely this part is always 0.
  888. var r = String.fromCharCode(sidParts[1]) + String.fromCharCode(sidParts.length - 3) + ShortToStr(Math.floor(sidParts[2] / Math.pow(2, 32))) + IntToStr((sidParts[2]) & 0xFFFF);
  889. // the rest are in 32 bit in little endian
  890. for (var i = 3; i < sidParts.length; i++) r += IntToStrX(sidParts[i]);
  891. return r;
  892. }