It's the basics of a service that would run a blog, and we're testing it today with Stackhawk. So you can see it has some posts and some post ideas, some content, and we want to be able to test that with Stackhawk scanner to see if it has any security vulnerabilities.
So we're going to do that with a simple Docker run command. You can see that I just kicked off the scan right before we started talking today, and I've got a simple Docker runs scan here that is docker run stackhawk hackscan, and I'm feeding it a Stackhawk.yml file. We're going to look at that yml file in just a second.
What you can see here is that it says we've turned on our GraphQL engine and we've got the information for what this host is. So you can see that the host is running on my local host on port 3000, and then you can also see the scanner found eleven different GraphQL routes in the application. Now this is important because it actually knows this from the GraphQL introspection endpoint. It's not guessing what's available in this GraphQL application. It's well documented in the introspection endpoint and the scanner's using that to test against it.
I just ran a scan right before this, so let's jump over to the platform and see what kind of output we have. So here you can see our scan that's already running, but the one I ran right before this is right here. So you can see I've got a couple of different issues. There's some interesting stuff in here that we can look at. What kind of tests ran against this application? What kind of findings do we have? Let's dig into one of these issues, shall we? So I've got two high issues, high criticality issues. And there are a SQL injection and a remote OS command injection.
Let's dig into that remote OS command injection really quickly. By clicking on that finding, it takes us to a simple description of what remote OS command injection is, as well as how an attacker might leverage that remote OS command injection and ways to remediate this problem. So you can see actually we have on our mutation here, our super secret private mutation. We have some kind of a problem. So over here on the request response side of the panel, you can see that during a mutation with this variable, we have now caused some kind of an output that looks like, looks like the output of Etsy passwd file to me. So we're quickly kind of getting into the context of what is this problem? How can I recreate it so I can go fix it? There's a couple of things that are really handy here. One, we've formatted all of these GraphQL requests in a GraphQL type of a fashion. So you can see that the operation and the variables make a lot of sense relative to GraphQL. The other thing that we've done is create this validate button up at the top. So if you wanted to, you could just copy and paste this curl request and replay this against the app. But the thing that I really like about GraphQL is because this is so well formatted and I've already got GraphiQL up, as we looked at before, I can kind of copy and paste our request out, paste that back into our app, and then I can copy our variables out and paste that into the app as well. So now I can replay exactly what the scanner did in my app, in GraphiQL, without too much hassle. So I can see what happened here was, the scanner tried to do a cat of slash etsy slash passwd, which on Linux boxes is where all the user information is stored, not the passwords, the users. And what came out of that was actually the content of that file. So that's bad. We want to be able to get into the application, start debugging and fixing how that actually works. This is really good at setting you up for success on how do I get back into my app, debug, fix this problem and get on with the business of creating value for my customers as a developer.
I hope you enjoyed my talk today and perhaps learn something new about how StackHawk can be integrated into your development workflow. If you like to check out StackHawk and see how you can integrate it into your development process, to keep pushing the limits on software development quality, you can always start a free trial at stackhawk.com. StackHawk is free to use on a single application. Thanks for watching and joining me with the StackHawk demo. I hope you continue to enjoy GraphQL Galaxy.
Comments