Reputation: 11
I have node.js bluemix app. I don't want the bluemix app url to be publicly available. Is there a way to restrict access to bluemix app from certain IP addresses only ? I know I can build authentication in the app itself but I am trying to avoid that. Thanks in advance.
Upvotes: 0
Views: 819
Reputation: 3546
The Bluemix CloudFoundry platform can not restrict routes to a certain IP address. Like you said, all authentication has to be part of the application logic.
Check out the express-ipfilter npm module: https://www.npmjs.com/package/express-ipfilter
Whitelisting certain IP addresses, while denying all other IPs:
// Init dependencies
var express = require('express')
, ipfilter = require('express-ipfilter')
, app = express.createServer()
;
// Whitelist the following IPs
var ips = ['127.0.0.1'];
// Create the server
app.use(ipfilter(ips, {mode: 'allow'}));
app.listen(3000);
Upvotes: 3
Reputation: 4590
As Ram mentioned you cannot restrict routes to a certain IP for a Bluemix app, but there is an alternative using IBM Containers.
You can deploy your node.js in an IBM Container (docker) and use the IBM VPN service to restrict access to your container instance to your company's VPN.
You can find more details on this service here:
https://console.ng.bluemix.net/docs/services/vpn/index.html
Upvotes: 0