Earlier quoted context omitted.
Thanks for responding! Currently running Jasmine on local dev box, yes that's cool, sysadmin not concerned about that. We don't have CI server. We have a dev server that is currently exposed to the world, our production server is separate. If Jasmine installed on the dev server a SpecRunner.html that triggers the unit tests on that dev server could be accessed by anyone if they knew the url. This is what the sysadmin…
Your dev server shouldn't be accessible to the public. If you want a server to be accessible to the public that isn't your production server (which is valid), you should be doing things as similar to production as possible (not running tests on it).
Ask HN: Can Jasmine Unit Tests Expose Security Vulnerabilities on Server?
11–15 of 15 posts
Re: Ask HN: Can Jasmine Unit Tests Expose Security Vulnerabilities on Server?
#12Earlier quoted context omitted.
Your dev server shouldn't be accessible to the public. If you want a server to be accessible to the public that isn't your production server (which is valid), you should be doing things as similar to production as possible (not running tests on it).
Thanks barylen for the response! Totally get what you're saying, could you expand a bit on why?
There are a lot of reasons for that, but for me the two big reasons are good user experience and good security. You get a good user experience by carefully controlling what people see and making sure that's polished. You don't want to have to think about them stumbling across things that aren't for them. And good security requires minimal attack surface. You don't give naughty people anything to abuse that you don't have to.
Re: Ask HN: Can Jasmine Unit Tests Expose Security Vulnerabilities on Server?
#13You shouldn't be unit testing on production. You should run as little as possible in prod.
Thanks for responding staunch! Is that mainly to avoid performance costs/clutter, or for security reasons or both?
Re: Ask HN: Can Jasmine Unit Tests Expose Security Vulnerabilities on Server?
#14Earlier quoted context omitted.
Thanks for responding staunch! Is that mainly to avoid performance costs/clutter, or for security reasons or both?
You're increasing risk for little benefit. A Javascript unit testing framework could likely be used for crafting XSS exploits. Or it could end up slowing down real users when you forget to turn it off (or whatever). Probably nothing bad will happen but it's a needless risk and a bad practice.
Re: Ask HN: Can Jasmine Unit Tests Expose Security Vulnerabilities on Server?
#15Earlier quoted context omitted.
Thanks barylen for the response! Totally get what you're saying, could you expand a bit on why?
I agree with barylen. Dev should never be visible. For the general reason that the default is "hidden". You make specific exceptions for the small number of things you want people to see. There are a lot of reasons for that, but for me the two big reasons are good user experience and good security. You get a good user experience by carefully controlling what people see and making sure that's polished. You don't want…