Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mentat Test 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Mentat
Mentat Test 3
Commits
eb039d6a
Commit
eb039d6a
authored
2 years ago
by
Jakub Judiny
Browse files
Options
Downloads
Patches
Plain Diff
Changed netmngr to always set emails in reporting settings (for new groups).
(Redmine issue: #7556)
parent
57214df8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/mentat/module/netmngr.py
+8
-12
8 additions, 12 deletions
lib/mentat/module/netmngr.py
with
8 additions
and
12 deletions
lib/mentat/module/netmngr.py
+
8
−
12
View file @
eb039d6a
...
...
@@ -506,19 +506,15 @@ class MentatNetmngrScript(mentat.script.fetcher.FetcherScript):
sqlgrp
.
settings_rep
=
SettingsReportingModel
()
self
.
logger
.
warning
(
"'
%s
'
Creating new abuse group.
"
,
gkey
)
checked_group_name
=
False
group_emails_set
=
False
for
network
in
[
network
for
networks
in
wi_file_data
[
group_name
].
values
()
for
network
in
networks
]:
# If there are multiple emails in this abuse group or lowest severity is not low then save
# emails in the reporting settings. By default, if the group in the database doesn't have
# any emails set in the reporting settings then the name of the abuse group is used as
# email address for every severity.
if
not
checked_group_name
:
if
'
,
'
in
group_name
or
any
(
severity
in
network
for
severity
in
[
'
emails_medium
'
,
'
emails_high
'
,
'
emails_critical
'
]):
sqlgrp
.
settings_rep
.
emails_low
=
network
.
get
(
'
emails_low
'
,
None
)
sqlgrp
.
settings_rep
.
emails_medium
=
network
.
get
(
'
emails_medium
'
,
None
)
sqlgrp
.
settings_rep
.
emails_high
=
network
.
get
(
'
emails_high
'
,
None
)
sqlgrp
.
settings_rep
.
emails_critical
=
network
.
get
(
'
emails_critical
'
,
None
)
checked_group_name
=
True
if
not
group_emails_set
:
sqlgrp
.
settings_rep
.
emails_low
=
network
.
get
(
'
emails_low
'
,
None
)
sqlgrp
.
settings_rep
.
emails_medium
=
network
.
get
(
'
emails_medium
'
,
None
)
sqlgrp
.
settings_rep
.
emails_high
=
network
.
get
(
'
emails_high
'
,
None
)
sqlgrp
.
settings_rep
.
emails_critical
=
network
.
get
(
'
emails_critical
'
,
None
)
group_emails_set
=
True
sqlnet
=
networkmodel_from_typeddict
(
network
,
{
'
description
'
:
'
Network created automatically by mentat-netmngr.py utility.
'
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment