Machine or service-account authorization¶
Unlike the human-identity checks above, this operation authorizes a machine or service account — typically from a batch job or infrastructure process rather than an interactive session. Because the WCF SecurityService has no direct "is this account authorized" call for machine accounts, the method instead retrieves the group's full membership list and searches it in-process for the requested machine name.
| Field | Value |
|---|---|
| Operation ID | OP-005 |
| Trigger | Caller invokes MachineSecurityService.IsAuthorized |
| Inputs | Machine name, mutable group name, resource flags, constructor LDAP and domain settings |
| Outputs | Boolean authorization decision and possibly mutated groupName |
| Primary components | MachineSecurityService.New, MachineSecurityService.IsAuthorized |
| Entry point | SAIF.Framework.Security\Utilities\MachineSecurityService.vb |
Steps¶
- The constructor captures the LDAP path, domain, and recurse settings it will need for every lookup, and resolves
securityServiceUrlfromCustomEnvironmentServiceonce, up front, so each authorization call has a ready-made WCF endpoint. - When
isResource=True, the method mutatesgroupNamein place: it appendsTestfor any non-production-resource lookup and then always appendsResource, enforcing BR-003. - Authorization context: the resulting group name follows the naming convention documented in the AD resource catalog.
- The method constructs
SecurityService.SecurityClient(_serviceUrl)and callsGetUsersByGroup(groupName, _ldap, _domain, _recurse)to pull back the group's effective member list — this is the only WCF call the operation makes. - Authorization context: this is the machine-account enforcement path listed in Authorization enforcement points.
- The returned member names are scanned case-insensitively, and the method returns
Trueas soon as it finds an exact match for the requested machine name. - If no match is found: the method falls through to the default
Falseresult rather than treating an empty match as an error. - Any exception raised while calling the WCF service is written to
Debugand swallowed; the method then returnsFalse, enforcing BR-008 so a downed or unreachable security service can never be mistaken for an authorized outcome.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Machine auth requested]) --> Name[Apply resource suffix rules]
Name --> Call[GetUsersByGroup]
Call --> Error{Call succeeded?}
Error -->|No| FailClosed[Return False]
Error -->|Yes| Match{Machine found?}
Match -->|Yes| EndOk([Return True])
Match -->|No| EndErr([Return False])
FailClosed --> EndErr
Failure and edge-case behavior¶
groupNameis a byref parameter and is mutated in place whenever resource suffixing is enabled, so callers see the effective (suffixed) group name after the call returns.- WCF failures are swallowed at the
Debuglog level and converted into a fail-closedFalseresult rather than being surfaced to the caller. - Membership matching is case-insensitive but otherwise requires an exact match against the returned member string.
Related documentation¶
Sources¶
SAIF.Framework.Security\Utilities\MachineSecurityService.vb