Welcome to the Packet Hacking Village. Thank you for all coming. My name is Riverside. I'm one of the co-founders of the Packet Hacking Village. This is C-Docs, the other co-founder. Alright, so we're going to get kicked off this morning by doing a little something special for some of our senior members to recognize all their hard work for the many, many years that they've been here. And we're going to start by giving Ming his long-term challenge coin. Thank you, Ming. Ten years. B-Box, please come up on stage. B-Box, thank you so much. Thank you, boss. Try not... I don't know. Do I have it on? It should be in here. Right there. Thank you so much for everything you did. Thank you, Matt. Who's the next one? Warlord. Warlord. Warlord. Our famous photographer. The master of shenanigans. I got his. Thanks, buddy. Thank you. Who's the next one? Fricosius, right there. Fricosius. Fricosius, our DJ. He's the one that brings the jams up in here. Thank you. Thank you. Thank you. Thank you very much. All right. So with that, we're going to hand the mic over to Ming, and he's going to get you all kicked off, explain a little bit of what we're doing this year. We have a lot of new, really exciting events, some crazy stuff that's going on, more shenanigans, as always, and have a blast. Thank you all. Thank you. Good morning, everyone, and welcome to the Packet Hacking Village at DEF CON 24. My name is Ming, and I want to start off by asking everyone here, who's here if this is your first DEF CON? Is this your... Oh, my goodness. Wow. Wow. Words cannot describe... Words cannot describe how blessed we are, how grateful, how humble we are to have you all here. We knew that this were going to be a lot of people here at the Packet Hacking Village, but if you just look around you right now, I think you're all as amazed as I am. Thank you so much for being here. I mean, words cannot describe my gratitude, certainly my gratitude and our appreciation for you being here. Now, I asked if... If this is your first DEF CON for a reason. On a very personal note, that this is a very special DEF CON for me, because this is the 10th anniversary of my very first DEF CON, back in 2006 at the Riviera. And I can tell you when I first went to my first DEF CON in 2006, I only knew DEF CON as a place where, you know, every mother, every father tell their kids not to go to that conference. That's... I certainly knew that of DEF CON. I also knew that it was very... If you made something called the Wall of Sheep or the Table of Doom, it would be very, very bad. This was in 2006. Little did I know at that time that I would one day be involved working with the Wall of Sheep and the Packet Hacking Village. And also, I am not afraid to admit, and I'm not afraid to say that having worked with all the wonderful people at the Wall of Sheep, with Warlord, with B-Box, Fecotius, with SeaDocs, with Riverside, this group provided me all the hands-on knowledge, all the practical hands-on skills in security, that I never got out of four years of college. So, in the bottom of my heart, I want to certainly want to thank Riverside, and I want to thank SeaDocs for what they have provided for their energy, for what they have provided for DEF CON, and also for the information security. Because if it wasn't for them, I would not be standing here right now. And also, I wouldn't have gotten this far in my career. So, I am extremely grateful for them and to the Wall of Sheep and all the senior members that have helped, that have certainly helped me here. And I really, really hope that this message would resonate to each and every one of you who will be, if this is your first DEF CON, I hope that this same message, that you will also eat up this experience, gain everything that you can, and I hope that this will do wonders for you in your career. We have moved to many, many different venues, we have been at the Rio, we have been also here, we've also moved a couple of times. And the village has gotten bigger and bigger each and every year. Yeah, it gets crowded every so often, but I can tell you right now, although things, time has changed, one thing has not changed, and that is our mission here at the Packet Hacking Village. That is security awareness and education. That's the bottom line. A lot of things, time changes and life changes, and things change, but that has not changed over the years. That mission of security awareness and education. And we're at a time where this is even becoming more and more important over the years, because we're founding new, new problems, but there's a lot more people getting engaged in the field, and we're very, very lucky to have the opportunity each and every year to inform the new audience, especially the first time people at DEF CON, you know, a little bit about the field, so you can help the future generation as well. So the mission has never changed over the years. So you may be curious, like, who are we, and how do we accomplish our mission? We accomplish our mission by having lots of volunteers, and throughout this whole village, you can find a volunteer by way of the gray shirts and the badges. And if you're here at the Packet Hacking Village, you know, I hope that you will take advantage of the opportunity to speak to each other, you know, definitely speak to people, you know, learn from each other, because you may never know what happens in one year when you will meet that person again, maybe even at your workplace or at a future conference in your hometown. We do a lot of crazy stuff, like really, really unconventional things. And a couple, and many of our ventures have really caught the attention of media and press. And some of those ventures, as you see, they still reverberate up to this day. We have not only a lot of volunteers, but we have a lot of people where our wives could be pissed at us for being here for so many days in Vegas. Yeah, we've now also gotten to a point where a few of the members here have brought in their wives and children for them, to come here. And there's a lot of putting up with some of the staff members, and there's a lot of long hours, and most of us have to pay our own way to come here as well. And finally, last but not least, and we'll be honest, is that we could not have accomplished all this massive work in a massive scale without our sponsors, which we'll give a small shout out to each and every one of them this year. So just a little brief history of what we have done over the years. We have not only done fundraising for the EFF, but we have also put on a lot of educational programs for the children as well, too, at Roots Asylum. Okay, say whatever you want, but yeah, we've been there, and that's something that we take a lot of pride in. Things like the NFC, the Near Field Communication Scavenger Hunt, that's still ongoing, but spun off into another event this year. We have also done juice jacking. You may have heard, I'm sure you all heard of, you know, it's not the wisest thing to plug in your mobile devices into outlets that you don't know. Yeah, we did that back in the days, okay? And we've been trying to get it back, but no avail. Time changes. So let's cut to the chase. Let's talk about the main events of 2016. We have the Venerable Wall of Sheep. We have the Capture the Packet. Where is Capture the Packet? Where is Capture the Packet? Anyone there? Give a shout out. Shout out. So we got, all right, got a little camera shy right now. So we'll talk, I'll talk a little bit about each and every one of the events. Right behind us is Capture, is right behind the, those curtains is Packet Detective. And new this year, brand new, you may have noticed that something might have caught your attention when you walked into the village, and it was a train set in the, like a train set that has a nice little miniature city. And you'll be wondering, whoa, what are you, what's the goal here? What could possibly go wrong? You'll see. We have the Wall of Sheep DJ, of course, that's a precocious, you've run that, we'll talk a little bit about that. And of course, right here, for the speaker workshops. And we give talks that are security awareness based, but also, they are largely defense focused. Now you may be asking, okay, defense is boring, no one cares about defense. But quite to the fact of the matter is, each and every one of us, you know, if you take a look at our day job, we're all doing defense somehow in some way. And the goal is, unlike a lot of other conferences, a lot of the talks, the goal of the talks is that what you learn, you take and apply right away, immediately after you leave the talk. So the content does not go over your head. I want to give a special shout out now to all the sponsors that have made this year's Packet Hacking Village in the scale possible. The Wall of Sheep Title Sponsor, Splunk. Thank you, thank you. Thank you, Splunk. The Wall of Sheep, Wall of Sheep and Sheep City Sponsor, Veracode. Capture the Packet Title Sponsor, Packet Sled. Capture the Packet Platinum Sponsor, Talos. Packet Detective Title Sponsor, Fidelis. Sheep City Title Sponsor, Evident.io. Wi-Fi Sheep Hunt Title Sponsor, Tinder. Yeah. And the DJ Sponsor, Talos. So now let's talk about the events, the main events, a little bit about each and every one of the main events that we have. First on the docket is Capture the Packet. The goal of Capture the Packet is a network forensic skills challenge. Network, there's skills, there's network forensic skills challenge. Now, for over the last five years, this has been a black badge event at DEF CON. Okay? This is not only a game to teach, it's also, it gets pretty hardcore. Because it's a game built by hackers, for hackers, but with a little ingredient, with a little touch of defense in mind. This year, there are two amazing prizes. Two MacBook Pros. Not bad. Thanks to Packet Sled. Packets, Capture the Packet is directly, diagonally behind us. And also, great news, big news this year, that Capture the Packet is now a training simulator used by the Department of Defense. Now, for those of you who may be feeling, okay, I'm new at this. I'm new at network forensics. I really want to sit down and learn. I want to learn before I compete for two MacBook Pros at the Capture the Packet. Is that possible? And the answer is absolutely yes. Behind us, behind us here, behind that curtain, is Packet Detective. Now, it uses the same exact engine as Capture the Packet. However, the only big difference is that the game is built for beginners of all ages, including children, to learn the fundamentals of network forensics. Behind us, there are also 20 laptops, like 20-plus laptops that are on the table. And the goal is so you don't have to bring your laptop. And I'm sure you may have heard news, especially if this is your first time, it may not be the wisest thing to bring electronic devices because what goes wrong will go wrong. So, we cannot thank you, the sponsors, for helping us out and making it possible so you don't actually, let's say, need to bring your devices and then things go wrong and then you have to burn your laptop when you go back home. So, that's all the equipment is all available for you. And when you feel comfortable after playing Packet Detective, of course, you're more than welcome to jump in to Capture the Packet. This year, brand new, is Sheep City. Now, Sheep City, this is our first year, and what this is, of course, one of the biggest things, the biggest trends of this year you may have heard of, it's called the Internet of Crap. I mean, the Internet of Things. Okay? This is a, that, Sheep City is a miniature city that is all connected. Door, the power grid, the train set, the water supply, the lighting, you name it. You have one job. You have one goal. See if you can disrupt or shut down the whole damn thing. And remember, folks, you cannot spell idiot without I-O-T. Our next main event is the Wi-Fi Sheep Hunt. Now, the Wi-Fi Sheep Hunt has evolved for the last couple of years. The goal of the Wi-Fi Sheep Hunt is to hunt around for mobile devices all throughout the conference. That means who, different hotels. There are three big challenges, sub-challenges of the conference of the Wi-Fi Sheep Hunt. There is an NFC, a near-field communication tag sheep hunt. There is a sheep hunt for the radio frequency. If you're into software to find radio and RF, this may be the event for you. And we also have a sheep hunt for Wi-Fi. The story is a bunch of sheep have left. You have to go find them. Registration is available today Tuesday through Sunday. And if you have any questions, And registration is at our wonderful, wonderful information booth all the way in the back. Hey, information booth, where are you? Give a shout out. And a little camera shot. The wall of sheep. Yes. It's that little, that little big wall, that projector screen that says don't get your info on there. That's, this is the one and only. We don't need to say no more. So, what we're going to do is we're going to have a wall of sheep disco. Now, the wall of sheep disco is a very unique event. We fly in DJs from all around the world. We fly in DJs from all around the world to have tracks for the next, the next three days here. All of our DJs, biographies, when they're going to come, they're on the wall of sheep website at wallofsheep.com slash pages slash DC24. Okay? And that's Precocious Event. So, hey DJ, where are you? Well, they're not there. And, of course, you know, one thing that we have not talked about is the Speaker Workshops. Now, the Speaker Workshops is going to run all day today, tomorrow, and for a good part of Sunday. At the top of the hour plus 10 minutes, so people can come up to the 26th floor. Uh, that 10, at the, at the, at the, uh, the 10 past the hour we will have a speaker. We'll have, uh, a speaker, uh, at each and every time. And at 1110, we will have Walt William. Walt, give a, give a, he's, he's getting prepared, he's getting prepared and he'll be talking about, uh, presenting metrics to, uh, security metrics to the board. Now, so, it may be, this is a pretty big, big event area. Should you have more information, if you need some help, or if you need to find someone, if you have any question, we have a world-class information booth in the back when you walk in. And they will have more information about all the different events. Uh, the Wall of Sheep to capture the packet, Sheep City, uh, and the Wi-Fi sheep hunt. Uh, they, as a world-class team, uh, back there, and, again, it's a very welcoming environment. And, you know, we're very proud to say we're one of the very, very few, you know, world group that includes, we like to include a lot, lots and lots of folks. Uh, Wall of Sheep, there is a network drop that you can use. So, you can capture packets from the DepCon network. Be unsecured. Feel free. Hunt for username and passwords. And, uh, this is, this is all for you to learn and to get to know, uh, people. And we hope you really, really, really, really have fun. I hope that you will take advantage of what we have to offer here. And we hope that one day you will be coming back over and over again to help out. Because if it wasn't for volunteers, and it wasn't for the energy, we would not, I mean, we would not be here right now. And, again, we cannot be so grateful, so thankful for each and every one of you to be here. I mean, just looking at this, although the light is pretty bright, it's, um, it, it's just really, really amazing, really amazing to, uh, to all of us to see it. I do not have any, any other words. So have fun. Welcome to the Packet Hacking Village here at DepCon 24. Make yourselves a home. Meet new people. Have fun and learn. Thank you so much. And we at the, uh, at the, uh, at 1110, we will have our very first speaker of the workshops, uh, here. Thank you so much. All right. So, good morning, everyone. And welcome to, uh, the Packet Hacking Village at the, uh, at DepCon 24. In one minute, uh, well, in about, oh, and, and, and so it is. So it's now 1110. And it is my great pleasure to introduce our very, very first speaker of the day and of the, uh, of the conference. He will be talking on how to present information security metrics to boards. And it is now my great pleasure and also, just for your interest, he was the very first speaker to not only, he's not only the first speaker to speak, uh, for the, at the Packet Hacking Village, he was also the very first submission for the speaker workshops at the, at the Packet Hacking Village. And it is finally my pleasure, give it up, Walt Williams. Good morning, DepCon. Uh, a couple of words about me. I don't have the obligatory slide that says, I live, I breathe, I've done security stuff. So let me tell you, I live, I breathe, I do security stuff. But I also want to tell you one quick thing about today. Uh, 30 years ago today, I should have been killed so that I'm on stage today talking to a bunch of fellow security geeks is nothing short of awesome. Hurrah! Alrighty. So what the hell are metrics and why do we care? Most people think that metrics are measurements and they don't understand the difference. Um, a metric is more than just something that I should measure. A metric really is a result of analysis. It is a way of saying I am not at whatever my goal is and what is the difference between where I'm at now and what is my goal. In order to do metrics, you have to do some measurements but you got to do measurements on more than one thing most of the time. You need to understand what your scale is, you need to understand the relevance to time, you need to understand the relevance to, um, um, scale, you need to have a unit of measure. Ideally, you have an analytical model and some sort of criteria that says, no, I'm not at my goal yet or, hell yeah, I made it. The other thing you got to do with your metrics is you have to understand how mature they are, how well they'll stand up to external scrutiny, especially when you're going in front of a board of directors because they are going to put you under a lot of scrutiny. So, what do I mean by goal? Okay, what are your business goals? One of my business goals is to bring in new logos. How does security help with that? How about sell more product? Slightly different than bringing in a new logo, could be a different business model. How does security fit into that? What are your business goals? Do you understand how security fits into them? If you don't understand how security fits into your business goals, the time to start figuring that out is now. This is not a matter of how many packets you capture. This is not a matter of how many hack attacks that you block. This is a matter of how you enable your business to grow, how you enable your business to thrive. The metric is the gap between that goal and reality. Now, these numbers are all fake, and you'll find fake numbers throughout the entire presentation, but the metrics that I'm using are very, very real. So when I'm saying that my antivirus system blocked 30,000 plus incidents in the last quarter, it probably blocked that many actually in the last week, if not more. Believe it or not, my antivirus works. I don't know about yours. That number where it says it failed to block 10 incidents last quarter, I actually think that's more like five in the past month. Okay, so I know the number's great, but what do they tell me? Do they tell me is blocking 30,000 effective? Is not blocking five ineffective? What are my goals for it? Before I bought the antivirus software, what were my goals for it? Did I have any? Can I tell from these numbers if I'm being effective? No. If I, however, take a look at these numbers over time, so number of items I block, number of items I don't block, measure that over a three-month span of time, that may or may not tell me if I'm being effective, but it certainly gives me a trend of relative effectiveness. My goal, of course, is always 100% of viruses blocked, zero incidents caused by viruses, every year, every single day. Do I get to that goal? No. Combining these two numbers, which are different measurements, along with what those goals are, it allows me to know if I'm being effective. Yes. Speak louder. Is this loud enough? Oh. I mentioned maturity a bit earlier. Gary Hinson has a great book out there, and I highly recommend that you pick it up, read it. It's a fairly thick cover. It's great. It's called Pragmatic Metrics. I'm going to go through Pragmatic Metrics very, very quickly. Yes, there is a slide for each bullet item, so what I define as quickly may not be your goal as quickly, but we'll get there. Hopefully, the gap is not too big a delta. But what Pragmatic is, is it is a model for measuring the effectiveness or the maturity of your metrics over time, allowing you to help get them better. So before we get into constructing specific metrics, let's take a look at what makes a good metric. First thing is that a metric ideally is predictive. So saying that I've had zero breaches over the past three days doesn't mean that I'll have a breach tomorrow or I won't have a breach tomorrow. It's kind of like the flipping the coin scenario. I can flip that coin and get heads or tails 10,000 times, but you have no idea what the next flip is going to be. And by the way, who can tell me what, how many options there are when you flip a coin? Did I hear three? Beautiful. Yes, it can land on the side. Now numbers like how many breaches you've had over the past three months, three years, are very good indicators of past success, but they're not predictive. It's kind of like looking at the stock market. Now the change in number of accepted risks with an impact over $1 million over the last 12 months is down by three. That's a great number. That shows that you're accepting less risk. That probably means that you're doing a better job of remediation, but again, it's not predictive. It's looking at the past. And by the way, sound risk management doesn't always see a decrease in the number of accepted risks. It often sees an increase, however, in the impact of risk because that means your company is growing. And so if you take a look as an example of the actual increase of business impact to the company from a security event divided by the number of security events, then you're starting to get a decent handle on how well you're doing risk management. Predictive measurements are usually best off when taking a look at things such as personnel is to respond to remediation demands, or how long does it take for a customer to respond to a security survey, areas where you can do trend analysis over time. You notice in both cases of the two sample metrics I just gave you, there was a unit of measurement in there regarding duration or time. How many companies have an SLA of five nines? Raise your hand. So you're okay with five hours of downtime every year. It shows operational success or maybe not so much if five hours of downtime makes your customers go crazy. But it tells you nothing about your security goal of availability. Did you exceed that measurement? Hopefully you did. If you didn't exceed that measurement, then you could be in trouble. How many DDoS attacks did you have in the last four quarters that took you down? That's again a great measurement, but at least that one informs on the information security goal of availability. Remember, while that's a measurement, it's looking backwards. However, if you take a look at that over time and that measurement continues to be pretty flat, that's giving you a good trend of your controls are working. Actionable. A goal should tell you something to change. So if my denial of service attack metric that I just mentioned a moment or two ago all of a sudden spikes up to I had one successful incident that took me down, well, I need to act on something. I need to change my DDoS defenses. All good metrics should give you something that you can do about them when the difference between the metric and the goal changes in a negative way. So 95% of vulnerabilities detected on servers found on non-OS components over the last six months, that's a very, very actionable goal. Go out there and patch your non-Microsoft stuff. Patch the Java, patch the Adobe. It's very actionable. Genuine. I love companies that go up there and say, I have had zero breaches in the past 12 months. And you know this how? How many of you like science? Raise your hands. Shout to the heavens. There's a little thing in science you cannot prove a negative. Saying that you had zero breaches is effectively trying to prove a negative. You can only talk about the breaches you know about, not the breaches you don't. No, it's not implied. You can only... No. No. With every single metric, you can only talk about what you know. You cannot talk about what you don't know. So you can't talk about breaches you haven't had. You can talk about breaches you have had. Metrics should be genuine. Metrics should be meaningful. So is 54 emails identified as spam a good thing or a bad thing? It could be that you're getting no spam. It could be that your controls are so horrible that you get 54 emails as spam. I don't know, is that a good thing or a bad thing? Personally, I think if I'm only getting 54 as spam, that's a pretty good thing. Other people would say if you're getting 54 in a day, that means your spam controls are horrible. What's your goal? You don't want a metric to just, however, show that a product is doing something. Okay, great. It's blocked everything except 54. Well, how many did it block? Probably a better metric here is how many tickets have people opened up with my IT staff over emails that were identified by them as spam? It can be meaningful. It can be tracked over time. It can be predictive. If the trend is heading downwards, it means that the changes you made to your controls, remember, you did something about it, have been successful. Accurate. These are two eye charts. Anyone remember Nessus reports? These are two samples right out of Nessus reports. They are impossible to read, and that's somewhat deliberate. I don't want you knowing what my vulnerable cities were, but what you can tell here is very, very simple. This one doesn't line up with this one. They work. They were taken within a week of each other. Did my vulnerability stance change over that drastically over a week? Probably not. Your metrics need to be accurate. You need to verify them. When you get discrepancies like this, you need to go in and independently verify that you're getting accuracy out of your tools. Don't just trust your tools because your tools give you information, does not make it reality. Ideally, you have multiple tools that give you the same information from different perspectives so that you have different ways of correlating that data. I realize we all have budgets. Does anyone care how many vulnerabilities I had in 2012? Raise your hands if you care. I only care if those vulnerabilities are still with me. Those servers probably don't even exist anymore, and if I still have those vulnerabilities today, I am in big doo-doo. However, the number of vulnerabilities I have on a brand-new production system as it's staged up, that's something that I care about. And yes, it's August now, and I wrote this presentation in March, which is why I was first, but the big question is, okay, great. Do I still have them? If I still have them here in August, I'm in really big trouble. So the data should always be about current state, not about past state. Now, when I'm taking a look at the measurements that I use for information security, I'll come up with my numbers. If I hand it off to my security engineer, and she can't come up with the same numbers while I'm here in DEF CON, and she's putting together the reports, my metrics program is a failure. The metrics that are being produced by your metrics program should be independent of who's ever putting them together. There should be no, oh, that's a high-risk issue. Well, what does high mean? To whom? Under what conditions? The metrics got to be objective. It's also got to be cost-effective. If you spend 12 hours a day calculating out your metrics report, you are probably spending way too much time on this. Your metrics report should be very, very quick to generate out of the existing tools the numbers that you have. Okay, so that tells you what a pragmatic metric is. If your metrics don't conform to every one of those goals, then there are places where your metrics can be improved. So as you're taking a look at the metrics that you have in your organization, compare it to each one of those items, look for places where you can get an improvement in the metrics you have, and then work on improving them. That allows you to mature your metrics over time, which is part of your goal, is to have mature, solid metrics when you go in front of the board to present to them. Now, what does the board care about when you're looking at your program? Does the board care about security? Does the board care about compliance? This is a trick question. Who thinks the board cares about security? Raise your hand. A few people. Who thinks the board cares about compliance? Raise your hands. More people. The people who raised their hands about compliance were absolutely right. The people who raised their hands about security are sometimes right. Depends upon your board. Get to know your board. Compliance metrics are a good way of looking at security through a very, very particular lens. It involves some dangerous assumptions. So, take a look at compliance in terms of, okay, if the policies and procedures and standards are doing their job, and if the organization is compliant with them, then you can measure to what degree you're compliant with those policies, procedures, and standards. Some dangerous assumptions there. I love the word if. It's so small, so very meaningful. Your board will certainly care about measuring your policies, measuring your procedures, measuring your standards. They may also care about external standards, such as PCI DSS, such as SOC 2, such as Sarbanes-Oxley, such as etc., etc., etc. So, it's always a good idea to line up your standards with those external standards. Okay, great. So, now we're to the point where we're ready to start deriving metrics. And I highly recommend that you take a good look at ISO 27004, which has been the basis of everything that I've been saying here. It is an international security standard. Yes, are you compliant with that standard on how you put together a metric? And by the way, it does not mandate particular metrics. It mandates the approach that I'm recommending regarding putting metrics together. It involves you thinking about what's important to your organization. Now, the metrics that we're using at Lattice are goal-oriented. They inform the success regarding our program. They identify the relationship between different measurements that we take regarding tools that we have in our environment. And the metric is the goal. And the goal, or other layers of management within my organization, is the difference between where reality is and where my goal is. Now, before I get into specific metrics, the metrics produce results. Inside of six months, the number of vulnerabilities that we had in our organization plunged by 98% of what they were. Does that mean that I no longer have vulnerabilities? No. Unauthorized changes plunged by 100% from what they were. Now it's very, very rare that I have an unauthorized change. My confidence by the Board of Directors and Senior Management in our DR strategy rose significantly. I don't have an exact number here. Hard to measure confidence. But I get a lot of pats on the back because we're doing a recovery every single month. And finally, 100% of the metrics that I started with have been adjusted over the last six months as we work on maturing them. All right. I'm certain none of you care about most of this stuff because this is a lot of specific stuff. I want to point out a resource to you. If you don't know about the Thomas Scoring System, I highly recommend you start reading the Exploring Possible Space blog and become familiar with the Thomas Scoring System. It's an effort to produce pretty metrics that aggregate across multiple controls in a realistic way that's not multiplying apples times oranges to get grapefruits but is a realistic way of looking at the different measurements in a way that understands how they inform each other. Highly recommend it. Now if you came here looking for okay, what do good dashboards look like, that's somebody else's talk. And by the way, when I present metrics I don't recommend the wrong numbers but I'm working at a data science firm. We like numbers. So again, know what your board wants. Now for the sample metrics right after this sponsored drink. All righty. Now I can talk again. Risk management. This is a metric that I do report to the board. When I look at risk, I'm looking at the measurements that I'm taking come out of the basis of information risk program. And so we're going to take a look at the impact value of unremediated risks divided by the impact value of total risks. We're looking for that delta to shrink over time. So we are taking a look at this on a per quarter basis over the past four years. We have watched a market decrease in time. That's a good thing. In terms of the effectiveness of my security policy, I actually come up with two metrics here. One of them is counterintuitive to many security professionals. How many of you like when you have people who violate your security policy? Raise your hand if you like people violating your security policy. I got three other crazy people here. Violations of your security policy tell you a couple of things. One of the things that it tells you is that you have an ineffective control. You have a control that is probably too draconian for your enterprise and so people are trying to go around it. So I measure the amount, the effectiveness of my security policy based upon how many people are trying to go around it. If the amount of people who are trying to go around my security policy are small to none, then I have an effective security policy. So while I don't like the fact that they're trying to go around me, I like what that's telling me about my security policy and I'm looking for that number to go down. This is a great other metric that I use to inform on my value of my information security program. This one I love reporting onto my board. I can tell you flat out that in 2015, the information security program on that has brought in 84% of our ACV to our organization. That means that 84% of our gross bookings last year would not have happened if we did not have an effective security policy. That's a great number. I get to that number by taking a look at the total dollar amount of those contracts that we book versus the total dollar amount of contracts we book at organizations that look at our security program. And I track that over time. And I track that not only on a per year basis, but on a multiple year basis. The goal here is to always increase the value of my business being able to be successful. And this is a great way of demonstrating to the board of directors how I have increased the effectiveness of their ability to do what they're trying to do on a business basis. Asset management is something that my board of directors doesn't give two hoots about, but it is something that my director of technology cares about. So I report to him on a pretty regular basis. Actually, this is now down to monthly on the gap between where we want to be with our assets and where we actually are in our assets. And I'm using my vulnerability scans compared to the hosts in the actual inventory to identify that. And I'm looking at two different things about hosts in the inventory. When I scan a host and see it's on our network, is it in the asset register? More importantly, is it in the asset register with an owner? If it's not in the asset register with an owner, I got fail, and that's something that I would need to be able to report to my director of technology. Okay, computer, come on. Let's try that again. There we go. Security awareness. I love security awareness. By the way, how many of you have heard about Hacker Jeopardy? It's a great game here at DEF CON. Not exactly work safe, but I did a very work safe version of Hacker Jeopardy as my way of doing my security awareness campaign this past year. Where I got ten people on a conference call or in a room, and we played a game of Jeopardy. Instead of just reading to them, thou shalt not do this, thou shalt not do that. And people had a blast. It was interactive. This year I'm looking at maybe doing some prizes for the people who did it the best. But the trick is that at the tail end of it all, I gave people a quiz three months later. And I looked at how much did people remember from our Hacker Jeopardy campaign to see how many people answered the wrong number of questions compared to the number of questions times the number of employees. So that gave me a good way of looking at how effective Hacker Jeopardy was at conveying the information to my employees when I needed them to remember. It wasn't so bad. By the way, that one I report to my director of HR. Security of operations they need to care about change management. If there are unauthorized changes coming into our environment, that's a bad thing. So we take a look at the number of change records created. We take a look at the number of changes that have been detected in our platform environment. And by the way, if you don't have a SIEM, get a SIEM of one kind or another. I don't care what SIEM you're using. And tune your SIEM to record detected changes by looking at your logs in a very, very critical way. It's much more important to your organization than you can believe. You've got to know how many unauthorized changes you have, because that tells you how well managed your environment is. Ideally, the number of changes compared to the number of recorded changes is a one-to-one relationship. Okay. How many databases do you back up? How many databases do you recover? The relationship of databases to database backup jobs. This is an old metric. I should have changed this one. We also multiply this by the number of recoveries we do. We decided that we needed to incorporate that. So the goal here is no longer one. The goal here is to have an N plus one, because the number of databases, the number of backup jobs should still be one, and multiplying that by the number of recoveries we do successfully, we should have a number greater than one. Our monitoring system, and I'm not just talking information security monitoring, I'm also talking about IT monitoring. Is it up? Is it responding? Is the processor in good shape? I want this to be at 100% for both security monitoring and operations monitoring. So here's a system where I take a look at the number of systems times the number of protocols, divided by the total number of systems and the total number of protocols, and that gets me a great relationship again, and my goal here is that I have a one-to-one relationship between the systems, the protocols, and everything that I should be measuring. Every now and then, I get somebody who's trying to do something that they shouldn't do. And so sometimes they'll go to IT and they'll ask me, do me a favor, I need to be in this group, put me into this group. What I'm looking at here isn't just who's in groups, but I'm comparing that to authorizations to put them into those groups. Do I have a letter from a manager someplace that authorized that person being put into that group? Does that person ever get removed out of that group, especially when they're supposed to be? So I'm going to take a look at this over time. The goal here is I should never have a single employee in a group where I don't have some sort of form of authorization from their manager. So my goal here is zero. I hate this metric. Why? I hate CVSS. Why? It's wrong. It is so wrong. But it's all I've got. In terms of somebody else looking at the vulnerability and saying how dangerous is it in an objective way. And by the way, I'm doing those quote things. CVSS isn't truly objective. It doesn't truly work. It works better if you're using CVSS3. It works better if you do the full put it in context stuff by doing extended CVSS. But it is a way of tracking things over time. So when I take a look at this thing this is one of those things where I do it by gritting my teeth by taking a look at the change in this over time I can look at at least a trend of is that number getting better even if I don't believe that number has anything to do with risk. You'll notice one thing about my CVSS metric. I weighed it. So issues rated 7 through 10 are modified by one factor. Issues 4 to 6 modified by another factor. Issues related 1 to whatever are unmodified. I want to make certain that the scaling highlights out the potential risk of a higher CVSS number on a very, very proportionate and repeatable way. So I've taken a bad number and I've modified it to make it exponential and I don't like it but it does allow me to do good trend analysis. This is a better I need a drink. This is a better way to measure vulnerabilities in my opinion. And by the way this one really should be number of exploitable critical vulnerabilities to show the effectiveness of my vulnerability management program. This is a raw measurement. This should be zero. This is an example of how sometimes taking a single raw measurement can be a good thing. But I'm looking at it over time. Pen tests. Anyone not do pen tests in this day and age? Good. How many of you are tracking the remediation of the findings in your pen tests? Maybe about 5% of the audience? This is an area that you should be tracking because when you've had a pen test and you've had a finding, you know that this is a path into your environment to do some pretty nasty stuff. So the goal here should be zero paths to compromise any aspect of integrity, confidentiality, availability, etc, etc, etc through un-remediated pen test results over a span of time. And that span of time should be based upon the risk tolerance of your organization. Some organizations have a very high risk tolerance where they'll give themselves an entire year to fix these things. Some organizations, you have to fix it within a month. Know the risk tolerance of your organization. But if you have something here that is found in a pen test that is a path to a compromise, this should be something that you're tracking over time. Realize security incidents. There's a difference between a security investigation and a security incident. We call a security incident a realized security incident because every investigation we're tracking as a security incident simply because it's people doing something over time. So it's a very, very simple way for us to look at how much time we are spending doing triage and investigation. So I'll track this and I'll take a look at the number of false positives. I'll take a look at the actual incidents where I had to do something to remediate somebody in my environment or something in my environment trying to do us harm. And the goal here is for me that both numbers should be zero and I do a non-mathematical thing here and I do zero over zero and say that's valid. Matter of fact, that's my goal. I don't care if it's rational. The metric doesn't have to be a number. It can be the proportion. It can be the relationship. Business continuity. How many tests do you do that succeed versus how many tests you do? A very simple trend analysis over time. Ideally, you're doing this more than once a year. If you're only testing your business continuity once per year, a lot changes over a year. That doesn't give you a lot of assurance in the 11th month that what you tested 11 months ago is still going to work. I love my auditors. The only people who are more my friends than my auditors are my legal team. My auditors help me understand how good a job I'm doing. If I have zero audit findings through a third-party audit, that is my goal. This past year with my SOC 2 audit against the cloud security matrix, I had 11 findings. None of them major. Against my ISO 27001 audit, I had four findings. None of them major. As of this date, I'm looking at my annual reassessment against ISO. Only one of those findings is outstanding. Not only am I going to look at the number of findings, I'm going to track them over time as we work to remediate those findings and get them out of my current. By the way, yes, I'm doing both a SOC 2 and an ISO. Can anyone tell me what the key difference is between a SOC and an ISO? And if you can tell me, there will be a mouse for you. Yes? The SOC doesn't state which controls you have to apply with. The SOC actually will state which controls you have to apply with within the scope. There's a different difference. Yes? The SOC actually will document evidence of the controls. The SOC and an ISO will both document the evidence of controls within your organization. The difference is something else. Yes? Yes, that is one difference. You get a mouse. Good catch. There's another critical difference between a SOC and an ISO. An ISO will challenge you to improve your controls over time. A SOC won't. A SOC, you can have the same findings year after year after year, and because it's not a certification, but it's an attestation, they don't care. With an ISO, you can actually lose your certification if you don't work to remediate your findings. So if you look at an organization and they hand you a SOC 2 report, look at it over time to see if they actually do something to fix the findings. That would be a great metric of the third-party risk in your organization. It's not to the presentation. It's an extra, which is why you got a mouse. No, SOC leads to an attestation of compliance, not a certification. Attestation. And there's no penalty for not remediating the findings. With an ISO, it's a certification. You can get certified without being 100% compliance with everything. You just have to be 100% compliant with the core elements of ISO. However, the following year, they're going to look, have you improved on your program? If you have not improved on your program, if you've done nothing to remediate the findings, you can lose your certification with ISO. Yes? That is true. With an ISO audit, the results of the ISO audit are not normally shared with third parties. They're normally private and privileged. What you can do is you can put yourself under an NDA with the organization that's gone under, gone an ISO audit, and they can, if they choose, share with you those findings. What many organizations do that go through an ISO finding is they'll ask their auditors to produce two reports, one for internal consumption, one for external consumption. That's well within reason. A good auditor will do that. By the way, that's it in terms of the stuff I came. I'm ending a few minutes early if there are any other questions. Yes? Can you get a copy of this? That's a great question. Will this be posted up on the Wall of Sheep webpage someplace? Anyone know? They're all for sale. This is not for sale. This is for free. If it's not going to be on the Wall of Sheep page, give me your business card. I will email this to you. Hopefully this will be up on the Wall of Sheep webpage in a day or two if it's not already there. Any other questions? Yes? Could you either speak up or come to the mic? I did not hear that over the funky rhythm. It's the eyesight party last night. You're tracking quite a range of different data types to capture all these metrics. How do you store all that? Currently, his question is, where are we storing all the different data types that we are tracking? This is bad news for me. Currently, I'm tracking these in a fairly large Excel spreadsheet. I'm a startup. Sorry. If you have a GRC tool, I'm certain that it's a great place for you to track these sort of things. There are a couple of free GRC tools that are out there that I'm taking a look at. Having trouble, of course, free stuff means it's tough to implement, so we're not there yet with our implementation. I can't tell you whether or not IRAMBA or RISC are good ways of solving that problem in terms of free GRC tools, but we are certainly looking into that. Because I hate doing this on spreadsheets just as much as everybody else. Any other questions? Yes? What about when you have an auditor that may not be as savvy, as you? Okay. If my auditor is not as savvy as I am, I take time to educate my auditor, because I want them to have just as good a knowledge and understanding of what I'm doing as I do, and I hide nothing from my auditor. Because my auditor is my best friend for getting things fixed. Any other questions? So, the data you collect, you collect from various sources, right? What kind of sources do you actually do? The data that I'm collecting comes from sources that are based upon the tools that I have in my organization. So as an example, I'm using Tenable Security Center, which collects a lot of different measurements across my enterprise. I'm using McAfee EPO that collects a lot of data across my enterprise. Every single tool that I have will give me measurements on the effectiveness of that tool. So what I do is, on a periodic and regular basis, I go and I pick out those measurements from that tool, and I aggregate them together. And I've got a 90-page presentation that I give to operations on a weekly basis, pulled out of all of those tools. Yes, they hate me. Any other questions? Yeah? Probably loud enough. So for your... Oh! Yeah. For your verification of your tools and verification of your discrepancies, how do you go about that process? Want to ask? Yeah. . . . Thank you. Otherwise I'd forget what the question was. I actually normally have multiple tools that have the same job within my environment. So I have two different anti-malware. I have two different vulnerability testing tools. I have two different almost everything. A lot of those supplements will be free shareware kind of stuff. The open source community is wonderful. Sometimes I'll dump a paid-for tool based upon what I'm getting out of the open source tools. But by having multiple tools on the same problem, I not only have an independent record of that particular measurement, but I have a way of validating the measurements I'm getting. . What risk assessment methodology would you recommend? Risk assessment versus risk analysis are two different things when you're talking about methodology. So from a risk assessment point of view, I like either Octave or ISO 27005. From a risk analysis point of view, you don't get better than FAIR, Factor Analysis of Information Risk by Jack and Jack. It's a tremendously brilliant way of looking at risk from a quantitative approach. The nice thing is that both Octave as a management framework and ISO 27005 as a management framework allow you to integrate into it an external analysis framework like FAIR transparently. So if you're interested in that, I highly recommend that you take a look at the open group, which has very good write-ups of how to integrate FAIR into those larger risk management frameworks. Any other questions? Yes? So for boards who may not be as sophisticated as you, how do you explain to them what they should be looking at and what questions they should be asking you? I don't. I find out from them what they care about to grow their business. I then work on aligning what I do based upon what they care about. I then educate them on the relationship between what I do and how it helps them succeed at what they want the business to accomplish. So the only thing that I'm educating them is on how my activity is helping them achieve what they want to achieve on the business level. So I don't ask them to change the questions they're asking. I just make certain the answers I'm giving them actually help them answer those questions in a way that's meaningful for them and their goals. I never push the board to ask a question the board doesn't care about because they won't trust that I care about what they're interested in. It involves putting myself second. Security doesn't run the business. Security just allows the business to operate in a trusted framework. And if security is not about the business and making the business operate in a trusted framework, then security is doing the wrong job in that company. Anyone else? I think this is the last question. Sorry about yelling out before. Just to go back to that question, when you said you can't prove a negative, right? So if you're saying use the positive, I had 37 virus infections last month, aren't you saying the same thing? That I only had 37 virus infections? Isn't that the same? No, what I say is I only know about 37. No, I can't say I know about zero. What I can say is I don't know of any. Which is a very, very different statement. I'm admitting to ignorance rather than saying I know of nothing. This is one of those areas where syntax is very, very important. And having the syntax where I'm forward with what I don't know. So I know of no data breaches is a very, very realistic statement. Saying that I have I forget the other way of approaching it, but by being open to ignorance, I'm not setting false expectation. The board doesn't assume I'm omniscient. The board assumes that I'm as failed a human as they are, and they don't expect me to be omniscient. What they expect me to be is as open about the limitations of my knowledge and insight as possible. So if I go to the board and say over the past quarter I know of no data breaches, they'll understand that there may have been one that gets detected two months from now, but I didn't lie to them when I said I know of none. Yeah, it's not really a FUD factor. It isn't based upon fear. And I'm not trying to say that I'm Yes, there is uncertainty there, and that never goes away in our discipline. We can never be 100% certain about anything other than we can never be 100% certain about anything. This, however, does not mean that we have to have doubt. By saying I have detected no breaches means I'm actively trying and looking at for them. It just means that I'm unaware of any breaches. Yeah, it could be that I suck at my job or it could be that and frankly if I ever have a breach where I find it and they were in my environment for nine months prior to when I found it, yes, I suck at my job! And that is a very real metric. So looking at time to discovery for data breach is a very good way of looking at how badly do I suck at my job? And it's a measurement that every CISO, Director of Security, or somebody in that kind of position should be looking at and we all should be very very self-critical about this and honest that you can only talk about what you found. You can't ever talk about what you haven't. Alright, I think that's all I have time for. Thank you so much. Enjoy DEF CON! Applause It is my pleasure to introduce you to the next speaker who is the Head of Research at Topspin Security based out of Israel. And Omar Zohar he will be presenting on a topic that I'm sure a lot of you are very curious on. It's on the topic of deception. So without much ado please give a very warm welcome Omar Zohar. Applause Hi everyone. Okay. So here's the scenario. You spent months preparing to infiltrate the evil corp. You tried everything, exploits, whatever, and finally after months of preparation you finally got a foothold on the network. Now you got to some work states somewhere. You don't know. You succeeded in infiltrating. And now you try to move your way in order to well your goal is to basically excitate some data, important data out of the organization. So you're looking for the work station that you found and you come across quite a bit of interesting information. So you look you see some emails that the users discovered. You see some credentials. You see some session data. And what I want from you in the show of hands to tell me what kind of data would you think would help you to move along in your data laterally across the network. Who thinks number one is the one that's going to help the most? Okay. Show of hands. No one? Alright. Number two? Alright. A little bit more. And who thinks number three is the most? Okay. So we have a majority for number three. And these are the types of questions that I've been dealing with in the past few months. And this is what I'm going to talk about today. Basically what I was thinking about the past few months is what attackers are interested in when they are inside your network where they inside where they see your data and what they care about in order to execute whatever they're here for. So my name is Omar Zohar. I'm the head of research for Topsy Insecurity. And we're going to talk about some research that we have been participating in the past couple of months about how deception can be applied in the network, inside the network, and how efficient it is and how to do it in an effective way. So we're going to talk about today a little bit about how is deception implemented at post-infection scenarios. We're going to put I'm going to explain a little bit about the test that we made in order to test the efficiency of deception solution. We're going to show you a few examples of some traps and decoys and different deception mechanisms that we implemented for our test. And we're going to discuss the results. So why are we even talking about post-witch detection? So everybody here today probably agrees that the perimeter of Apache can be easily bypassed. Add to that that chaotic internal networks with little or sometimes even no security that leads to a further ground for attackers to roam around your network and do basically whatever they want. Attackers have most of the advantage in a cyber attack. They have the initiative. They have the veil of anonymity. They have the privilege to try and try again until they succeed. While defenders have exactly the opposite position. They don't know who is attacking them usually. Usually they don't even know if it's an attack or a false positive. And they usually end up trying to defend everything from everything all the time. But defenders do have one big advantage. And this is the control of information that they have and the asset they have on their network. So in order to if a good defender would prepare in advance the image that an attacker would see once he's inside your network then it is possible to change the image that the attacker would see once they're inside the network and to channel attackers towards detection mechanism instead of the real asset in the organization. And I'll show you how it's done. So every network has its assets, workstation servers, IoT devices, switches, routers and everything that connects between them. So the deception mechanism that we call the decoy is exactly the device that will mimic the operation of each and every type of the asset. So from the standpoint of networking services, operating system, application and sometimes even data it all depends on the different interactivity level of the decoy. Okay so decoys have, because they're not part of the organization, they're not part of the real operation no one's supposed to know about them and therefore no legitimate users are ever supposed to touch the decoys. But so every time someone is touching the decoy then you should the alert is very suspicious. Another advantage of the decoy is because it doesn't hold any important information for the organization, you can use the decoys in order to employ the attacker, delay it and study it a little bit and while it's been detected you also know what does he want, what is his needs, what is his goals. So this is the decoys. The only issue with decoys is that as I said before they're not part of the organization no legitimate users are supposed to ever touch them and then the question is how sophisticated attackers who would not do some scanning on the network how do they ever find about the decoys? And here we introduce another deception mechanism that is called the trap. Trap are actually a piece of breadcrumbs, links if you may that of pieces of information that we place on the endpoints in order to let attackers know about either decoys or other detection mechanism and we're going to talk about it moving on. So if an attacker would find one of my traps he would gain information about different services that I deployed and will eventually reach the decoys. Okay, so up to now this was the theory. Okay, in real life deploying decoys and traps can be quite a task because there are so many types, I guess some of you are already thinking about what kind of traps and decoys can be deployed on a network and how you're going to do that. And the deployments are very very difficult because there are endless possibilities. So for example what kind of traps would I deploy? What kind of decoys? How many should I put in each machine? How many should I put on my network? All these are very important to our question and we pondered about them a lot and we had some hunches about them but we really didn't have a lot of real data about this stuff. So we thought we would check and it's apparently that no one that we know of ever checked them. So we decided we're going to do this research and this is what I'm going to talk about today. We defined three different research questions. First is, are decoys and traps effective in real life scenarios? Can they actually help me detect attacks in a post-breach scenario? And what types of attacks should I be expecting to be able to detect? The second is, do attackers really take my baits? What kind of baits are better than others? What kind of baits will help me against in different scenarios? And the third is, is there an ideal deployment or what rule of thumb can I be expected to use in order to increase the effectivity of my deception deployment? So we pondered about how to answer those questions which are all very can be answered in a lot of ways and we have to check a lot of types of deception mechanisms in real life scenarios against real attackers. But we also have to do it in a controlled environment where we can actually test the results of the interaction with the deception technology. So we ended up doing, we decided the best way is to do a CTF, a game, to gamify it, bring attackers in, let them have their prizes so we have the incentive to do real attacks and we're gonna deploy our stuff inside and see how they interact with it. So this is exactly what we did. We built a whole corporate environment, workstations, servers, connected in a main controller with DNS servers and what not in order to make it a real organization. We added a lot and lots of data, emails, files, users, applications, corporate web applications, all to create a snapshot of a real live organization. On top of it came the deception there. So we deployed decoys on the network in order to, in all sorts of configuration, in order to mimic the operation of the regular assets on the network and we placed traps on the real assets to lure the attackers towards decoys and other detection mechanisms. The traps and decoys that we used were all sorts of types of things that we already had, things that were in POC mode and some open source projects that we wanted to test. So there was a very big variety of different deception mechanisms. We're going to get to that in a minute. On top of it all, we built the challenge. So our challenge consisted of five different types of information we spread around the network. We then infected one machine with remote access to the RAT and gave the contestant access to that machine. From there, the contestant had to do his reconnaissance, get to know where he is at, what his target is, and to execute this data out of the organization. So basically you get a really classic data exploitation scenario. Then we gave the shout out to everyone that wanted to participate. We had people from all over the world participating. So a few numbers about our CTF. We ran it for over a month with over 50 security professionals taking place, taking part, sorry. Each and every one of them spent six to seven hours doing the CTF exclusively in this network. And some of them took a lot more than that. We also ran quite a few malware samples on the same environment in order to test how automatic malware responds with the detection mechanism as opposed to human attackers. We collected more than two million lines of data. We had a lot of data to walk through. Over here you can see some of the declarations that we placed. We really wanted to make a live real environment for attackers to roam in. This is very important for deception. Let's talk a little bit about some of the results. The first thing that we noticed is how much time does people take in order to solve each and every one of these phases. The first phase of our CTF was very simple. We just gave the contestant to find one file inside of the local file system of the initial infected machine. We thought it was going to be a really simple task as a first task for the CTF. What we found is this task took attackers the longest. We measured this in shell command, the number of shell commands they had to type in order to get to each one of the phases. The first phase took 600 steps while the second phase, which was a lot more technical, which consisted of moving laterally on the network and doing all sorts of scanning, took a lot less and it went down from there. We had on this phase people doing all sorts of stuff from exploit kits to privilege escalations. We had even one guy who downloaded each and every file of the file system in order to check if this is the correct file. It's not like we didn't give any hints. In our instructions we gave a very specific hint for the attackers where exactly to find that first file. Our first conclusion is if you're going to do a CTF read the fucking manual. Really. Because when people who actually read this stuff and people who actually or we pointed out when we see that they're taking too long, they found this file in no more than 100 steps. What we have here is a gap. A gap between a knowledgeable attacker and a disinformed attacker. We call this the knowledge gap which is exactly the difference between the perception of the attacker and what is actually going on. So we also found that this knowledge gap as we saw in the graph before it decreases as much as the time the attacker spends on your network. At first the attackers they don't know where they are they don't know where is their target they try to look and find out as much as they can about the network and this is exactly the time that they're making the most noise. They're making a lot of noise a lot of command, they issue a lot of stuff in order to find out where they are. These gaps are also the difference between a sophisticated and knowledgeable attacker and some random crime or malware infection that doesn't care about the specific attacker. If we think about it in the aspect of detection then this knowledge gap is what the deception mechanism is supposed to do in order to widen this gap is actually what the deception mechanism is supposed to do. The wider the gap the harder for the attacker to know what's really going on and it's going to make a lot more noise in the network and it will do a lot more stuff in order to find out what's going on and this is where we're going to be able to detect it. So before we move on with more results we're going to look at different detection mechanisms that we placed for this CTF. So, traps. We divided traps into four types network-based traps file-based, credential-based traps and application-based traps and each one of them we have a long list of different traps and actually this is the place where you can really get creative because everything on the asset that you think that an attacker can be looking at you can use as a trap. So we start with the file-based trap file-based are really the simplest types of traps they can be very simple like for example the configuration file containing username and passwords it can also be a document with IP addresses and URLs and username and password from the IT department supposedly to how to connect to the VPN and everything, all these IPs and URLs either bringing the attacker to the decoy or some other detection mechanism. But sometimes it's not enough just to send the attacker somewhere we want to know exactly when he's opening the file or if he's exiting the file from the file system we want to know when the attacker even if he's not on premise anymore we want to know when he opened the file and this concept this mechanism is called a canary a canary is basically some mechanism that will trigger once someone is opening either a document it can be an email file it can be a database table and you can imagine what other types you can do so what's going on in this example we have a document and once someone is opening this document an HTTP request for going out for some domain that we control with a unique token so we know exactly which file has been opened in this example we used an open source project called Canary Tokens which is made available by the folks at Thinkest I think a year ago and it makes it really easy to implement Canaries for everyone so really recommended Emails Emails are working the same as documents but they have the credibility of being a conversation between two people so the data inside emails really can be have really the credibility and the data for users for the attackers can be a lot more valuable this email that we found has been triggered by 27% of the contacts opened this specific email so it was quite popular actually it was the most popular trap we had on the CTF and as a wise man once said you can hear a human saying but when you control the mail you control information so let's talk about our users can users create a false positive when we press the traps you're probably asking that because they can, they can find your traps they can find the documents we put in or whatever that we found and they can either delete it or accidentally click on it and we have false positive so what do we do certainly it's really wise not to put it in the user's face so don't put it in the high on his email don't put it on the documents folder there are quite a few places we found that can be used in order to put traps where users usually doesn't look like the temp folder, recycle bin printer's pool and the list goes on and on so again creativity but I want to share with you a nice method that we found was very useful and this is using the file permission system so in this case we hid some directory that contained traps to the system system hidden files and this is not the problem but really what we did is to lock this directory to the domain admin user and it doesn't have to be the domain admin it can be any privileged user the thing is that the legitimate users on the workstation doesn't have access to these traps so it cannot create false positive but once someone is taking this trap we not only know that we have an attacker on our premise but we also know that this attacker has the credentials to read these traps so we also know that this is a highly privileged attacker who is also deep in my system and he has the domain admin credibility so one way to prevent false positive moving on to network based traps one way of a very popular way for attackers to know the network neighbors is using the ARP cache in our experiment a third of the attackers use the ARP cache in order to view who is the neighbors on the LAN so it's a very popular method and how do we implement deception on it so what we want to do is to inject the IP addresses and the MAC addresses of our decoys to the ARP cache so we can use static entries and this is a very simple way but it doesn't look very authentic because everybody can see over here you can see the static methods the static entries so what we found is a way of injecting entries into the ARP table and this is done very simply by sending an ARP sorry a SYN packet to the to one of the open ports on the asset so any open port can do and what's going on is when you send the SYN packets or a SYN reset or a SYN hack reply should be returned to the sender because the sender is not in the ARP cache he sends an ARP request and we're going to send an ARP reply from our decoy and repeating that every 2-3 hours from each decoy you can make sure that every one of your the IP addresses of the decoys are in the ARP cache always and in our experiment we found that each attacker that contacted the ARP cache that viewed the ARP had a 14% more likelihood in interacting with the decoy than any other attacker so it's probably it's a nice method moving on to applications applications can be any data that you can insert into an application that can be used by attackers the most obvious example are all sorts of connectivity programs like PuTTY or RDP or FTP clients and what not you can use either installed or even uninstalled program with installed program you also have the more complicated complicity of the data that you insert from the user so depends of course it looks more authentic if the program is installed but the hard part about implementing this kind of traps is how to reverse engineer each and every application in order to know exactly what the data structure looks like what values in the registry or the file system or other databases I need to insert in order to insert my traps so fortunately for us we don't have to because malware has done these works for us TrojanDarkPony, GameOverZeus and a lot of others have their source code leaked in the past couple of years and they implemented exactly this method in order to find this session credentials in different applications so over from the source code that we already found we have more than 200 different applications lying around that we can place traps on and finally I want to talk to you about credential based traps so Windows has the Windows Credential Manager and it makes it it's a bad place to save your password because every attacker that is using a tool like Mimikatz can see your passwords in the clear if you have domain if they have some admin privileges on their workstations but by default every RDP password is being saved there but you can save any type of data that you want IP addresses, passwords, whatever you want and inject them there and you can see on the CredMan type of Mimikatz that you can see all the data in plain text another cool method is injecting some domain user passwords in this example we injected the domain admin we have a unique password for each for each asset so we later going to be able to know where the password came from so in this example we also used another open source project called Decept Decept has been released by the folks at SecureWorks not a while ago and it makes it really easy to inject and deploy this stuff to all sorts of all sorts of workstations so however you want the attacker to once the attacker takes the password it doesn't matter how we use it and we had tons of stuff that we saw in tons of different types of passwords usage attempts in our city and you can see some example here every time an attacker tries to login to some network asset he can make a request to the DC for authentication in this request there is the password hash and by brute forcing this hash we know the plain text so it's really easy we can verify that this type of login attempt was made by from the injected password which is unique so and just mind you that in this example we didn't even use the decoys we just used some network analysis network sniffing in order to find the trap so finally I'd like to leave you with a few guidelines towards how to create how to create a good trap so first of all a trap must blend in to the environment it has to be lucrative and authentic otherwise attackers just not gonna buy it it has to be non-intrusive as we saw before don't create false positives don't agitate the users so otherwise you create a lot of noise and finally your trap should have a low attack surface and what I mean by that is don't create new vulnerabilities by placing traps so if you run code on the machine or stuff like that to create your traps that may be a possibility for attacker to take advantage of your trap and to actually gain privileges or do some other attacks on your network so mind of that ok back to our CTF so we had more than 177 different traps placed all over our networks 11 different decoys with different decoy services and we had one clear win only one winner emerged from our CTF which I was able to solve all the riddles so this is a snapshot of a message text that he sent me at 2.30 in the morning very happy about being able to solve our CTF but by the way that doesn't mean that he also did not fall in one of our traps so he solved the CTF but still he stumbled about quite a few deception mechanisms so some results um we made a breakdown of the different types of traps and exactly how many traps were consumed in each type of the CTF so as you can see the most popular one was the fire based trap out of the 340 traps that were consumed 120 were fire based traps but as you can see only 64 of them were revealed so not all even though it was very popular not all traps were discovered by the attackers we had one trap who were very popular it was consumed 21 times which was the party application but on average each trap was consumed only 3 times and this proves the the the diversity of attackers and what they are looking for and how attackers diverse from one another so each attacker took interest in very different types of traps um and overall 62% of our traps has been discovered we also checked the difference between humans and malware and automatic malware and as you can see there is a clear different patterns between what malware are looking for and what humans attackers are looking for so malware being automatic they look for the structured data, application data, browser data and the most sophisticated ones actually look at files and try to find tokens in them but not more than that human base are really more diverse they like the files most but they also did in high numbers emails and credentials and more on average each human attacker tried triggered around 10 traps so this is a lot of information each and every attacker gained from from our traps during his his contestant so what we have here so we have traps being triggered by the assets and we have and we know that the attackers saw these traps and they consumed it and we actually had a lot of we did a lot of data analysis in order to make sure the attacker each traps that we found actually reached the attackers eyeballs so a lot of data analysis and stuff like that in order to make sure of that but how attackers really use the information how did they employ it how did they act upon it so eternal attackers doesn't really give a shit about what we think when they use the traps so we had attackers using the data that we gave them right away some attackers ignored completely some of them mixed the trap data together some of them even added information on top of what we actually gave them so we basically we were a little bit concerned about what types of traps we supposed to do in order to really channel the attackers so we want to use it's kinda tough it's kinda so we took a look about on one one case of an attacker who who did access decoys in different services so we want to find out how he found all these types of services so we went back and see what traps he triggered so this type of trap he found from so many emails that we found and that contained the IP address of an RDP service in order so he accessed that and then he stumbled upon the PhyZilla FTP application which contained three different three different IP addresses please stop that it contained three different IP addresses along with the username and password so he tried two of them and even though I had the password written for each specifically for each service he actually tried several of them I don't know why several of them on each service so really added information there and then another two services he found from an RDP file that was sitting around in the file system and this email that I've seen before which was the most popular one so all in all we could explain five of these services so how did he find about the rest of them it was a real puzzle to us and we looked down and we checked there is no traps for these for these services so how did we know about them our guess is that there is an RDP service here and he figured that some of the some of the decoys has RDP service so he would try another one he figured because there is an RDP service then it's probably a Windows machine so he's gonna try SMB sharing and then and he got to the rest of the SMB services so overall the attacker added a lot more information from the basic trap information that we got him he thought that the decoys were very interesting for him he spent more than four hours interacting with our decoys in a lot of ways and he spent most of his CTF interacting with our decoys instead of solving the readers so what we did here is not only did our traps widen the information gap for the attacker we also had him because the decoys were a little bit convincing for him so he could more information gap by himself ok moving on our final result is about the decoy access so we also did a breakdown of what kind of decoy services are being used in each and every by the attack and you can see that the number of decoy accesses were in the 10th of thousands so we had a lot of events in our decoys in which each contestant used access 10 different decoy services but this only takes you half the picture because if we look at the histogram of the decoy accesses we see that indeed most of the attackers actually used these roughly 10 decoy services but we have quite a few attackers who made a lot, a lot, a lot more than that so we decided to figure out, we wanted to know why is it so so we looked at the type of services that these guys that did these lots of accesses how, what kind of services did they access and we realized that most of these accesses are low interactivity events on the decoys and that means this is TCP SYN, PINGS and all sorts of initial connection packets which are basically what it is, is a network scan so some of the users are doing a network scan of the network in order to find who can they access on the network so if you have decoys on the network, network scanning is going to be very, very loud as you can see for that so we want to see how attackers interacted deeply a little bit more with the decoys so we removed all the low interactivity low interactivity events and what we found is that we still had on average four different services and attacker each attacker has been interacting so this means that even though you remove all the PINGS and SYNs and stuff like that attackers really found our decoys really believable because as you can see these four different accesses, it means that the user has either logged into one of the services or he downloaded the file uploaded the file looked around the directories of some services and stuff like that so it's really been into interacting with our decoys and if we compare the high interactivity events with the rest of the events you can see that the pattern is not very different the pattern between high interactivity events only and all the rest of the events the usage of attackers who access are not very different what this means for us is that first of all, attackers those attackers who did the scanning found about about the decoys but most of them continued on and the decoys were interesting enough for them to do high interactivity events so most of them continued and interacted with the decoys and if you see that no single bar here is over 50% the overall detection rate of the decoys were 66% so 66% of the attackers has interacted with the decoys and been discovered so in order to reach 66% no single service is enough in order to cover all types of attackers so in order to get high coverage rate when you have decoys you have to have different types of decoys different types of services and to spread them around in order to really comply with each attacker and whatever he wants but as I told you 66% is not enough but as I reminded earlier decoys are not the only type of detection that we had so if you consider the canaries and the data analysis and the example for that that we showed you earlier if you combine all this together we reached a level of 100% of attackers that did some significant activity in the network has been detected by either one of them of course there is some overlap between them so finally just to share with you a little bit about how attackers interacted with decoys this is just a small conversation I had with one of the frustrated contestants in a CTF he actually knew the right file that he wanted to get but he tried to access some server and he's telling me dude this is not working I'm sure the file is there and I said to him are you sure and he told me I found it in the history in the email and I asked history of what history of Firefox and then I realized where he got this information and I said dude you are playing with a decoy and this guy just spent two hours of his life trying different stuff so just a first hand example about how to interact with decoys as we saw deception increases the attacker's knowledge gap the bigger it is the easier it is to have proper detection of attackers using different deception mechanism diversity is the key to get full coverage of each and every type of attacker attackers are diverse they each have different interests on your networks and you can see and deploy the traps and decoys accordingly as you see the decoys are better working better when they are tailored to the organization and finally remember that the end goal is not deception it's detection so it doesn't matter or even canaries the end goal is to get detection and by getting high rate of detection is about combining different types of detection mechanisms so our friend Newman he had it half right it's not about he who controls the mail controls information it's about he who controls information and he knows how to employ it and how to use it and he will truly be master of your domain thank you any questions thank you for that presentation that was very informative the question that I have is when trying to do this in a large enterprise speak up when trying to do this in a large enterprise what's the thought process around how realistic and how wide to deploy that deception layer because that could get pretty expensive so when you do it in a large enterprise it's really important to understand what are the key assets that are in the organization where you want to put some high interactive decoys to be filled with a lot of data which takes a lot of time to prepare and how to deploy and where you want to put some low interactive decoys that will just you know be there in order to in order to be a general detection mechanism for those guys who are just spraying spraying around so the low interactivity of decoys the deployment is really easy and when you get to high interactivity you get deployments very hard so you have to make a balance between the high interactivity and the ease of deployment regarding to traps some of the traps can be easily deployed and can be very generic but some of them if you have some specific asset or specific data on some assets then really you can try to specific tailor specific traps in specific location on your network so it's basically a balance between the ease of deployment and the ease of the interactivity level and the believability of that deception solution Any other questions? Okay Thank you very much Thank you very much and we had we are very very lucky to have a very very good friend of ours and also a legendary speaker Jay you've given talks all around the world and you've also given trainings at Black Hat did you train this year at Black Hat? and some people have actually asked why do we have Black Hat we have Black Hat speakers why are they speaking at two times because one thing we're very mindful of is not everyone has the opportunity to go to Black Hat and you know it's nice that you can come over here and see the content as well so that's something that we're very mindful because there's a huge significant cost to go to Black Hat and it is not it is our pleasure it is our pleasure and without much ado this man needs no introduction Jay Beal Thank you thank you I love that free applause you get before you even speak years ago I created a hardening tool called Bastille Linux so you'll pardon the name of this talk the focus of this talk is SELinux I basically want to give you I want to give you an awareness and understanding of SELinux that you could actually use that you can go home with and start playing with things right now if any of you have a laptop and want to crack it open CentOS or Fedora or something that came with SELinux by default is really useful if you don't I totally understand they are videoing this talk and the slides are going to be up on InGuardian's website later on so let's start just who's done anything with SELinux besides gone with set and force zero who's done anything with SELinux besides turn it off okay who's turned it off who's lying thank you okay the liars are here so what I'm going to do is in my experience most people with SELinux they either never run into it they never realize it's there because the configuration the default config is so good that it's just on it's helping them and they don't realize it or alternatively some set of people run into the first pitfall where something doesn't quite work the way they hoped and they say ah I'll just turn the whole damn thing off and I'll get back to this later and later ends up being 2-3 years sometimes when they were compromised and wishing they turned it back on I'll give a shout out to the SELinux people they have worked very hard on making SELinux something that's much much easier for all of us to use and I think you're going to get that out of this talk so what does SELinux basically do you have discretionary access control there's some theory in here there's discretionary access control that's the normal unixy thingy where people set file permissions and files are inherently all readable by everybody unless you choose otherwise lots of us have had that experience of realizing that we can see and sometimes write to files in the system that don't belong to us and sometimes that's what got us into hacker conferences so SELinux adds what's called mandatory access control there are a bunch of things that do this including app armor and tomoyo and smack SELinux is certainly the one that seems to provide the most comprehensive controls but it also means it's got the steepest learning curve so here's how the I'm going to talk about how it works we'll get into like playing with it I've got a couple videos that are inherently here to defeat the demo gods and we'll hope that that works or I know that'll work because that's why we do it so discretionary access control every single decision about access control that happens on a linux system is first going to run into the normal unix stuff that's been with us for you know 20 plus years so linux file permissions file ACLs root capabilities all that stuff if and only if the DAC permits that even if only if the DAC permits that access SELinux gets a shot the first thing it does is it checks out it's access vector cache and the reason I'm telling you about that word is you see that a lot in the logs AVC and if the answer isn't in the AVC it goes and looks at the policy and that policy stored on disk it's really big it takes a little while to look up and that's why everything gets aggressively cached so to make things really simple SELinux's most popular policy is the targeted policy it confines only some of the systems so it confines the programs a lot of the programs started on boot generally everything listening to the network and then some privileged programs like set UID programs so it's not trying to confine everything perfectly SELinux can do that but the targeted config doesn't try and for really good reason it gets really annoying so basically just like with the rest of hardening this is a bang for your buck what are the where's the highest risk and how can I address that risk at the lowest cost and I'm constantly trying to and anybody who's designing a system like this and when you're playing with a system like this that's the trade off you're trying to make so the user processes by default aren't targeted that means that all the users run in unconfined mode and we're going to talk about that in a little bit SELinux SELinux actually enables three different types of mandatory access controls type enforcement or TE and then also RBAC and MLS the targeted policy is all about type enforcement you can do the other two but that's not on by default and I don't really recommend you get into it unless you're doing specific things like building kiosks or other systems that are going to have a lot of users on them that aren't very trusted or what have you if you're most Linux servers you don't even want to touch that for now if you're ready to touch RBAC if you're ready to touch roles and users on this then you're done then skip past the rest of this talk on YouTube or wherever we're watching it and just find your next talk okay so SELinux a few quick commands you can use get enforce to find out whether the thing is on you can use set enforce to turn enforcing on and off and you can use SELinux status to see basically what mode you're in and some other information like what policies in place if you're going to change things from enforcing to anything else so people basically go with enforcing permissive disabled never ever ever ever please please god forbid please don't use disabled okay you've got enforcing that makes it work you've got permissive that lets it go and gather all the data that will be useful when you do want to use it later it'll tell you all the things that it would have blocked if you'd let it and having all those logs makes it a lot easier to profile your system right so you know it in we have we have work we do where we're like okay we're going to we want to make a really good outbound firewall for a client what we might need is a year of flow data do you have flow data and they say no it's like you want to say okay come back to us in a year you can you can generally be smarter than that but in this kind of situation what I want to do is say instead of I turned it off I have no data I want to say I told it not to block anything and I kept all the logs for a year or for six months or three months or however much time it takes you to get the data you need and then the other variable here is targeted so at its core SELinux basically does this it labels processes and files with security context okay so it has a policy that says how those things are all allowed to interact the parsing is default deny but that would result in lots of denies and so as a result you end up with lots of types that are called unconfined or that are classified as unconfined which means they can kind of do anything most of the time so a label breaks down into a user a role a level and a type the only one that really gets used much is going to be that type so you'll see let's see I'm not going to step out of the camera they've reminded me don't step out of the light if I can if I'm not being blinded then something's wrong I'm not going to be on camera okay so this could be the best recording they've had all day I've been promised if I just don't step out of the light that sounds like some kind of you know end of life thing okay so go into the light go into the light God good we need some humor in here this this gets a little this gets a little dry right so you've got system you've got object and you've got a type on here and you've got level and container and so on and the only one you're going to pay attention to is this thing that ends in T now this is the great thing I really like the idea I like I'm imagining that you're all drunk maybe 80% of you are drunk since this is DEF CON could you raise your hand if you're currently under the influence whoa we might need to pass this around okay so so well then my job's a little bit tougher I was just going to say like okay let's do this let's imagine that you're drunk and so you can just barely focus on anything and the thing I want you to focus on is anything in that line that ends in an underscore T all you care about are underscore T's okay so I have taken every single every single thing I was going to do on the command line and either made it part of the slide or made it into a video so you're going to watch me flipping slides here and we'll talk about it so I can run basically SELinux adds a capital Z to a bunch of commands so instead of running PS minus EF you go PS minus EF with a capital Z and it tells you about all the SELinux stuff and you're like wait I've been running on Red Hat for you know so many years and I never even knew this stuff was here and that's mostly the goal of the people who are writing the policies but you do that Z and you start seeing okay you've got this program of ahi daemon it's got it's own type called of ahi T you've got an SSH daemon it's got a type called SSHD SSHT all of these types are basically how it gets labeled okay SELinux has users we're not going to talk about that because at the end of the day basically the way the users get mapped this is a little bit harder to see on my copy of the slide so I'm going to turn toward the screen anybody who logs in by default is going to be unconfined and then you've got the system user which is system you and that's it you can there are like eight more users that come with the policy there are rules for them and until you get some experience don't touch those again that's really really good for the kiosks and for the public use systems there are also roles and in practice there are only two roles that get used the system role and the unconfined role if you want to learn more about roles look at the documentation so we're all about types types and domains are the same thing if you hear the word domain just think of it as a type if you hear the word type think of that as a type if you want to think of it as a domain that'd be fine too whole idea of the domains is to basically say we'll take all the programs on the system we'll lock them each in their own little jails we'll define what that jail is when you use SELinux as opposed to normal unix what do you see well if you were the apache demon there are a bunch of files that are labeled on the system as ones that either are that are ones that you're allowed to see and the ones that anything else on the system that's not labeled for you to see you can't look at you can't read you can't nothing what does that mean why is that useful well it means if an attacker compromises like breaks in through your web server or whatever but they break in through your web server they can read the web servers config files they can look at the content was there if things are labeled as such they could modify it but sometimes you even set the permissions sometimes you even set these rules so that somebody can't somebody takes over the web server can't actually modify the content so just a quick count it's all about types there are 8 users 14 roles and 4622 types it's all about the types by default the users processes run as this unconfined type and unconfined is just an arbitrary name there are other types that are unconfined and we can run seinfo and ask it hey tell me which domains are unconfined and get a list we look at the first 5 we find there are 89 unconfined types there so you can even take something and just add it to unconfined we'll talk about that a little bit later now with that said we've said the users the users processes all are unconfined right except it turns out selinux has this thing called transitions and if you run a program that has an automatic transition you go into a new type you started out on a unconfined and you end up in the password type you end up in a type that's just for when you run the password program to change your own password so the example here is basically I'm running the password program and then I paused and in another window I've looked and run ps and looked at my password program and normally this would run with my user except it's setuid so it runs with root's user and normally it would run with my unconfined type but now it's running with a password type and that's that's the big that's how selinux goes and confines setuid programs and anything else so you can basically say listen I got all these users they're unconfined all the time but whenever they touch this program they're getting a lot of privilege maybe that lots of privilege is the ability to write to web server files or to write to somewhere they shouldn't normally be able to write to or whatever maybe it's the part where they run this program they're able to talk to the network and so you can then say hey I'm gonna make it so that I'm sticking so that I'm sticking you in a box you can do anything the hell you want but when you run this program I know what that program does I know what files or what have you it needs access to I'll confine it and you're confined just for that so that type transition this is the big control around setuid programs if you've been in my class you know like one of the things we talk about is setuid is the biggest internal privilege escalation risk an attacker you find some setuid program that's got a vulnerability in it you use the vulnerability and this program now instead of just you know letting you change your password lets you have a shell on the system running as root and thus do anything the hell you want unless you're in an SELinux situation or AppArm or one of the other mandatory access controls where now you're getting stuck and confined okay so y'all having fun this stuff can be dry but it can also be very useful I see a few of you starting to you know take a swig out of a little bottle that does help I promise but okay okay let's see so SELinux the type transitions you basically spell out we're gonna look at what happens when you run password the password has three types that it deals with I wanna step out of the light and point to the and point to the screen and I'm not gonna do it I'm not gonna do it this is gonna be a great recording I mean you might wanna mute it if this is boring but at least I'm gonna be like I'm gonna be the one who stayed in the light I'm so happy about it okay so I've got I'm trying to see but my I've been blinded by the light where's our song blinded by the light okay don't drink Jay you sing and it's bad okay so password T so password lets you edit the shadow file shadow T is the shadow file and then password exec T is what you label the password program as so in order for you to have this transition thing happen if you wanted to write your own transition you do it like this so unconfined T what your user was running as already has to be able to run the password program so it has to have execute on the password exec T type and unconfined T has to be allowed to transition into password T that thing we're gonna be when we can write to the password file and password exec T has to be defined as an entry point as a way in to password T and so what you end up with is these your rules and those rules best basically do with that diagram just did and they add one more thing which is this first line so those those last three were all the allows and then that first line basically specifies that it has to happen whether people like it or not so specifies the transition and makes it automatic it's not just something you can request it something that happens whether you like it or not so there are a lot of these transitions there are there are more than 12,000 of them in the Red Hat 7 policy so yeah this is pretty integral to the way the system works so I'm gonna go into an example now and what I want to show you how to do is the main thing you're gonna find yourself doing on SELinux systems so there are basically three things the one is that something's gonna go wrong you're gonna move a file to another place you're gonna need your web server you're gonna move the web server space where it keeps all the files you're gonna want it you're gonna need to know what you do so that the web server can now see this other directory okay so that's the one the next one is you're gonna flip booleans because you're gonna think of something the system needs to do and the folks who maintain the policies have already thought of that they've created a nice little on off switch and that's your basically second most common thing and then the third most common which is pretty rare is when you actually add a new program that's nothing like the others and you have to add new types okay so let's look at this first just starting with bind so we've got bind and we've got bind and we look at just the files for name D for the bind DNS server what we find is remember we don't look at the U we don't look at the R just razor focus on the T's and I've tried to make it simple by making there are only three types here so I've taken those three types and put them in red and I even got it right so the name D configuration file is of type name D conf T okay and you've got name D cache T that's going to be for anything that is going to be primarily for the things that name D is changing so that'll be where it's keeping its file caching data where it and then you have name D zone T which in general is stuff that you don't change now if you need bind to be able to maintain its own zone files there's a boolean for that and we'll get to that later so let's look at what bind what bind D runs as so or what name D runs as name D runs as name D T so name D T name D T is what name D runs as that's basically the name of bind or name D's jail it's domain is called name D T and the binary itself is labeled as name D exec T and that differentiates between like hey who's allowed to run name D exec T once they run it the system transitions we have a transition into name D T so the name D T type can read the configuration file can write to files okay so you can if you want to this is one of the most useful tools in SE Linux honestly if you want to understand how the policy is working is SE search you fire up SE search you do a minus minus allow or minus capital A and say what source domain are you looking for and what target domain are you looking for and you'll see the rules that basically say name D T is allowed to do this and name D T is allowed to do that so what I want to do is do an example real quick and this is where I'm going to switch over to a video the bottom of the slide says let's change the label on name D dot conf from what it is right now from the name D conf type over to the same one that's used for roots home directory so I'm going to switch over and do our first video let's do full screen on that so I change it and I'm going to try to start name D and I'm going to get an error name D won't start for me and I'll just change it back in this case now we're going to deal with the same problem where we actually change the configuration so I change it back and I can start it now and it started just fine so so this is the slide where we do that and we changed it back and we're able to start name D so I'm going to talk to you now about basically how we're creating new modules so instead of just changing it back we can actually change the configuration of the system that chacon the reason I also showed you that is that chacon is like chmod and chgroup and chown it's basically change file context if you want to change a file's context at least until the next reboot you do it that way I'll show you how to make it permanent later on so the SELinux policy is made up of modules there are 393 of them to start on Red Hat 7 you end up with more over time the modules are just the way they've broken up the policy they could make the policies one big monolithic thing and to be honest it gets compiled into one big monolithic thing but we're going to create a new module we'll activate it we'll deactivate it by having it modular we're able to turn stuff off so let's look and see how we can make a new module so we saw this log message about how name D had a problem and so we can just basically look at the audit log where the SELinux errors are getting written it's one of the places and we can pipe it into a program this is going to be one of your favorite programs if you play with SELinux called audit to allow and it basically says I can turn entries in the audit log into allow rules that you can then load you don't have to even learn the rule language it's not that complicated to learn it but you don't have to learn it for most anything so what we're going to do is we're going to run audit to allow or to create a new module called something like name D admin home that'll be a I'll show you the rule that that generates we'll insert that module into our running policy and then we'll have one more and then stuff's going to work so let's look at that video all SELinux work should have a driving base beat behind it like this okay so here we go we've got roots home directory is admin home T so we're going to change Etsy name D dot com to have that same type now we're going to try to start name D it's going to fail we're going to look for log messages in audit dot log and we're not even going to look at them in this case we're just going to pipe them straight to audit to allow and we're going to tell audit to allow that we'd like it to make a new module called name D can read admin home T you could just call this Joe if you wanted to and it says hey here's how you put this in so we're going to look at it it creates two files basically there's a TE file there's a PP file the TE file basically is our I'm going to pause right here the TE file has two basic important lines so it has a bunch of like hey you need to make sure these types are defined and as long as they're defined I'm skipping the other lines so I end up with two new rules and the second of these rules is the one that we were aiming for audit to allow caught another issue too but this second rule says allow name T to read files that are labeled with admin home T okay cool it's just one simple thing so okay I've highlighted it so I'm going to insert that module SE module the same thing it asked me to do it's that simple we can do it while intoxicated I don't recommend admitting systems while intoxicated but it does sometimes make it fun um you have to wait while that module gets while the whole darn policy file gets recompiled so it takes about five six seconds on this laptop that's got a that has an SSD um so I try to start name D and it still won't start something else has gone wrong so I'm just going to go and say oh screw it let's cat that auto log again let's create a new file create a second module insert that module wait wait our obligatory five seconds maybe six come on okay it's done man computers have gotten so fast we don't like wait for anything that long anymore unless we're on a raspberry pi or any other IOT system on a chip 8 megahertz thing that's still faster than my first computer so we can run that now we can start name D successfully everything's great so that's that's honestly the thing you end up doing the most in SELinux there are a few other things we can do though so we used chacon before to to relabel a directory so that name D could read it if we wanted to if we want to make that permanent what we end up doing is using SEManage SEManage file context I'm going to minus a for basically add a type name D zone type to all of these to this directory and then to anything under it you'll notice this is regular expressions if you're a unix admin or a windows admin for that matter or heck if you're at this conference you don't know regular expressions yet find five or ten pages from a good book read that and you will gain like another what's it called little loop on your karate belt a stripe there you go stripe on your karate belt it's pretty worth it okay I told you that you've got these Booleans and if you run SEManage Boolean minus L you'll see all the Booleans in the system there are a whole bunch of them if you look at name D it's going to tell you there are two different Booleans if you were to make it so that your name D server is going to start like say signing your zones for DNSSEC or otherwise is going to need to write to the zone files maybe it's a slave DNS server then what you could end up doing is basically just changing one Boolean that name D write master zones and that's something that the people writing SELinux policies have done that let their policies be as tight as possible while not breaking things if you're in a different configuration so the way I think about it whenever you're hardening a system is you're customizing that system from the general purpose that the operating system was shipped as to now being really specific to what you want sometimes that's stripping out code sometimes that's just flipping Booleans in an SELinux config file one way or another that's what you're doing and so I love that SELinux has these kind of nice on off switches and you can use getCBool to see what the status is of one you can use setCBool to change it if you change it and things are working you set it persistently with another flag with that minus P flag here's one more thing that I haven't mentioned in terms of what you'd be doing when you're creating new files if you move the port on something SELinux will usually break will usually break what you're doing and that's good and that's also really really impressive so as an attacker by day that's really what I get to do most of all I only get to play with this stuff kind of as a very very very tiny part of my work as an attacker by day what I find is you compromise a computer that usually means you compromise a program so you're in the running execution of that program and whatever the rules are in that program those are the ones that are confining you you're hoping to just get a root program or a program running a system or what have you and be able to do whatever you want but when you have a mandatory access control layer in if that mandatory access control layer is like this and says ah you can bind to port 53 and to no other port well that's really a pain in the ass as an attacker what I want to be able to do is I want to be able to create arbitrary connections out I want to be able to allow arbitrary connections in and bind other ports so SELinux doesn't do that and this is one of the things I this is one thing I like about it over app armor and that is that you can basically say hey this is port 53 was your port okay that's the only port you can listen on and you can actually specify all the different behaviors on in terms of its in terms of what ports it's allowed to listen on and talk to so you can go and change it if we if you add 54 in you basically run one command se manage my port definition I'm going to take the DNS port T definition and say ah that's not just port 53 now now it's 54 too okay just a couple more slides so se manage permissive I can set so I told you I told you never to turn it off always put SELinux in permissive mode so it should either be in permissive or enforcing I'm going to tell you next that what I really recommend you do is you always leave SELinux in enforcing mode but if it's getting to be a pain in your butt and you're thinking about turning it off or turning it into permissive mode then go and take the one program that's getting in your way the one program that you're trying to get work that isn't working right now and basically say okay it's type in this case the name DT type if you can't figure out how to make things work right now and you want to come back to this later go and take the entire name D type and just say that's in permissive mode but the rest isn't now I know some of the purists right now are like you know are like oh my god he's turning things off he's the security guy he's not supposed to turn things off he's the blue team what the hell and what I'm going to say is this I've spent enough time where it's where what I've learned is if the configuration is too tight or the tools are too hard to use people will often go all or nothing so they'll go from it's going to be super super tight wait that didn't work okay we're throwing it entirely out and sometimes that throw it entirely out isn't really their decision it's their boss who says listen you know listen you can't make this work screw it you know we're turning it off we'll look at it again in a year so what I like to do is then say okay let's find the damn middle ground if you have to take one program turn it into permissive and spend your time profiling that and figuring out when you're able to get it back into that fully locked down mode that also means that even while you're stuck trying to figure out how to make that thing work or you're in a delay loop or you have to wait a year to build trust again cool for that year you have the rest of SELinux and I think that's a really good idea it may sound like I'm trying to sell SELinux here but it's free and it's on all your systems and you can you know play with it really easily so I just think it's a really I think it's a really great technology but most of us don't ever touch it just for lack of this kind of one hour or 45 minutes of introduction so yeah that's mostly it I've got a quick SELinux is logging to audit to the audit log the way you saw and if audit D isn't running then it doesn't log to the audit log yet it just logs to var log messages but there's also a program on Red Hat on my Red Hat system that's now shipping by default which is SE Troubleshoot D and it'll tell you how to get more data and it'll give you with SE Alert it'll give you kind of more it'll give you an explanation that's a little bit easier to read and I like that a lot lastly I just want to mention there's some SELinux alternatives if what you saw here was holy holy bejesus I never want to play with this this is this is not going to work in my environment it's too complicated I'm you know maybe I'm you know one of the new funky DevOps kids and you know we're not going to do it I don't know whatever but it's whatever your reason is there's some other alternatives the only the there there are three big ones one is app armor which is what ships on Ubuntu by default and SUSE Linux you've got Tomoyo and smack and smack I know actually a bunch of us are running we don't know it it's on the philips smart TVs the only one of these three that I've played with a lot is app armor and I think app armor is really really neat so SELinux can give you better assurance it can give you a heck of a lot more control control it's a little bit but the difference between between SELinux and app armor is almost like the difference between driving a stick shift car and automatic some of us want the control of sticks so that every single time we're like going from stopping to starting we're exactly engaging we're exactly deciding when the clutch engages and when we get that nice powerful you know push forward right but some of us just want the car to freaking go app armor is not quite just go but it is really really fast and easy to write a profile with and I enjoy that a lot so I'm going to I'll make my make my push for app armor if you thought SELinux was too much I could teach you I know this from teaching my classes I could teach you how to sit down and confine a root shell to something that can do say three things in under ten minutes so that should speak to the ease of creating app armor profiles the downside is that app armor basically confines root capabilities and file access you're not going to get the same kind of among other things you're not going to get the same kind of program can't talk to them can't talk to the network or sorry more to the point program can only talk to these ports in these ways so so that's the deal anyway I hope this was fun it's 1.43 I think this is one of the first talks I've ever finished early we're seven minutes early so what would you like would you like to ask me questions should I do some kind of dance on the stage that hopefully won't be caught on camera dance dance any wait wait there's a question on SELinux before we dance maybe I can stall okay if the boss says if you turn SELinux on you're fired you stand your ground you are going to serve your organization best by being an example yeah the guy who got fired no no no so so so my thought is if the boss says you're going to get fired like have a conversation realize you're going to have a conversation so I have a talk tomorrow on phishing that's a lot more human than the SELinux stuff it's a lot more talking actually about communication and negotiation and collaborating with your client with the other people at work and trying to have the situations where you think that your two choices are either to piss off the other party you know whether that's your client or your co-worker or your boss or to instead you know give in and have the and basically create a solution that's bad go talk what's that plan six months ahead I have no idea what you're saying but I'm going to take the next question what was that I do a lot of pentesting for the day job have I ever configured anybody in pentesting configure SELinux on the system and totally fuck it up does fuck it up mean make the system not work or make my attacks work more easily either I don't think so no I mean honestly if I end up if I'm in a pentest and I end up compromising an SELinux system compromised if I my goal is to be a user where I've got that unconfined if I end up in a confined process I'm pretty screwed and it's time to find another time to find another way in another machine there's a legend that it's impossible to configure SELinux unless they're superhuman so I will say that you can I've shown you how to do some configuration here and a lot of that relies on the types that are already on the system you can go and create your own types and that's what you'd have to do for a whole brand new program and that is a bit more of a pain in the butt especially if you don't know what the program does to start the nice thing is that the people who've been creating SELinux profiles for all of us have been doing it for like ten odd years and so the profiles have gotten really good and so we tend to only have to tweak them if you do have to create one, it is not impossible you don't have to be a god but you do have to have some time on your hands and that's what I'll say there are also some really really good books out there I'll also tell you that a lot more of you are running SELinux than realize it the most recent version or two of Android has got SELinux on it and it's enforcing so there was another question back right service I'm going to ask you to repeat the question it was basically, it was Linux containers Yeah, we've got a pretty complicated situation as soon as you're talking about as soon as you're talking about a program That's in a container that has a profile on the outer host That is trying to the outer host profile isn't so bad because the program in the container Is almost always trying to wait is that is that that waving hand back there an answer to the question? Oh, we have a really good answer. We'll get your butt up here. Oh That's a really good question, but we're not gonna do that right now So so the container thing so the container question Yeah, as soon as you're in a container you end up in a different type anyway And usually the containers basically say I've got all the things that are in the container they're all gonna be labeled the type that the programs that are contained can read and The bind mounted stuff ends up being a whole different thing So no, I don't have don't have a good answer, but I will get you a good answer and and God if it's really simple And you're watching this and you know you're smacking your head and saying Beale what the hell I I apologize I owe you drink if you can come up with an answer that fast And I'll make sure the next time I get this question. I'm better prepared. Thank you Okay, we got two minutes left. We talked about the the other question back There was what if you want to use tomoyo, and you don't speak Japanese yet well Obviously as hackers. I mean I've watched enough anime to know that as hackers we all speak Japanese like like out of the womb I mean at least You do if you're cool, right? I? mean You speak Japanese right he does he does he won't admit it okay any other questions Cool cool. Oh dance is anybody want to come up here and dance with me. I'm stepping out of the light I'm hoping that camera can't be moved. Oh, oh no that cameras panning Okay, if you want to see me dance then then you have to come to To want whatever the biggest parties are that where Keith Meyers is playing if Keith Meyers is playing there And I'm dancing. I'll be dancing there, so I don't know if there's not really great music for this Let's see what I can do That's my that's my drunken frat boy dance