Code Monkey home page Code Monkey logo

Comments (2)

bradlarsen avatar bradlarsen commented on June 3, 2024

Hi @roshvin, and thanks for the question.

I'm not aware of any example at present for using Nosey Parker in a pre-receive hook for GitHub Enterprise Server. (Presumably the use case there is to be able to scan for secrets at push time, and block pushing of commits that contain secrets.)

To make that work, you'd need to script some pieces: in a pre-receive hook, run noseyparker scan on the received content, and then perhaps noseyparker report -f json, followed by some test in the pre-receive hook that would cause it to fail if there were any Nosey Parker findings in the JSON output. I've not written such a thing myself.

One thing you would want to do if you set up a mechanism like this is specify a custom ruleset to only enable rules that have essentially no false positives, as you don't want to spuriously be blocking developer's commits. This mechanism is not well documented, but it involves writing a YAML file with the list of rule IDs that you want to enable, and then invoking noseyparker scan --rules-path YOUR_YAML_FILE --ruleset YOUR_RULESET_NAME.

See here for an example ruleset: https://github.com/praetorian-inc/noseyparker/blob/0cce95910be38058cc0cf00b548a892e3ed5dc35/crates/noseyparker/data/default/builtin/rulesets/default.yml

Let me know if you have questions about this and I will write up more documentation.

from noseyparker.

roshvin avatar roshvin commented on June 3, 2024

Hi @bradlarsen thanks a lot for the quick help/support.

from noseyparker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.