Code Monkey home page Code Monkey logo

codemill's Introduction

codemill

codemill helps with the creation of codeql models for Go.

You build a spec of a module in a browser-based UI, adding models and selectors to it, and then it generates the corresponding codeql and go code.

Currently supported codeql models

  • TaintTracking - DONE
  • UntrustedFlowSource - DONE
  • HTTP::HeaderWrite - WIP
  • HTTP::Redirect - WIP
  • HTTP::ResponseBody - WIP

Install

You can install codemill cloning this repo and running make install; you need Go < 1.16.

NOTE: Go 1.16 will be supported soon (WIP).

Example generated code

You can see an example of what codemill can generate here: https://github.com/github/codeql-go/pull/438/files

Example: gin

# Welcome to a `codemill` basic usage example
# First' let's create a folder for our codemill files
mkdir my-codemill && cd my-codemill
# Then we need a folder for the projects' specs
mkdir specs
# And a folder for generated files
mkdir generated
# Now we're ready for creating our first spec
# In this example I will create a very incomplete model for the gin web framework
codemill --spec=./specs/Gin.json --dir=./generated --http=true --gen=true

codemill-initial-setup

After that, let's open http://127.0.0.1:8070/ in a browser, and edit the spec.

The first model we will add to the Gin spec is an UntrustedFlowSource model, which defines sources of user-defined input:

codemill-gin-untrustedflowsource

The second model we will add to the Gin spec is a TaintTracking model, which defines taint propagation in functions and methods:

codemill-gin-tainttracking

Now our spec is done, let's go back to the terminal and hit CTRL+C to close the program.

On exit, codemill will save the Gin spec we just created to specs/Gin.json, and generate codeql and go files in a timestamped folder inside the generated/ folder.

codemill's People

Contributors

gagliardetto avatar intrigus-lgtm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.