Skip to content

Commit

Permalink
feat(teler): implement Verify datasets (checksum)
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Feb 26, 2024
1 parent df08f7e commit d402b0a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions teler.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,24 @@ func (t *Teler) getResources() error {
updated = false
}

// Do checksum for threat datasets
if updated {
t.log.Debug("verifying datasets")
verify, err := threat.Verify()
if err != nil {
// Got something error while verifying
updated = false
}

// Checks if datasets is malformed/corrupted
//
// If not verified, err is defintely not nil.
if !verify {
t.log.Debug(err.Error())
updated = false
}
}

// Download the datasets of threat ruleset from teler-resources
// if threat datasets is not up-to-date, update check is disabled
// and in-memory option is true
Expand Down

1 comment on commit d402b0a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d402b0a Previous: fc389f7 Ratio
BenchmarkInitializeCommonWebAttack 62351743 ns/op 44603431 B/op 98681 allocs/op 28559147 ns/op 43950038 B/op 97947 allocs/op 2.18
BenchmarkInitializeCommonWebAttack - ns/op 62351743 ns/op 28559147 ns/op 2.18
BenchmarkInitializeCVE 64732153 ns/op 44603348 B/op 98679 allocs/op 28822842 ns/op 43949636 B/op 97946 allocs/op 2.25
BenchmarkInitializeCVE - ns/op 64732153 ns/op 28822842 ns/op 2.25
BenchmarkInitializeBadIPAddress 60973079 ns/op 44602838 B/op 98677 allocs/op 30122270 ns/op 43949158 B/op 97945 allocs/op 2.02
BenchmarkInitializeBadIPAddress - ns/op 60973079 ns/op 30122270 ns/op 2.02
BenchmarkInitializeBadReferrer 60880411 ns/op 44603514 B/op 98678 allocs/op 29976159 ns/op 43949640 B/op 97946 allocs/op 2.03
BenchmarkInitializeBadReferrer - ns/op 60880411 ns/op 29976159 ns/op 2.03
BenchmarkInitializeBadCrawler 61018449 ns/op 44604188 B/op 98681 allocs/op 28862908 ns/op 43949102 B/op 97944 allocs/op 2.11
BenchmarkInitializeBadCrawler - ns/op 61018449 ns/op 28862908 ns/op 2.11
BenchmarkInitializeDirectoryBruteforce 64114700 ns/op 44602565 B/op 98678 allocs/op 29612099 ns/op 43949703 B/op 97946 allocs/op 2.17
BenchmarkInitializeDirectoryBruteforce - ns/op 64114700 ns/op 29612099 ns/op 2.17
BenchmarkInitializeWithoutCommonWebAttack 62286943 ns/op 44603759 B/op 98679 allocs/op 29619594 ns/op 43949312 B/op 97945 allocs/op 2.10
BenchmarkInitializeWithoutCommonWebAttack - ns/op 62286943 ns/op 29619594 ns/op 2.10
BenchmarkInitializeWithoutCVE 61067217 ns/op 44603973 B/op 98681 allocs/op 29574100 ns/op 43949236 B/op 97946 allocs/op 2.06
BenchmarkInitializeWithoutCVE - ns/op 61067217 ns/op 29574100 ns/op 2.06
BenchmarkInitializeWithoutBadIPAddress 60783218 ns/op 44602448 B/op 98676 allocs/op 29704793 ns/op 43948404 B/op 97942 allocs/op 2.05
BenchmarkInitializeWithoutBadIPAddress - ns/op 60783218 ns/op 29704793 ns/op 2.05
BenchmarkInitializeWithoutBadReferrer 60887057 ns/op 44603008 B/op 98678 allocs/op 29725568 ns/op 43949471 B/op 97946 allocs/op 2.05
BenchmarkInitializeWithoutBadReferrer - ns/op 60887057 ns/op 29725568 ns/op 2.05
BenchmarkInitializeWithoutBadCrawler 62167163 ns/op 44603462 B/op 98681 allocs/op 29275224 ns/op 43948716 B/op 97944 allocs/op 2.12
BenchmarkInitializeWithoutBadCrawler - ns/op 62167163 ns/op 29275224 ns/op 2.12
BenchmarkInitializeWithoutDirectoryBruteforce 60260775 ns/op 44603988 B/op 98680 allocs/op 29404007 ns/op 43949140 B/op 97944 allocs/op 2.05
BenchmarkInitializeWithoutDirectoryBruteforce - ns/op 60260775 ns/op 29404007 ns/op 2.05
BenchmarkInitializeCustomRules 62264019 ns/op 44605846 B/op 98713 allocs/op 29870038 ns/op 43953081 B/op 97982 allocs/op 2.08
BenchmarkInitializeCustomRules - ns/op 62264019 ns/op 29870038 ns/op 2.08

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.