Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

Credentials and sensitive-data security

Controls secret acquisition, use, logging and revocation.

Credentials and sensitive-data securityAdvPL
01 · OVERVIEW

Overview

Credentials, tokens and keys should come from protected provisioning with least privilege, auditing and consumer-compatible rotation. Keep them out of source, URIs, errors and logs. Removing an exposed value from a file does not invalidate it: address revocation/rotation and existing copies. GetErrorMessage and user arrays can include sensitive values; log selected fields rather than whole structures. This example logs only a constant event/state and handles no secret. (Sources: refs. 1–2.)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed645()
    // Allowed fields only: no password, token, request body or user array.
    Local cEvent := "ED645_STAGE"
    Local cState := "OK"
    ConOut(cEvent+" "+cState)
Return Nil
Expected result

Logs a technical marker and OK. It supplies neither a secrets manager nor secure-memory-erasure guarantees. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Control log access/retention and test rotation without breaking consumers. Assigning Nil does not erase copies in logs, dumps or backups.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. OWASP. Secrets Management Cheat Sheet. Armazenamento, acesso e ciclo de vida. Accessed on 2026-10-28.
  2. TOTVS. FWFormModel:GetErrorMessage e valores no diagnóstico. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha