-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify rule S5547: Add ssl module (#3113)
- Loading branch information
1 parent
5e87343
commit 146e2fa
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,7 @@ | |
* PyJWT | ||
* python-jwt | ||
* python-jose | ||
* ssl | ||
// Docker | ||
* Wget | ||
// Cloudformation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
== How to fix it in ssl | ||
|
||
=== Code examples | ||
|
||
include::../../common/fix/code-rationale.adoc[] | ||
|
||
==== Noncompliant code example | ||
|
||
[source,python,diff-id=41,diff-type=noncompliant] | ||
---- | ||
import ssl | ||
ciphers = 'RC4-SHA:RC4-MD5' | ||
ctx = ssl.create_default_context() | ||
ctx.set_ciphers(ciphers) # Noncompliant | ||
---- | ||
|
||
==== Compliant solution | ||
|
||
[source,python,diff-id=41,diff-type=compliant] | ||
---- | ||
import ssl | ||
ctx = ssl.create_default_context() | ||
---- | ||
|
||
=== How does this work? | ||
|
||
It is recommended to not override the ciphers but instead, use the secure | ||
default ciphers of the module, as they might change over time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters