[{"data":1,"prerenderedAt":662},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fbancwr\u002Fprotecting-the-key":148,"\u002Fdocs\u002Fbancwr\u002Fprotecting-the-key-surround":659},[4,19,62,93],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,11,15],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-rocket",{"title":12,"path":13,"stem":14},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F2.installation",{"title":16,"path":17,"stem":18},"Using Diogel","\u002Fdocs\u002Fgetting-started\u002Fusage","1.docs\u002F1.getting-started\u002F3.usage",{"title":20,"path":21,"stem":22,"children":23,"icon":61},"Porwr","\u002Fdocs\u002Fporwr","1.docs\u002F2.porwr\u002F01.index",[24,26,29,33,37,41,45,49,53,57],{"title":25,"path":21,"stem":22,"icon":10},"What is Porwr",{"title":12,"path":27,"stem":28},"\u002Fdocs\u002Fporwr\u002Finstallation","1.docs\u002F2.porwr\u002F02.installation",{"title":30,"path":31,"stem":32},"Dashboard","\u002Fdocs\u002Fporwr\u002Fdashboard","1.docs\u002F2.porwr\u002F03.dashboard",{"title":34,"path":35,"stem":36},"Key Management","\u002Fdocs\u002Fporwr\u002Fkeys","1.docs\u002F2.porwr\u002F04.keys",{"title":38,"path":39,"stem":40},"Profile Management","\u002Fdocs\u002Fporwr\u002Fprofile","1.docs\u002F2.porwr\u002F05.profile",{"title":42,"path":43,"stem":44},"Relay Management","\u002Fdocs\u002Fporwr\u002Frelay","1.docs\u002F2.porwr\u002F06.relay",{"title":46,"path":47,"stem":48},"Messaging","\u002Fdocs\u002Fporwr\u002Fmessaging","1.docs\u002F2.porwr\u002F07.messaging",{"title":50,"path":51,"stem":52},"Media Management","\u002Fdocs\u002Fporwr\u002Fmedia","1.docs\u002F2.porwr\u002F08.media",{"title":54,"path":55,"stem":56},"Wallet Management","\u002Fdocs\u002Fporwr\u002Fwallet","1.docs\u002F2.porwr\u002F09.wallet",{"title":58,"path":59,"stem":60},"Extension Settings","\u002Fdocs\u002Fporwr\u002Fsettings","1.docs\u002F2.porwr\u002F10.settings","i-lucide-puzzle",{"title":63,"path":64,"stem":65,"children":66,"icon":92},"Symudol","\u002Fdocs\u002Fsymudol","1.docs\u002F3.symudol\u002F1.index",[67,69,72,76,80,84,88],{"title":68,"path":64,"stem":65,"icon":10},"What is Symudol",{"title":12,"path":70,"stem":71},"\u002Fdocs\u002Fsymudol\u002Finstallation","1.docs\u002F3.symudol\u002F2.installation",{"title":73,"path":74,"stem":75},"Your vault","\u002Fdocs\u002Fsymudol\u002Fvault","1.docs\u002F3.symudol\u002F3.vault",{"title":77,"path":78,"stem":79},"Accounts and profile","\u002Fdocs\u002Fsymudol\u002Faccounts","1.docs\u002F3.symudol\u002F4.accounts",{"title":81,"path":82,"stem":83},"Approving requests","\u002Fdocs\u002Fsymudol\u002Fapproving-requests","1.docs\u002F3.symudol\u002F5.approving-requests",{"title":85,"path":86,"stem":87},"Remote apps (NIP-46)","\u002Fdocs\u002Fsymudol\u002Fremote-apps","1.docs\u002F3.symudol\u002F6.remote-apps",{"title":89,"path":90,"stem":91},"Settings","\u002Fdocs\u002Fsymudol\u002Fsettings","1.docs\u002F3.symudol\u002F7.settings","i-lucide-smartphone",{"title":94,"path":95,"stem":96,"children":97,"icon":147},"Bancwr","\u002Fdocs\u002Fbancwr","1.docs\u002F4.bancwr\u002F01.index",[98,100,103,107,111,115,119,123,127,131,135,139,143],{"title":99,"path":95,"stem":96,"icon":10},"What is Bancwr",{"title":12,"path":101,"stem":102},"\u002Fdocs\u002Fbancwr\u002Finstallation","1.docs\u002F4.bancwr\u002F02.installation",{"title":104,"path":105,"stem":106},"Configuring the URLs","\u002Fdocs\u002Fbancwr\u002Furls","1.docs\u002F4.bancwr\u002F03.urls",{"title":108,"path":109,"stem":110},"First administrator and signing in","\u002Fdocs\u002Fbancwr\u002Ffirst-administrator","1.docs\u002F4.bancwr\u002F04.first-administrator",{"title":112,"path":113,"stem":114},"Protecting the bunker key","\u002Fdocs\u002Fbancwr\u002Fprotecting-the-key","1.docs\u002F4.bancwr\u002F05.protecting-the-key",{"title":116,"path":117,"stem":118},"Team and roles","\u002Fdocs\u002Fbancwr\u002Fteam","1.docs\u002F4.bancwr\u002F06.team",{"title":120,"path":121,"stem":122},"Signing identities","\u002Fdocs\u002Fbancwr\u002Fsigning-identities","1.docs\u002F4.bancwr\u002F07.signing-identities",{"title":124,"path":125,"stem":126},"Connecting apps","\u002Fdocs\u002Fbancwr\u002Fconnecting-apps","1.docs\u002F4.bancwr\u002F08.connecting-apps",{"title":128,"path":129,"stem":130},"Approval before signing","\u002Fdocs\u002Fbancwr\u002Fapproval-before-signing","1.docs\u002F4.bancwr\u002F09.approval-before-signing",{"title":132,"path":133,"stem":134},"Profile, follows and relays","\u002Fdocs\u002Fbancwr\u002Fprofile-follows-relays","1.docs\u002F4.bancwr\u002F10.profile-follows-relays",{"title":136,"path":137,"stem":138},"Health, versions and logs","\u002Fdocs\u002Fbancwr\u002Fhealth-and-logs","1.docs\u002F4.bancwr\u002F11.health-and-logs",{"title":140,"path":141,"stem":142},"Backup and restore","\u002Fdocs\u002Fbancwr\u002Fbackup-and-restore","1.docs\u002F4.bancwr\u002F12.backup-and-restore",{"title":144,"path":145,"stem":146},"Updating","\u002Fdocs\u002Fbancwr\u002Fupdating","1.docs\u002F4.bancwr\u002F13.updating","i-lucide-server",{"id":149,"title":112,"body":150,"description":420,"extension":653,"meta":654,"navigation":655,"path":113,"seo":656,"stem":114,"__hash__":658},"docs\u002F1.docs\u002F4.bancwr\u002F05.protecting-the-key.md",{"type":151,"value":152,"toc":637},"minimark",[153,158,171,194,200,205,218,221,228,310,316,320,332,361,364,368,371,399,402,406,409,471,475,478,496,577,581,584,611,622,626,633],[154,155,157],"h2",{"id":156},"how-the-key-is-kept","How the key is kept",[159,160,161,162,166,167,170],"p",{},"The bunker keeps its key in ",[163,164,165],"code",{},".\u002Fdata\u002Fbunker-key.enc",", encrypted with XChaCha20-Poly1305 under a root credential. The root credential is 32 random bytes, written as 64 hex characters in ",[163,168,169],{},".\u002Fsecrets\u002Fbancwr_root_key",".",[172,173,174,181,188],"ul",{},[175,176,177,178,170],"li",{},"Compose mounts the root credential read-only into the bunker as a secret. The bunker reads it at every start, through ",[163,179,180],{},"BANCWR_ROOT_KEY_FILE",[175,182,183,184,187],{},"The key file on its own, or a backup of ",[163,185,186],{},".\u002Fdata",", is no use without the root credential.",[175,189,190,191,193],{},"The two files together are the key. Keep them apart: never put the root credential in a backup of ",[163,192,186],{},", or in the same place as one.",[159,195,196,197,170],{},"Every other identity the bunker holds is encrypted under the same root credential, and kept in the database. See ",[198,199,120],"a",{"href":121},[201,202,204],"h3",{"id":203},"what-this-does-not-protect-against","What this does not protect against",[159,206,207,208,210,211,217],{},"Anyone who controls the server can read both files, or the bunker's memory, and so the key. Encryption at rest protects copies of ",[163,209,186],{}," and backups that leave the server. It does not protect a server someone else controls. The ",[198,212,216],{"href":213,"rel":214},"https:\u002F\u002Fgithub.com\u002Fdiogel-io\u002Fbancwr\u002Fblob\u002Fv0.1.0\u002Fdocs\u002Fthreat-model.md",[215],"nofollow","threat model"," lists this and the other known limits.",[159,219,220],{},"Every identity a bunker holds shares the one root credential, in the one process. Whoever controls the server has them all. Run separate bunkers for keys that must not share that fate.",[154,222,224,225,227],{"id":223},"what-a-copy-of-data-reveals","What a copy of ",[163,226,186],{}," reveals",[229,230,231,247],"table",{},[232,233,234],"thead",{},[235,236,237,241,244],"tr",{},[238,239,240],"th",{},"A copy of…",[238,242,243],{},"Reveals the key?",[238,245,246],{},"Also holds",[248,249,250,264,279,297],"tbody",{},[235,251,252,258,261],{},[253,254,255,257],"td",{},[163,256,186],{}," on its own",[253,259,260],{},"No. The key file is encrypted.",[253,262,263],{},"The team and their roles, connection tokens (only a hash of each secret), connected apps, the signing log and the bunker relays.",[235,265,266,273,276],{},[253,267,268,270,271],{},[163,269,186],{}," and ",[163,272,169],{},[253,274,275],{},"Yes.",[253,277,278],{},"Everything above.",[235,280,281,288,291],{},[253,282,283,284,287],{},"A ",[163,285,286],{},"bunker backup"," archive on its own",[253,289,290],{},"No. It is encrypted under the backup passphrase, and the key inside it is still encrypted under the root credential.",[253,292,293,294,296],{},"The same as ",[163,295,186],{},", once decrypted.",[235,298,299,304,307],{},[253,300,301],{},[163,302,303],{},".\u002Fsessions",[253,305,306],{},"No.",[253,308,309],{},"Sign-in sessions, named by a hash of their id. A copy is no way to sign in.",[159,311,312,313,315],{},"The database names every member and every connected app, so keep copies of ",[163,314,186],{}," and backups as private as the server.",[154,317,319],{"id":318},"importing-the-key","Importing the key",[159,321,322,323,326,327,331],{},"The key is imported once, with ",[163,324,325],{},"bunker import-key",", from a plain copy mounted for that one command. See ",[198,328,330],{"href":329},"\u002Fdocs\u002Fbancwr\u002Finstallation#_6-import-the-key","Import the key"," on the installation page.",[172,333,334,340,346],{},[175,335,336,337,170],{},"The import encrypts the key under the root credential and prints the bunker's ",[163,338,339],{},"npub",[175,341,342,343,345],{},"It never replaces an existing ",[163,344,165],{},". To start again, stop the bunker and remove that file first.",[175,347,348,349,352,353,356,357,360],{},"Delete the plain copy straight after. Check for any other copy too: in ",[163,350,351],{},".env",", in any ",[163,354,355],{},"compose.override.yaml",", in editor backups such as ",[163,358,359],{},"bunker_nsec~",", or in your shell history.",[159,362,363],{},"The console never imports a key, so a key never passes through a browser.",[154,365,367],{"id":366},"when-the-bunker-will-not-sign","When the bunker will not sign",[159,369,370],{},"The bunker never reads a plain key while it runs. It starts locked, and signs nothing, when:",[172,372,373,383,388,393,396],{},[175,374,375,378,379,382],{},[163,376,377],{},"BUNKER_NSEC"," or ",[163,380,381],{},"BUNKER_NSEC_FILE"," is still set, whether or not the key has been imported,",[175,384,385,387],{},[163,386,180],{}," is not set, or its file cannot be read or is not 64 hex characters,",[175,389,390,392],{},[163,391,165],{}," is missing or cannot be read,",[175,394,395],{},"the root credential does not decrypt the key file: either it is the wrong credential, or the key file has been altered,",[175,397,398],{},"another identity in the database cannot be decrypted. The status names it by its label.",[159,400,401],{},"A locked bunker keeps running so it can say why. NIP-46 does not start, and every console page except the dashboard's health answers with an error.",[201,403,405],{"id":404},"finding-out-why","Finding out why",[159,407,408],{},"The container shows as unhealthy, and the reason appears in three places:",[172,410,411,445,463],{},[175,412,413,414],{},"the health check:",[415,416,421],"pre",{"className":417,"code":418,"language":419,"meta":420,"style":420},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","podman exec bancwr-bunker bunker healthcheck\n","bash","",[163,422,423],{"__ignoreMap":420},[424,425,428,432,436,439,442],"span",{"class":426,"line":427},"line",1,[424,429,431],{"class":430},"sBMFI","podman",[424,433,435],{"class":434},"sfazB"," exec",[424,437,438],{"class":434}," bancwr-bunker",[424,440,441],{"class":434}," bunker",[424,443,444],{"class":434}," healthcheck\n",[175,446,447,448],{},"the bunker's log:",[415,449,451],{"className":417,"code":450,"language":419,"meta":420,"style":420},"podman logs bancwr-bunker\n",[163,452,453],{"__ignoreMap":420},[424,454,455,457,460],{"class":426,"line":427},[424,456,431],{"class":430},[424,458,459],{"class":434}," logs",[424,461,462],{"class":434}," bancwr-bunker\n",[175,464,465,466,470],{},"the console's dashboard, where the ",[467,468,469],"strong",{},"Signer"," check is red with the same words.",[201,472,474],{"id":473},"fixing-it","Fixing it",[159,476,477],{},"Fix the cause, then recreate the bunker:",[415,479,481],{"className":417,"code":480,"language":419,"meta":420,"style":420},"podman compose up -d\n",[163,482,483],{"__ignoreMap":420},[424,484,485,487,490,493],{"class":426,"line":427},[424,486,431],{"class":430},[424,488,489],{"class":434}," compose",[424,491,492],{"class":434}," up",[424,494,495],{"class":434}," -d\n",[172,497,498,548,565,571],{},[175,499,500,503,504,540,543,544,378,546,170],{},[467,501,502],{},"A plain key is still set."," Find where:",[415,505,507],{"className":417,"code":506,"language":419,"meta":420,"style":420},"podman inspect bancwr-bunker --format '{{range .Config.Env}}{{println .}}{{end}}' | grep NSEC\n",[163,508,509],{"__ignoreMap":420},[424,510,511,513,516,518,521,525,528,531,534,537],{"class":426,"line":427},[424,512,431],{"class":430},[424,514,515],{"class":434}," inspect",[424,517,438],{"class":434},[424,519,520],{"class":434}," --format",[424,522,524],{"class":523},"sMK4o"," '",[424,526,527],{"class":434},"{{range .Config.Env}}{{println .}}{{end}}",[424,529,530],{"class":523},"'",[424,532,533],{"class":523}," |",[424,535,536],{"class":430}," grep",[424,538,539],{"class":434}," NSEC\n",[541,542],"br",{},"Remove it from ",[163,545,351],{},[163,547,355],{},[175,549,550,553,554,556,557,560,561,170],{},[467,551,552],{},"The root credential cannot be read."," Check ",[163,555,169],{}," exists, holds 64 hex characters, belongs to user ID 65532 and has mode ",[163,558,559],{},"0400",". See ",[198,562,564],{"href":563},"\u002Fdocs\u002Fbancwr\u002Finstallation#_4-hand-the-files-to-the-bunkers-user","Hand the files to the bunker's user",[175,566,567,570],{},[467,568,569],{},"The key file is missing."," Import the key, or restore a backup.",[175,572,573,576],{},[467,574,575],{},"The wrong credential, or an altered key file or identity."," Put back the root credential that was used for the import, from where you kept it. If the key file or the database was altered, restore it from a backup.",[154,578,580],{"id":579},"keep-copies-somewhere-else","Keep copies somewhere else",[159,582,583],{},"If the server is lost, the key goes with it, and so does the bunker's identity. Keep, each apart from the others:",[172,585,586,592,605],{},[175,587,588,591],{},[467,589,590],{},"The plain key",", one copy offline, in a password manager or on an encrypted drive.",[175,593,594,597,598,600,601,604],{},[467,595,596],{},"The root credential",", somewhere other than the backups of ",[163,599,186],{},". Without it, ",[163,602,603],{},"bunker-key.enc"," cannot be decrypted, and a restored bunker stays locked unless you import the plain key again.",[175,606,607,610],{},[467,608,609],{},"The backup passphrase",", apart from both the root credential and the backups. Without it, a backup cannot be opened.",[159,612,613,614,617,618,621],{},"Your own user cannot read the secrets once they belong to user ID 65532. To read or replace one, use ",[163,615,616],{},"podman unshare"," with rootless Podman, or ",[163,619,620],{},"sudo"," with Docker.",[154,623,625],{"id":624},"the-bunkers-key-never-signs-in","The bunker's key never signs in",[159,627,628,629,170],{},"The bunker's key, and every other identity it holds, can never sign in to the console or be registered as a member. The bunker signs for other people, so anyone it signs for could otherwise get it to sign a Bancwr sign-in. See ",[198,630,632],{"href":631},"\u002Fdocs\u002Fbancwr\u002Ffirst-administrator#why-the-bunkers-key-can-never-sign-in","Why the bunker's key can never sign in",[634,635,636],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":420,"searchDepth":638,"depth":638,"links":639},2,[640,644,646,647,651,652],{"id":156,"depth":638,"text":157,"children":641},[642],{"id":203,"depth":643,"text":204},3,{"id":223,"depth":638,"text":645},"What a copy of .\u002Fdata reveals",{"id":318,"depth":638,"text":319},{"id":366,"depth":638,"text":367,"children":648},[649,650],{"id":404,"depth":643,"text":405},{"id":473,"depth":643,"text":474},{"id":579,"depth":638,"text":580},{"id":624,"depth":638,"text":625},"md",{},true,{"description":657,"title":112},"How Bancwr keeps its key encrypted at rest under a root credential, what a copy of .\u002Fdata does and does not reveal, and what to do when the bunker is locked.","CY7tQSzCHP2enQW1SQw2OLaM1JaAIdW2vP1Md1geH4s",[660,661],{"title":108,"path":109,"stem":110,"description":420,"children":-1},{"title":116,"path":117,"stem":118,"description":420,"children":-1},1795083909795]