start	end	text
0	7860	Good morning, party track. How are we doing? Yeah! All right. How many people here came
7860	13900	to hear about home alarm systems? All right. You're not going to hear about home alarm
13900	27240	systems. Oh, sorry. The speaker had a small problem with his employer. So that talk is
27240	31880	not going to happen. But I can guess and I'll summarize it even though I haven't read the
31880	43790	talk. Your home alarm system is kind of fucked. All right. So with that out of the way, let's
43790	48190	figure out a bonus talk then, right? So this is my good friend Zach. We go back a long
48190	53630	way. And he's going to give you the most entertaining and exciting talk about logs that you're going
53630	59490	to see all day. So let's give Zach a big party track welcome.
65880	71920	It's the most exciting one because there's no other one. So before we get started, as
71920	77720	Juris was saying, this is Logan. Everyone say hi, Logan. He was the one who was originally
77720	82800	supposed to speak at this slot about the insecurities in home alarm systems. And you may have seen
82920	89360	a few articles, you know, hit up on a few different sites about his talk. But last week this
89360	96060	article came out and it sounds like he had to cancel. Ergo why I'm here. More recently NPR
96060	99860	actually did an article. They actually got time with him. I pinged him a few times to see if
99860	104800	he wanted to actually share some information that he could share. But didn't respond. So I
104800	108380	just want to post this NPR article real quick because that summarizes pretty much what
108380	117160	happened. He was supposed to be on stage but because of the pressures put on him he can't. So
117160	129160	I'm just going to leave those names up there for a second. And we're moving on. So in honor
129160	133440	of Logan, because he couldn't make it, I decided to start our new meme. Ridiculously good
133440	142630	looking researcher. Has to pull talks, still impresses us all with his smile. So I'm going to
143070	147110	give you a talk. And this is your top gear, top tip. If you're going to do this and get your
147110	154410	talk pulled, pro tip number one, follow responsible disclosure if you're feeling nice. Tip
154410	158430	number two, don't name the vendor in a press release unless your goal is to get your talk
158430	166110	pulled. And if you're going to give the talk and you're worried about legal action, go ahead
166110	173370	and up a skate. And make sure you sell the job. So top gear, top tip, if you're going to do
173370	177770	what Logan did for the future, for those of you who may be considering, I don't know, doing
177770	182290	his talk or a similar talk in a future venue, you might want to follow that. So instead you
182290	201360	get me logging by Zach. This is party track, isn't it? Good. So I always like to start the
201360	204640	talks off with what this talk is and what this talk is not so you don't have to spend the
204640	210020	next 45 minutes listening to me ramble. So first and foremost, this is going to be a
210020	213960	defense focused talk. So if you're looking for some sexy Oday, you're not going to find it
213960	219780	here. We're going to be talking about collecting, storing, monitoring, parsing, having fun
220220	224760	with logs. And we're going to try to make it fun. And the big reason I'm giving this is
224760	228940	because it's a reoccurring problem we keep having over and over and over. We're not
228940	232960	getting good logging systems put together. We're not getting good logging data in most
232960	237660	situations. Sure, you may be the 1% here who's like, yeah, I got this shit covered. This
237660	244900	talk is not for you. And if you know what ELK stands for and you are an ELK rock star, you
244900	248780	may want to go get a few minutes elsewhere. But this is going to be probably a 200, 300 level
248780	256200	talk on logging and big logging environments. So as I said, this is not a talk about hacking
256200	261600	your alarm systems and the wireless problems with them. This is not an offensive security
261600	265520	talk and I'm not going to be addressing challenges of dealing with over 200 gigs of log
265520	273100	data a day. That's going to be a whole different barrel of monkeys to deal with. So who am I?
273100	278520	My name is Zach, as we've already covered. I'm a magic partner over at Urbane. I hail from
278520	284900	Chicago. I do things and stuff. And everyone has their big slide of credentials. This is
284900	294950	mine. Moving on. So let's face it, you know, offensive talks can get up here and ramble
294950	300510	about the cool hotness for a full hour about how awesome things are. But really, we're not
300510	304490	going to use a lot of that stuff. Yeah, it's cool to hear about, you know, the insecurities
304490	307850	and this and that. But when we come back to our day jobs back at home, we've actually got to
307850	314710	deal with protecting stuff. So the vast majority of us actually need more defensive talks. I
314710	317490	figured I would take and make it my initiative to start looking a little more on the
317490	323370	defensive side. So let's start with logging. I'm going to say it with an Irish or Boston
323370	328130	accent. I don't know. So we still have a logging problem. We're still relying on log data
328130	333610	and log formats that are archaic. And we've seen, you know, from me and my consulting role
333610	337450	and from a lot of other people, we've seen that, you know, the tech community has this
337450	342050	figured out, but not from a security perspective. Their focus has been on, you know, we
342050	347570	want to know if there's errors. We want to know what user habits are. But InfoSec hasn't
347570	351270	really figured it out. I don't know if it's because we're lazy or because we haven't taken the
351270	357370	time to look at it, but I figured let's dive into it a little bit more. So kind of what we're
357370	360310	going to cover today, we're not going to talk about generating logs, because that's easy. I
360310	364250	could give you a configuration file and we could call it a day. I'm not going to fill 45
364250	367490	minutes of explaining a config file. It will put you all to sleep, even if there's music
367490	372150	here at party track. We're going to talk more about the collecting logs. We're going to talk
372150	377590	about storing, processing, and most importantly, the actual monitoring and security
377590	384750	events for logs. Here's the obligatory why do we need logs, because, oh, I'm just storing
384750	390810	them. It goes beyond just security. You know, we need it just from a management perspective
390810	395950	to convince our bosses that we're doing what we're doing and we're doing it right. A lot of
395950	405550	times we have to deal with this compliance stuff. Full disclosure, I'm a QSA now and I cannot
405550	414150	say anything about it. So it's not out of choice. So long story short, yeah, compliance is
414150	418350	going to be a driving force a lot of times for stuff. And we can use that also from a security
418350	423210	point of view of going, hey, I've got to meet this ISO, PCI, HIPAA, whatever it may be,
423210	427290	whatever you have to deal with. We can use that to say, hey, I need a little money, I need a
427290	432950	little time to actually do the cool security stuff I want to do. We need it from the
433530	437190	security perspective, duh. For instance, response, duh. And from a technical operation
437190	440830	side, as I said, DevOps has this figured out. They've got to figure it out from, you know, we
440830	446490	need this from an operational side. But they don't really share that information sometimes,
446490	450450	or we don't have a DevOps kind of thing. And I'm using DevOps loosely, if people don't know
450450	453970	what it is, it's the whole integration of developers with operational people and being one
453970	460510	big happy family. And let's be honest about our current state of logs. Most stuff just kind of
460510	464850	sits there or gets deleted. You know, we have our log rotate set for 90 days because we have
464850	469510	to for compliance reasons, and it's getting deleted. Or we're sending it to some product
469510	474470	that's magically this pretty little box or pretty little VM or pretty little software, and
474470	477950	we're storing it, and when, you know, we're having people come in to troubleshoot something
477950	485030	or having an auditor or assessor come in, we're showing it to them. But honestly, let's be
485030	487790	honest with ourselves and confess right now, we're not really watching them as much as we
487790	490870	should in most cases. You know, we set it up because we thought we were doing the right
490870	495670	thing, but we don't actually watch them. And I think a lot of that comes from the usual
495670	500250	approach of watching logs. As you can tell, by the way, I love the TV show Archer. So all
500250	505770	these images that don't have attribution, you can take them. But so the traditional
505770	511830	approach of using a sys log server and using regex and sending alerts if it hits a
511830	516470	certain thing, it doesn't really scale well. We can take and set up for multiple systems
516470	520490	and back up, but it really defeats the purpose of being able to search and actually leverage
520490	525930	those. And again, as I said, we can leverage a vendor product. A lot of good vendors, I
525930	533030	won't name names here. You can. But a lot of them have great products out there, but they are
533470	539750	expensive as shit. And the whole model is to do it as a volume based licensing. You want to
539750	544850	log more, it's going to cost you more. But I'm hosting my own data. It's going to cost you
544850	548710	more. And yeah, it makes sense from a business standpoint and it makes sense from a scale
548710	553830	standpoint, but it can get very expensive quickly. I was talking to a friend the other day
553830	560630	and they had a $2 million IT budget for all their operational expenses. They had a large
560630	569090	vendor, we'll call them a flog him him. And they wanted $400,000 to do the logging for their
569090	576670	environment. I mean, that's almost 25% of their year's budget just to do logs? I mean, we
576670	582390	can use our money a little bit more wisely. And I'm not saying, you know, vendors are a
582390	586970	bad thing. If you work for a vendor, a lot of you probably do, I'm not saying, oh, don't go
586970	591390	buy the big guy's data. It's great a lot of times. If you have the financial resources, they
591390	598090	are definitely great. And they also offer, most importantly, the idea of not having to have
598090	601910	the technical talent to manage them. You can hire the guy who just graduated from college,
601910	606990	say here, have fun with this product and they'll figure it out. But we can be a little bit
606990	611470	smarter since we're people who actually like to tinker with things, break things and do
611470	617410	things right. So I've been on this journey to find open source solutions and to actually
618250	622370	help share the open source solutions that are out there and how to configure them. So I
622370	627130	looked for this scalable logging solution that's, you know, open source so we can tinker
627130	630970	with them, we don't have to pay license fees. It's reliable, scalable, secure. And the
630970	635450	reliable and scalable is really important when it comes to your logs. And meets the
635450	640630	compliance requirements stuff that you have to follow. And here are our top three winners.
641110	645410	We've got Logstash, Elasticsearch and Kibana, which is what I'll be talking about today, also
645410	650550	known as Elk. As a runner up we have Fluentd, which leverages Elasticsearch. They're a great
650550	654050	product or a great solution. I don't want to call them a product because they don't really
654050	660770	sell it. And then there's Greylog2 as well. Now as you can tell, Logstash and Greylog are
660770	667150	Java based. I know, boo, hiss, Java, so memory consumption, but they work. And then
667150	673570	Fluentd is CRuby based, so Ruby. So as I said, we'll be focusing on Logstash, kind of going
673570	678950	through what is this Logstash, Elasticsearch, Kibana stuff, and how do we get events,
678950	683670	process them, alert them, search them, and most importantly, impress that boss, because
683670	688450	that's what we're doing. And so that's the end of my talk. You should just go use it and
688450	698010	we're done. More or less my water break. So the biggest pains for logging as a lot of us have
698010	701990	faced is that we're getting a lot of log data from a bunch of different sources that come in
701990	707390	all these different formats and all these different timestamp formats and sometimes they're
707390	710030	this, sometimes they're that, and we've got to parse them, we've got to actually make sure we
710030	717090	have the accurate time for them. And so the Logstash processor actually tries to do that. So
717090	723910	this is a look as to how Logstash processes its data. So from a shipper perspective, that's
723910	728970	kind of your Syslog agents, your Logstash agents that are basically generating those logs
728970	733330	and sending it to a central source. You have a broker which basically queues everything up so
733330	738030	it can process it as fast as possible and distribute that job across. You have an indexer
738030	744430	that looks at it, does the analysis of what is this log, how do I parse it, how do I tag it,
744430	748450	and where do I ship it, and sends it off to search and storage, and then you've got the pretty
748450	751190	little web interface to actually monitor everything. This sounds kind of familiar to a lot
751190	756370	of other products out there. But the cool thing with Elasticsearch and with Logstash is that
756370	761290	you can scale it. So instead of just having one system, you know, you may be logging 10
761290	765730	gigs of data a day and then next week you've got to log 100. Obviously the whole title of
765730	770390	the talk is log all the things. You know, I'll start on the ramble about generating logs
770390	774810	later, but the more data we have, the more we can actually do actionable intelligence for
774810	780190	it. So to scale it up, all you have to do is take those little individual parts and split
780190	784570	them across more systems. So you can take and split the broker across multiple systems
784570	788610	to queue everything up and have a little more redundancy. You can take the Logstash
788610	793130	indexer and split it up across multiple systems to actually process those logs. And then
793130	798170	your Elasticsearch cluster obviously can grow as well for the storage and the searching. So
798170	803590	as I previously said, we're going to focus on really the aspects of collecting and
803590	807450	shipping logs, storing logs, processing, monitoring them, and searching them. And
807450	812170	obviously there's that generating log component as well. So first things first, the
812170	816130	biggest reason a lot of us don't generate the logs we need to is because we're using some
816130	821450	commercial product and paying based upon how much we generate. That doesn't really work
821450	825510	well for security and for monitoring because you're starting to get in the case of picking
825510	830490	and choosing before you get the intel. So my theory is we should build something that we
830490	834910	can collect all the logs we want and the only cost to us is more disk space and more
834910	844400	processing power, which is now relatively cheap compared to other things. So in order to
844400	849200	collect the logs, Logstash has the thing called inputs. And so we can use our traditional
849200	855840	syslog that everyone has fun and is familiar with, the archaic syslog of text. We can also
855840	860560	leverage Logstash's agent, Lumberjack, which is a thinner version that actually can do the
860560	865160	parsing of the data on the clients. And we can also do time queries as inputs, and I'll
865160	869600	touch on that in a second. So going through kind of the different systems you typically
869600	875500	have to face for your Linux, Unix and Mac logs, obviously you can leverage syslog agents
875500	881360	just as is and send that data to Logstash. Or you can also leverage the Logstash agent,
881360	884780	which is Java based. Now obviously you have to do that tradeoff of do I want to install
884780	894340	Java or do I want to just send it with syslog? Syslog. So it also supports TLS as well, so
894340	898160	for those of you who are like, oh, UDP, syslog, it will lose stuff, it's not encrypted. It
898160	903960	does support TCP and TLS. So the good old Windows logs that everyone has a hiccup on
903960	907100	and everyone is making their money off of because there's no good solution out there
907100	915340	for Windows logging agents. You're able to do it with obviously Windows Logstash agent.
915340	920500	Again, you'll be installing Java on systems. Or there are syslog agents that are available,
920500	926120	open source, free, and community editions of them online. So NX log is a great one that
926120	931320	basically takes whatever you're sending in, files, or Windows event logs, sends it off to
931320	936580	syslog. And same thing for Snare's open source edition. Now both of these agents, NX log
936580	941160	and Snare have commercial versions, so before you go, Zach, they have a paid version. They
941160	946160	also have an open source community edition. It just doesn't have as much pretties. And
946160	948900	then obviously the third option for those of you who are banging your head about Windows
948900	953100	logs and how do you deploy this across your environment is to just use Windows built in
953100	957420	event collector. Using Windows event collector and one Windows system to kind of collect
957420	962040	all those logs, use that central event collector system to parse the logs and then ship them
962040	966520	off over syslog. That way you can easily deploy it with a group policy and not have to worry
966520	973620	about installing software on all your production systems. And then obviously the device logs,
973620	978560	your network devices, your storage devices, your traditional syslog works well, but what's
978560	982800	one of the cool things about log stash is it also offers SNMP traps as well. So you're
982800	987120	able to just send SNMP traps to it and it's able to parse that and push it into the logging
987120	992700	complex. You can also send raw socket data and it will be able to parse whatever it has
992700	998660	coming in. And then able to make exec calls, which I'll touch on in a second. But most
998660	1003060	importantly, a lot of times we focus on just the operating system logs and the application
1003060	1007620	logs get fed into the syslog complex. But one of the biggest things we miss is these
1007620	1014120	application logs. So we need to log more than just the defaults, hey, I requested this
1014120	1021720	page, moving on. Leveraging web app logs and integrating into the web app code with your
1021720	1025580	development team to generate, hey, I saw a password change, this seems weird, oh, we just
1025580	1030340	got a bunch of sessions that didn't exist, send something into the main logging complex. It
1030340	1034120	creates a single source for you and the rest of the security teams out there to kind of
1034120	1039040	monitor everything. Instead of having all these different aspects to pull. And obviously
1039040	1043100	you can generate from those applications the usual text files depending on what
1043100	1050380	application you're using. Or use Redis to queue up the logs and pretty much anything. One of
1050380	1054200	the nice things about Logstash is the ability to pull from any source and write your own
1054200	1058320	plugins. That would be a whole different talk for a whole other day so we won't get too far
1058320	1068680	deep in there but it's an option. So what about the cloud? We're going to drink every time I
1068680	1078880	say the cloud. So what about the cloud? Cyber, cyber, cyber. If you're playing at home, I
1078880	1086260	don't see many people playing at home. It's afternoon, yes. So more and more providers who are
1086260	1088720	offering cloud infrastructures and a lot more people are moving to these cloud
1088720	1092420	infrastructures are offering the ability to grab the audit logs without having to do a
1092420	1098080	formal request. So a lot of people aren't monitoring this. You know, recently, I'm trying to
1098080	1104520	remember the name, code someone fill me in, that had their AWS instances completely. Thank
1104520	1109820	you. Codespaces. Codespaces recently had one under an AWS attack and yes we can argue
1109820	1112560	over how their infrastructure was actually set up, that they should have had their backups in
1112660	1120860	a whole different environment that wasn't AWS. But we aren't monitoring those logs there. We're
1120860	1126460	pushing all of our emails, not we all, but a lot of places are pushing these logs and this
1126460	1132300	data out everywhere and not monitoring it. We're not monitoring who's logging into our Google
1132300	1136120	apps account. Someone could be sitting there for months or logging in from some other
1136120	1141140	geolocation that doesn't normally log into. No one is checking AWS to see who's got our
1141140	1145380	API key that may have accidentally ended up somewhere. Something seems weird. So some of
1145380	1151100	these services started offering the ability to actually take and grab these logs from AWS,
1151100	1157680	Google apps, box, sales force, but others aren't yet. So these are kind of a top gear, top
1157680	1162140	tip of different options for logging if you want to start pulling logs from these cloud
1162140	1173400	services. So AWS has cloud trail. Thank you. The gentleman is keeping me honest. Thank you, sir.
1174420	1182720	AWS has trail, which basically takes event logs every five minutes and pushes them into an S3
1182720	1188440	bucket. Log stash is able to pull those S3 buckets and parse those logs. Google apps has
1188440	1191820	their reports API, which is basically an API you can make queries against. Box has their
1191820	1197800	events API. And sales force has log in history now. But correct me if I'm wrong, but
1197800	1202460	office 365 currently doesn't offer any kind of live parsing. You can request them, but that
1202460	1206740	doesn't help you with monitoring it. Drop box, same thing. You can see it through their
1206740	1211340	dashboard, but you can't have any kind of API access to it. And GitHub, I have yet to find
1211340	1214880	any kind of logging other than enterprise. And more and more people for some reason think
1214880	1220040	it's a good idea to push all your enterprise code into GitHub. I love GitHub, don't get me
1220040	1225960	wrong, but I think it's kind of a bad idea to push everything out there. So as I said, log
1225960	1230040	stash can pull from these from either an exec or from a built in input. Now you may be like,
1230040	1233380	okay, you're talking about all these inputs, what are they? This is a list of the current
1233380	1240940	version of inputs. And there's a lot that are, we'll call them alpha. And we'll touch on that
1240940	1244480	later. But there's a lot that have been established, tested and well rounded. So as I
1244480	1250240	said, you have exec. Exec will let you run any kind of shell script, any kind of Ruby script,
1250240	1255280	any kind of command whatsoever, take whatever the output is and send it into the logging
1255280	1260020	infrastructure. So you can customize exactly how you want to get that log data. You know,
1260020	1264260	if you don't have a traditional source of data, you can start querying other APIs. And in
1264260	1268480	fact, you may see also on that list, there's a Twitter plugin. You can have it monitor the
1268480	1272680	Twitter stream for mentions of something, hashtags, whatever, and put that into your
1272680	1277220	logging complex. I think that's pretty cool. That you're able to be like, oh, create a
1277220	1284000	security event, somebody just doc dropped this. So as I said, it's got the S3 input, it's
1284000	1287720	got exec and it's got a few other things in there and the SNMP trap as well. So those are
1287720	1298100	the different inputs. So as I said, traditional inputs, you can still use the Syslog to
1298100	1303740	collect the events and Redis and all those other agents. But the idea is then, do you really
1303740	1309160	trust this somewhat young product? By the way, I did mention Logstash is now part of Elastic
1309160	1313940	Search and their whole parent family. So they have commercial support behind them. But do you
1313940	1320800	really trust this new Java based application with all your logs all the time? So yeah, if
1320800	1324600	you're one of those people who live on the wild side like me, you can send it straight to
1324600	1328500	Logstash and just be like, here, have fun. But you can also take and build a logging
1328500	1333040	complex where you're able to send these logs and parse these logs in different ways. So my
1333040	1336860	recommendation is always, if you don't really trust it, you can always build up an R
1336860	1342280	Syslog or Syslog NG layer of basically send the logs to the Syslog system first, then send
1342280	1347320	it to Logstash and then also send it to Hadoop for storage or send it traditional files for
1347320	1350920	storage. So you still have that retention and you still have that log being archived
1350920	1357900	elsewhere, but you also have all the cool new pretties that Logstash offers. So once Logstash
1357900	1364540	has all these events, what do you do with them? Projects kind of is awesome and sucks at
1364540	1370100	the same time. It's awesome because you can do anything with it. It sucks because you can
1370100	1374700	do anything with it and you have to learn how to do anything with it. So Logstash has
1374700	1378920	decided to create this thing called, this parsing engine called Grok. It still supports
1378920	1384220	regex, it still supports traditional grep statements, but Grok is pretty awesome as it
1384220	1389940	simplifies not having to know regex. They have prebuilt all these different syntaxes in
1389940	1395960	here and I'll go through examples in a second. This is just probably 10% of them. But if you
1395960	1402300	want to map an IP address, a user name, a log status level, you're able to do that with
1402300	1413060	just saying what the syntax is. So you would just say word or data. It makes life easy. So
1413060	1417500	even those who are not super technical with regex are able to write a pattern this
1417500	1422840	quickly to parse Apache logs. And this is really it. I mean, as soon as you get an input,
1422840	1426700	obviously you need to have the input in there too. But this is it for the filter. Combine
1426700	1432360	Apache log. Done. It parses it. Happy days. What about more complex data? Stuff that
1432360	1440900	doesn't really fit in existing syntax? Let's take this as an example. We have a typical
1440900	1448200	PAM notification. This is raw sys log data that I generated August 8th. You do the math.
1449600	1456220	Basically it's typical, hey, PAM detected someone log in. Now this may look a little
1456220	1459940	complicated, but really I'm doing two levels of parsing here. And this is an actual working
1459940	1465180	config and I'll be posting more later. But this is all you have to do in order to parse it.
1465180	1470980	First we parse to see is it a PAM message. So we look for the PAM UNIX flag. Say grab all the
1470980	1475280	data. Pick what module. Pick what phase it's coming from. Is it authentication? Is it
1475280	1480000	authorization? And then once you tag it, you know, as you can see in there, there's those
1480000	1485220	add tags, add tag for PAM, add tag for log in. So you can do filtering and pondering for it.
1485780	1489020	Once you tag it with that, you can easily then say, all right, let me grab all the other
1489020	1492880	data out of it. I want to grab the user, I want to grab the session ID, I want to grab the
1492880	1499980	remote host. And that's it for the regex and it gets parsed. And you're able to take, and
1499980	1505140	here's a quick from Elasticsearch of it parsing into all the different fields. And
1505140	1510020	without having to know all this crazy regex to figure out, oh, we got a missing case here,
1510020	1514040	you're able to quickly say, all right, grab the data, put it into this format, and it's
1514040	1519460	pretty easy to figure out how to start parsing and filtering your logs. But that's not all
1519460	1523920	the filters it has on the way in. We can tag metrics with it. We can track to see, all
1523920	1527160	right, let's grab everything that has a failed log in and start assigning a metric to it and
1527160	1531920	know how many failed log ins we have for this IP or this user over a one minute, five
1531920	1537500	minute, 15 minute, one hour window. We can get GUIP information in it with the filters as
1537500	1542460	well. Those pretty graphs like I was saying your bosses love. I don't know why people love
1542460	1548540	seeing that. We have a bunch of attacks coming from this other country. Did they get in? No,
1548540	1556520	but we have a bunch of attacks. You're on the internet, bro. But management for some reason
1556520	1559960	loves that. So you can give them those pretty little graphs. You can do GUIP tagging and pull
1559960	1564700	from the GUIP databases. You can do reverse DNS lookups to make your matches easier if you
1564700	1569460	have a dynamic environment or just want to start logging that data. And then there's URL
1569460	1575460	decode so you can take a decode if you have a URL inside of a URL. You can do multiline data
1575460	1579560	so if it crosses more than one line you can do key value. So if it's a situation as you saw in
1579560	1584160	the previous one of our host equals, action equals, you can just say key value it and it
1584160	1588420	parses all that automatically. And the coolest thing is it can do anonymize. So if you
1588420	1594700	happen to not be here in the U.S. and have to not store data of people, you can anonymize that
1594700	1600180	data as soon as it comes in with random data, hash data, however you can take and sanitize
1600180	1604720	that. So for those of you who have to deal with European laws or other laws that say you can't
1604720	1612770	actually store this after so long. So after you filter all that data, Logstash can output it
1612770	1617910	to pretty much anywhere. Traditionally people will send it to Elasticsearch for monitoring
1617910	1621570	and searching and that's what we're going to cover next. But you can send it to different
1621570	1627870	indexes just like you can with other large logging products. You can also do what's really
1627870	1634470	cool is called exec. So with exec, if you see a certain set of flags or you parse it out and
1634470	1639710	filter it out, you can take and go, oh, this looks interesting. I wanted to do something every
1639710	1644090	time I see this. But I don't want an email. I wanted to, I don't know, automatically block
1644090	1648350	something. You can just make an exec call to whatever script. I'll touch on some cool things
1648350	1652270	later. If you're like me and you don't want to keep changing your filters and want to
1652270	1657430	dynamically change how things are, you can make a simple web call to some other monitoring
1657430	1662150	app that you wrote and say, hey, I saw a bunch of odd things or I saw a log in from this IP.
1662730	1667130	Do something with that. And write up a web app, instead of having to script and write all
1667130	1671530	this stuff and keep restarting your filters, you can just say, send all this log in
1671530	1677790	information to this other web source and tell me if I should generate any kind of alerts. If
1677790	1681910	you're someone who sits on chat all day, you can send it as into your chat logs. I don't
1681910	1686750	think there's an IRC output, which I was kind of disappointed in. If you're a user of
1686750	1689910	PagerDuty, you can send it there or your traditional email notifications that go in that
1689910	1701370	bucket you never monitor. So, as I was saying, you can filter, you can parse, you can
1701370	1704910	do all this fun stuff. What do we care about? We're sending it to this place and we're
1704910	1707550	not monitoring it. As I said, the biggest important thing is for us to actually monitor
1707550	1713370	these security events. So, as I was saying, we sub filter some parts of stuff, we tag them,
1713370	1717490	saying this is a security event, this is a compliance event, this is a fail log in,
1717490	1721570	success log in. We can create all the tags you want. Add metrics if you want to see if
1721570	1725490	there's too many fail log ins over a certain window. You pick the output and then you can
1725490	1731630	scale. So here are two simple outputs that I wrote together real fast that shows if it's a
1731630	1738530	fail log in and it's been over two for this specific user within a minute, send me an email.
1739110	1745670	That's how simple it is. If you want to send it, like I was saying, all the auth requests,
1745670	1748610	you want to send it to some other source to dynamically determine, hey, I wrote this cool
1748610	1753030	little PHP app that will tell me if you send it the IP and the user name, it will determine
1753030	1757490	if it's new. If you're more comfortable with some other language, Ruby, whatever, send it
1757490	1761730	there. You can start sending these kind of actions elsewhere that traditional logging
1761730	1768830	complexes can't do. Yes, some commercial products support this as well. But this one's free.
1770590	1774930	So in the second example, obviously, any time there's an auth request that's tagged as an
1774930	1779650	auth request after we do all those filters, send it to whatever. That's not actually real,
1779650	1785510	so don't go trying to query that. You're not going to get anything. And send it a post. So
1785510	1788870	this is what I'm saying, we can do these execs, we can do these remote calls. As a security
1788870	1793770	people, this is awesome. We can have it do whatever we want automatically. We can have it
1793770	1798230	update, again, this is for those who like to live dangerously on the end. You can have it
1798230	1802690	automatically update firewalls, switches. Oh, I see someone new join the thing. I don't
1802690	1807910	have a traditional NAT complex. Go ahead and tell it to disable switch port. Cool, exec,
1807910	1811750	da, da, da, wrote this cool script, done. You're able to do that with this new logging
1811750	1817450	complex. Notify a user directly, hey, somebody logged in from a new IP address and this
1817450	1821790	looks weird or it's not from within the U.S. or whatever country you're from, hey, this is
1821790	1825790	weird for them, let me send that user an email and make it their responsibility to go, hey,
1825790	1830390	security, something's up, I didn't log in. You don't have to monitor that all and you can
1830390	1834630	start using your logging complex to generate those kind of alerts directly to your users.
1835770	1840030	Obviously notify for admin logins, both on an internal and external side. One of the
1840030	1843910	greatest things pen testers will talk about is, oh, I got admin on all these systems, oh,
1843910	1848350	yeah, it crawled across the environment. Why aren't we logging and detecting that? Admin
1848350	1851870	shouldn't be logging in remotely typically and why not generate events for people to
1851870	1857570	follow up on them? And then obviously for user logins on new machines, hey, Jim doesn't
1857570	1861310	normally log in this machine and I haven't seen this before, I'm going to generate an event.
1861310	1866950	And this is easy to do then with these filters, with these custom outputs that some other
1866950	1870910	logging complexes don't support. So, again, we've got the monitoring, we've got the
1870910	1875510	collection, we've got the storage. What about the searching? That's one of the biggest
1875510	1879910	problems with traditional syslogs is that you have to run, grab, awk, run through this text
1879910	1886390	file, wait, wait, wait, wait, go through 10 gigs, come on, give me something. So, since it's
1886390	1891270	based on Elasticsearch, the crew over at Elasticsearch is complex has this pretty little
1891270	1895830	front end called Kibana. Kibana pretty much looks like every other logging searching thing
1895830	1900490	you can ever imagine. And you're able to quickly search for the events, correlate the
1900490	1903330	events, and go through there. I'm not going to go too far into Kibana because you're going to
1903330	1907510	create all these pretty custom dashboards, you can go through and have a pretty map for
1907510	1918430	the management, as we were saying, your boss loves them. But no, I mean, get a raise,
1918430	1925070	sorry. But so, this works great. But that's all the pretty dashboards, you can do all the
1925070	1928310	searches, really, like I said, we're focusing on the security side, getting those alerts,
1928310	1933610	getting that notification. But you may be going, for those of you who know what Elasticsearch
1933610	1941850	is, may be going, dude, Elasticsearch, really? That shit kind of not has any security
1941850	1946390	controls whatsoever. Yeah, it does not have security controls whatsoever. You have to build
1946390	1950370	them. So as I said, it's not an easy solution, but it's one that you can scale and
1950370	1954590	customize greatly. So Elasticsearch is made so that basically you can cluster with
1954590	1959210	everything, multicast to figure out all the other peers, doesn't have authentication, just
1959210	1963990	trust everyone, gives everyone pseudo rights. Yeah, it's bad, from a security perspective.
1963990	1966810	But it's great from a data perspective. So we have to build in these security controls on
1966810	1971290	top of that. We have to write an NGX proxy in order to bind locally, really simple
1971290	1975730	configure. Have to segment the stuff off on the network so it doesn't take a multicast
1975730	1981390	everywhere else. Again, simple change. And you need to enable some logging on your NGX
1981390	1985210	front end that you're doing the proxy for. Again, for compliance reasons and for the
1985210	1989770	tracking of that. Again, simple configs. But everyone who's like, oh, you can't use that
1989770	1996210	because of security reasons, you just have to add a few additional controls. Now from a
1996210	2001350	performance side, you can tweak, obviously, a lot more when you build your own system. So
2001350	2005070	you can take in a tweak if you're starting to scale up the size of your indexes,
2005070	2009770	sometimes by default Logstash and Elasticsearch do daily indexes, but if you start
2009770	2015030	logging, I don't know, 200 gigs a day, a 200 gig index is kind of a bad thing. So you can
2015030	2020010	start changing the size of your indexes to hourly, minutes, so on and so forth. You can
2020010	2023390	increase the number of workers in Logstash in order to parse that stuff faster. You can
2023390	2028130	enable compression in Elasticsearch and you can enable queuing for the network traffic
2028130	2033570	coming in. And again, the whole point of this is so you can scale. You know, the
2033570	2037590	traditional systems you can't scale, you can't cluster, it's not fault tolerant. You can
2037590	2041590	easily scale up with Logstash, Elasticsearch, and Kibana by spinning up more instances of
2041590	2046730	Elasticsearch, spinning up more instances of Logstash, and as I was saying, putting more
2046730	2050030	steps in front of it that can kind of distribute and spin it out, and they recommend
2050030	2053950	Redis, works well if you put Logstash in front of Logstash. I know it doesn't make sense,
2053950	2059470	but it does. So the question you all have is, is it as good or better than a vendor? You're
2059470	2062250	up here preaching, you should look at open source stuff and you should take and do
2062250	2066970	something different than just buy a product. Is it better? It's your call. I mean, if you
2066970	2072530	have the technical ability or the team who has the technical ability or coworkers, yeah, it
2072530	2076610	works well and it doesn't come at the licensure cost of other things, but it's not easy to
2076610	2081950	manage as a paid solution. And still very relatively young, so there may be bugs you
2081950	2086310	encounter. So if you're sitting there with critical logs, you cannot lose it all, you may
2086310	2090190	want to look at someone who's a little more established or, like I was saying, add a few steps
2090190	2095070	in there to send it off to multiple storage locations. And it lacks authentication out of
2095070	2098790	the box, again, something you can easily change, but you'll hear people shaking their stick at
2098790	2105550	that saying you've got to be able to authenticate to it. Entry proxy, HTTP password, done. But
2105550	2111270	on the flip side, it's extremely customizable, the price is just right, and some enterprise
2111270	2125680	support is available. And you can even use it in the cloud. I had to whet my whistle there. So
2125680	2130500	what's next? I just rambled here about how great this thing is, what's next? We have this
2130500	2135200	little thing as much as, okay, I'm ready for the boo and the hiss, but we call it the open
2135200	2142480	PCI project, the domain hack PCI also works for some reason, I don't know why. But basically
2142480	2146680	the idea of that, there shouldn't be any secrets as to how to secure stuff. People have
2146680	2150860	been selling this whole magic bean of, oh, we can give you these configs and keep
2150860	2157060	reselling them. They're configs, guys. We can share that information. It doesn't provide
2157060	2161060	any kind of competitive advantage. In fact, it just makes things easier for all of us. So we
2161060	2166500	have this thing called the open PCI project. It needs an update for all this stuff, but I
2166500	2173540	will get that soon. As soon as possible. But basically to take and share this information,
2173540	2178400	and we'll take and share all the configs, the base parsing, a VM that's ready to go that you
2178400	2182920	can just spin up right away. And obviously the hardening guides, as I was saying, elastic
2182920	2188340	search and secure by default. Some hardening guides and configs are just here. It works.
2188340	2193540	Great. Awesome. To make it as close as similar to these large commercial products, but
2194260	2200520	obviously you need a little more hands on support. So with that, I'm ending a little bit
2200520	2204780	early, I'm sorry, but I'll let you guys get in line for the next talks here. But that's me,
2204780	2210180	that's the talk about all that stuff and all in all log stuff. Fuck companies that sue
2210180	2216580	people for legal pressure for giving talks about stuff they don't want. And that's it. Thanks
2216580	2217280	all.
