WEBVTT

1
00:00:00.040 --> 00:00:02.560
<v Speaker 1>All right, ready to jump into mod security.

2
00:00:02.640 --> 00:00:03.279
<v Speaker 2>Let's do it.

3
00:00:03.680 --> 00:00:06.280
<v Speaker 1>You guys give us a ton on this open source

4
00:00:06.559 --> 00:00:08.679
<v Speaker 1>web application firewall, so.

5
00:00:08.800 --> 00:00:10.119
<v Speaker 2>Uh yeah, a lot to cover.

6
00:00:10.240 --> 00:00:12.279
<v Speaker 1>We're going to figure out how mod security does its

7
00:00:12.279 --> 00:00:14.560
<v Speaker 1>thing and more importantly, why you should care.

8
00:00:14.839 --> 00:00:16.960
<v Speaker 2>I think what's really cool here is that we're not

9
00:00:17.120 --> 00:00:22.480
<v Speaker 2>just looking at like a technical manual, we're also seeing philosophy, right, yeah,

10
00:00:22.480 --> 00:00:24.719
<v Speaker 2>and that's really key to how mod security works.

11
00:00:24.839 --> 00:00:26.640
<v Speaker 1>Is like a behind the scenes look. Yeah. And the

12
00:00:26.679 --> 00:00:31.519
<v Speaker 1>Mond Security handbook itself feels like the like the ultimate guide,

13
00:00:31.600 --> 00:00:33.399
<v Speaker 1>you know, And I was just looking through it and

14
00:00:33.399 --> 00:00:35.799
<v Speaker 1>there's some really cool stuff like did you know mod

15
00:00:35.840 --> 00:00:39.719
<v Speaker 1>security can rewrite website traffic like live Yeah?

16
00:00:39.799 --> 00:00:42.880
<v Speaker 2>Yeah, yeah, it's a really powerful trick. It allows you

17
00:00:42.960 --> 00:00:47.719
<v Speaker 2>to essentially adjust traffic on the fly to protect your applications.

18
00:00:47.799 --> 00:00:50.039
<v Speaker 2>We'll definitely get into how that works and why it's

19
00:00:50.079 --> 00:00:51.119
<v Speaker 2>so valuable, and we're going.

20
00:00:51.079 --> 00:00:55.200
<v Speaker 1>To meet the creator and uncover his unique philosophy, which hint,

21
00:00:55.520 --> 00:00:57.600
<v Speaker 1>he doesn't even trust automated tools.

22
00:00:57.920 --> 00:01:01.039
<v Speaker 2>Yeah, that's a really interesting philosophy and kind of sets

23
00:01:01.079 --> 00:01:04.560
<v Speaker 2>mod security apart. It's all about keeping the human in control,

24
00:01:04.760 --> 00:01:07.000
<v Speaker 2>not relying on blind automation.

25
00:01:07.359 --> 00:01:10.640
<v Speaker 1>So not replacing human judgment, yeah, just giving us better

26
00:01:10.680 --> 00:01:12.359
<v Speaker 1>tools to make judgment precisely.

27
00:01:12.439 --> 00:01:15.599
<v Speaker 2>And that's why mod security focuses on detection and blocking,

28
00:01:15.799 --> 00:01:20.480
<v Speaker 2>not data sanitization. Risti sees that as kind of inherently risky.

29
00:01:20.840 --> 00:01:23.319
<v Speaker 1>So it's like a really smart security guard, Yeah, who

30
00:01:23.840 --> 00:01:26.120
<v Speaker 1>will point out things that are suspicious, but lets you

31
00:01:26.159 --> 00:01:27.239
<v Speaker 1>make the call on what to do.

32
00:01:27.439 --> 00:01:31.120
<v Speaker 2>That's a great analogy, and that approach has really kind

33
00:01:31.159 --> 00:01:34.400
<v Speaker 2>of been central to mod security's evolution. You know, from

34
00:01:34.400 --> 00:01:37.560
<v Speaker 2>the early days when it was tough to integrate it

35
00:01:37.560 --> 00:01:40.519
<v Speaker 2>with apatche to the complete rewrite with version two point zero,

36
00:01:40.879 --> 00:01:43.000
<v Speaker 2>it's all been about giving users control.

37
00:01:43.159 --> 00:01:45.879
<v Speaker 1>The speaking of big wins, the handbook mentions that mod

38
00:01:45.920 --> 00:01:50.840
<v Speaker 1>security was actually compared to other web application firewalls. Oh yeah,

39
00:01:50.840 --> 00:01:54.680
<v Speaker 1>forced to research evaluation and mod security came out on top.

40
00:01:54.879 --> 00:01:57.480
<v Speaker 2>That was a big moment for mod security. Yeah, it

41
00:01:57.519 --> 00:01:59.319
<v Speaker 2>really proved that it could go head to head with

42
00:01:59.719 --> 00:02:02.439
<v Speaker 2>the with the big players and really hold its own.

43
00:02:02.599 --> 00:02:05.159
<v Speaker 1>All Right, so we've got this powerful tool built on

44
00:02:05.200 --> 00:02:10.599
<v Speaker 1>this idea that humans are still in charge. But how

45
00:02:10.599 --> 00:02:13.520
<v Speaker 1>does that fit into a web server environment? What is

46
00:02:13.560 --> 00:02:14.560
<v Speaker 1>it actually doing?

47
00:02:14.919 --> 00:02:17.800
<v Speaker 2>So mod security is what's called a hybrid we mess

48
00:02:17.840 --> 00:02:21.280
<v Speaker 2>of it needs the host web server, in this case

49
00:02:21.319 --> 00:02:24.840
<v Speaker 2>Apache to do some of its work. Works really well

50
00:02:24.879 --> 00:02:27.599
<v Speaker 2>with a patchy, but it could technically work with other

51
00:02:27.599 --> 00:02:30.360
<v Speaker 2>web servers as long as they have the right APIs.

52
00:02:30.439 --> 00:02:33.400
<v Speaker 1>So it's like a dynamic duo with a patches. Yeah, exactly,

53
00:02:33.400 --> 00:02:34.560
<v Speaker 1>it could team up with others.

54
00:02:34.680 --> 00:02:37.639
<v Speaker 2>That's right. And remember mod security is all about detection

55
00:02:37.840 --> 00:02:41.120
<v Speaker 2>and blocking. It's constantly looking at incoming and outgoing web

56
00:02:41.159 --> 00:02:45.599
<v Speaker 2>traffic looking for patterns that match the rules you set up.

57
00:02:45.680 --> 00:02:48.560
<v Speaker 1>So like a security checkpoint scrutinizing every single piece of

58
00:02:48.639 --> 00:02:50.360
<v Speaker 1>data coming in and going out.

59
00:02:50.599 --> 00:02:53.560
<v Speaker 2>That's exactly right. And it does this in five phases. First,

60
00:02:53.680 --> 00:02:56.919
<v Speaker 2>it checks the request headers before even looking at the

61
00:02:57.439 --> 00:03:01.360
<v Speaker 2>content of the request. Then it analyzes the request body,

62
00:03:01.400 --> 00:03:03.199
<v Speaker 2>which is the data being sent to the server.

63
00:03:03.439 --> 00:03:06.240
<v Speaker 1>So it's like a multi step inspection process. Yeah, what

64
00:03:06.280 --> 00:03:08.159
<v Speaker 1>happens after the request is processed.

65
00:03:08.360 --> 00:03:12.080
<v Speaker 2>After that, it goes on to the response headers, checking

66
00:03:12.080 --> 00:03:15.280
<v Speaker 2>the server's initial response. Then it looks at the content

67
00:03:15.360 --> 00:03:18.400
<v Speaker 2>being sent back to the user. This is the response

68
00:03:18.439 --> 00:03:22.319
<v Speaker 2>body phase. And finally it records everything in the logging phase.

69
00:03:22.360 --> 00:03:25.039
<v Speaker 1>Wow, really breaking down that whole request and response cycle.

70
00:03:25.080 --> 00:03:27.719
<v Speaker 2>Right, that's right. It's a systematic way to make sure

71
00:03:27.800 --> 00:03:29.919
<v Speaker 2>nothing slips through the cracks when it comes to web

72
00:03:29.960 --> 00:03:30.960
<v Speaker 2>application security.

73
00:03:31.520 --> 00:03:33.960
<v Speaker 1>So all this analysis in work that's going on, doesn't

74
00:03:34.000 --> 00:03:35.120
<v Speaker 1>that affect performance?

75
00:03:35.719 --> 00:03:40.039
<v Speaker 2>Well, yeah, there's no denying that. Mod security uses more resources,

76
00:03:40.360 --> 00:03:45.039
<v Speaker 2>you know, both CPU and RAM. You know, it's parsing data,

77
00:03:45.120 --> 00:03:48.599
<v Speaker 2>it's handling complex information, it's constantly checking those rules.

