-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdatabase_filter.R
23 lines (18 loc) · 1.55 KB
/
database_filter.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DESCRIPTION <- "Filter for database-related breaches."
# Database Preso / Blog
# Number of Database breaches
vz %>% filter(`asset.assets.variety.S - Database`==T | action.hacking.variety.SQLi==T | `action.malware.variety.SQL injection`==T) %>% dim
# Number of years covered
vz %>% filter(`asset.assets.variety.S - Database`==T | action.hacking.variety.SQLi==T | `action.malware.variety.SQL injection`==T) %>% select(timeline.incident.year) %>% unique
vz %>% filter(`asset.assets.variety.S - Database`==T | action.hacking.variety.SQLi==T | `action.malware.variety.SQL injection`==T) %>% select(timeline.incident.year) %>% unique %>% dim
# Breaches by Year
gg <- ggplot(db.years, aes(x=enum, y=x)) + geom_bar(stat="identity", fill="steelblue") + coord_flip() + xlab("Year") + ylab("Number of Incidents")
print(gg)
# Data Disclosure
db.disclosure <- vz %>% filter(`asset.assets.variety.S - Database`==T | action.hacking.variety.SQLi==T | `action.malware.variety.SQL injection`==T) %>% getenum('attribute.confidentiality.data_disclosure')
gg <- ggplot(db.disclosure, aes(x=enum, y=x)) + geom_bar(stat="identity", fill="steelblue") + coord_flip() + xlab("Disclosure Status") + ylab("Number of Incidents")
print(gg)
# Compare Attributes
db.attribute <- vz %>% filter(`asset.assets.variety.S - Database`==T | action.hacking.variety.SQLi==T | `action.malware.variety.SQL injection`==T) %>% getenum('attribute')
gg <- ggplot(db.attribute, aes(x=enum, y=x)) + geom_bar(stat="identity", fill="steelblue") + coord_flip() + xlab("Attribute Breached") + ylab("Number of Incidents")
print(gg)