Skip to content

Commit 7a5d94c

Browse files
authored
Tags for crypto libs and methods (#67)
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 7c68f06 commit 7a5d94c

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "chen"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "2.0.5"
3+
ThisBuild / version := "2.0.6"
44
ThisBuild / scalaVersion := "3.3.1"
55

66
val cpgVersion = "1.0.0"

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"downloadUrl": "https://github.com/AppThreat/chen",
88
"issueTracker": "https://github.com/AppThreat/chen/issues",
99
"name": "chen",
10-
"version": "2.0.5",
10+
"version": "2.0.6",
1111
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
1212
"applicationCategory": "code-analysis",
1313
"keywords": [

meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.0.5" %}
1+
{% set version = "2.0.6" %}
22

33
package:
44
name: chen

platform/frontends/x2cpg/src/main/scala/io/appthreat/x2cpg/passes/taggers/EasyTagsPass.scala

+28
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,33 @@ class EasyTagsPass(atom: Cpg) extends CpgPass(atom):
109109
atom.method.name("wp_signon").newTagNode("authentication").store()(dstGraph)
110110
atom.method.name("wp_remote_.*").newTagNode("http").store()(dstGraph)
111111
end if
112+
if language == Languages.JAVA || language == Languages.JAVASRC then
113+
atom.identifier.typeFullName("java.security.*").newTagNode("crypto").store()(dstGraph)
114+
atom.identifier.typeFullName("org.bouncycastle.*").newTagNode("crypto").store()(
115+
dstGraph
116+
)
117+
atom.identifier.typeFullName("javax.(security|crypto).*").newTagNode("crypto").store()(
118+
dstGraph
119+
)
120+
atom.call.methodFullName("java.security.*").newTagNode("crypto").store()(dstGraph)
121+
atom.call.methodFullName("org.bouncycastle.*").newTagNode("crypto").store()(dstGraph)
122+
atom.call.methodFullName("javax.(security|crypto).*").newTagNode("crypto").store()(
123+
dstGraph
124+
)
125+
atom.call.methodFullName("java.security.*doFinal.*").newTagNode(
126+
"crypto-generate"
127+
).store()(dstGraph)
128+
atom.call.methodFullName("org.bouncycastle.*(doFinal|generate).*").newTagNode(
129+
"crypto-generate"
130+
).store()(dstGraph)
131+
atom.call.methodFullName("javax.(security|crypto).*doFinal.*").newTagNode(
132+
"crypto-generate"
133+
).store()(
134+
dstGraph
135+
)
136+
atom.literal.code(
137+
"\"(DSA|ECDSA|GOST-3410|ECGOST-3410|MD5|SHA1|SHA224|SHA384|SHA512|ECDH|PKCS12|DES|DESEDE|IDEA|RC2|RC5|MD2|MD4|MD5|RIPEMD128|RIPEMD160|RIPEMD256|AES|Blowfish|CAST5|CAST6|DES|DESEDE|GOST-28147|IDEA|RC6|Rijndael|Serpent|Skipjack|Twofish|OpenPGPCFB|PKCS7Padding|ISO10126-2Padding|ISO7816-4Padding|TBCPadding|X9.23Padding|ZeroBytePadding|PBEWithMD5AndDES|PBEWithSHA1AndDES|PBEWithSHA1AndRC2|PBEWithMD5AndRC2|PBEWithSHA1AndIDEA|PBEWithSHA1And3-KeyTripleDES|PBEWithSHA1And2-KeyTripleDES|PBEWithSHA1And40BitRC2|PBEWithSHA1And40BitRC4|PBEWithSHA1And128BitRC2|PBEWithSHA1And128BitRC4|PBEWithSHA1AndTwofish|ChaCha20|ChaCha20-Poly1305|DESede|DiffieHellman|OAEP|PBEWithMD5AndDES|PBEWithHmacSHA256AndAES|RSASSA-PSS|X25519|X448|XDH|X.509|PKCS7|PkiPath|PKIX|AESWrap|ARCFOUR|ISO10126Padding|OAEPWithMD5AndMGF1Padding|OAEPWithSHA-512AndMGF1Padding|PKCS1Padding|PKCS5Padding|SSL3Padding|ECMQV|HmacMD5|HmacSHA1|HmacSHA224|HmacSHA256|HmacSHA384|HmacSHA512|HmacSHA3-224|HmacSHA3-256|HmacSHA3-384|HmacSHA3-512|SHA3-224|SHA3-256|SHA3-384|SHA3-512|SHA-1|SHA-224|SHA-256|SHA-384|SHA-512|CRAM-MD5|DIGEST-MD5|GSSAPI|NTLM|PBKDF2WithHmacSHA256|NativePRNG|NativePRNGBlocking|NativePRNGNonBlocking|SHA1PRNG|Windows-PRNG|NONEwithRSA|MD2withRSA|MD5withRSA|SHA1withRSA|SHA224withRSA|SHA256withRSA|SHA384withRSA|SHA512withRSA|SHA3-224withRSA|SHA3-256withRSA|SHA3-384withRSA|SHA3-512withRSA|NONEwithECDSAinP1363Format|SHA1withECDSAinP1363Format|SHA224withECDSAinP1363Format|SHA256withECDSAinP1363Format|SHA384withECDSAinP1363Format|SHA512withECDSAinP1363Format|SSLv2|SSLv3|TLSv1|DTLS|SSL_|TLS_).*"
138+
).newTagNode("crypto-algorithm").store()(dstGraph)
139+
end if
112140
end run
113141
end EasyTagsPass

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "appthreat-chen"
3-
version = "2.0.5"
3+
version = "2.0.6"
44
description = "Code Hierarchy Exploration Net (chen)"
55
authors = ["Team AppThreat <cloud@appthreat.com>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)