78
00:03:48.960 --> 00:03:52.879
<v Speaker 1>So there is like a trade off between security.

79
00:03:52.360 --> 00:03:56.800
<v Speaker 2>And speed to some degree. Yeah, but the handbook emphasizes

80
00:03:56.919 --> 00:03:59.680
<v Speaker 2>that this is manageable. Okay, if you set your servers

81
00:03:59.719 --> 00:04:04.080
<v Speaker 2>up directly and importantly, mod security is highly configurable, so

82
00:04:04.120 --> 00:04:06.960
<v Speaker 2>you can fine tune it to you know, strike the

83
00:04:07.000 --> 00:04:09.080
<v Speaker 2>right balance between security and performance.

84
00:04:09.319 --> 00:04:11.599
<v Speaker 1>That's good to hear. Yeah, not one size fits all.

85
00:04:11.879 --> 00:04:14.159
<v Speaker 1>You can customize it for your environment precisely.

86
00:04:14.520 --> 00:04:18.480
<v Speaker 2>You're in control. You know what gets analyzed, how deeply

87
00:04:18.560 --> 00:04:21.319
<v Speaker 2>it gets analyzed, and what happens when when a rule

88
00:04:21.399 --> 00:04:21.920
<v Speaker 2>is triggered.

89
00:04:22.279 --> 00:04:25.519
<v Speaker 1>Right, this brings us to the fun part diving into

90
00:04:25.560 --> 00:04:30.240
<v Speaker 1>mod security's unique features. Let's start with how it handles

91
00:04:30.560 --> 00:04:32.720
<v Speaker 1>you know, file uploads. Yeah, I know those can be

92
00:04:32.759 --> 00:04:34.040
<v Speaker 1>a real security headache.

93
00:04:34.199 --> 00:04:37.279
<v Speaker 2>Oh for sure. File uploads are a you know, a

94
00:04:37.319 --> 00:04:40.800
<v Speaker 2>favorite target for attackers, and that's why mod security takes

95
00:04:40.800 --> 00:04:44.519
<v Speaker 2>a very cautious approach. Instead of processing them directly in memory,

96
00:04:45.000 --> 00:04:47.439
<v Speaker 2>it creates temporary files on the disc.

97
00:04:47.879 --> 00:04:50.120
<v Speaker 1>Ah, So it isolates those files.

98
00:04:49.920 --> 00:04:53.720
<v Speaker 2>Right, Yeah, it's isolating those those potentially dangerous files from

99
00:04:53.759 --> 00:04:56.800
<v Speaker 2>the server's memory. And it actually goes even further. It

100
00:04:57.120 --> 00:05:01.439
<v Speaker 2>carefully adjusts the permissions of these temporary files to prevent

101
00:05:01.680 --> 00:05:03.120
<v Speaker 2>you know, unauthorized access.

102
00:05:03.319 --> 00:05:06.279
<v Speaker 1>So it creates it locks it down. Yeah, and then

103
00:05:06.319 --> 00:05:08.920
<v Speaker 1>what like does it analyze the contents or store it

104
00:05:09.120 --> 00:05:10.480
<v Speaker 1>or like what happens? Then?

105
00:05:10.600 --> 00:05:13.160
<v Speaker 2>It depends on how you've configured it. Right. You can

106
00:05:13.279 --> 00:05:17.120
<v Speaker 2>have mod security scan the file for malicious patterns. You

107
00:05:17.160 --> 00:05:19.399
<v Speaker 2>can even run it through an anti virus engine like

108
00:05:19.480 --> 00:05:22.680
<v Speaker 2>clam ab, or you could just store it for review later.

109
00:05:22.839 --> 00:05:26.160
<v Speaker 1>So there's flexibility, that's right. But these files they don't

110
00:05:26.160 --> 00:05:27.680
<v Speaker 1>stick around forever, do they No?

111
00:05:27.879 --> 00:05:31.120
<v Speaker 2>No, mod security automatically cleans them up, okay, when they're

112
00:05:31.120 --> 00:05:32.000
<v Speaker 2>not needed anymore.

113
00:05:32.120 --> 00:05:35.720
<v Speaker 1>That's good. Wouldn't want a bunch of temporary files clogging things.

114
00:05:35.560 --> 00:05:40.040
<v Speaker 2>Up, exactly. And mod security is also designed to handle

115
00:05:40.079 --> 00:05:43.680
<v Speaker 2>those really large file uploads. If a file is too big,

116
00:05:44.000 --> 00:05:47.279
<v Speaker 2>it automatically switches from using memory to storing it on

117
00:05:47.360 --> 00:05:47.800
<v Speaker 2>a disc.

118
00:05:48.079 --> 00:05:49.600
<v Speaker 1>So it adapts to the file size.

119
00:05:49.720 --> 00:05:51.560
<v Speaker 2>Yeah, it adapts to the size of the file to

120
00:05:51.600 --> 00:05:54.199
<v Speaker 2>prevent the server from being overwhelmed.

121
00:05:54.279 --> 00:05:55.319
<v Speaker 1>Yeah, that's pretty smart.

122
00:05:55.439 --> 00:05:57.879
<v Speaker 2>And to really get a sense of this process, the

123
00:05:57.920 --> 00:06:03.519
<v Speaker 2>handbook actually include us excerpts from mod Security's debuglog. We

124
00:06:03.560 --> 00:06:07.680
<v Speaker 2>can actually see it creating the temporary file, setting permissions

125
00:06:08.160 --> 00:06:11.279
<v Speaker 2>and even you know, the exact size limits that trigger

126
00:06:11.399 --> 00:06:12.959
<v Speaker 2>that switch to disk storage.

127
00:06:13.240 --> 00:06:16.360
<v Speaker 1>So those debug logs, it sounds like they're really valuable

128
00:06:16.439 --> 00:06:19.040
<v Speaker 1>for us. Oh yeah, understanding what's happening under the hood.

129
00:06:18.839 --> 00:06:21.720
<v Speaker 2>Right absolutely. And speaking of logs, that brings us to

130
00:06:21.759 --> 00:06:23.480
<v Speaker 2>another really important feature.

131
00:06:23.759 --> 00:06:26.199
<v Speaker 1>Right, the logging system. Yes, it seems like it's not

132
00:06:26.279 --> 00:06:28.959
<v Speaker 1>just about you know, catching the bad guys, but also

133
00:06:29.160 --> 00:06:32.920
<v Speaker 1>keeping these detailed records of everything that's happening.

134
00:06:32.560 --> 00:06:35.800
<v Speaker 2>You got it. So mod security has two main types

135
00:06:35.839 --> 00:06:39.000
<v Speaker 2>of logs, the debug log and the audit log. The

136
00:06:39.040 --> 00:06:42.920
<v Speaker 2>debuglog is, you know, it's your best friend for figuring

137
00:06:42.920 --> 00:06:46.759
<v Speaker 2>out how mod security is handling requests and troubleshooting any issues.

138
00:06:46.839 --> 00:06:49.439
<v Speaker 1>And the handbook recommends using debug level three right.

139
00:06:49.720 --> 00:06:52.759
<v Speaker 2>Yeah, for for live websites, that's kind of the sweet spot.

140
00:06:53.000 --> 00:06:56.199
<v Speaker 2>It gives you the essential information without without overwhelming you

141
00:06:56.240 --> 00:06:58.519
<v Speaker 2>with details. But if you need to dig really deep,

142
00:06:58.680 --> 00:07:00.800
<v Speaker 2>you can you know, crank it up to level nine

143
00:07:01.079 --> 00:07:04.079
<v Speaker 2>and that'll give you the most detailed output possible.

144
00:07:04.199 --> 00:07:06.800
<v Speaker 1>It's like adjusting the focus on a microscope.

145
00:07:06.920 --> 00:07:07.959
<v Speaker 2>Right, That's a great way to put it.

146
00:07:08.040 --> 00:07:09.639
<v Speaker 1>Yeah, Like you can zoom in as much as you

147
00:07:09.720 --> 00:07:10.639
<v Speaker 1>need exactly.

148
00:07:10.879 --> 00:07:13.160
<v Speaker 2>And then there's the audit log, which is all about

149
00:07:13.279 --> 00:07:16.360
<v Speaker 2>you know, keeping a comprehensive record of all the HTTP

150
00:07:16.519 --> 00:07:20.600
<v Speaker 2>traffic that passes through mod security. It's your security journal.

151
00:07:21.160 --> 00:07:24.319
<v Speaker 1>So this seems like where the idea of like human

152
00:07:24.360 --> 00:07:27.240
<v Speaker 1>oversight really comes into play. Right, you can go back

153
00:07:27.560 --> 00:07:30.120
<v Speaker 1>analyze these logs and then making a formed.

154
00:07:29.920 --> 00:07:33.480
<v Speaker 2>Decision precisely, and you have options for how those logs

