{"id":10669,"date":"2023-08-23T13:30:06","date_gmt":"2023-08-23T05:30:06","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=10669"},"modified":"2023-08-23T13:29:59","modified_gmt":"2023-08-23T05:29:59","slug":"%e5%90%8e%e5%8f%b0%e6%89%8b%e5%b7%a5%e5%90%af%e5%8a%a8defensor%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=10669","title":{"rendered":"\u540e\u53f0\u624b\u5de5\u542f\u52a8Defensor\u63d2\u4ef6"},"content":{"rendered":"<h3>\u80cc\u666f\u5173\u7cfb<\/h3>\n<p>Defensor\u4e2d\u6267\u884c\u90e8\u5206Inceptor\u7684\u5206\u7c7b\u5206\u7ea7\u4efb\u52a1\u3001\u9759\u6001\u8131\u654f\u3001\u53bb\u6807\u8bc6\u5316\u4efb\u52a1\uff0cInceptor\u90fd\u9700\u8981\u52a0\u8f7d\u5b9a\u5236\u7684UDF\u540e\u624d\u80fd\u8fd0\u884c\u3002\u4f46\u662f\u9875\u9762\u5f00\u542f\u63d2\u4ef6\u53ea\u662f\u4e34\u65f6\u7684\uff0c\u91cd\u542fpod\u5c31\u4f1a\u5bfc\u81f4\u63d2\u4ef6\u5931\u6548\uff0c\u4e3a\u4e86\u6301\u4e45\u5316\u53ef\u4ee5\u4f7f\u7528\uff0c\u4ee5\u53ca\u5982\u679c\u9875\u9762\u5f00\u542f\u63d2\u4ef6\u65f6\u51fa\u73b0\u9519\u8bef\u65e0\u6cd5\u4f7f\u7528\u63d2\u4ef6\u7684\u60c5\u51b5\u3002\u9700\u8981\u540e\u53f0\u624b\u52a8\u914d\u7f6e\u6301\u4e45\u5316udf\u6587\u4ef6\u3002<\/p>\n<h3>\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<h4>1 \u5c06defensor\u7684data-protection\u955c\u50cf\u4e2d\u7684\/usr\/lib\/protection-web\/plugins\/defensor-inceptor-1.0.tar.gz\u62f7\u51fa\u5bb9\u5668\uff0c\u8be5\u538b\u7f29\u5305\u4e2d\u5305\u542b\u63d2\u4ef6\u7684jar\u5305\uff0c\u6216\u8005\u53bbmanager\u9875\u9762\u7684\/var\/lib\/transwarp-manager\/master\/content\/meta\/plugins\/\u4e0b\u83b7\u53d6jar\u5305<\/h4>\n<p>\u6ce8\uff1a\u5982\u679c\u5b58\u5728argo\u7684\u60c5\u51b5\u5305\u540d\u4f1a\u6709\u53d8\u5316\u4f46\u5176\u5b9e\u5185\u5bb9\u662f\u76f8\u540c\u7684\u4e0a\u4f20\u4ea7\u54c1\u5305\u7684\u65f6\u5019\u505a\u4e86\u4e00\u4e2ahack\uff0c\u4f1a\u628a\u4e00\u4e2ajar\u5305\u91cd\u547d\u540d2\u6b21\u3002\u590d\u52362\u4e2a\uff0c\u4e00\u4e2a\u7ed9quark\uff0c\u4e00\u4e2a\u7ed93.X\u7684argodb\u53ebargodbcomputing<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/08\/image-1692695518920.png\" alt=\"file\" \/><\/p>\n<h4>2 \u83b7\u53d6\u5230defensor-inceptor-1.0.tar.gz\u4e4b\u540e\uff0c\u6267\u884c<\/h4>\n<pre><code class=\"language-bash\">tar zxvf defensor-inceptor-1.0.tar.gz<\/code><\/pre>\n<p>\u5c06tgz\u5305\u89e3\u538b\uff0c\u89e3\u538b\u540e\u7684defensor\/inceptor\/lib\u76ee\u5f55\u4e2dprotection-inceptor-udf-1.8.jar\u5373\u4e3aDefensor\u7684\u63d2\u4ef6\u5305\u3002<\/p>\n<h4>3 \u4e0a\u4f20\u5230HDFS<\/h4>\n<p>\u901a\u8fc7\u5ba2\u6237\u7aef\uff0c\u6267\u884chdfs\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">hdfs dfs -put .\/inceptor\/lib\/protection-inceptor-udf-1.8.jar \/tmp\/<\/code><\/pre>\n<p>\u5047\u8bbe\u5c06\/tmp\/protection-inceptor-udf-1.8.jar\u4e0a\u4f20\u5230\u4e86Inceptor\u6240\u4f9d\u8d56\u7684HDFS\u7684\/tmp\u8def\u5f84\u4e0b\u3002hive\u7528\u6237\u9700\u8981\u6709\u8be5jar\u5305\u5728HDFS\u4e0a\u7684\u8bfb\u53d6\u6743\u9650\uff08\u6ce8\u610f\uff1a\u751f\u4ea7\u73af\u5883\u8bf7\u52ff\u653e\u5728\/tmp\u4e0b\uff09<\/p>\n<h4>4 \u4e0a\u4f20\u4e4b\u540e\u9700\u8981\u6267\u884c\u5bf9\u5e94\u7684sql\u8bed\u53e5\uff0c\u6839\u636edenfensor\u7684\u7248\u672c\u4e0d\u901a\u9700\u8981\u6267\u884c\u7684sql\u8bed\u53e5\u4e5f\u4e0d\u76f8\u540c<\/h4>\n<p>\u6839\u636eDefensor\u7684\u7248\u672c\u8fdb\u884c\u6dfb\u52a0\uff0c\u6bd4\u5982\u5b89\u88c5\u7684Defensor\u7248\u672c\u4e3a3.2.0\uff0c\u5219\u9700\u8981\u6dfb\u52a03.0.0 &#8211; 3.1.0\u7248\u672c\u6240\u6709\u7684UDF\uff08\u56e0\u4e3a3.2.0\u7248\u672c\u6ca1\u6709\u65b0\u589eUDF\uff09\uff1a<br \/>\nDefensor-3.0.0\uff1a<\/p>\n<pre><code class=\"language-bash\">create permanent function keep_back as 'io.udf.KeepBack' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function keep_from as 'io.udf.KeepFrom' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function keep_from_sl as 'io.udf.KeepFromSL' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function keep_front as 'io.udf.KeepFront' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_back as 'io.udf.MaskBack' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_back_sl as 'io.udf.MaskBackSL' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_from as 'io.udf.MaskFrom' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_from_sl as 'io.udf.MaskFromSL' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_front as 'io.udf.MaskFront' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_front_sl as 'io.udf.MaskFrontSL' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_specify as 'io.udf.MaskSpecify' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function number_floor as 'io.udf.NumberFloor' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function phone_confusion as 'io.udf.PhoneConfusion' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function sm3 as 'io.udf.SM3' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function sm4_decrypt as 'io.udf.SM4Decrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function sm4_encrypt as 'io.udf.SM4Encrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function sequence as 'io.udf.Sequence' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function triple_des_decrypt as 'io.udf.TripleDESDecrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function triple_des_encrypt as 'io.udf.TripleDESEncrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function regular as 'io.udf.Regular' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\n\ncreate permanent function match_bank_card as 'io.udf.MatchBankCard' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function match_birthday as 'io.udf.MatchBirthday' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function match_citizen_id as 'io.udf.MatchCitizenId' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function match_credit_code as 'io.udf.MatchCreditCode' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function match_url as 'io.udf.MatchUrl' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function vin as 'io.udf.VIN' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function imsi as 'io.udf.IMSI' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function imei as 'io.udf.IMEI' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\n\ncreate permanent function block_back as 'io.udf.BlockBack' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function block_front as 'io.udf.BlockFront' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function blur as 'io.udf.Blur' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function character_scrambling as 'io.udf.CharacterScrambling' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function cover as 'io.udf.Cover' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function cover_sl as 'io.udf.CoverSL' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function des_decrypt as 'io.udf.DESDecrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function des_encrypt as 'io.udf.DESEncrypt' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function date_floor as 'io.udf.DateFloor' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function enumeration as 'io.udf.Enumeration' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\n\ncreate permanent function random as 'io.udf.GenericUDFRandom' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';  \/\/\u6ce8\u610f \u7cfb\u7edf\u81ea\u5e26\u4e86random  \u5982\u679c\u4e0d\u7528\u9700\u8981\u628a\u8fd9\u884c\u6ce8\u91ca\u6389\ncreate permanent function random_str as 'io.udf.GetRandomString' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function hmac as 'io.udf.HMAC' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function hide as 'io.udf.Hide' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';<\/code><\/pre>\n<p>Defensor-3.1.0\uff1a<\/p>\n<pre><code class=\"language-bash\">create permanent function replace_max as 'io.udf.ReplaceMax' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_min as 'io.udf.ReplaceMin' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_max_and_min as 'io.udf.ReplaceMaxAndMin' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';```bash\ncreate permanent function replace_max as 'io.udf.ReplaceMax' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_min as 'io.udf.ReplaceMin' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_max_and_min as 'io.udf.ReplaceMaxAndMin' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';<\/code><\/pre>\n<p>Defensor-3.4.0\uff1a<\/p>\n<pre><code class=\"language-bash\">create permanent function mask_firstname as 'io.udf.MaskFirstname' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_lastname as 'io.udf.MaskLastname' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_birthday as 'io.udf.ReplaceBirthday' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_code as 'io.udf.ReplaceCode' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_email as 'io.udf.ReplaceEmail' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_phone as 'io.udf.ReplacePhone' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_firstname_fixed as 'io.udf.MaskFirstnameFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function mask_lastname_fixed as 'io.udf.MaskLastnameFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_birthday_fixed as 'io.udf.ReplaceBirthdayFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_code_fixed as 'io.udf.ReplaceCodeFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_email_fixed as 'io.udf.ReplaceEmailFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate permanent function replace_phone_fixed as 'io.udf.ReplacePhoneFixed' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\n\ncreate TEMPORARY function sm3_hex as 'io.udf.SM3Hex' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate TEMPORARY function mask_name as 'io.udf.MaskName' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';\ncreate TEMPORARY function mask_credential as 'io.udf.MaskCredential' using jar 'hdfs:\/\/\/tmp\/protection-inceptor-udf-1.8.jar';<\/code><\/pre>\n<h3>\u9a8c\u8bc1\u63d2\u4ef6<\/h3>\n<p>\u6267\u884c\u4e0b\u9762\u7684sql\uff0c\u80fd\u51fa\u7ed3\u679c\u5c31\u8bf4\u660e\u63d2\u4ef6\u7684udf\u662f\u6210\u529f\u5bfc\u5165\u7684\uff1a<\/p>\n<pre><code class=\"language-sql\">select random_str(5) from system.dual<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/08\/image-1692696182513.png\" alt=\"file\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f\u5173\u7cfb Defensor\u4e2d\u6267\u884c\u90e8\u5206Inceptor\u7684\u5206\u7c7b\u5206\u7ea7\u4efb\u52a1\u3001\u9759\u6001\u8131\u654f\u3001\u53bb\u6807\u8bc6\u5316\u4efb\u52a1\uff0cInceptor\u90fd ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=10669\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":161,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10669","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10669"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10669\/revisions"}],"predecessor-version":[{"id":10679,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10669\/revisions\/10679"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}