-
Notifications
You must be signed in to change notification settings - Fork 228
Update TWS version to 1037 and improve credential handling in startup scripts #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…mmand-line arguments Addresses security vulnerability where credentials were visible in process listings (ps -ef) when passed as command-line arguments. Changes: - Modified DefaultLoginManager to read credentials from environment variables (TWSUSERID, TWSPASSWORD, FIXUSERID, FIXPASSWORD) with priority over args - Updated ibcstart.sh to export credentials as environment variables before launching Java process - Updated StartIBC.bat to set credentials as environment variables before launching Java process - Simplified Java invocation in scripts - credentials no longer passed as command-line arguments Benefits: - Credentials no longer visible in process listings - Enables secure credential storage using file permissions - Maintains backward compatibility with existing configurations - Consistent behavior across Linux, macOS, and Windows platforms
|
|
||
| ### Running the Scripts | ||
|
|
||
| **Linux/macOS:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't right. macOS have their own scripts, see twsstartmacos.sh and gatewaystartmacos.sh
| TWSUSERID= | ||
| TWSPASSWORD= | ||
| TWSUSERID=${TWSUSERID:-} | ||
| TWSPASSWORD=${TWSPASSWORD:-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't these changes also be applied to gatewaystartmacos.sh?
|
Apologies for not responding to this PR before now. There are quite a lot of points to make, and the net result is that I will not be accepting this in is current form. First of alll, this is arguably three different sets of unrelated changes, so it should be three PRs, not one. Mixing up unrelated changes just makes everything more difficult (except in the rare case where all the changes are accepted as they stand). Making multiple PRs is no more difficult that making one, so there's really no reason for doing it. We can quibble about the README changes being directly related to the credential handling changes, but documentation changes are very likely to cause dicsussion and, I feel, are better separated out. Next I'm not keen on the environment variable approach to storing credentials. I don't have any intrinsic objection to it, but it adds complexity and in my opinion doesn't add any security. If we want to avoid credentials being shown in process listings we can just remove the option of setting them in the start scripts, which I've been mulling over for a long time. The only reason for still being able to set them there is that it's been there since 2007, and I suppose there's a chance that someone still does this. I don't recall the reason for this in the first place, I expect someone asked for the ability to be able to pass credentials via the Now, I'm perfectly open to offering the ability to store credentials in environment variables as an alternative to the config file, but the way to do this is to use a custom
If this setting exists, IBC would load the specified class rather than the default login manager. That'll do for the moment. I'll try to give some detailed feedback on the file changes soon. |
Resolves #129
Summary
This PR updates the IBC startup scripts to support TWS/Gateway version 10.37 and implements secure credential handling across all shell scripts by using environment variables.
Changes Made
Version Updates:
TWS_MAJOR_VRSNfrom1019to1037across all startup scripts (Windows batch and Unix shell scripts)Credential Handling Improvements:
TWSUSERID,TWSPASSWORD,FIXUSERID,FIXPASSWORD) to use bash parameter expansion with empty defaults (${VAR:-})TWOFA_TIMEOUT_ACTIONvariable to prevent word splitting issuesPath Resolution:
commandsend.shfrom hardcoded/usr/local/bin/telnetto/usr/bin/env telnetfor better portability across different system configurationsFiles Modified
resources/StartGateway.batresources/StartTWS.batresources/commandsend.shresources/gatewaystart.shresources/twsstart.shresources/twsstartmacos.shTesting
Scripts maintain backward compatibility with existing configurations while providing better support for environment-based credential management.
No testing for windows or mac was done