155
00:07:33.480 --> 00:07:37.199
<v Speaker 2>are stored. You can have everything appended to a single file,

156
00:07:37.600 --> 00:07:40.480
<v Speaker 2>or you can create you know, a separate file for

157
00:07:40.519 --> 00:07:42.759
<v Speaker 2>each entry, Okay, so you can tailor it to how

158
00:07:42.800 --> 00:07:46.480
<v Speaker 2>you like to manage data. That's right, And each log

159
00:07:46.639 --> 00:07:49.319
<v Speaker 2>entry is structured in a consistent way, you know, breaking

160
00:07:49.360 --> 00:07:52.199
<v Speaker 2>down the details of the request and response into you know,

161
00:07:52.279 --> 00:07:53.240
<v Speaker 2>manageable parts.

162
00:07:53.759 --> 00:07:56.399
<v Speaker 1>It's like taking this complex event and turning it into

163
00:07:56.439 --> 00:07:57.480
<v Speaker 1>these bite sized.

164
00:07:57.240 --> 00:07:59.319
<v Speaker 2>Pieces that's a good way to think about it. And

165
00:07:59.360 --> 00:08:02.120
<v Speaker 2>to help you this, the handbook actually gives you clear

166
00:08:02.160 --> 00:08:05.240
<v Speaker 2>examples of these audit log entries. You know, it even

167
00:08:05.279 --> 00:08:08.560
<v Speaker 2>shows you how to pull out specific pieces of information

168
00:08:08.720 --> 00:08:10.759
<v Speaker 2>like what browser someone is using.

169
00:08:10.879 --> 00:08:13.519
<v Speaker 1>It's like a detective's toolkit for web traffic.

170
00:08:13.720 --> 00:08:19.079
<v Speaker 2>Yeah, exactly. And to make managing all those logs easier,

171
00:08:19.439 --> 00:08:22.240
<v Speaker 2>mod Security has a tool called MOG.

172
00:08:22.560 --> 00:08:25.360
<v Speaker 1>Okay, So that's like a dedicated tool for those logs.

173
00:08:25.480 --> 00:08:29.800
<v Speaker 2>Yes, MOG stands for mod Security Log Collector okay, and

174
00:08:29.800 --> 00:08:32.840
<v Speaker 2>it allows you to centralize your logs, you know, instead

175
00:08:32.840 --> 00:08:35.000
<v Speaker 2>of having them scattered across all your web servers, you

176
00:08:35.000 --> 00:08:36.399
<v Speaker 2>can collect them all in one place.

177
00:08:36.559 --> 00:08:38.600
<v Speaker 1>I could see how that would be a huge time saver.

178
00:08:38.840 --> 00:08:42.639
<v Speaker 2>Oh absolutely. And the handbook actually walks you through setting

179
00:08:42.720 --> 00:08:45.879
<v Speaker 2>up MOG, you know, from choosing where to store your

180
00:08:45.919 --> 00:08:48.960
<v Speaker 2>logs to troubleshooting any common problems you might run into.

181
00:08:49.159 --> 00:08:50.759
<v Speaker 1>It's really a step by step guide.

182
00:08:50.840 --> 00:08:51.159
<v Speaker 2>Yeah.

183
00:08:51.200 --> 00:08:54.200
<v Speaker 1>So now we have a good handle on how mod

184
00:08:54.240 --> 00:08:57.200
<v Speaker 1>security is capturing all this information, But what about the

185
00:08:57.279 --> 00:08:59.679
<v Speaker 1>rules themselves? You know, how do you actually tell it

186
00:08:59.759 --> 00:09:01.000
<v Speaker 1>what to look for and what to do.

187
00:09:01.440 --> 00:09:06.519
<v Speaker 2>That's where the magic of mod Security's rule language comes in. Okay,

188
00:09:06.519 --> 00:09:10.159
<v Speaker 2>it's incredibly flexible. It lets you create very very specific

189
00:09:10.240 --> 00:09:14.200
<v Speaker 2>and complex rules to detect all sorts of security threats.

190
00:09:14.480 --> 00:09:16.960
<v Speaker 1>So before we get into the specifics of how to

191
00:09:17.000 --> 00:09:19.360
<v Speaker 1>actually write that language, can you just give me like

192
00:09:19.600 --> 00:09:22.559
<v Speaker 1>a basic overview of how these rules work.

193
00:09:22.799 --> 00:09:28.960
<v Speaker 2>Sure? At their core, mod security rules have three main parts, variables, operators,

194
00:09:28.960 --> 00:09:29.600
<v Speaker 2>and actions.

195
00:09:29.679 --> 00:09:29.960
<v Speaker 1>Okay.

196
00:09:30.080 --> 00:09:32.919
<v Speaker 2>Variables represent the data you want to examine, like request

197
00:09:32.960 --> 00:09:35.559
<v Speaker 2>headers or the content of a form submission.

198
00:09:35.639 --> 00:09:38.000
<v Speaker 1>So variables are like the ingredients exactly.

199
00:09:38.440 --> 00:09:40.440
<v Speaker 2>Then you have operators, which are the tools you use

200
00:09:40.519 --> 00:09:43.320
<v Speaker 2>to examine those ingredients. They let you compare, search for patterns,

201
00:09:43.440 --> 00:09:45.919
<v Speaker 2>analyze the data you know to see if a rule

202
00:09:46.000 --> 00:09:46.759
<v Speaker 2>should be triggered.

203
00:09:46.960 --> 00:09:49.320
<v Speaker 1>So the operators are like the verbs precisely.

204
00:09:49.360 --> 00:09:52.600
<v Speaker 2>And finally, actions define what happens when a rule is triggered.

205
00:09:52.639 --> 00:09:56.159
<v Speaker 2>You know, they determine the consequences like blocking the request,

206
00:09:56.279 --> 00:09:59.000
<v Speaker 2>logging the event, or doing something else entirely.

207
00:09:59.159 --> 00:10:01.559
<v Speaker 1>So the actions are the outcome you got it.

208
00:10:02.120 --> 00:10:05.240
<v Speaker 2>To illustrate this, let's look at some simple examples.

209
00:10:04.759 --> 00:10:07.679
<v Speaker 1>Perfect show me like how this actually works in practice.

210
00:10:07.759 --> 00:10:12.000
<v Speaker 2>Okay, Let's say you want to protect against a very

211
00:10:12.000 --> 00:10:16.559
<v Speaker 2>common attack called SQL injection, where hackers try to sneak

212
00:10:16.679 --> 00:10:20.720
<v Speaker 2>malicious code into web requests. You could write a rule

213
00:10:20.759 --> 00:10:24.080
<v Speaker 2>that looks for specific patterns in the data being submitted.

214
00:10:24.679 --> 00:10:26.879
<v Speaker 2>What would that look like, Well, it could look something

215
00:10:26.919 --> 00:10:31.600
<v Speaker 2>like this. Secral ARGs at rx select dot plus from.

216
00:10:31.799 --> 00:10:35.000
<v Speaker 1>Okay, break that down for me. Secruel tells mod security

217
00:10:35.000 --> 00:10:38.039
<v Speaker 1>it's a rule. ARGs means we're looking at the data

218
00:10:38.039 --> 00:10:40.879
<v Speaker 1>being submitted, But what about that att rx and the

219
00:10:40.919 --> 00:10:41.639
<v Speaker 1>rest of that stuff?

220
00:10:41.720 --> 00:10:44.440
<v Speaker 2>Right, So that's where the operator and pattern matching come in.

221
00:10:45.240 --> 00:10:48.039
<v Speaker 2>At rx means we're using regular expressions. Those let you

222
00:10:48.080 --> 00:10:52.279
<v Speaker 2>define those complex patterns, and the pattern select dot plus

223
00:10:52.360 --> 00:10:55.039
<v Speaker 2>from looks for any text that starts with select, has

224
00:10:55.039 --> 00:10:57.600
<v Speaker 2>some other characters in between, and ends with from. This

225
00:10:57.679 --> 00:11:00.000
<v Speaker 2>is a common structure used in SQL queries.

226
00:11:00.080 --> 00:11:02.679
<v Speaker 1>Looking for the fingerprints of that attack rank Exactly.

227
00:11:02.960 --> 00:11:05.679
<v Speaker 2>If it finds that pattern, boom, the rule is triggered.

228
00:11:05.759 --> 00:11:07.600
<v Speaker 1>And then what what action would you take?

229
00:11:07.879 --> 00:11:09.879
<v Speaker 2>Well, that's up to you. You could just log the

230
00:11:09.919 --> 00:11:14.320
<v Speaker 2>event and let the request continue, or you could take

231
00:11:14.320 --> 00:11:16.600
<v Speaker 2>a stronger action and block the request altogether.

232
00:11:16.919 --> 00:11:18.639
<v Speaker 1>So again that flexibility is there.

