19 ms·
Which libraries are people expected to plug together the security parts? I'm not pushing for clojure but a lot of other languages and frameworks are taking this
by dmix 7y ago
Which libraries are people expected to plug together the security parts? I'm not pushing for clojure but a lot of other languages and frameworks are taking this approach too including Node and Go.
Wouldn't the security stuff be a part of the individual packages? Ie authentication package handles sessions and tokens, an http server/middleware with built in csp and ssl, orm, the data stuff handling serialization and data parsing?
Technically rails is composed of a bunch of smaller gems with a similar responsibility tree although without the centralized CVE distribution and pressure that creates.
When I used Clojure it was always mini frameworks which created a base set of important packages with a pluggable middleware system on top and flexible data back ends.
The individual packages need to have domain experts for their particular attack surfaces and exposures.
If anything its about a lack of eyes or community size on the various wholes, rather than expecting the end user to do the individual hardening or plumbing.
- Kalium 7y agoYou're right. Many things can be handled by packages, abstracting them away from the developer. Of course, that's assuming the developer thinks far enough ahead to remember that they need authentication, decide how they want to handle it, figure out what they want for a CSP, and so on. Other things cannot be so readily handled. Authorization, for example, isn't a concern that can be bundled into a pre-fab function. It's something application-specific that has to be re-evaluated with every single web request and is going to be subject to unique business requirements. Frameworks tend to handle these issues by setting out a set of conventions to adhere to, within which many of these concerns are handled for you to the extent possible. It's far from perfect, but it does a lot to reduce the chances of someone forgetting (for example) that forms need anti-CSRF tokens because their form-generation function doesn't do it for them or automatically work with the form-accepting and validating functions. Or, to use example I've seen, the logging package's ignorance of what might be sensitive in the strings its been handed turns into secrets being sent to the centralized logging system and exposed to far more people than they should be. The developer didn't think about what might be in what they were logging, the package assumed that the developer did, and the result could have been avoided by a more integrated whole. A culture of libraries instead of frameworks can mean that each project may have to make all the decisions a framework does all over again. Is everyone going to get it right every time?
- bcrosby95 7y ago> The developer didn't think about what might be in what they were logging, the package assumed that the developer did, and the result could have been avoided by a more integrated whole Umm, is there any all in one web framework that protects against this to any level of guarantee?
- Kalium 7y agoIt's been my experience that Rails logging can and will do things like censor password fields when passed objects. So, yes, it is possible for logging (and serialization) systems to defend against this kind of thing.
- bcrosby95 7y agoIn my experience these password logging events tend to be at a lower level than object serialization. They're usually at the raw request level.
- harperlee 7y agoSeveral purported cons of clojure according to this conversation, including yours, are more a critique of using a niche language with a small community than really about the language. Addressing that explicitly can clarify the debate. Also, clojure is a special beast in the sense that can leverage a big community easily (java). This is not covered in your web framework example, but you can use clojure in frameworks (e.g. you use unity through arcadia, as a framework)
- Scarbutt 7y agoThe situation in Node and Go is better by the fact that these ecosystems have extensive documentation related to web security.
- dmix 7y agoThat's the many eyes thing but I don't see how it's unique to Clojure's culture which was my point. Node only got to that point through plenty of failure and last time I used Go it didn't seem much different than Clojure. The only reason I'm not using Clojure is the lack of types but that's another issue.
- iLemming 7y ago> The only reason I'm not using Clojure is the lack of types Have you tried Clojure.spec? Have you tried generative testing where you generate data based on given Spec? Have you tried using Specs for form validation? Have you seen how Specs can be shared between Clojure and Clojurescript? Basically between two completely different platforms. Even vanilla nodejs cannot do that, even though the code is running on the same [JS] platform.