1
1

00:00:00,549  -->  00:00:02,490
<v Narrator>IAM Auditing.</v>
2

2

00:00:02,490  -->  00:00:03,810
In this lesson, we're going to talk
3

3

00:00:03,810  -->  00:00:06,330
about auditing and monitoring and logging.
4

4

00:00:06,330  -->  00:00:08,670
First, let's talk about IAM auditing
5

5

00:00:08,670  -->  00:00:11,700
because IAM auditing is necessary for us to use
6

6

00:00:11,700  -->  00:00:14,460
if we want to detect compromises of legitimate accounts
7

7

00:00:14,460  -->  00:00:17,910
any kind of rogue account use or an insider threat.
8

8

00:00:17,910  -->  00:00:20,940
The idea with IAM auditing is to look through our systems
9

9

00:00:20,940  -->  00:00:22,950
to see if there's anything bad happening,
10

10

00:00:22,950  -->  00:00:24,630
and one of the best ways to do that is
11

11

00:00:24,630  -->  00:00:26,610
by monitoring and logging.
12

12

00:00:26,610  -->  00:00:28,650
Now, one of the most key logs we're going to be looking
13

13

00:00:28,650  -->  00:00:30,360
at is our audit logs.
14

14

00:00:30,360  -->  00:00:32,850
Audit logs contain a log of all file access
15

15

00:00:32,850  -->  00:00:35,550
and authentications within a network-based operating system,
16

16

00:00:35,550  -->  00:00:37,860
an application or a service.
17

17

00:00:37,860  -->  00:00:39,480
As we go through our audit logs,
18

18

00:00:39,480  -->  00:00:42,150
we're going to be accounting for all of our user actions.
19

19

00:00:42,150  -->  00:00:42,983
As we look through that
20

20

00:00:42,983  -->  00:00:45,180
and we see which users did which things,
21

21

00:00:45,180  -->  00:00:46,950
were they supposed to be able to do those things
22

22

00:00:46,950  -->  00:00:49,020
and why were they doing those things?
23

23

00:00:49,020  -->  00:00:51,030
As we look through that, we can figure that out.
24

24

00:00:51,030  -->  00:00:51,960
That would help us determine
25

25

00:00:51,960  -->  00:00:54,330
if there was some rogue account use going on.
26

26

00:00:54,330  -->  00:00:56,730
Also, we're going to use this to detect intrusions
27

27

00:00:56,730  -->  00:00:58,230
or attempted intrusions.
28

28

00:00:58,230  -->  00:01:00,270
For instance, if I look in there and I see
29

29

00:01:00,270  -->  00:01:01,200
that somebody tried logging
30

30

00:01:01,200  -->  00:01:04,080
into the same account multiple times and failed
31

31

00:01:04,080  -->  00:01:05,160
that could be an indication
32

32

00:01:05,160  -->  00:01:06,810
that somebody's trying to break into that account.
33

33

00:01:06,810  -->  00:01:09,720
That would be an attempted intrusion or it's an indication
34

34

00:01:09,720  -->  00:01:11,340
that somebody just forgot their password.
35

35

00:01:11,340  -->  00:01:12,840
Now again, we're going to have to look at these
36

36

00:01:12,840  -->  00:01:15,690
and make the intelligent guess based on what we're seeing.
37

37

00:01:15,690  -->  00:01:17,520
If I look through my audit logs and I see
38

38

00:01:17,520  -->  00:01:20,130
that somebody tried logging in with A and then AA
39

39

00:01:20,130  -->  00:01:23,640
and then AB, and then AC, what does that look like to you?
40

40

00:01:23,640  -->  00:01:25,830
To me, it looks like a brute force login attempt
41

41

00:01:25,830  -->  00:01:27,540
and so I would want to go and look at that,
42

42

00:01:27,540  -->  00:01:28,860
turn that access off
43

43

00:01:28,860  -->  00:01:30,750
and then go into a further investigation.
44

44

00:01:30,750  -->  00:01:32,340
Now, one of the things we have to worry about
45

45

00:01:32,340  -->  00:01:35,130
here is logging and logging can be a really good thing
46

46

00:01:35,130  -->  00:01:37,440
but it can also be a really dangerous thing for us.
47

47

00:01:37,440  -->  00:01:39,120
Now, why would logging be dangerous?
48

48

00:01:39,120  -->  00:01:41,670
Because we could become buried in logs.
49

49

00:01:41,670  -->  00:01:43,620
Obviously, the more events that are logged,
50

50

00:01:43,620  -->  00:01:44,880
the more difficult it's going to be
51

51

00:01:44,880  -->  00:01:47,490
for us to analyze and interpret those logs.
52

52

00:01:47,490  -->  00:01:49,890
Therefore, it's important for us as cybersecurity analysts
53

53

00:01:49,890  -->  00:01:52,770
for us to choose what to log and how much to log
54

54

00:01:52,770  -->  00:01:54,690
and we have to do this carefully.
55

55

00:01:54,690  -->  00:01:57,450
The other challenge with logs is that they get overwritten.
56

56

00:01:57,450  -->  00:02:00,330
When logs reach their maximum allocated file size,
57

57

00:02:00,330  -->  00:02:02,760
they're going to actually start overwriting the older logs
58

58

00:02:02,760  -->  00:02:05,160
so you need to make sure that you have a way
59

59

00:02:05,160  -->  00:02:06,870
to back up those logs and be able
60

60

00:02:06,870  -->  00:02:08,520
to look at them in the future.
61

61

00:02:08,520  -->  00:02:11,310
For example, we talked earlier about intrusions.
62

62

00:02:11,310  -->  00:02:14,460
How long does it take before the average intrusion is found?
63

63

00:02:14,460  -->  00:02:17,040
Over half of the time it took months.
64

64

00:02:17,040  -->  00:02:18,630
So if you have logs that are being overwritten
65

65

00:02:18,630  -->  00:02:21,450
every seven days, you'll never be able to find it.
66

66

00:02:21,450  -->  00:02:23,670
So you need to be able to think about that as well
67

67

00:02:23,670  -->  00:02:26,040
as you think about what your maximum allocatable size is
68

68

00:02:26,040  -->  00:02:27,780
or if you're going to offload those logs
69

69

00:02:27,780  -->  00:02:30,300
to another system where you can store them for longer.
70

70

00:02:30,300  -->  00:02:31,260
Another thing you have to think about
71

71

00:02:31,260  -->  00:02:32,520
when you're storing these logs is
72

72

00:02:32,520  -->  00:02:34,050
how are you going to keep them secure?
73

73

00:02:34,050  -->  00:02:35,250
Are you going to encrypt them?
74

74

00:02:35,250  -->  00:02:37,320
Are you going to make sure there's confidentiality to them
75

75

00:02:37,320  -->  00:02:40,080
and are you going to hash them to make sure there's integrity?
76

76

00:02:40,080  -->  00:02:42,840
You want to make sure that these logs aren't being modified
77

77

00:02:42,840  -->  00:02:45,270
because an attacker, when they break into your system,
78

78

00:02:45,270  -->  00:02:47,490
one of the things they want to do is cover their tracks
79

79

00:02:47,490  -->  00:02:50,220
and they will do that by modifying your logs.
80

80

00:02:50,220  -->  00:02:52,680
Now, when you start determining what to log
81

81

00:02:52,680  -->  00:02:55,590
this can be a challenge for a lot of security personnel.
82

82

00:02:55,590  -->  00:02:58,200
Most people just say, "I'm going to log everything,"
83

83

00:02:58,200  -->  00:03:00,690
but that can be gigabytes of information every hour
84

84

00:03:00,690  -->  00:03:02,820
or every day, and you might not have enough data
85

85

00:03:02,820  -->  00:03:04,440
to store it all on your system,
86

86

