A Node.js web application based on the popular NodeBB utilizing Bluefyre's kubernetes native runtime application security.
This repo sets up the docker image for the NodeBB application v1.7.5 using MongoDB. Refer the blog post for additional details.
Refer to this blog post for prerequisites for minikube, hyperkit, OSX. You can certainly run this without minikube as well.
If you're running minikube on OSX, make sure to run the following to set the right context for your docker images
minikube config set vm-driver virtualbox
minikube start --memory=4096
eval $(minikube docker-env)
- Let's set up the nodebb namespace in your Kubernetes cluster
kubectl create -f namespace.yaml
- Create the persistent volumes needed for Mongo. You can skip this step if you already have volumes you intend to use.
kubectl create -f local-volumes.yaml
kubectl get pv
- Set up the Mongo service that uses the persistent volumes defined earlier
kubectl create -f mongo.yaml --namespace=nodebb
- Signup at Bluefyre to obtain a free agent API key. Refer docs here for how to do this. Once you've obtained this
# Replace BLUEFYRE_AGENT_ID with the API key from the Bluefyre app
kubectl create secret generic bluefyre-agent-id --from-literal=agentid=BLUEFYRE_AGENT_ID --namespace=nodebb
kubectl get secrets --namespace=nodebb
-
Also once you've signed up at Bluefyre to download the Node.js microagent. Place the
bluefyre-agent-node-x.x.xtgz
in the same folder as the Dockerfile -
Now lets set up the app build
cd ../
docker build -t nodebb:v1 .
- Lets set up a job to setup the environment
cd k8
kubectl create -f nodebb-setup.yaml --namespace=nodebb
Verify that the job ran successfully
kubectl get jobs
kubectl logs REPLACE_YOUR_POD_ID_HERE -f
- Now lets set up the app
kubectl create -f nodebb.yaml --namespace=nodebb
- Now in your browser, navigate to the service
minikube service nodebb --url
- View realtime vulnerabilities in your Bluefyre portal
- update k8 setup scripts with user/pw secrets for MongoDB
Here are some screenshots from NodeBB. For more updated info, refer the NodeBB repo
NodeBB is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).