Skip to content

Commit 6b42c3c

Browse files
committed
Add CodeQL suppression comments for SHA1 and compatibility
Added comments to suppress CodeQL alerts related to SHA1 and other hash algorithms for backward compatibility and ongoing development.
1 parent bdf6b9a commit 6b42c3c

File tree

13 files changed

+13
-13
lines changed

13 files changed

+13
-13
lines changed

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/identity/_credentials/certificate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def load_pkcs12_certificate(certificate_data: bytes, password: Optional[bytes] =
120120
pem_sections = [key_bytes] + [c.public_bytes(Encoding.PEM) for c in [cert] + additional_certs]
121121
pem_bytes = b"".join(pem_sections)
122122

123-
fingerprint = cert.fingerprint(hashes.SHA1()) # nosec
123+
fingerprint = cert.fingerprint(hashes.SHA1()) # nosec # CodeQL [SM02167] This is for backward compatibility.
124124

125125
return _Cert(pem_bytes, private_key, fingerprint)
126126

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/hazmat/_oid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class SignatureAlgorithmOID:
140140
SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(),
141141
SignatureAlgorithmOID.ECDSA_WITH_SHA512: hashes.SHA512(),
142142
SignatureAlgorithmOID.ECDSA_WITH_SHA3_224: hashes.SHA3_224(),
143-
SignatureAlgorithmOID.ECDSA_WITH_SHA3_256: hashes.SHA3_256(),
143+
SignatureAlgorithmOID.ECDSA_WITH_SHA3_256: hashes.SHA3_256(), # CodeQL [SM02167] This is for compatibility.
144144
SignatureAlgorithmOID.ECDSA_WITH_SHA3_384: hashes.SHA3_384(),
145145
SignatureAlgorithmOID.ECDSA_WITH_SHA3_512: hashes.SHA3_512(), # CodeQL [SM02167] This is for compatibility.
146146
SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(),

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/hazmat/backends/openssl/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def scrypt_supported(self) -> bool:
209209

210210
def hmac_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
211211
# FIPS mode still allows SHA1 for HMAC
212-
if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
212+
if self._fips_enabled and isinstance(algorithm, hashes.SHA1): # CodeQL [SM02167] This is for backwards compatibility.
213213
return True
214214

215215
return self.hash_supported(algorithm)

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def add_signer(
8080
if not isinstance(
8181
hash_algorithm,
8282
(
83-
hashes.SHA224,
83+
hashes.SHA224, # CodeQL [SM02167] This is for compatibility.
8484
hashes.SHA256,
8585
hashes.SHA384,
8686
hashes.SHA512,

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/x509/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
hashes.SHA3_224,
5050
hashes.SHA3_256,
5151
hashes.SHA3_384, # CodeQL [SM02167] This is for comtatibility.
52-
hashes.SHA3_512,
52+
hashes.SHA3_512, # CodeQL [SM02167] This is for comtatibility.
5353
]
5454

5555

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/x509/ocsp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class OCSPResponseStatus(utils.Enum):
3737

3838
_ALLOWED_HASHES = (
3939
hashes.SHA1, # CodeQL [SM02167] This is for backwards compatibility.
40-
hashes.SHA224,
40+
hashes.SHA224, # CodeQL [SM02167] This is for backwards compatibility.
4141
hashes.SHA256,
4242
hashes.SHA384,
4343
hashes.SHA512,

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/requests/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def sha512_utf8(x):
202202
s += time.ctime().encode("utf-8")
203203
s += os.urandom(8)
204204

205-
cnonce = hashlib.sha1(s).hexdigest()[:16]
205+
cnonce = hashlib.sha1(s).hexdigest()[:16] # CodeQL [SM02167] This is for compatibility.
206206
if _algorithm == "MD5-SESS":
207207
HA1 = hash_utf8(f"{HA1}:{nonce}:{cnonce}")
208208

Solutions/CyeraDSPM/Data Connectors/CyeraDSPM_Functions/AzureFunction/CyeraConnector/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _iso(dt: datetime) -> str:
120120

121121
# -------------------- Azure clients --------------------
122122

123-
_default_cred = DefaultAzureCredential(exclude_interactive_browser_credential=True)
123+
_default_cred = DefaultAzureCredential(exclude_interactive_browser_credential=True) # CodeQL [SM05139] Commecting to supress alert. Partner have been asked to udate the code to address the alert.
124124
_blob_client: Optional[BlobServiceClient] = None
125125

126126
def _init_blob_client() -> BlobServiceClient:

Solutions/MimecastAudit/Data Connectors/Helpers/request_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from Models.Error.errors import MimecastRequestError
44
from Models.Request.refresh_access_key import RefreshAccessKeyRequest
55
import base64
6-
from hashlib import sha1 as EncryptionAlgo
6+
from hashlib import sha1 as EncryptionAlgo # CodeQL [SM02167] CCF based data connector is in development. This will be deprecated once CCF based connector is available.
77
import hmac
88
import uuid
99
import datetime

Solutions/MimecastSEG/Data Connectors/Helpers/request_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ..Models.Error.errors import MimecastRequestError
44
from ..Models.Request.refresh_access_key import RefreshAccessKeyRequest
55
import base64
6-
from hashlib import sha1 as EncryptionAlgo
6+
from hashlib import sha1 as EncryptionAlgo # CodeQL [SM02167] CCF based data connector is in development. This will be deprecated once CCF based connector is available.
77
import hmac
88
import uuid
99
import datetime

0 commit comments

Comments
 (0)