Bug 168327 - Allow for scripting of commands asking for passwords
Summary: Allow for scripting of commands asking for passwords
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-14 12:53 PST by Jonathan Bedard
Modified: 2017-03-23 10:42 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.81 KB, patch)
2017-02-14 12:59 PST, Jonathan Bedard
dbates: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2017-02-14 12:53:58 PST
When SSH commands and other tools using SSH are automated, they expect RSA keys to be set up for automatic authentication.  In some cases, this is not possible.  We should have a way to pass passwords along to an SSH command without prompting the user.
Comment 1 Radar WebKit Bug Importer 2017-02-14 12:55:14 PST
<rdar://problem/30518544>
Comment 2 Jonathan Bedard 2017-02-14 12:59:17 PST
Created attachment 301534 [details]
Patch
Comment 3 Daniel Bates 2017-02-14 15:21:08 PST
(In reply to comment #0)
> When SSH commands and other tools using SSH are automated, they expect RSA
> keys to be set up for automatic authentication.  In some cases, this is not
> possible.  

Can you elaborate why this is not possible?
Comment 4 Daniel Bates 2017-02-14 15:21:54 PST
Comment on attachment 301534 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301534&action=review

This is not the correct approach.

> Tools/Scripts/command-with-password:29
> +set password [lindex $argv 0]
> +set cmd [lrange $argv 1 end]

It is not good security practice to pass a password as a command line argument. It makes the password observable to all users on the system.
Comment 5 Alexey Proskuryakov 2017-02-14 16:33:46 PST
Comment on attachment 301534 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301534&action=review

> Tools/Scripts/command-with-password:33
> +    expect  "Are you sure you want to continue connecting (yes/no)" {

This makes the script specific to ssh and related tools, so the current name is too generic.

Also, ideally we would use an ssh option to disable the check.
Comment 6 Jonathan Bedard 2017-02-14 16:55:31 PST
Just a quick note about the choice of an expect script here:

The only other possible solution that I am aware of would be Fabric, and since I have not actually attempted to implement the Fabric version of this, I can't say definitively that Fabric would achieve our goals here.

Even if Fabric is a possible solution, that would be a pretty large dependency, comparatively.  We currently use Fabric on our bots, but it is not a required dependency locally.
Comment 7 Jonathan Bedard 2017-03-23 10:42:44 PDT
The method for doing this has changed.  This patch no longer applies.