Skip to content

Export-DbaLinkedServer not exposing passwords if DAC is blocked for remote connections #10549

Description

@edbmfo

Summarize Functionality

Export-DbaLinkedServer over the network does not expose passwords if DAC is not enabled for remote access.
This (DAC for remote access) should not be needed as shown in the technical details below.

My question is, can the current code be changed so that Export-DbaLinkedServer here does not need port 1434
to be open in the same way, or is the current situation intended.

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

On version 2.7.20 of dbatools there was an issue where
Export-DbaLinkedServerdid not expose passwords for SQL servers in clusters since
the the DAC connection might be be busy since DAC might be available on multiple ipadresses.

A possible fix was discussed here where the Get-DecryptedObject.ps1 could be changed to
access 127.0.0.1 instead of $sourceName, making sure only that connection/ip was used.

This was the issue I commented on regarding DAC and Export-DbaLinkedServer:
#10040

I tested this my self on a dbatools clone from 2.7.2.0, and it worked perfectly.

Now that code did not end up in the public dbatools on its own; as several changes were
introduced, multiple rewrites of a lot of code. I could not follow the trail,
the refactiroing was done in multiple stages and i just waited it out and tried each released
version to check if this functionality worked for me.

It never did. So I kept on using my local fixed version for this functionality.

Current version 2.8.4 still does not work.

I've narrowed it down in that that code fails if DAC connection is not available
over the network - as in, if port 1434 is blocked, it fails, if port 1434 is open, it works as expected.

On that version 2.7.20 with the changed Get-DecryptedObject.ps1 to use 127.0.0.1 instead of $sourcename,
it still works without exposing 1434 over the network.

My understanding was and still is that the DAC portion was happening through psremoting, effectively
running locally on the sql server and so 127.0.0.1 was fine.

My question is, can the current code be changed so that export-dblink here does not need port 1434
to be open in the same way, or is the current situation intended.

Regards,
Marco

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions