UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

39 lines (38 loc) 1.28 kB
rules: - id: insufficient-rsa-key-size patterns: - pattern-either: - pattern: cryptography.hazmat.primitives.asymmetric.rsa.generate_private_key(..., key_size=$SIZE, ...) - pattern: cryptography.hazmat.primitives.asymmetric.rsa.generate_private_key($EXP, $SIZE, ...) - metavariable-comparison: metavariable: $SIZE comparison: $SIZE < 2048 - focus-metavariable: $SIZE fix : | 2048 message: >- Detected an insufficient key size for RSA. NIST recommends a key size of 2048 or higher. metadata: cwe: - 'CWE-326: Inadequate Encryption Strength' owasp: - A03:2017 - Sensitive Data Exposure - A02:2021 - Cryptographic Failures source-rule-url: https://github.com/PyCQA/bandit/blob/b1411bfb43795d3ffd268bef17a839dee954c2b1/bandit/plugins/weak_cryptographic_key.py references: - https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/ - https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf category: security technology: - cryptography subcategory: - audit likelihood: MEDIUM impact: MEDIUM confidence: MEDIUM functional-categories: - crypto::search::key-length::cryptography languages: [python] severity: WARNING