Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security enhancements #188

Merged
merged 38 commits into from
Sep 14, 2021
Merged

Security enhancements #188

merged 38 commits into from
Sep 14, 2021

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Aug 26, 2021

This PR covers a few items that don't have issues logged, but handle a few security-related enhancements I've been considering for a few months (years??)

  • 🥉 3rd place: LoggerAdmin permission set now has access to all custom metadata types included in the repo. Is this a bugfix, or is this an enhancement? Who can say?! But all CMDT objects are now included.

  • 🥈 2nd place: new setting LoggerSettings__c.StripInaccessibleRecordFields__c - Disabled by default, when enabled, any time an SObject record is logged (or a List<SObject> is logged), only fields that the current user can access will be included in the record's JSON. This is useful in orgs where end-users have access to view Log__c and LogEntry__c records.

  • 🥇 1st place: data masking for log entry messages. Enabled by default, regex-based CMDT rules can be configured to automatically mask sensitive data in the Message__c and RecordJson__c fields. Pre-built rules are included for credit card numbers and social security numbers - additional rules can be configured by creating additional LogEntryDataMaskRule__mdt records.

    • New LoggerSettings__c fields: ApplyDataMaskRules__c and StripInaccessibleRecordFields__c

      image

    • New custom metadata type LogEntryDataMaskRule__mdt list view, showing the included rules

      image

    • Example log entries with masked data - the 1st two entries shows masked credit card numbers, and the 3rd entry shows a masked social security number

      image

Other included changes:

  • Fixed Null Record causes error #198 Made record & records parameters optional in FlowRecordLogEntry & FlowCollectionLogEntry (respectively) to handle situations where null is passed (e.g., Get Records returns null for no matches, instead of an empty list)
  • Fixed Log but no entries #199 - Changed FlowDescription__c.field to long text area + added automatic field-truncation for LogEntry__c inserts + added a ridiculously long description to one of the Flows in nebula-logger-recipes
  • Switched to using custom getters for all constants in LogEntryEventBuilder that involve queries - this prevents the queries from executing if logging is disabled for the current user
  • Added a private method setTransactionDetails() in LogEntryEventBuilder to defer setting some transactional details until absolutely necessary - this helps minimize heap size/avoid using some of the heap size limit until needed
  • Updated Apex docs
  • Made fancier buttons that include the release number
  • Enabled some user management settings in scratch definition files
  • Cleaned up a few areas in README
  • Added 'Code Quality Tests' to deploy.yml + ran prettier
  • Setup ESLint for lwc + fixed some reported issues
  • @jamessimone setup PMD rules & apex-scanner plugin + fixed some reported issues (via PR Added static code analysis / PMD #201)
  • Reenabled Codecov.io integration in pipeline
  • Removed some unused scripts in package.json

@jongpie jongpie added Type: Enhancement New feature or request Package Type: Managed Package Issues and enhancements that specifically apply to the managed package Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app Package Type: Unlocked Package Issues and enhancements that specifically apply to the unlocked package Salesforce Feature: Platform Events Items related to how platform events are leveraged by Nebula Logger Salesforce Feature: Security Items related to the security model (object-level access, field-level security, record sharing) labels Aug 26, 2021
@jongpie jongpie temporarily deployed to Test August 26, 2021 03:22 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 03:22 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 03:29 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 03:29 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 04:31 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 04:31 Inactive
Repository owner deleted a comment from codecov bot Aug 26, 2021
@jongpie jongpie temporarily deployed to Test August 26, 2021 04:51 Inactive
@jongpie jongpie temporarily deployed to Test August 26, 2021 04:51 Inactive
Repository owner deleted a comment from codecov bot Aug 26, 2021
@jongpie jongpie force-pushed the feature/security-enhancements branch from cbd6958 to 0cadbf6 Compare August 26, 2021 06:04
@jongpie jongpie temporarily deployed to Test August 26, 2021 06:04 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:10 Inactive
@jongpie jongpie force-pushed the feature/security-enhancements branch from 3d1951d to cc0c556 Compare September 13, 2021 05:42
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:42 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:45 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:45 Inactive
… auto-install it into the package-demo org, then reinstall the latest released package version
@jongpie jongpie force-pushed the feature/security-enhancements branch from cc0c556 to 07d82af Compare September 13, 2021 05:49
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:49 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:51 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 05:51 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 06:01 Inactive
@jongpie jongpie added the devops Items related to tooling, automation, and guidelines used for developing Nebula Logger label Sep 13, 2021
* Fixes #149 by adding PMD through sfdx-scanner

* Apologizing to prettier by correctly running pmd-ruleset.xml through

* Correcting debug statement ordering - LoggingLevel comes first!

* Adding SFDX prior to running scanner

* Removing unused line as per @jongpie's feedback
@jamessimone jamessimone temporarily deployed to Test September 13, 2021 20:33 Inactive
@jamessimone jamessimone temporarily deployed to Test September 13, 2021 20:37 Inactive
@jamessimone jamessimone temporarily deployed to Test September 13, 2021 20:37 Inactive
@jamessimone jamessimone temporarily deployed to Test September 13, 2021 20:47 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 21:50 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 21:55 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 21:55 Inactive
@jongpie jongpie temporarily deployed to Test September 13, 2021 22:08 Inactive
@jongpie jongpie temporarily deployed to Test September 14, 2021 04:24 Inactive
@jongpie jongpie temporarily deployed to Test September 14, 2021 04:29 Inactive
@jongpie jongpie temporarily deployed to Test September 14, 2021 04:29 Inactive
@jongpie jongpie temporarily deployed to Test September 14, 2021 04:39 Inactive
@jongpie jongpie merged commit 408580f into main Sep 14, 2021
@jongpie jongpie deleted the feature/security-enhancements branch September 14, 2021 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Items related to tooling, automation, and guidelines used for developing Nebula Logger Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Salesforce Feature: Platform Events Items related to how platform events are leveraged by Nebula Logger Salesforce Feature: Security Items related to the security model (object-level access, field-level security, record sharing) Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log but no entries Null Record causes error
2 participants