Users

All Posts (8)

avatar

ambrozticar

$USERNAME$ stopped working within powershell variables

avatar
avatar
avatar
avatar

Thank you for the quick response and fix, I will test the new release when it comes out and let you know if the issue is fixed

$USERNAME$ stopped working within powershell variables

avatar
avatar
avatar
avatar

I have a Powershell script (remote) that launches an external process and takes parameters from the arguments field and the credentials. Until now, the script was working without issues. After an update (not quite sure which version caused this - probably the last 1-2 versions), the $USERNAME$ is not resolved if it is first assigned to a variable before being used.

Example of the original script:

$hostname = $args[0]
$port = $args[1]
$principal = $args[2]
$user = "$USERNAME$"
$password = "$PASSWORD$"

$additionalParameters = "-q -s $hostname -p $port -a partnernet -l $user -m $principal -L $password"

I have now changed the script to use the $USERNAME$ variable directly which seems to work.

$additionalParameters = "-q -s $hostname -p $port -a partnernet -l $USERNAME$ -m $principal -L $password"

If I remember correctly, the variable assignment intermediate step was made, because the reverse was true - the variable did not work when passed directly to the Start-Process command (code omitted here)

I presume that this is a bug and is not the intended behavior, since the changelogs do not mention any changes in this area.

Bitwarden offline credentials

avatar
avatar
avatar

Maybe I have the wrong idea, but if I were to implement this feature, I would go about it like this:

  1. on start-up check Bitwarden entries for the "offline" mode option

  2. make a "retrieve credentials" call to the api for these entries - same as it is done when clicking on a bitwarden entry or launching a RDP connection with the connected bitwarden entry

  3. store the credentials in a secure maner in the system memory or disk for the duration of the session/application runtime

  4. prefer the "fresh" data from the bitwarden server if the connection is possible, otherwise use the cached credentials

I hope this is of any help. Please keep me posted on this issue, if any progress or decision is made, I know that it is probably not as simple and fast to implement as described above.

Bitwarden offline credentials

avatar
avatar
avatar

Hi,

in my Remote Desktop Manager instance, I try not to keep any passwords stored directly in RDM, but I am using the Bitwarden credentials option and have them connected to individual entries. This works great as long as of course, I have access to the Bitwarden vault. The issue becomes when I have to connect to another network via a VPN that cuts off access to my Bitwarden instance (this can be due to a very strict VPN policy on some networks - cuts off internet access, or in my case the on-premise Bitwarden address overlaps with the VPN local network mapping). In either case, the connection to Bitwarden is lost and the credentials can no longer be accessed on demand.

I would like to request an offline Bitwarden credential feature. This could maybe implemented as a setting on the Bitwarden credential entry, that allows the credential to be stored locally for the time of the session. I would presume that this is technically possible as this is how the Bitwarden desktop application and browser extension work - if access to the server is lost the credentials are still available, but the vault password is still required to unlock the vault. The credentials should be "downloaded" on RDM start and stored in a temporary application cache in case the connection to the Bitwarden server drops.

This would greatly improve the usability of RDM in my case, as most of the connections in my RDM require a VPN connection to another network.

If any other alternative methods are viable that I don't know of, please inform me.

Kind regards,

Ambrož Tičar

Setting PowerShell script entry password

avatar
avatar
avatar

Hi,

thank you, this seems to work!

Kind regards,

Ambrož Tičar

Setting PowerShell script entry password

avatar
avatar
avatar

Hi,

I am trying to update my PowerShell script entries (Embedded script) which have their username and password passed as plain text variables in the arguments field. I am trying to move these values to the dedicated username and password fields on the entry, but I am having trouble moving the password.

Import-Module Devolutions.PowerShell
$RDPSessions  = Get-RDMSession | Where-Object {$_.ConnectionType -eq "PowerShell"}
foreach ($s in $RDPSessions)
{
    $words = $s.PowerShell.Arguments -split ' '
    if ($words.Length -eq 4) {
        $username = $words[2]
    } elseif ($words.Length -eq 5) {
        $username = $words[2]
        $password = $words[4]
    } else {
        continue
    }
    if ($password -ne "") {
        $safePassword=ConvertTo-securestring $password -asplaintext -force
        Set-RDMSessionPassword $s.ID -Password $safePassword -Refresh
	    $test =Get-RDMSessionPassword $s.ID -AsPlainText
        $test

    }
    $s.PowerShell.UserName = $username
    Set-RDMSession $s
    $s.Name,$username, $password -join ' - '
}

When the $test variable is printed, the RDMSessionPassword returnes the newly set value. If I try to add another same check after Set-RDMSession it returns an empty value, as if the newly reloaded session does not contain the value anymore. Even after commenting out the Set-RDMSession call, the password is not applied to the entry. It is not visible on the entry and the export also doesn't contain the PowerShell.SafePassword value.

I would try to set the password via the $s.PowerShell.SafePassword variable, but I do not know how to generate the correct Base64 string that is used in the field. Setting the field this way with a known Base64 value from an existing "SafePassword" field does seem to work though.

Kind regards,

Ambrož Tičar

Cannot choose Bitwarden credential from list - Linux

avatar
avatar
avatar
avatar

Hi,

thank you for the quick response. If you require any further information I am available.

Kind regards,

Ambrož Tičar

Cannot choose Bitwarden credential from list - Linux

avatar
avatar
avatar
avatar

Hi,

when trying to add a Bitwarden credential entry using a on-premise installation of Bitwarden (so host is set to custom and a specific URL is used) I cannot get a credential list from Bitwarden to choose one. I am using the Use "My account settings" checkbox with the credentials stored localy. If I input my api keys directly into the RDM entry, I get the full list of credentials. When trying to open the credential list, I get a pop-up with the "My account settings" window, as though the credentials are not set. If I try the exact same thing on the Windows application it works. After creating this entry with the Windows app, the credential entry also works on the Linux side (RDM connected to a central database).

I am using version 2023.2.0.6 on Linux and 2024.2.18.0 on Windows. Perhaps this is a legacy issue that has been fixed on Windows but not on Linux (changelog in Windows version 2023.1.1.3 mentions something related to "My account settings" with Bitwarden)?

P.S.: The Linux Bitwarden list implementation lacks the organization structure (entries stored only in organization collections, not in folder), which can be annoying if you have multiple entries with the same name. Again on Windows this seems to be already implemented.

1 - 8 of 8 items