Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@stordata/grunt-tunnel-exec
Advanced tools
Grunt wrapper around tunnel-exec node module.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-tunnel-exec --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-tunnel-exec');
In your project's Gruntfile, add a section named tunnelExec
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
tunnelExec: {
target: {
options: {
// Options here.
},
exec: function(err, tunnel){
// Do something here
}
}
},
});
Type: String
A string value that represents the hostname or ip of the host that will be accessed through SSH.
Type: Integer
A numeric value that represents the port forwarded through the tunnel.
Type: String
Default value: null
A string value that represents the username which will connect to the remote server. If no username given, ssh command will use the default (usually, read ~/.ssh/config file, or use current username).
Type: String
Default value: null
A string value that represents the path to the identity file used to authenticate with the server (usually, ~/.ssh/id_rsa.pub
).
Type: Integer
Default value: (random)
A numeric value that represents the port number that will be used to create the local endpoint of the tunnel.
Type: Integer
Default value: 22
A numeric value that represents the port in which the SSH client will connect to in the server.
Type: String
Default value: (same as remoteHost)
A string value that represents the hostname or ip of the host that will be accessed through the tunnel (this is the remote endpoint).
Type: Integer
Default value: 15000
A numeric value that represents the timeout (in milliseconds) of the SSH connection/negotiation.
In this example, the default options are used to start a tunnelExec tunnel. These are the required and minimal options that should be passed.
grunt.initConfig({
tunnelExec: {
myTarget: {
options: {
remoteHost: 'example.com',
targetPort: 1234
},
exec: function(err, tunnel){
// Do your stuff here
// Require http module, we're requesting an html page
var http = require('http');
// Request the page, listen for the response
var request = http.get(
// We are using our tunnel!
"http://localhost:1234/myPage.html",
function(res){
// Print data
res.on('data', function( data ) {
console.log( data.toString() );
});
res.on('close', function(){
// After everything is finished, close tunnel
tunnel.done();
});
}
);
}
}
},
});
This would execute an SSH command like:
ssh -p 22 example.com -L 1234:example.com:1234 -N -v
In this example, custom options are used to start the api-mock server in port 1235 with another_api.apib as source.
grunt.initConfig({
tunnelExec: {
myTarget: {
options: {
user: 'myUser',
identityFile: '~/.ssh/id_dsa.pub',
localPort: 1234,
// Host which is being SSH'd
remoteHost: 'example.com',
remotePort: 2222,
// Target host, will receive the commands executed through the tunnel
targetHost: 'host2.example.com',
targetPort: 6666,
// Connection timeout
timeout: 10000
},
exec: function(err, tunnel){
// Something, then close the tunnel
tunnel.done();
}
}
},
});
This would execute an SSH command like:
ssh -p 2222 myUser@example.com -i ~/.ssh/id_dsa.pub -L 1234:host2.example.com:6666 -N -v
And will timeout after 10 seconds.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
v0.1.0 - Initial release
FAQs
Grunt wrapper for tunnel-exec
The npm package @stordata/grunt-tunnel-exec receives a total of 19 weekly downloads. As such, @stordata/grunt-tunnel-exec popularity was classified as not popular.
We found that @stordata/grunt-tunnel-exec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.