Giter Site home page Giter Site logo

"paranoid" switch about iniscan HOT 3 OPEN

psecio avatar psecio commented on May 18, 2024
"paranoid" switch

from iniscan.

Comments (3)

jeremyquinton avatar jeremyquinton commented on May 18, 2024

Im a 12 hour flight tonight so thought this would be something cool to hack on if it still needs doing?

from iniscan.

enygma avatar enygma commented on May 18, 2024

Yeah, that'd be great! Some of those checks may already exist but the ranges for them may not match up with the "paranoid" settings.

from iniscan.

jeremyquinton avatar jeremyquinton commented on May 18, 2024

Having had a look at the source code there is a couple ways this could be implemented.

Approach 1
A real simple approach I took was to define a new rule with a context of paranoid. I also updated the context when doing a scan to use prod by default if context is not specified. I only defined memory limit as an example you can see the implementation here https://github.com/jeremyquinton/iniscan/compare/issue39

Approach 2
There is a another approach that could be used. Tests in the rules.json could instead be defined as a different structure where contexts supersede other contexts. My thinking was to perhaps modify the json and a rule could have multiple test operations. So for memory limit the test is updated from

"test": {
      "key": "memory_limit",
      "operation": "smaller",
      "value": "128M"
} 

to

"test": [{
            "key": "memory_limit",
        "operation": "smaller",
        "value": "128M"
       },
       {
        "key": "memory_limit",
        "operation": "smaller",
        "value": "32M",
        "context": ["paranoid"]
       }
  ] 

Which approach do you think is best or if you think there is a better way let me know and I could go about implementing it.

test operations can then override other operations based on context. The second item in that json would also need an operation of smallerthanorequalto.

For this feature to be complete the fix command needs to be updated to have contexts and apply approach 1 or approach 2.

from iniscan.

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.