00:03:04,440  -->  00:03:07,050
so you have to think about what you want to store.
87

87

00:03:07,050  -->  00:03:08,280
Now, to figure this out,
88

88

00:03:08,280  -->  00:03:11,400
you should take a look at the audit policy recommendations.
89

89

00:03:11,400  -->  00:03:13,710
This is a document on Microsoft's website
90

90

00:03:13,710  -->  00:03:15,030
and it'll give you some recommendations
91

91

00:03:15,030  -->  00:03:18,120
on how they say you should configure your audit policy.
92

92

00:03:18,120  -->  00:03:19,800
Some typical categories that are covered
93

93

00:03:19,800  -->  00:03:21,330
underneath these recommendations are things
94

94

00:03:21,330  -->  00:03:23,400
like the account log on and management events,
95

95

00:03:23,400  -->  00:03:25,290
and how many of those you should be capturing.
96

96

00:03:25,290  -->  00:03:28,050
The process creation, the object access,
97

97

00:03:28,050  -->  00:03:30,600
things like file systems and file shares,
98

98

00:03:30,600  -->  00:03:32,520
things like changes to your audit policy
99

99

00:03:32,520  -->  00:03:35,100
or changes to system security and integrity
100

100

00:03:35,100  -->  00:03:37,740
like for instance, if somebody turns on or off a firewall,
101

101

00:03:37,740  -->  00:03:40,290
on or off an antivirus, and things like that.
102

102

00:03:40,290  -->  00:03:41,850
All of these are things you should consider
103

103

00:03:41,850  -->  00:03:43,530
as you're determining what to log
104

104

00:03:43,530  -->  00:03:45,960
because these are some of the big rocks.
105

105

00:03:45,960  -->  00:03:48,150
Now, if you want to configure all of this, again,
106

106

00:03:48,150  -->  00:03:50,010
you can refer to that Microsoft document
107

107

00:03:50,010  -->  00:03:51,180
but essentially you're going to go
108

108

00:03:51,180  -->  00:03:52,800
into your group policy object
109

109

00:03:52,800  -->  00:03:54,900
and you're going to go in there and configure these things.
110

110

00:03:54,900  -->  00:03:56,820
Either enable them or disable them based
111

111

00:03:56,820  -->  00:03:59,460
on how much you want to log and what you want to log.
112

112

00:03:59,460  -->  00:04:01,830
Now again, the reason logging is so important is
113

113

00:04:01,830  -->  00:04:04,110
because it is the primary method we use
114

114

00:04:04,110  -->  00:04:06,720
to uncover account access violations.
115

115

00:04:06,720  -->  00:04:08,130
This is known as a log review.
116

116

00:04:08,130  -->  00:04:10,140
We're going to go through and look at these logs.
117

117

00:04:10,140  -->  00:04:11,250
If you're logging everything
118

118

00:04:11,250  -->  00:04:14,010
but you never look at the logs, they're worthless to you.
119

119

00:04:14,010  -->  00:04:15,090
Logs are only good
120

120

00:04:15,090  -->  00:04:17,460
if you open them up and actually look at them.
121

121

00:04:17,460  -->  00:04:19,770
Now, what are you going to be looking for in this log review?
122

122

00:04:19,770  -->  00:04:22,710
Well, multiple consecutive authentication failures,
123

123

00:04:22,710  -->  00:04:23,730
that's a good indication
124

124

00:04:23,730  -->  00:04:25,770
that somebody's trying to break into your network.
125

125

00:04:25,770  -->  00:04:27,300
You might look for unscheduled changes
126

126

00:04:27,300  -->  00:04:28,860
to a system's configuration.
127

127

00:04:28,860  -->  00:04:31,560
That might tell you that they're infected with malware.
128

128

00:04:31,560  -->  00:04:34,260
You might look at sequencing errors or gaps in logs.
129

129

00:04:34,260  -->  00:04:36,570
This can tell you, you have a modification problem.
130

130

