Skip to content

Commit

Permalink
[u] Setup CloudWatch alarm for ClamAV notifications (#3895)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirho-ucsc committed Feb 22, 2024
1 parent adbda4d commit 877ac0d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions UPGRADING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ have too many entries in this file.
Operator
~~~~~~~~

Manually deploy the ``gitlab`` component of any main deployment just before
pushing the merge commit to the GitLab instance in that deployment.
Manually deploy the ``shared`` and ``gitlab`` components of any main deployment
just before pushing the merge commit to the GitLab instance in that deployment.


#5728 Many stale images in gitlab-dind and GitLab registry
Expand Down
26 changes: 21 additions & 5 deletions terraform/shared/shared.tf.json.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,19 @@ def paren(s: str) -> str:
'value': 1,
'default_value': 0,
}
},
'clamscan': {
'name': config.qualified_resource_name('clamscan', suffix='.filter'),
# Patterns that include non-alphanumeric characters must be
# wrapped in double quotation marks ("")
'pattern': '"docker: clamscan"',
'log_group_name': '/aws/cwagent/azul-gitlab',
'metric_transformation': {
'name': config.qualified_resource_name('clamscan'),
'namespace': 'LogMetrics',
'value': 1,
'default_value': 0,
}
}
},
'aws_cloudwatch_metric_alarm': {
Expand All @@ -546,8 +559,8 @@ def paren(s: str) -> str:
for a in cis_alarms
},
**{
'trail_logs': {
'alarm_name': config.qualified_resource_name('trail_logs', suffix='.alarm'),
resource_name: {
'alarm_name': config.qualified_resource_name(resource_name, suffix='.alarm'),
'comparison_operator': 'LessThanThreshold',
'threshold': 1,
'datapoints_to_alarm': 1,
Expand All @@ -570,14 +583,17 @@ def paren(s: str) -> str:
{
'id': 'log_count_raw',
'metric': {
'metric_name': config.qualified_resource_name('trail_logs'),
'metric_name': config.qualified_resource_name(resource_name),
'namespace': 'LogMetrics',
'period': 10 * 60,
'period': period,
'stat': 'Sum',
}
}
]
}
} for resource_name, period in [
('trail_logs', 10 * 60),
('clamscan', 18 * 60 * 60)
]
}
},
'aws_iam_role': {
Expand Down

0 comments on commit 877ac0d

Please sign in to comment.