-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added snmp_security check plugin for various SNMP checks #403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the blacklist plugin be used instead of defining a new plugin?
examples/snmp.py
Outdated
@@ -0,0 +1,9 @@ | |||
from pysnmp.hlapi import UsmUserData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alpha sort: UsmUserData comes after CommunityData
@@ -0,0 +1,8 @@ | |||
----------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
----------------------------- | |
---------------------------- |
@@ -0,0 +1,8 @@ | |||
----------------------------- | |||
B508: snmp_weak_cryptography | |||
----------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
----------------------------- | |
---------------------------- |
if context.call_args_count == 1 or context.call_args_count == 1: | ||
return bandit.Issue( | ||
severity=bandit.MEDIUM, | ||
confidence=bandit.MEDIUM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the confidence not HIGH?
severity=bandit.MEDIUM, | ||
confidence=bandit.MEDIUM, | ||
text="You should not use SNMPv3 without encryption. " | ||
"noAuthNoPriv is an insecure method of transport.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about authNoPriv
? Seems equally bad.
context.check_call_arg_value("mpModel", 1): | ||
return bandit.Issue( | ||
severity=bandit.MEDIUM, | ||
confidence=bandit.MEDIUM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the confidence not HIGH?
@ericwb fixed up the lint errors you pointed out and corrected the duplicate code. As for using the blacklist plugin, I would think it should be its own plugin since its a very narrow use case |
# Copyright (c) 2018 SolarWinds, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to SPDX short form of the license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This solves #355 by adding a single plugin that has two tests: