You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to create a Nifi processor that reads account permissions. I am able to connect and authenticate to SMB service, but I am not able to open a policy handle. This line PolicyHandle handle = service.openPolicyHandle(adServerNameorNull, Integer.parseInt(accessLevel)); always results in nca_s_fault_ndr (0x000006F7) error from Active Directory. According to Microsoft docs this error means RPC_X_BAD_STUB_DATA To Reproduce
Steps to reproduce the behavior:
try using LocalSecurityAuthorityService::openPolicyHandle()
Code that reproduces the behavior:
This is the code:
try (Connectionconnection = smbClient.connect(hostname);
SessionsmbSession = connection.authenticate(ac)) {
finalRPCTransporttransport = SMBTransportFactories.SRVSVC.getTransport(smbSession);
longsessionId = smbSession.getSessionId();
StringsessionKey = smbSession.getSessionContext().getSessionKey().toString();
getLogger().debug("Connected to SMB service. SessionId: {}, SessionKey: {}", newObject[]{sessionId, sessionKey});
finalLocalSecurityAuthorityServiceservice = newLocalSecurityAuthorityService(transport);
PolicyHandlehandle = service.openPolicyHandle(adServerNameorNull, Integer.parseInt(accessLevel));
String[] accountRights = service.getAccountRights(handle, accountSid);
// add account rights to incoming flowfile and pass it to success relationshipif (flowFile != null) {
flowFile = session.putAttribute(flowFile, "accountRights", String.join(",", accountRights));
session.transfer(flowFile, REL_SUCCESS);
}
} catch (Exceptione) {
getLogger().error("Could not establish smb connection because of error {}", newObject[]{e});
context.yield();
smbClient.getServerList().unregister(hostname);
session.transfer(flowFile, REL_FAILURE);
}
Expected behavior openPolicyHandle should return PolicyHandle object
Environment (please complete the following information):
Operating System: Ubuntu 22
Java Version: 11
Library Version: 0.12.1
The text was updated successfully, but these errors were encountered:
Try changing final RPCTransport transport = SMBTransportFactories.SRVSVC.getTransport(smbSession);
to final RPCTransport transport = SMBTransportFactories.LSASVC.getTransport(smbSession);
I was able to get the same error (while searching for how to do this - really need some docs), and since this is a LSA service, tried that instead and it worked. Also, is your connection to a DC? IE, is your host you are asking capable of doing the work? I had to point to our AD DC instead of the SMB File Server.
Describe the bug
I am trying to create a Nifi processor that reads account permissions. I am able to connect and authenticate to SMB service, but I am not able to open a policy handle. This line
PolicyHandle handle = service.openPolicyHandle(adServerNameorNull, Integer.parseInt(accessLevel));
always results innca_s_fault_ndr (0x000006F7)
error from Active Directory. According to Microsoft docs this error meansRPC_X_BAD_STUB_DATA
To Reproduce
Steps to reproduce the behavior:
try using
LocalSecurityAuthorityService::openPolicyHandle()
Code that reproduces the behavior:
This is the code:
Expected behavior
openPolicyHandle
should returnPolicyHandle
objectEnvironment (please complete the following information):
The text was updated successfully, but these errors were encountered: