Improved security on PA routines

This commit is contained in:
Douglas Barone 2021-10-27 12:41:22 -04:00
parent b755d756d5
commit 572389aab7
2 changed files with 7 additions and 6 deletions

View File

@ -106,10 +106,11 @@ async function updateUserIdMappings() {
tags: ['paloalto', 'user-id'],
message: `Erro atualizando user-id mappings em ${
pAHost.description || pAHost.cidr
}: ${e.message}`,
data: e
}: ${e.message}`
})
console.log(e) // Do not add e to log DB for security reasons...
return 'Não foi possível atualizar. Veja o log do servidor'
} finally {
const index = isWorking.indexOf(pAHost.id)

View File

@ -4,10 +4,10 @@ import prisma from '../prisma'
const PAHost = {
key: parent => {
const decryptedKey = decryptKey(parent.encryptedKey)
return `${decryptedKey.slice(0, 3)}*****${decryptedKey.slice(
decryptedKey.length - 4,
decryptedKey.length
)}`
return `***${decryptedKey.slice(5, 8)}***${decryptedKey.slice(
decryptedKey.length - 8,
decryptedKey.length - 5
)}***`
},
owner: parent => prisma.user.findUnique({ where: { id: parent.ownerId } })
}