00:04:36,570  -->  00:04:37,950
Somebody might have broken into your system
131

131

00:04:37,950  -->  00:04:41,040
and deleted some of the logs, or they modified the logs.
132

132

00:04:41,040  -->  00:04:43,590
All of these are things you have to worry about.
133

133

00:04:43,590  -->  00:04:44,880
Now, another thing you need to worry
134

134

00:04:44,880  -->  00:04:47,220
about is doing a manual review.
135

135

00:04:47,220  -->  00:04:50,220
Now, a manual review helps you look at your user accounts
136

136

00:04:50,220  -->  00:04:52,560
and make sure they actually have the right permissions.
137

137

00:04:52,560  -->  00:04:53,730
Why do you need to do this?
138

138

00:04:53,730  -->  00:04:55,890
Well, because in every company.
139

139

00:04:55,890  -->  00:04:58,320
people get hired and people get fired
140

140

00:04:58,320  -->  00:05:00,360
and as people are hired, they're given permissions.
141

141

00:05:00,360  -->  00:05:02,700
When they're fired, they should be losing permissions
142

142

00:05:02,700  -->  00:05:04,950
and if they move even jobs within the company,
143

143

00:05:04,950  -->  00:05:06,630
they should have different permission levels based
144

144

00:05:06,630  -->  00:05:07,890
on the job they have.
145

145

00:05:07,890  -->  00:05:10,410
So doing a manual review will make sure
146

146

00:05:10,410  -->  00:05:13,080
that those permissions are accurate for those users.
147

147

00:05:13,080  -->  00:05:15,030
This is an important thing and another reason
148

148

00:05:15,030  -->  00:05:17,010
why we'd like to put people in and out of groups
149

149

00:05:17,010  -->  00:05:18,030
to give them permission
150

150

00:05:18,030  -->  00:05:19,710
as opposed to giving people permissions
151

151

00:05:19,710  -->  00:05:22,680
directly on different file shares or different services.
152

152

00:05:22,680  -->  00:05:24,660
It's easier to take them and remove them from groups
153

153

00:05:24,660  -->  00:05:26,400
than it is to find every single place
154

154

00:05:26,400  -->  00:05:27,870
that they have been given permission.
155

155

00:05:27,870  -->  00:05:29,460
So keep that in mind and try to use
156

156

00:05:29,460  -->  00:05:32,280
role-based authentication as you set up your systems.
157

157

00:05:32,280  -->  00:05:34,500
Now, the other thing we're going to do is a re-certification
158

158

00:05:34,500  -->  00:05:36,480
and this is part of our manual review.
159

159

00:05:36,480  -->  00:05:39,060
A re-certification essentially is a manual review
160

160

00:05:39,060  -->  00:05:41,760
of all the accounts, the permissions, the configurations
161

161

00:05:41,760  -->  00:05:43,590
and the clearance levels, and you'll do this
162

162

00:05:43,590  -->  00:05:46,890
at a given interval that might be monthly, quarterly
163

163

00:05:46,890  -->  00:05:49,710
every six months, every year, every five years.
164

164

00:05:49,710  -->  00:05:50,730
I don't care what it is.
165

165

00:05:50,730  -->  00:05:53,460
That's for you and your organization to determine based
166

166

00:05:53,460  -->  00:05:54,900
on your risk appetite.
167

167

00:05:54,900  -->  00:05:57,810
In my organization, we do this once a year.
168

168

00:05:57,810  -->  00:06:00,090
Now that's a pretty long time for most organizations
169

169

00:06:00,090  -->  00:06:01,680
but we have a small staff
170

170

00:06:01,680  -->  00:06:04,740
and we don't have people hiring and firing very commonly
171

171

00:06:04,740  -->  00:06:06,870
so for us, a recertification isn't something
172

172

00:06:06,870  -->  00:06:08,640
that takes a big priority based
173

173

00:06:08,640  -->  00:06:10,773
on our risk appetite and our risk posture.