233
00:11:18.759 --> 00:11:21.879
<v Speaker 2>You got it, And you can actually chain multiple rules

234
00:11:21.879 --> 00:11:25.519
<v Speaker 2>together to create even more complex logic. So, for example,

235
00:11:25.960 --> 00:11:29.279
<v Speaker 2>you could have one rule that checks for certain keywords,

236
00:11:29.559 --> 00:11:32.320
<v Speaker 2>and then another rule that analyzes the structure of the

237
00:11:32.399 --> 00:11:33.960
<v Speaker 2>request based on those keywords.

238
00:11:34.080 --> 00:11:36.519
<v Speaker 1>It's like a security system with multiple layers.

239
00:11:36.240 --> 00:11:40.960
<v Speaker 2>Precisely, And as we explore mod security further, you'll see

240
00:11:41.000 --> 00:11:44.159
<v Speaker 2>just how powerful and granular this rule language can be.

241
00:11:44.440 --> 00:11:46.480
<v Speaker 1>This is really cool. I'm starting to see how you

242
00:11:46.480 --> 00:11:48.879
<v Speaker 1>can really build like a strong defense.

243
00:11:49.120 --> 00:11:52.000
<v Speaker 2>Yeah, for web applications, and we've only just scratched the surface.

244
00:11:52.039 --> 00:11:55.000
<v Speaker 2>There are so many more features. For example, we haven't

245
00:11:55.000 --> 00:11:58.120
<v Speaker 2>even talked about persistent storage. Okay, that allows you to

246
00:11:58.159 --> 00:12:01.320
<v Speaker 2>actually track data across multiple requests.

247
00:12:01.679 --> 00:12:04.000
<v Speaker 1>Persistent storage, what's that all about?

248
00:12:04.360 --> 00:12:08.399
<v Speaker 2>So imagine being able to remember details about a user's

249
00:12:08.399 --> 00:12:12.000
<v Speaker 2>behavior over time. Did they try to log in multiple

250
00:12:12.039 --> 00:12:15.240
<v Speaker 2>times with the wrong password? Have they been submitting spam

251
00:12:15.279 --> 00:12:18.840
<v Speaker 2>comments repeatedly? Right, persistent storage, let's you keep track of

252
00:12:18.879 --> 00:12:19.960
<v Speaker 2>that information.

253
00:12:19.799 --> 00:12:23.240
<v Speaker 1>So you're not just looking at each request in isolation. Right,

254
00:12:23.360 --> 00:12:24.559
<v Speaker 1>You're building this history.

255
00:12:24.720 --> 00:12:28.159
<v Speaker 2>That's right. It's like having a security system that learns

256
00:12:28.200 --> 00:12:30.200
<v Speaker 2>and adapts based on past events.

257
00:12:30.399 --> 00:12:32.279
<v Speaker 1>I'm definitely eager to learn more about that.

258
00:12:32.399 --> 00:12:36.639
<v Speaker 2>Yeah, we'll definitely explore that, we'll see how to create, manage,

259
00:12:36.679 --> 00:12:39.080
<v Speaker 2>and delete these records, and we'll look at some real

260
00:12:39.120 --> 00:12:43.159
<v Speaker 2>world examples of how persistent storage is used for some

261
00:12:43.200 --> 00:12:45.039
<v Speaker 2>pretty advanced security features.

262
00:12:44.759 --> 00:12:47.240
<v Speaker 1>Exloaded, Blowing my mind. I can't wait to see what

263
00:12:47.279 --> 00:12:50.799
<v Speaker 1>else mod security can do. All right, welcome back. Last

264
00:12:50.840 --> 00:12:54.320
<v Speaker 1>time we kind of laid the foundation, you know, explored

265
00:12:54.360 --> 00:12:57.600
<v Speaker 1>mod securities origins, some of those core concepts. Right now,

266
00:12:57.639 --> 00:12:59.320
<v Speaker 1>we're going to get into persistent storage.

267
00:12:59.679 --> 00:13:04.039
<v Speaker 2>Yeah, fun stuff. Persistent storage is where mod security really shines.

268
00:13:04.879 --> 00:13:08.679
<v Speaker 2>Remember how we talked about tracking data across multiple requests.

269
00:13:09.279 --> 00:13:12.480
<v Speaker 2>Let's imagine you're dealing with oh, I don't know, comment spam, right,

270
00:13:12.919 --> 00:13:14.080
<v Speaker 2>flooding your website.

271
00:13:14.519 --> 00:13:17.679
<v Speaker 1>Comments spam the bane of my existence exactly.

272
00:13:18.440 --> 00:13:21.759
<v Speaker 2>But with mod security's persistent storage, you can actually create

273
00:13:21.799 --> 00:13:24.360
<v Speaker 2>a system that keeps track of how often each IP

274
00:13:24.519 --> 00:13:26.679
<v Speaker 2>address is posting comments.

275
00:13:26.919 --> 00:13:30.840
<v Speaker 1>Wait, so each IP address gets its own little like record. Yeah,

276
00:13:30.960 --> 00:13:32.360
<v Speaker 1>that seems like a lot to manage.

277
00:13:32.480 --> 00:13:35.600
<v Speaker 2>It can be, but mod security is built to handle

278
00:13:35.639 --> 00:13:39.960
<v Speaker 2>that efficiently. So let's call this record a comment spam collection.

279
00:13:40.399 --> 00:13:42.759
<v Speaker 2>Every time someone tries to post a comment, mod security

280
00:13:42.759 --> 00:13:44.759
<v Speaker 2>can check their IP address against this collection.

281
00:13:44.840 --> 00:13:46.799
<v Speaker 1>Okay, so it's like a like a running tallly of

282
00:13:46.840 --> 00:13:49.679
<v Speaker 1>comments from each IP exact way, what happens if someone

283
00:13:49.679 --> 00:13:52.200
<v Speaker 1>gets a little too excited about commenting.

284
00:13:52.240 --> 00:13:54.960
<v Speaker 2>Well, that's where you can start setting some some boundaries, right.

285
00:13:55.039 --> 00:13:57.600
<v Speaker 2>You could create a rule that says, hey, if this

286
00:13:57.679 --> 00:14:00.759
<v Speaker 2>IP address has posted more than say, ten comments in

287
00:14:00.799 --> 00:14:04.000
<v Speaker 2>the last hour, block any further comments from that IP.

288
00:14:04.360 --> 00:14:07.440
<v Speaker 1>So it's like a speed limit on comments exactly.

289
00:14:07.840 --> 00:14:11.480
<v Speaker 2>You've created a dynamic rate limiting system using mod securities

290
00:14:11.559 --> 00:14:16.080
<v Speaker 2>persistent storage, and this is incredibly powerful for dealing with

291
00:14:16.159 --> 00:14:17.879
<v Speaker 2>all sorts of abuse scenarios.

292
00:14:17.960 --> 00:14:19.600
<v Speaker 1>This makes a lot of sense, But how do you

293
00:14:19.639 --> 00:14:22.039
<v Speaker 1>actually like set these up and manage them?

294
00:14:22.080 --> 00:14:22.120
<v Speaker 2>Like?

295
00:14:22.159 --> 00:14:24.159
<v Speaker 1>What kind of information can you even store?

296
00:14:24.759 --> 00:14:28.159
<v Speaker 2>Creating a collection is actually pretty straightforward. You just use

297
00:14:28.279 --> 00:14:31.840
<v Speaker 2>the the in a call action within a rule. So

298
00:14:32.159 --> 00:14:35.960
<v Speaker 2>to start tracking an IP address in our comment spam collection,

299
00:14:36.519 --> 00:14:39.120
<v Speaker 2>the action would look something like this in it call

300
00:14:39.200 --> 00:14:41.240
<v Speaker 2>dot comment spam percent remote.

301
00:14:40.960 --> 00:14:44.120
<v Speaker 1>Address, so percent remote adder that represents the IP address.

302
00:14:44.200 --> 00:14:47.840
<v Speaker 2>That's right. It dynamically grabs that information. Okay, but what

303
00:14:47.879 --> 00:14:50.159
<v Speaker 2>about the actual data itself. You can actually store a

304
00:14:50.240 --> 00:14:54.480
<v Speaker 2>variety of different data types, numbers, text strings, even timestamps.

305
00:14:54.320 --> 00:14:58.120
<v Speaker 2>It's like creating you know, custom variables within each record

306
00:14:58.159 --> 00:14:59.399
<v Speaker 2>to track exactly what you need.

307
00:14:59.679 --> 00:15:02.879
<v Speaker 1>So for our comment span example, what kinds of variables

308
00:15:02.960 --> 00:15:03.879
<v Speaker 1>might we actually store?

309
00:15:04.120 --> 00:15:06.799
<v Speaker 2>So we've already talked about the counter variable, right to

