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

Add Apex and VisualForce rules #3085

Merged
merged 24 commits into from
Oct 19, 2023
Merged

Conversation

garretpatten-ncino
Copy link
Contributor

@garretpatten-ncino garretpatten-ncino commented Aug 30, 2023

Changes

  • Add the following Apex rules:
    • GlobalAccessModifiers
    • ApexCSRFConstructor
    • ApexCSRFStaticConstructor
    • DmlNativeStatements
    • BadCrypto
    • InsecureHttpRequest
    • NamedCredentialsConstantMatch
    • NamedCredentialsStringMatch
    • ApexSOQLInjectionFromUnescapedURLParam
    • ApexSOQLInjectionUnescapedParam
    • SpecifySharingLevel
    • SystemDebug
    • UseAssertClass
    • AbsoluteUrls
    • AvoidNativeDmlInLoops
    • AvoidOperationsWithLimitsInLoops
    • AvoidSoqlInLoops
    • AvoidSoslInLoops
  • Add the following VisualForce rules:
    • CSPHeaderAttribute
    • UseSRIForCDNs (also applies to HTML but being added just to VF set here)
    • VisualForceAPIVersion
    • XSSFromUnescapedURLParam

Outstanding Questions

  • We have some rules (Semgrep versions of existing open source PMD rules) around Apex performance and best practices. Not sure if they belonged in this PR or not; for now, they've been included.
  • Guidance was initially given to include technology: ncino in the metadata of each rule, but Apex and VisualForce are Salesforce languages/frameworks. We thought it would be more appropriate to include technology: salesforce. With that, would it make sense to add another metadata entry for contributor: ncino or something like that?

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2023

CLA assistant check
All committers have signed the CLA.

@garretpatten-ncino garretpatten-ncino changed the title Add apex and VF security rules Add Apex and VisualForce rules Aug 30, 2023
@garretpatten-ncino garretpatten-ncino marked this pull request as ready for review September 19, 2023 18:22
@p4p3r p4p3r requested a review from a team October 18, 2023 15:33
Copy link
Contributor

@p4p3r p4p3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@p4p3r p4p3r requested a review from a team October 18, 2023 18:37
@p4p3r p4p3r merged commit 075ee5c into semgrep:develop Oct 19, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants