Earlier quoted context omitted.
Do you have more to share, like resources about capability-safe languages, or your ongoing work? > This also means that object capabilities aren't "colored" like async/await, monads, or other effect systems. That's interesting. How does that work? Is it by passing around a value from your main function to the functions that need it?
> Do you have more to share, like resources about capability-safe languages, or your ongoing work? I can share an example from the main function of the self hosting Firefly compiler [1]: main(system: System): Unit { ... let fs = system.files() if(fs.exists(tempPath)) { deleteDirectory(fs, tempPath) } ... } deleteDirectory(fs: FileSystem, outputFile: String): Unit { fs.list(outputFile).each { file => if(fs.isDirectory…
A capability-safe language would have minimized the Log4j vulnerability
131–140 of 158 posts
Re: A capability-safe language would have minimized the Log4j vulnerability
#132Re: A capability-safe language would have minimized the Log4j vulnerability
#133Earlier quoted context omitted.
This is more like ACLs, which are a completely different paradigm from capability-based security. An ACL system is based around specifying permissions for actions and such, whereas capability systems are based around reifying authority in an unforgeable way and passing the resulting tokens around.
I don't see the difference between passing tokens around and inheriting a security manager that can only have permissions and capabilities revoked?
Re: A capability-safe language would have minimized the Log4j vulnerability
#134Personally I wonder whether anyone actually used log4j willingly or just because its generally used by all the apache projects and they wont start without it. With a healthy dose of "use the latest versions" mentality. I checked back and all my java code was still running log4j 1.1, and removing it has been on the todo list ever since it needed linking. You should be checking all your 3rd party source code, "capabili…
Same, all of our Java projects were using 1.X log4j, and have been for years and years without issue. Ironically, all of this scrutiny on the problems of the 2.X releases has forced us to agree to update from those rather dumb, safer builds to the latest releases, so that we'll have to be on the treadmill.
Re: A capability-safe language would have minimized the Log4j vulnerability
#135Earlier quoted context omitted.
I don't think that's particularly useful though. A program with requirements like that seems more likely to be split up into two independent pieces.
But that's not at all the case in practice. Logging is intertwined with other program functionality.
Re: A capability-safe language would have minimized the Log4j vulnerability
#136Earlier quoted context omitted.
Programming language can know more about the program's (intended) state at any given time. The OS can/should frequently be involved, but even then you're frequently doing something like pledge() from the program to let the OS know when/how to restrict you. Doing it totally externally, like SELinux does, is valuable but coarser-grained.
Can you not use network namespaces on Linux to give a process its own restricted network device and then filter that traffic?
Re: A capability-safe language would have minimized the Log4j vulnerability
#137Java has actually had this built in for a long time now. A SecurityManager allows you to restrict access to things like the filesystem and the network (and whatever else you want). I have never seen it used in a real codebase. https://docs.oracle.com/javase/tutorial/essential/environmen...
Javascript follows a better approach because it has a small core API. All other APIs have to be explicitly injected and permitted by the host program.
Re: A capability-safe language would have minimized the Log4j vulnerability
#138Ideally all egress network connections should go via NAT Gateway & filters at NAT Gateway should have policies to say which request can go out. Failures do happen in programming, we need to have better guardrails ensuring security.
What sort of software are you using for the NAT gateways? (I know that's an AWS term, but not what I'm looking for. I've used that to provide a consistent outbound IP for production traffic so that upstream providers can allowlist an IP to talk to their API. Dumb security model when TLS client certificates exist, but... easy to set up I guess.) I've always wanted to defend against the attack where an application rout…
Possible alternative: a dedicated API facade that forwards to the real APIs, and blocking of all other connections. There might be a tool that generates one from Swagger specifications. Also, require a client certificate or a password for each service. This way, you get centralized logging and access control without breaking TLS.
Re: A capability-safe language would have minimized the Log4j vulnerability
#139Earlier quoted context omitted.
> Do you have more to share, like resources about capability-safe languages, or your ongoing work? I can share an example from the main function of the self hosting Firefly compiler [1]: main(system: System): Unit { ... let fs = system.files() if(fs.exists(tempPath)) { deleteDirectory(fs, tempPath) } ... } deleteDirectory(fs: FileSystem, outputFile: String): Unit { fs.list(outputFile).each { file => if(fs.isDirectory…
Thank you for the example, that helps a lot. So for example, when you write a library that need capabilities, you would write it using dependency (capability?) injection, and then the main program would have to pass an object with that capability for the code to work? And I see what you mean by "they are just plain values, and require nothing special from the type system", as long as you restrict what part of the pro…
I would point to an online resource, but honestly I haven't run across any that does justice to the simplicity of the concept.
Re: A capability-safe language would have minimized the Log4j vulnerability
#140https://fossandcrafts.org/episodes/20-hygiene-for-a-computin... does a great job of introducing capabilities in an easy to understand manner.