text
stringlengths
0
2.02k
[1688.28 --> 1693.68] that code probably depends on some other code and that those can end up pulling in many, many
[1693.68 --> 1694.28] dependencies.
[1694.58 --> 1698.76] It's kind of like those installers where they're like, curl this URL, pipe it into bash. And then a lot of
[1698.76 --> 1702.68] people will show up in the comments like, please don't do that because bash is going to execute
[1702.68 --> 1707.82] arbitrary code that's in that URL. Anyways, cut you off. But I just was reminded of that where it's
[1707.82 --> 1712.90] like, yeah, but it's as long as it's safe, you know, like audit it and you'd be happy. But if you
[1712.90 --> 1715.38] don't audit it, you probably shouldn't be piping into bash.
[1715.84 --> 1723.04] Unfortunately, it's really hard to audit all of your code these days. I mean, we depend on society level
[1723.04 --> 1728.56] infrastructure, right? There's no possible way if you plan to be a productive developer to
[1728.56 --> 1733.66] go out and actually read through all of the dependencies and the transitive dependencies
[1733.66 --> 1738.30] of your dependencies. You know, by the way, you're talking about like curling bash scripts.
[1738.56 --> 1743.36] When you NPM install something, arbitrary code from the internet is running on your computer
[1743.36 --> 1749.86] without any security sandboxing. So, you know, and beware when you are NPM installing something,
[1750.34 --> 1757.40] you are completely and utterly open to having your computer taken over. It takes one bad actor in the
[1757.40 --> 1759.48] ecosystem to make that happen. And we've seen that.
[1760.78 --> 1769.08] We have seen that, yes. This is mitigated in web browsers. Web browsers do not allow you to
[1769.08 --> 1775.04] access your local file system. They do not allow you to do a lot of stuff, right? Web browsers are a
[1775.04 --> 1782.44] secure sandbox. And this is a really nice property of V8 and the JavaScript language is that it does not
[1782.44 --> 1789.44] necessarily have access to the system. We, Dino and Node, give access to the system so that you can do
[1789.44 --> 1794.80] things like writing a little script to rename a bunch of files. The purpose of a server-side JavaScript
[1794.80 --> 1801.50] system is to interact with the system. But in Node, we did this without any constraints. We just opened
[1801.50 --> 1806.50] all sorts of holes. So you can access the file system, you can access the network, you can do all sorts of
[1806.50 --> 1814.44] stuff. There's no gating on those privileges. In Dino, we're much more aware of opening holes into the
[1814.44 --> 1820.98] system. And I mentioned earlier these ops and how Dino has a very centralized system for calling from
[1820.98 --> 1827.78] JavaScript into Rust. By having this centralized system, we also have kind of centralized gating
[1827.78 --> 1834.46] for security. And so by default, when you run a Dino program, whether that's a local program on your
[1834.46 --> 1842.50] computer or a remote program via a HDP URL, it's given no access to the system. All it can do is
[1842.50 --> 1849.68] compute. So it cannot access your file system. It cannot open outbound connections. Can't do anything
[1849.68 --> 1854.84] mischievous. It can calculate some numbers. It can print to standard out, but that's about it,
[1855.08 --> 1862.32] which sometimes is all you want. To allow programs to, in web browsers, they have this system for kind of
[1862.32 --> 1869.38] opting in to more privileges. So for example, websites can access your webcam, right? But not just any
[1869.38 --> 1874.50] website can access your webcam. It needs to like elevate its privileges. So, you know, you get this
[1874.50 --> 1881.50] little pop-up that says, do you want to allow website X to access your webcam? Dino is very similar. When you
[1881.50 --> 1888.68] try to access the file system, it's going to fail if you don't have the privileges and you can give it
[1888.68 --> 1894.32] those privileges. And you give it those privileges via command line flags, right?
[1894.74 --> 1901.54] Via command line flags. So we have, you can do allow all if you want to node mode,
[1901.70 --> 1908.74] where there's, there's no privileges. There's no gating. We have allow write to write to the file
[1908.74 --> 1915.92] system. We have allow run to run sub processes. We have allow read to read file system. We have allow
[1915.92 --> 1923.64] plugin to load kind of rust plugins, which we can't assure are not going to do something nasty. We have
[1923.64 --> 1930.38] allow net for making outbound network connections and allow end for environmental variables, which may
[1930.38 --> 1931.72] often contain secrets.
[1932.80 --> 1937.06] Is that something you can put in the file itself or does it have to be a flag to the runtime?
[1937.06 --> 1944.42] It has to be a flag. We are considering having a configuration file. We are really conservative
[1944.42 --> 1950.84] about adopting kind of new file formats. You know, I was just talking about how we try to keep things
[1950.84 --> 1956.54] as boilerplate free as possible. And so we don't want to force people to write a configuration file. We
[1956.54 --> 1962.56] don't want, you know, kind of overhead of configuring your system before you ever get started. So for now,
[1962.56 --> 1969.14] they are command line flags and they're pretty obvious and annoying. And that's kind of purposeful because
[1969.14 --> 1974.60] these are security things. They should be obvious and annoying. You should, you know, be very clear that you
[1974.60 --> 1982.14] are allowing the system to run arbitrary sub processes. Yeah. So via command line flags is how you enable them.
[1982.30 --> 1987.54] How often are those flags being used by, you know, general applications you see being built? Like all the time.
[1987.54 --> 1993.44] All the time. All the time. Yeah. I mean, it depends on what you're doing. I mean, if you say have a,
[1993.82 --> 2001.86] let's say you're writing a program like ES Lint, this ES Lint like program doesn't need to make outbound
[2001.86 --> 2008.14] network connections. It doesn't need to write to the disk. All it needs to do is read from the disk. So
[2008.14 --> 2012.56] you would only, you would only enable the allow read in that case.
[2012.56 --> 2016.68] Yeah. So I was telling you during the break that I was writing this little script with Dino the other
[2016.68 --> 2023.62] day and basically it went out to the Slack API, got some data from there about members of our community
[2023.62 --> 2029.76] and then, uh, looped over. I was trying to like pick a random winner for a giveaway from like a certain
[2029.76 --> 2035.02] channel from one of our Slack channels. And then it, you know, picked a random three or something and
[2035.02 --> 2043.36] just printed them out, you know, very simple use case. And I had to use allow net and obviously
[2043.36 --> 2047.58] cause I'm hitting Slack API. Right. And then I also had to use allow end because I could have just
[2047.58 --> 2052.60] hard coded the token into the script, but I just used it as an environment variable. And I could say
[2052.60 --> 2055.46] from a script from a person who's just trying to get stuff done, it is kind of annoying. You're just
[2055.46 --> 2060.78] like, ah, you know, I didn't know about dash all. I would have just used that. But now I know I'll just
[2060.78 --> 2065.46] use that all the time, baby. Node mode. Yeah. Node mode, please. I mean, if, if, if you're the one
[2065.46 --> 2070.48] who's writing it, then you're pretty sure that it's going to be okay. I think it's the problem
[2070.48 --> 2074.36] comes when you're running somebody else's code. Yeah. Like I said, this is a inconvenience,
[2074.50 --> 2080.30] but it's like a very explicitly well-considered inconvenience. That's like, yes, we're doing this
[2080.30 --> 2085.12] because of the trade-off is completely worth it. Right. This is a shift left kind of moment where
[2085.12 --> 2091.94] you're taking typical, maybe security concerns that, you know, you might rather just say Dino
[2091.94 --> 2096.12] run or whatever the command is to run a Dino application, but you're kind of shifting left
[2096.12 --> 2101.98] saying these are security concerns that Dino resolves and has control over and putting them
[2101.98 --> 2106.96] more front and center rather than, you know, as you said, in a configuration file, which is less minimal,
[2107.26 --> 2112.68] requires more potentially different file format or other concerns. Like this is a, a shift shift
[2112.68 --> 2117.30] left kind of moment. Would you say that? Sure. I haven't heard the term shift left before.
[2117.88 --> 2122.32] Shift left is whenever you take the security concerns, which if you take a, you know, a product
[2122.32 --> 2128.26] life cycle left to right, left being dev iteration, you know, right going to production. I see.
[2128.54 --> 2133.08] A shift left is you sometimes think about security further to the right. Once it's shipped,
[2133.18 --> 2138.32] potentially shift left is a term using security minds to take that security concern and shift it more
[2138.32 --> 2144.56] left into dev land. Yeah. I should mention that there is a new feature dash dash prompt,
[2144.88 --> 2150.02] Dino run dash dash prompt. So if you don't want to allow all the current behavior is if you hit one
[2150.02 --> 2155.22] of these ops, that's trying to access the file system and you don't have the correct allow flags,
[2155.66 --> 2160.76] you get an exception. The process drops out, errors out. There is a new feature that's kind of has an
[2160.76 --> 2165.48] interactive prompt that will be like, Hey, I'm trying to read this environmental variable.
[2165.48 --> 2171.66] Are you, do you want to allow this? Yes or no. And so you can kind of yes or no through the exact
[2171.66 --> 2176.46] accesses that the system is doing. And we think that we're going to enable this by default actually,
[2176.52 --> 2181.76] and not require this dash dash prompt flag. And so this is kind of going more in the direction of,
[2181.94 --> 2187.30] as always in the direction of web browsers, we'd like this programming model where you opt into
[2187.30 --> 2193.26] additional privileges. No, I like that. It sounds like a good, a good compromise, right? You're kind of
[2193.26 --> 2197.36] shifting a little bit further, right? But you're following the web browsers lead where it's like,
[2197.42 --> 2202.98] are you sure you want to give this person access to your webcam? You know? And if you say yes,
[2203.70 --> 2211.48] it's on you. So security front and center, we've talked about packages and how that all stuff works,
[2211.60 --> 2216.06] importing other people's code. We've talked about TypeScript. What are some other aspects of Dino that
[2216.06 --> 2220.58] are cool and exciting? There's some tooling things, there's a formatter, there's some of these kind of
[2220.58 --> 2225.58] developer experience things that help you stay productive, right? Yeah. So there's a bunch of
[2225.58 --> 2232.78] subcommands in Dino. So Dino run being the most obvious one to run a script, but we're kind of
[2232.78 --> 2237.54] taking this go approach where we're just going to build in all the tooling for you so that you don't
[2237.54 --> 2244.48] need to bring in all this other third party tooling. So for example, we have a code formatter built into
[2244.48 --> 2249.98] the system. So you can Dino format your code. We have a linter built into the system. You can Dino
[2249.98 --> 2257.68] lint. We have a test runner, Dino test to run tests. We actually have all sorts of stuff in there. We
[2257.68 --> 2264.86] have test coverage and we have a documentation generator and we have a dependency analyzer,