Class SensitiveDataLoggingCodemod

java.lang.Object
io.codemodder.RawFileChanger
io.codemodder.SarifPluginRawFileChanger
io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod
io.codemodder.codemods.SensitiveDataLoggingCodemod
All Implemented Interfaces:
io.codemodder.CodeChanger

@Codemod(id="pixee:java/sensitive-data-logging", importance=HIGH, reviewGuidance=MERGE_AFTER_REVIEW) public final class SensitiveDataLoggingCodemod extends io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod
A codemod that removes any sensitive data being logged.
  • Field Summary

    Fields inherited from class io.codemodder.RawFileChanger

    reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    SensitiveDataLoggingCodemod(io.codemodder.RuleSarif sarif, io.codemodder.plugins.llm.OpenAIService openAI)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    protected String
    getThreatPrompt(io.codemodder.CodemodInvocationContext context, List<com.contrastsecurity.sarif.Result> results)
     
    protected boolean
    isPatchExpected(com.github.difflib.patch.Patch<String> patch)
     

    Methods inherited from class io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod

    onFileFound

    Methods inherited from class io.codemodder.SarifPluginRawFileChanger

    visitFile

    Methods inherited from class io.codemodder.RawFileChanger

    getDescription, getIndividualChangeDescription, getReferences, getSummary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.codemodder.CodeChanger

    shouldRun
  • Constructor Details

    • SensitiveDataLoggingCodemod

      @Inject public SensitiveDataLoggingCodemod(@SemgrepScan(ruleId="sensitive-data-logging") io.codemodder.RuleSarif sarif, io.codemodder.plugins.llm.OpenAIService openAI)
  • Method Details

    • getThreatPrompt

      protected String getThreatPrompt(io.codemodder.CodemodInvocationContext context, List<com.contrastsecurity.sarif.Result> results)
      Specified by:
      getThreatPrompt in class io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod
    • getFixPrompt

      protected String getFixPrompt()
      Specified by:
      getFixPrompt in class io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod
    • isPatchExpected

      protected boolean isPatchExpected(com.github.difflib.patch.Patch<String> patch)
      Specified by:
      isPatchExpected in class io.codemodder.plugins.llm.SarifToLLMForBinaryVerificationAndFixingCodemod