310
00:15:06.879 --> 00:15:10.159
<v Speaker 2>keep track of how many comments have been posted, but

311
00:15:10.200 --> 00:15:13.799
<v Speaker 2>you could also store the time stamp of the last comment,

312
00:15:14.240 --> 00:15:16.480
<v Speaker 2>the content of that comment, or even a flag to

313
00:15:16.559 --> 00:15:18.840
<v Speaker 2>indicate if that IP address has been blocked before.

314
00:15:19.080 --> 00:15:21.759
<v Speaker 1>So it can paignt a pretty detailed picture exactly.

315
00:15:22.120 --> 00:15:24.279
<v Speaker 2>And you have a lot of control over how these

316
00:15:24.320 --> 00:15:27.279
<v Speaker 2>records are managed. You can set them to expire after

317
00:15:27.320 --> 00:15:30.279
<v Speaker 2>a certain period, automatically deleting.

318
00:15:29.879 --> 00:15:32.360
<v Speaker 1>Old data so they don't just grow forever, right, you.

319
00:15:32.360 --> 00:15:35.480
<v Speaker 2>Don't want them to get clogged up without dated information.

320
00:15:36.080 --> 00:15:38.879
<v Speaker 2>And you can actually manually delete records or even entire

321
00:15:38.919 --> 00:15:42.279
<v Speaker 2>collections if you need to. Mod security gives you actions

322
00:15:42.279 --> 00:15:45.240
<v Speaker 2>like setvar and expire VAR to manipulate that data and

323
00:15:45.840 --> 00:15:46.799
<v Speaker 2>how long it's kept.

324
00:15:46.919 --> 00:15:49.200
<v Speaker 1>This is like a whole database built in.

325
00:15:49.519 --> 00:15:52.279
<v Speaker 2>Yeah in a way. Yeah, it's incredibly powerful and it

326
00:15:52.320 --> 00:15:54.399
<v Speaker 2>allows you to do some really really clever things. And

327
00:15:54.440 --> 00:15:59.960
<v Speaker 2>the handbook actually dives into three specific applications of persistent

328
00:16:00.159 --> 00:16:02.399
<v Speaker 2>storage that are worth highlighting.

329
00:16:02.600 --> 00:16:05.080
<v Speaker 1>Okay, let's hear them. Let's hear about these real world uses,

330
00:16:05.279 --> 00:16:05.720
<v Speaker 1>all right.

331
00:16:05.919 --> 00:16:11.080
<v Speaker 2>So the first one, it's called periodic alerting. Imagine you

332
00:16:11.120 --> 00:16:15.200
<v Speaker 2>have a rule that flags a specific type of suspicious activity,

333
00:16:15.639 --> 00:16:18.039
<v Speaker 2>but you don't want to be bombarded with alerts every

334
00:16:18.080 --> 00:16:18.759
<v Speaker 2>single time it.

335
00:16:18.720 --> 00:16:21.039
<v Speaker 1>Happens, right, Sometimes there's only a problem if it happens.

336
00:16:20.840 --> 00:16:24.039
<v Speaker 2>A lot, right exactly. With periodic alerting, you can set

337
00:16:24.080 --> 00:16:27.799
<v Speaker 2>mod security to only you send an alert for that

338
00:16:27.840 --> 00:16:31.759
<v Speaker 2>event once within a specific timeframe, even if the rule

339
00:16:31.799 --> 00:16:33.000
<v Speaker 2>is triggered multiple times.

340
00:16:33.240 --> 00:16:35.679
<v Speaker 1>So how does persistent storage help with that?

341
00:16:36.200 --> 00:16:38.840
<v Speaker 2>So you can set up a rule that checks for

342
00:16:38.879 --> 00:16:41.879
<v Speaker 2>that suspicious event if it happens. The rule can look

343
00:16:41.919 --> 00:16:44.600
<v Speaker 2>for a flag in a global collection that tells you

344
00:16:44.679 --> 00:16:47.759
<v Speaker 2>whether an alert has been sent recently. If the flag

345
00:16:47.799 --> 00:16:50.200
<v Speaker 2>is set, meaning an alert was already sent, it just

346
00:16:50.279 --> 00:16:52.960
<v Speaker 2>increments a counter, okay, and doesn't sound the alarm.

347
00:16:53.120 --> 00:16:56.559
<v Speaker 1>Sure like silencing the alarm, but still keeping track.

348
00:16:56.559 --> 00:16:59.600
<v Speaker 2>Exactly, And that counter is also stored in the global collection.

349
00:17:00.000 --> 00:17:01.879
<v Speaker 2>When you set the flag to expire, let's say after

350
00:17:01.960 --> 00:17:05.920
<v Speaker 2>sixty seconds. Once the flag expires, the next occurrence of

351
00:17:05.960 --> 00:17:07.839
<v Speaker 2>that event will trigger a new alert.

352
00:17:08.119 --> 00:17:10.960
<v Speaker 1>So you're controlling how often you're alerted.

353
00:17:10.680 --> 00:17:13.599
<v Speaker 2>Exactly, and when that next alert is sent, it can

354
00:17:13.640 --> 00:17:16.359
<v Speaker 2>actually include the number of times that event happened while

355
00:17:16.400 --> 00:17:19.720
<v Speaker 2>the alert was suppressed. Oh wow, so you get valuable context.

356
00:17:19.799 --> 00:17:22.559
<v Speaker 1>That's awesome. What else can you do with persistent storage?

357
00:17:22.680 --> 00:17:28.400
<v Speaker 2>Another great application is detecting denial of service attacks. MOD

358
00:17:28.440 --> 00:17:31.920
<v Speaker 2>security can track how many requests are coming from from

359
00:17:31.960 --> 00:17:35.440
<v Speaker 2>specific IP addresses or user agents. That way, you can

360
00:17:35.440 --> 00:17:39.799
<v Speaker 2>spot patterns that might indicate a DOSS attack is underway.

361
00:17:39.839 --> 00:17:42.039
<v Speaker 1>So you can actually set limits, right, Yeah, you can.

362
00:17:41.920 --> 00:17:44.200
<v Speaker 2>Set limits on how many requests are allowed from a

363
00:17:44.240 --> 00:17:48.079
<v Speaker 2>single source within a certain timeframe, and if someone goes

364
00:17:48.119 --> 00:17:52.559
<v Speaker 2>over that limit, boom. Mod security can trigger a rule

365
00:17:52.680 --> 00:17:55.319
<v Speaker 2>to block them. It's like a dynamic shield exactly, a

366
00:17:55.359 --> 00:17:59.200
<v Speaker 2>dynamic shield that protects your server from being overwhelmed. But

367
00:17:59.359 --> 00:18:03.000
<v Speaker 2>the handbook makes a good point that the effectiveness of

368
00:18:03.039 --> 00:18:06.359
<v Speaker 2>this actually depends on how long you keep the records

369
00:18:06.359 --> 00:18:09.599
<v Speaker 2>in your collection. So if you keep records for too long,

370
00:18:10.039 --> 00:18:12.519
<v Speaker 2>a short burst of traffic might not actually stand out

371
00:18:12.599 --> 00:18:15.519
<v Speaker 2>enough to trigger the rule. Right. It's like trying to

372
00:18:15.559 --> 00:18:16.799
<v Speaker 2>find a needle in a haystack.

373
00:18:16.839 --> 00:18:18.720
<v Speaker 1>You gotta find that balance, right exactly.

374
00:18:18.920 --> 00:18:19.680
<v Speaker 2>The last one.

375
00:18:19.559 --> 00:18:20.960
<v Speaker 1>There's a third one, right, right.

376
00:18:21.319 --> 00:18:25.400
<v Speaker 2>The third one is all about stopping those brute force

377
00:18:25.440 --> 00:18:28.839
<v Speaker 2>attacks where hackers are, you know, trying to guess passwords.

378
00:18:29.480 --> 00:18:32.680
<v Speaker 2>Mod security can actually keep track of failed log in

379
00:18:32.720 --> 00:18:36.720
<v Speaker 2>attempts from specific IP addresses or user names.

380
00:18:36.960 --> 00:18:39.720
<v Speaker 1>You can spot accounts or IP addresses that are doing

381
00:18:39.799 --> 00:18:41.200
<v Speaker 1>something shady exactly.

382
00:18:41.279 --> 00:18:43.880
<v Speaker 2>You can set a limit for how many failed logins

383
00:18:43.880 --> 00:18:46.880
<v Speaker 2>are allowed before you take action, and if someone goes

384
00:18:46.960 --> 00:18:50.400
<v Speaker 2>over that limit, mod security can block them from making

385
00:18:50.480 --> 00:18:54.200
<v Speaker 2>further attempts. Like a lockout, Yeah, like a temporary lockout

386
00:18:54.200 --> 00:18:57.160
<v Speaker 2>to protect against those those brute force attacks. And you

387
00:18:57.200 --> 00:18:59.119
<v Speaker 2>can even get fancy with it. You could set it

388
00:18:59.200 --> 00:19:01.880
<v Speaker 2>up so that the lockout time actually gets longer with

389
00:19:01.960 --> 00:19:02.960
<v Speaker 2>each failed attempt.

390
00:19:03.079 --> 00:19:04.920
<v Speaker 1>Oh really, so they have to wait longer and longer.

391
00:19:05.079 --> 00:19:09.160
<v Speaker 2>Yeah, so that'll discourage those really persistent hackers.

392
00:19:09.480 --> 00:19:13.279
<v Speaker 1>Persistent storage is pretty amazing. It's like mod security is

393
00:19:13.319 --> 00:19:15.000
<v Speaker 1>not just watching, but it's remembering.

394
00:19:15.160 --> 00:19:19.079
<v Speaker 2>That's right. By analyzing past events, mod security can actually

395
00:19:19.119 --> 00:19:21.680
<v Speaker 2>make smarter decisions in real time.

396
00:19:22.079 --> 00:19:24.680
<v Speaker 1>That's cool. Yeah. Okay, So now that we've got like

397
00:19:24.799 --> 00:19:28.960
<v Speaker 1>those basics of persistent storage down, what other advanced techniques

398
00:19:29.000 --> 00:19:29.359
<v Speaker 1>are there?

399
00:19:29.480 --> 00:19:32.599
<v Speaker 2>Well, let's get into session management. Okay, mod security can

400
00:19:32.640 --> 00:19:36.559
<v Speaker 2>actually track and manage user sessions, adding a whole other

401
00:19:36.680 --> 00:19:39.559
<v Speaker 2>layer protection to your web applications.

402
00:19:39.680 --> 00:19:42.079
<v Speaker 1>Session management. I know it's important, but it also sounds

403
00:19:42.119 --> 00:19:42.880
<v Speaker 1>really complicated.

404
00:19:43.000 --> 00:19:46.680
<v Speaker 2>It can be, but essentially, when someone logs into a website,

405
00:19:47.000 --> 00:19:51.359
<v Speaker 2>they're usually given a unique session ID. That idea is

406
00:19:51.400 --> 00:19:53.759
<v Speaker 2>often stored in a cookie and it lets the application

407
00:19:53.920 --> 00:19:56.680
<v Speaker 2>know who they are and that they're logged in. But

408
00:19:56.880 --> 00:20:00.279
<v Speaker 2>these sessions can be hijacked, where an attacker steal the

409
00:20:00.319 --> 00:20:03.000
<v Speaker 2>idea and pretends to be the real user.

410
00:20:03.160 --> 00:20:04.839
<v Speaker 1>So how does mod security prevent that?

411
00:20:05.279 --> 00:20:09.160
<v Speaker 2>Mod security actually has several ways to secure those sessions.

412
00:20:09.440 --> 00:20:12.960
<v Speaker 2>It can analyze the characteristics of of the session IDs

413
00:20:13.000 --> 00:20:16.920
<v Speaker 2>to make sure they know meet certain security standards. For example,

414
00:20:17.039 --> 00:20:19.960
<v Speaker 2>you could create rules to check the length, the randomness,

415
00:20:19.960 --> 00:20:22.799
<v Speaker 2>the expiration time of session cookies.

416
00:20:22.920 --> 00:20:25.759
<v Speaker 1>So it's kind of like enforcing those best practices right exactly.

417
00:20:25.799 --> 00:20:29.480
<v Speaker 2>You can also set mod security to to track how

418
00:20:29.519 --> 00:20:32.799
<v Speaker 2>the session is being used and look for anything unusual

419
00:20:32.799 --> 00:20:36.640
<v Speaker 2>that might that might point to a hijacking attempt. Okay,

420
00:20:36.680 --> 00:20:39.119
<v Speaker 2>For instance, it could it could trigger an alert if

421
00:20:39.160 --> 00:20:43.119
<v Speaker 2>the if the session suddenly comes from a different IP address.

422
00:20:42.799 --> 00:20:44.559
<v Speaker 1>So it's like you've got a security camera focused on

423
00:20:44.559 --> 00:20:45.160
<v Speaker 1>each session.

424
00:20:45.319 --> 00:20:46.799
<v Speaker 2>That's a great way to think about it. And you

425
00:20:46.839 --> 00:20:50.920
<v Speaker 2>can actually even define actions to protect a session that

426
00:20:50.920 --> 00:20:54.200
<v Speaker 2>that looks compromised. For example, you could set up a

427
00:20:54.279 --> 00:20:57.799
<v Speaker 2>rule that automatically logs someone out if their session starts,

428
00:20:57.960 --> 00:20:59.839
<v Speaker 2>you know, behaving strangely.

429
00:20:59.519 --> 00:21:02.720
<v Speaker 1>So not detecting problems, but actually fixing them exactly.

430
00:21:02.839 --> 00:21:05.119
<v Speaker 2>Mod security gives you a lot of a lot of

431
00:21:05.200 --> 00:21:07.799
<v Speaker 2>power to control and protect those sessions.

432
00:21:08.279 --> 00:21:11.880
<v Speaker 1>Okay, so session management clearly important. What else? What else

433
00:21:11.960 --> 00:21:12.279
<v Speaker 1>is there?

434
00:21:12.440 --> 00:21:15.480
<v Speaker 2>Well, we've only just touched on some of the advanced

435
00:21:15.519 --> 00:21:19.480
<v Speaker 2>techniques that mod security offers. The handbook also talks about

436
00:21:19.480 --> 00:21:24.960
<v Speaker 2>things like whitelisting, virtual patching, even integration with other Apache module.

437
00:21:24.599 --> 00:21:27.480
<v Speaker 1>Hold on whitelisting, Yeah, isn't that the opposite of what

438
00:21:27.839 --> 00:21:28.960
<v Speaker 1>a way if is supposed to do?

439
00:21:29.119 --> 00:21:31.920
<v Speaker 2>Well? You know, blocking bad traffic is the is the

440
00:21:31.920 --> 00:21:35.039
<v Speaker 2>primary goal, but sometimes you need to make exceptions. Maybe

441
00:21:35.039 --> 00:21:39.319
<v Speaker 2>you have a trusted partner that needs access to specific resources,

442
00:21:39.480 --> 00:21:42.680
<v Speaker 2>or maybe a certain type of request just keeps triggering

443
00:21:42.720 --> 00:21:45.440
<v Speaker 2>false positives. That's where whitelisting comes in.

444
00:21:45.599 --> 00:21:48.119
<v Speaker 1>So you're essentially saying, hey, just let this traffic through.

445
00:21:48.279 --> 00:21:50.799
<v Speaker 2>Yeah, basically, let this traffic through, no need to check it.

446
00:21:51.319 --> 00:21:56.200
<v Speaker 2>But the handbook stresses the importance of being really cautious

447
00:21:56.200 --> 00:21:57.000
<v Speaker 2>with whitelisting.

448
00:21:57.279 --> 00:21:57.400
<v Speaker 1>Right.

449
00:21:57.480 --> 00:22:00.759
<v Speaker 2>If you're not careful, you can accidentally create a security

450
00:22:00.799 --> 00:22:02.519
<v Speaker 2>hole that attackers can exploit.

451
00:22:02.680 --> 00:22:05.400
<v Speaker 1>It's like creating a VIP lane that bypasses security. Right.

452
00:22:05.599 --> 00:22:09.359
<v Speaker 2>That's a great analogy, and the handbook actually provides examples

453
00:22:09.359 --> 00:22:15.799
<v Speaker 2>of how to whitelist requests from specific IP addresses, user agents,

454
00:22:16.440 --> 00:22:17.559
<v Speaker 2>even a patche itself.

455
00:22:17.599 --> 00:22:20.039
<v Speaker 1>You don't want to block your own server exactly.

456
00:22:19.640 --> 00:22:24.200
<v Speaker 2>But whitelisting is just one of the many advanced techniques.

457
00:22:24.440 --> 00:22:26.680
<v Speaker 2>Another interesting one is virtual patching.

458
00:22:26.880 --> 00:22:28.720
<v Speaker 1>Virtual patching, that sounds cool, right.

459
00:22:29.039 --> 00:22:33.640
<v Speaker 2>So imagine you discover a security flaw in your web application.

460
00:22:34.160 --> 00:22:37.960
<v Speaker 2>Ideally you'd fix the code directly. Yeah, but sometimes that's

461
00:22:38.000 --> 00:22:41.440
<v Speaker 2>not feasible. Maybe you're dealing with legacy software, or maybe

462
00:22:41.480 --> 00:22:43.400
<v Speaker 2>the fix is just going to take a while to implement.

463
00:22:43.599 --> 00:22:44.160
<v Speaker 1>So what do you do?

464
00:22:44.359 --> 00:22:47.480
<v Speaker 2>That's where virtual patching comes in with mod security. You

465
00:22:47.519 --> 00:22:52.480
<v Speaker 2>can create rules that specifically target that vulnerability, essentially blocking

466
00:22:52.480 --> 00:22:54.359
<v Speaker 2>attacks before they even reach your application.

467
00:22:54.559 --> 00:22:57.480
<v Speaker 1>So like a temporary shield over the weak spot exactly.

468
00:22:57.759 --> 00:23:00.799
<v Speaker 2>Virtual patching is a great way to buy yourself some

469
00:23:00.880 --> 00:23:03.160
<v Speaker 2>time while you work on a permanent fix.

470
00:23:03.039 --> 00:23:05.000
<v Speaker 1>Like a band aid exactly.

471
00:23:05.160 --> 00:23:08.960
<v Speaker 2>And speaking of temporary measures, there's another technique we should

472
00:23:09.000 --> 00:23:11.039
<v Speaker 2>touch on called reputation management.

473
00:23:11.119 --> 00:23:16.119
<v Speaker 1>Reputation management, now that sounds more like PR than security.

474
00:23:16.400 --> 00:23:19.920
<v Speaker 2>Well, in MOD security, reputation management is all about using

475
00:23:20.000 --> 00:23:24.319
<v Speaker 2>external data sources to determine whether a client is trustworthy.

476
00:23:24.440 --> 00:23:27.319
<v Speaker 2>It's like checking someone's background before you let them into

477
00:23:27.359 --> 00:23:27.759
<v Speaker 2>your house.

478
00:23:28.039 --> 00:23:30.839
<v Speaker 1>So how do you check an IP address's reputation?

479
00:23:31.559 --> 00:23:36.279
<v Speaker 2>MOD security can actually use GeoIP databases to figure out

480
00:23:36.279 --> 00:23:39.519
<v Speaker 2>where a request is coming from geographically. It can also

481
00:23:39.559 --> 00:23:45.240
<v Speaker 2>tap into real time blacklists rbls to identify IP addresses

482
00:23:45.279 --> 00:23:47.960
<v Speaker 2>that are known for malicious activity, so you.

483
00:23:47.920 --> 00:23:51.839
<v Speaker 1>Could block request from a certain country known for cyber.

484
00:23:51.599 --> 00:23:55.519
<v Speaker 2>Attacks exactly, or IP addresses that are constantly sending out spam.

485
00:23:55.599 --> 00:23:59.119
<v Speaker 2>But the handbook does caution that these blacklists can sometimes

486
00:23:59.160 --> 00:24:01.599
<v Speaker 2>have false positive so you don't want to accidentally block

487
00:24:01.680 --> 00:24:03.680
<v Speaker 2>you know, legitimate traffic, right.

488
00:24:03.559 --> 00:24:05.440
<v Speaker 1>Gotta be careful. It's amazing how much you can do

489
00:24:05.519 --> 00:24:08.240
<v Speaker 1>with MOD security. It's so much more than just a

490
00:24:08.279 --> 00:24:09.200
<v Speaker 1>simple firewall.

491
00:24:09.359 --> 00:24:13.440
<v Speaker 2>You're absolutely right, it's an incredibly versatile tool for building

492
00:24:13.559 --> 00:24:17.279
<v Speaker 2>a really solid web application security strategy.

493
00:24:17.400 --> 00:24:19.720
<v Speaker 1>Okay, so we've covered a lot, right. We've talked about

494
00:24:20.400 --> 00:24:24.440
<v Speaker 1>persistent storage, you know, it's uses in those real world scenarios.

495
00:24:24.880 --> 00:24:28.920
<v Speaker 1>We talked about whitelisting, virtual patching, reputation management.

496
00:24:29.079 --> 00:24:31.640
<v Speaker 2>We even touched on how you can you know, extend

497
00:24:31.680 --> 00:24:34.160
<v Speaker 2>mod security with your own code and use it with

498
00:24:34.240 --> 00:24:35.319
<v Speaker 2>other Apache modules.

499
00:24:35.400 --> 00:24:39.079
<v Speaker 1>So it's deep, it's complex, yeah, but very powerful.

500
00:24:39.160 --> 00:24:42.319
<v Speaker 2>Absolutely. In the final part of our deep dive, we're

501
00:24:42.319 --> 00:24:44.960
<v Speaker 2>going to step back look at the bigger picture and

502
00:24:45.000 --> 00:24:47.519
<v Speaker 2>we'll discuss some of the things mod security is still

503
00:24:47.519 --> 00:24:51.920
<v Speaker 2>working on, where it's headed and what that human centric

504
00:24:51.920 --> 00:24:53.799
<v Speaker 2>philosophy really means in practice.

505
00:24:53.880 --> 00:24:56.680
<v Speaker 1>Already looking forward to if this has been really enlightening. Yeah, right,

506
00:24:56.720 --> 00:24:59.279
<v Speaker 1>so welcome back. We've gone deep into mod security. You know,

507
00:24:59.279 --> 00:25:02.319
<v Speaker 1>we've talked about the features, the rules, and even how

508
00:25:02.319 --> 00:25:06.319
<v Speaker 1>it handles things like comment spammers. But I'm curious about,

509
00:25:06.599 --> 00:25:09.119
<v Speaker 1>you know, what's next. You mentioned that there were still

510
00:25:09.160 --> 00:25:11.920
<v Speaker 1>some areas where mod security could improve.

511
00:25:12.279 --> 00:25:16.559
<v Speaker 2>Yeah. Absolutely, you know, it's it's powerful, but there's always

512
00:25:16.640 --> 00:25:19.680
<v Speaker 2>room for growth. And one area that I think would

513
00:25:19.720 --> 00:25:23.480
<v Speaker 2>be a real game changer is automated learning. You know,

514
00:25:23.599 --> 00:25:27.599
<v Speaker 2>imagine if mod security could analyze your normal website traffic

515
00:25:28.079 --> 00:25:32.519
<v Speaker 2>and learn what typical behavior looks like, and then automatically

516
00:25:32.599 --> 00:25:36.839
<v Speaker 2>create rules to block anything that deviates from that baseline.

517
00:25:37.319 --> 00:25:40.759
<v Speaker 1>So it's almost like it's not just watching for suspicious activity,

518
00:25:41.000 --> 00:25:45.119
<v Speaker 1>but also like learning the routines of everyone it's supposed

519
00:25:45.119 --> 00:25:45.480
<v Speaker 1>to be there.

520
00:25:45.519 --> 00:25:47.039
<v Speaker 2>That's a great way to put it. Yeah, it would

521
00:25:47.079 --> 00:25:50.240
<v Speaker 2>take a huge burden off of you know, security professionals

522
00:25:50.240 --> 00:25:52.960
<v Speaker 2>who currently spend a lot of time manually crafting and

523
00:25:53.039 --> 00:25:56.839
<v Speaker 2>updating rules. And there's actually a project called mod Profiler

524
00:25:56.880 --> 00:25:59.240
<v Speaker 2>that's working on this, but it's not fully integrated into

525
00:25:59.279 --> 00:26:03.279
<v Speaker 2>mod security yet. It's definitely an exciting development to keep

526
00:26:03.319 --> 00:26:03.720
<v Speaker 2>an eye on.

527
00:26:03.960 --> 00:26:05.920
<v Speaker 1>Yeah, it sounds like the community is really you know,

528
00:26:06.039 --> 00:26:10.000
<v Speaker 1>pushing the boundaries there. You also mentioned something about deployment flexibility.

529
00:26:10.279 --> 00:26:11.319
<v Speaker 1>What do you mean by that.

530
00:26:11.240 --> 00:26:15.039
<v Speaker 2>Well, right now, mod security is primarily used in what's

531
00:26:15.079 --> 00:26:17.599
<v Speaker 2>called inline mode. This means it sits directly in the

532
00:26:17.599 --> 00:26:22.880
<v Speaker 2>path of traffic and it actively blocks or modifies requests.

533
00:26:23.480 --> 00:26:25.640
<v Speaker 2>But sometimes it would be really useful to have a

534
00:26:25.720 --> 00:26:28.599
<v Speaker 2>passive mode, so you know, where just observes the traffic

535
00:26:28.680 --> 00:26:29.519
<v Speaker 2>without interfering.

536
00:26:29.920 --> 00:26:32.079
<v Speaker 1>That makes sense. Yeah, I could see that being helpful

537
00:26:32.119 --> 00:26:36.599
<v Speaker 1>for just like analyzing traffic patterns, right, maybe even like

538
00:26:36.680 --> 00:26:41.200
<v Speaker 1>identifying threats and fine tuning rules without the risk of breaking.

539
00:26:40.920 --> 00:26:43.240
<v Speaker 2>Your site exactly. It would be a valuable tool for

