Skip to content

Commit

Permalink
Quickfix for TheHive-Project#169: added same regex change for fqdn de…
Browse files Browse the repository at this point in the history
…tection
  • Loading branch information
3c7 committed Jan 14, 2018
1 parent 9a7613a commit 666dd4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contrib/cortexutils/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init_regex():
# fqdn
regex.append({
'type': 'fqdn',
'regex': re.compile(r'^(?!http\:\/\/|https\:\/\/)^[\w\-\.]+\.[\w\-]+\.\w+$')
'regex': re.compile(r'^(?!http\:\/\/|https\:\/\/)^[\w\-\.]+\.[\w\-]+\.[a-zA-Z]+$')
})

return regex
Expand Down
11 changes: 9 additions & 2 deletions contrib/tests/test_suite_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,16 @@ def test_iterable(self):
'Check_iterable: wrong list returned.'
)

def test_float(self):
def test_float_domain(self):
self.assertEqual(
self.extractor.check_string(value='0.001234'),
'',
'Check_float: float was recognized, but should not.'
'Check_float: float was recognized as domain, but should not.'
)

def test_float_fqdn(self):
self.assertEqual(
self.extractor.check_string(value='0.1234.5678'),
'',
'Check_float_fqdn: float was recognized as fqdn but should not.'
)

0 comments on commit 666dd4f

Please sign in to comment.