meteorhacks:sikka

v1.0.1Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Sikka - A Firewall for Meteor Apps Build Status

This is an application level firewall for Meteor. Sikka can detect malicious users of your app and block those users.

We've build basic rate limiting support and it is well tested and works with most of the Meteor deployments techniques. We also have a huge roadmap and a feature set.

Sikka - A Firewall for Meteor

Installation

meteor add meteorhacks:sikka

Sikka comes with sufficient set of defaults, which is okay for a common Meteor app. But, it's better if you can tweak them for your needs. Refer following section for that.

All of the configurations are based on either environment variables or with Meteor.settings

Supported Features

Let's talk about supported features.

DDP Rate Limiting

You can configure a maximum number of DDP requests allowed per IP. If any of the IPs exceed that limit, we'll block that IP for couple of minutes.

We don't disconnect the DDP connection, but rather ignore the traffic. By doing that, attacker can't detect whether we've blocked his requests or our app goes down.

Here are some parameters you can configure.

DescriptionEnvironment VariableMeteor.settings keydefault
Per IP rate limitSIKKA_PER_IP_MAX_RPSsikka.rateLimits.perIp20
Time to block an IPSIKKA_BLOCK_IP_FOR_MILLISsikka.times.blockIpFor120000

Human Verification (Captcha Support)

Sometimes, it's possible for attacker to exist with legitimate users. So, when we block requests, legitimate users won't be able access our app. To solve this issue, we ask users to verify them as humans by completing a captcha.

Here are some parameters you can configure

DescriptionEnvironment VariableMeteor.settings keydefault
Captcha Site KeySIKKA_CAPTCHA_SITE_KEYsikka.captcha.siteKey
Captcha SecretSIKKA_CAPTCHA_SECRETsikka.captcha.secret
Per Human Rate LimitSIKKA_PER_HUMAN_MAX_RPSsikka.times.blockIpForIP Rate Limit
Human Lifetime (expired after that)SIKKA_HUMAN_LIVES_UPTO_MILLISsikka.times.humanLivesUpto3600000

Visit Google's Recaptcha website to get Captcha keys for your domain. We've added a default set of keys works on locally, meteor.com and onmodulus.net to make your development experience simpler. But, you should get a new pair of keys for a production deployment.

Humans Only Mode

Let's say, your app is under an attack. So, you can make your app to reject all DDP requests and ask for human verification by default. This is how you can configure it.

To enable this mode. Just export following environment variable or Meteor settings key.

  • Environment Variable: SIKKA_ONLY_FOR_HUMANS
  • Meteor Settings key: sikka.onlyForHumans

Support Deployment Methods

If your app behind a proxy or a SSL terminator, it needs to add x-forwarded-for header with the actual IP address.

Tested Proxies / SSL Terminators

  • proxy of meteor.com
  • proxy of modulus.io
  • Cloudflare
  • Cloudflare with SSL
  • Nginx with proxy_set_header

Failed Proxies / SSL Terminators

  • Meteor Up's SSL terminator - we'll have a fix soon.