kylo加密屬性值

kylo encrypting文檔

Encrypting Configuration Properties
By default, a new Kylo installation does not have any of its configuration properties encrypted. Once you have started Kylo for the first time, the easiest way to derive encrypted versions of property values is to post values to the Kylo services/encrypt endpoint to have it generate an encrypted form for you. You could then paste the encrypted value back into your properties file and mark it as encrypted by prepending the values with {cipher}. For instance, if you wanted to encrypt the Hive datasource password specified in application.properties (assuming the password is “mypassword”), you can get its encrypted form using the curl command like this:

$ curl -u dladmin:thinkbig -H "Content-Type: text/plain; charset=UTF-8" localhost:8400/proxy/v1/feedmgr/util/encrypt –d mypassword
29fcf1534a84700c68f5c79520ecf8911379c8b5ef4427a696d845cc809b4af0

You then copy that value and replace the clear text password string in the properties file with the encrypted value:

hive.datasource.password={cipher}29fcf1534a84700c68f5c79520ecf8911379c8b5ef4427a696d845cc809b4af0

注意

官網(wǎng)給的案例測(cè)試是返回401錯(cuò)誤

{"timestamp":1544088258333,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource","path":"/encrypt"}curl: (6) Could not resolve host: xn--d-5gn; Name or service not known
curl: (6) Could not resolve host: mypassword; Name or service not known

查api發(fā)現(xiàn):

curl -X POST --header 'Content-Type: text/plain' --header 'Accept: application/json' -d 'kylo' 'http://10.88.88.122:8400/proxy/v1/feedmgr/util/encrypt'

正確的請(qǐng)求方式

[root@kylo3 ~]# curl -X POST -u dladmin:thinkbig --header 'Content-Type: text/plain' --header 'Accept: application/json' -d 'kylo' 'http://10.88.88.122:8400/proxy/v1/feedmgr/util/encrypt'

{cipher}888909e4cd4a2fb11a14c0e5ff0aebe10784ff8489405fd85549ec81b373be0c[root@kylo3 ~]# 

在API給到的請(qǐng)求的基礎(chǔ)上加上登錄信息就可以了朽合;

-d dladmin:thinkbig

腳本

#!/bin/bash

curl -X POST -u dladmin:thinkbig --header 'Content-Type: text/plain' --header 'Accept: application/json' -d '$1' 'http://localhost:8400/proxy/v1/feedmgr/util/encrypt'
echo ""
echo ""

使用:

[root@kylo-1 kylo-1]# ./encry.sh  hive
{cipher}25314bc577db3b570810c0c9db3f13623773d9027412e8cf6048870e0755f310

[root@kylo-1 kylo-1]# 

The benefit of this approach is that you will be getting a value that is guaranteed to work with the encryption settings of the server where that configuration value is being used. Once you have replaced all properties you wish to have encrypted in the properties files, you can restart the Kylo services to use them.

文檔

Copy the encryption key file to the folder

cp /opt/kylo/encrypt.key /opt/nifi/ext-config

Change the ownership and permissions of the key file to ensure only nifi can read it

chown nifi /opt/nifi/ext-config/encrypt.key
chmod 400 /opt/nifi/ext-config/encrypt.key

Edit the /opt/nifi/current/bin/nifi-env.sh file and add the ENCRYPT_KEY variable with the key value

export ENCRYPT_KEY="$(< /opt/nifi/ext-config/encrypt.key)"
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末俱两,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子曹步,更是在濱河造成了極大的恐慌锋华,老刑警劉巖,帶你破解...
    沈念sama閱讀 216,591評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件箭窜,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡纳猫,警方通過(guò)查閱死者的電腦和手機(jī)芜辕,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,448評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門(mén),熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)憨闰,“玉大人轧坎,你說(shuō)我怎么就攤上這事缸血∩有海” “怎么了笆豁?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,823評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵怒竿,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我录豺,道長(zhǎng)媒抠,這世上最難降的妖魔是什么趴生? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,204評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮棚菊,結(jié)果婚禮上统求,老公的妹妹穿的比我還像新娘折剃。我一直安慰自己微驶,他們只是感情好开睡,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,228評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著胁艰,像睡著了一般奈梳。 火紅的嫁衣襯著肌膚如雪攘须。 梳的紋絲不亂的頭發(fā)上于宙,一...
    開(kāi)封第一講書(shū)人閱讀 51,190評(píng)論 1 299
  • 那天,我揣著相機(jī)與錄音谱俭,去河邊找鬼旺上。 笑死宣吱,一個(gè)胖子當(dāng)著我的面吹牛征候,可吹牛的內(nèi)容都是我干的疤坝。 我是一名探鬼主播,決...
    沈念sama閱讀 40,078評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼望侈!你這毒婦竟也來(lái)了脱衙?” 一聲冷哼從身側(cè)響起捐韩,我...
    開(kāi)封第一講書(shū)人閱讀 38,923評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤铜邮,失蹤者是張志新(化名)和其女友劉穎松蒜,沒(méi)想到半個(gè)月后秸苗,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體惊楼,經(jīng)...
    沈念sama閱讀 45,334評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,550評(píng)論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了棕诵。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片校套。...
    茶點(diǎn)故事閱讀 39,727評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖妹孙,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情映琳,我是刑警寧澤有鹿,帶...
    沈念sama閱讀 35,428評(píng)論 5 343
  • 正文 年R本政府宣布,位于F島的核電站娱俺,受9級(jí)特大地震影響荠卷,放射性物質(zhì)發(fā)生泄漏油宜。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,022評(píng)論 3 326
  • 文/蒙蒙 一蚁堤、第九天 我趴在偏房一處隱蔽的房頂上張望违寿。 院中可真熱鬧藤巢,春花似錦息罗、人聲如沸掂咒。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,672評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)绍刮。三九已至,卻和暖如春挨摸,著一層夾襖步出監(jiān)牢的瞬間孩革,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,826評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工得运, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,734評(píng)論 2 368
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像倍靡,于是被迫代替她去往敵國(guó)和親雨让。 傳聞我的和親對(duì)象是個(gè)殘疾皇子庵寞,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,619評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,322評(píng)論 0 10
  • 敏感的人總有很多困惑盹沈,很容易被周?chē)娜擞绊懬榫w菇用,從而陷入消極和自我懷疑悍缠,心情郁郁不歡趴拧。 敏感者的...
    大茉莉丸子閱讀 384評(píng)論 0 1
  • 蒸蒸日上 紅紅火火
    M有如果閱讀 640評(píng)論 4 16
  • 父母的不易,我的不屈 2017年九月份,我順利抵達(dá)浙江省麗水市云和縣驮捍,一路上的興奮激動(dòng)與輕松簡(jiǎn)直無(wú)與倫比珊泳,堪比一絲...
    小仙女大叔閱讀 146評(píng)論 0 1
  • 女孩跟男友視頻, 男孩媽媽突然冒出來(lái) 女孩立馬把臉移開(kāi)了攝像頭 聽(tīng)見(jiàn)男孩對(duì)他媽媽說(shuō)了一句 “你把我媳婦嚇到了,等下...
    陌瑾淺Becky閱讀 329評(píng)論 0 0