540
00:26:43.640 --> 00:26:47.160
<v Speaker 2>security analysis and incident response. And while mod security doesn't

541
00:26:47.200 --> 00:26:51.960
<v Speaker 2>have a dedicated passive mode yet, you can achieve similar

542
00:26:52.039 --> 00:26:54.000
<v Speaker 2>results using some of its existing features.

543
00:26:54.319 --> 00:26:56.079
<v Speaker 1>Okay, so a couple of things on the wish list

544
00:26:56.480 --> 00:26:58.960
<v Speaker 1>for the future. Yeah, but overall, it seems like mod

545
00:26:59.000 --> 00:27:03.000
<v Speaker 1>security gives you a pretty comprehensive set of tools.

546
00:27:03.079 --> 00:27:04.680
<v Speaker 2>It really does. But I think one of the most

547
00:27:04.720 --> 00:27:08.079
<v Speaker 2>important things about mod security is is that underlying philosophy,

548
00:27:08.359 --> 00:27:12.079
<v Speaker 2>you know, that that emphasis on human oversight rather than

549
00:27:12.160 --> 00:27:13.920
<v Speaker 2>just relying on automation.

550
00:27:14.680 --> 00:27:16.880
<v Speaker 1>Right, that was a big theme you know, in the

551
00:27:16.880 --> 00:27:19.279
<v Speaker 1>in the handbook and what we talked about earlier. But

552
00:27:19.680 --> 00:27:23.519
<v Speaker 1>what are like the practical implications of that, you know, like,

553
00:27:23.559 --> 00:27:26.279
<v Speaker 1>how does that actually affect the way people use and

554
00:27:26.400 --> 00:27:27.519
<v Speaker 1>manage mod security?

555
00:27:27.599 --> 00:27:29.880
<v Speaker 2>Well, it means that mod security is a tool that

556
00:27:30.039 --> 00:27:34.000
<v Speaker 2>demands your active participation. It's not a set it and

557
00:27:34.079 --> 00:27:35.279
<v Speaker 2>forget it kind of solution.

558
00:27:35.559 --> 00:27:35.799
<v Speaker 1>Right.

559
00:27:35.880 --> 00:27:38.799
<v Speaker 2>You need to be willing to you know, learn that

560
00:27:38.880 --> 00:27:44.039
<v Speaker 2>rule language, carefully craft your rules, monitor those logs, and

561
00:27:44.119 --> 00:27:46.880
<v Speaker 2>make informed decisions based on what you see.

562
00:27:46.960 --> 00:27:49.319
<v Speaker 1>So it's more like a collaboration, right exactly.

563
00:27:49.359 --> 00:27:51.400
<v Speaker 2>And I think that's a good thing. It keeps you engaged,

564
00:27:51.440 --> 00:27:54.200
<v Speaker 2>you know, with your web application security, you have to

565
00:27:54.279 --> 00:27:57.680
<v Speaker 2>understand the threats that you're facing and constantly adapt your defenses.

566
00:27:57.960 --> 00:28:01.079
<v Speaker 1>But doesn't it also put a lot of like responsibility

567
00:28:01.119 --> 00:28:04.039
<v Speaker 1>on the on the security professional. It sounds like you

568
00:28:04.079 --> 00:28:07.759
<v Speaker 1>need a pretty deep understanding of web security to really,

569
00:28:08.119 --> 00:28:09.319
<v Speaker 1>you know, use it effectively.

570
00:28:09.799 --> 00:28:13.039
<v Speaker 2>There's no doubt that mod security has a steep learning curve.

571
00:28:13.079 --> 00:28:16.759
<v Speaker 2>It's it's not a tool for beginners, but you know,

572
00:28:16.880 --> 00:28:19.240
<v Speaker 2>I think that's a trade off for the level of

573
00:28:19.279 --> 00:28:23.119
<v Speaker 2>control and customization it provides. And thankfully, you know, the

574
00:28:23.160 --> 00:28:26.839
<v Speaker 2>handbook and the wealth of resources available online make it

575
00:28:26.960 --> 00:28:28.480
<v Speaker 2>much much easier to master.

576
00:28:29.359 --> 00:28:31.880
<v Speaker 1>So you know, the resources are out there for those

577
00:28:31.920 --> 00:28:33.680
<v Speaker 1>who are willing to put in the work. Yes, but

578
00:28:33.839 --> 00:28:36.160
<v Speaker 1>let's let's talk about you know, the human element for

579
00:28:36.200 --> 00:28:39.000
<v Speaker 1>a second here. MOD security gives you a lot of power,

580
00:28:39.480 --> 00:28:42.279
<v Speaker 1>right you can monitor a block, even change web traffic.

581
00:28:43.039 --> 00:28:45.920
<v Speaker 1>How do you ensure that that power is used responsibly?

582
00:28:46.200 --> 00:28:49.000
<v Speaker 2>That's a crucial point. You know, with great power comes

583
00:28:49.079 --> 00:28:53.799
<v Speaker 2>great responsibility. You need to have clear policies and procedures

584
00:28:53.799 --> 00:28:58.200
<v Speaker 2>in place for using mod security. Your actions should be proportionate, justified,

585
00:28:58.400 --> 00:29:01.200
<v Speaker 2>and they should respect user privacy.

586
00:29:01.279 --> 00:29:03.640
<v Speaker 1>So it's not just like the technical know how, it's

587
00:29:03.640 --> 00:29:04.319
<v Speaker 1>it's ethics.

588
00:29:04.519 --> 00:29:07.519
<v Speaker 2>Absolutely. You need to be aware of data protection laws,

589
00:29:08.000 --> 00:29:12.240
<v Speaker 2>acceptable use policies, and you need a clear understanding of

590
00:29:12.720 --> 00:29:18.400
<v Speaker 2>you know, what constitutes malicious activity that justifies blocking or investigation.

591
00:29:18.680 --> 00:29:22.799
<v Speaker 1>So it's really responsibility. It's not just a tool, right, well.

592
00:29:22.640 --> 00:29:26.000
<v Speaker 2>Said, think of think of mod security as a powerful

593
00:29:26.039 --> 00:29:29.000
<v Speaker 2>tool that helps you be a vigilant guardian of your

594
00:29:29.000 --> 00:29:32.400
<v Speaker 2>web applications. But it's it's up to you to use

595
00:29:32.400 --> 00:29:34.200
<v Speaker 2>that power wisely and ethically.

596
00:29:34.880 --> 00:29:37.079
<v Speaker 1>Well, we've reached the end of our deep dive into

597
00:29:37.119 --> 00:29:39.759
<v Speaker 1>mod security. What a journey it has been. You know,

598
00:29:39.759 --> 00:29:41.839
<v Speaker 1>we talked about the origins, the inner workings, you know,

599
00:29:41.880 --> 00:29:46.160
<v Speaker 1>that unique philosophy, even some of the ethical considerations. What's

600
00:29:46.240 --> 00:29:48.720
<v Speaker 1>the what's the key takeaway you want our listeners to

601
00:29:48.759 --> 00:29:49.279
<v Speaker 1>walk away with.

602
00:29:49.519 --> 00:29:52.240
<v Speaker 2>You know, mod security is incredibly powerful, but it's it's

603
00:29:52.240 --> 00:29:55.640
<v Speaker 2>not a magic solution. It's a tool that rewards curiosity,

604
00:29:56.119 --> 00:29:59.279
<v Speaker 2>a desire to learn, and a willingness to explore. You know,

605
00:29:59.359 --> 00:30:02.079
<v Speaker 2>the more you and invest in understanding it, the more

606
00:30:02.079 --> 00:30:05.039
<v Speaker 2>you'll be able to leverage its capabilities to protect your

607
00:30:05.039 --> 00:30:08.720
<v Speaker 2>web applications in a world of constantly evolving threats.

608
00:30:08.799 --> 00:30:11.200
<v Speaker 1>So the learning doesn't stop here. That's right, it's just

609
00:30:11.240 --> 00:30:11.759
<v Speaker 1>the beginning.

610
00:30:11.920 --> 00:30:15.680
<v Speaker 2>Dive into that documentation, experiment with that rule language, and

611
00:30:16.200 --> 00:30:19.839
<v Speaker 2>see how you can use this remarkable tool to strengthen

612
00:30:19.880 --> 00:30:22.279
<v Speaker 2>your own web application security.

613
00:30:22.839 --> 00:30:26.039
<v Speaker 1>A huge thank you to you our expert, for walking

614
00:30:26.079 --> 00:30:28.200
<v Speaker 1>us through this deep dive into our listeners. Thanks for

615
00:30:28.279 --> 00:30:30.480
<v Speaker 1>joining us. Until next time, I'm on the deep dive,

616
00:30:30.839 --> 00:30:32.519
<v Speaker 1>Keep exploring and stay curious.
