View on GitHub

SecureCodingDojo

The Secure Coding Dojo is a platform for delivering secure coding knowledge.

About the Secure Coding Dojo

The Secure Coding Dojo is a platform for delivering secure coding training. While it comes with its own vulnerable training application (the Insecure.Inc website) the training portal can be used in conjunction with other training applications. The strength of the platform is its extensibility and the integration with the commonly used development collaboration platform Slack. The training portal can be easily setup in the cloud and instructions for AWS Elastic Beanstalk setup are available below.

Be sure to also check the wiki for more details on deploying and installing the Dojo.

Demo

Download the demo to get a look and feel of the training portal and the Insecure.Inc application.

Also take a look in /screenshots Alt text

Try it

The following steps will get you the basic configuration for the Dojo. For advanced configuration and integrations check the wiki

Why Another Security Training Site?

While open source training sites to teach application security concepts are not new the target audience for these sites has been pen-testers and ethical hackers. The Secure Coding Dojo is primarily intended as a delivery platform for developers and here’s why:

SecureCodingDojo and Compliance Requirements

While we don’t guarantee compliance the training could be used to meet compliance requirements such as PCI 6.5.a. See Insecure.Inc curriculum document on mapping to SANS 25/ OWASP Top 10 / PCI 6.5

Development Pre-requisites

Training portal

Insecure.Inc

Development Environment Setup Instructions

Training portal

Insecure.inc

Building

Training portal

Insecure.Inc

Hosting Insecure.Inc

Check out the wiki.

Deploying the Training Portal

More info on the wiki.

Slack Setup Instructions

You will need to create a Slack app for authentication.

Google Setup Instructions

Google authentication can also be configured in config.json. You will need a Google developer account and obtain the OAuth credentials from the Google API console: https://console.developers.google.com

In the same place you will setup your domain and authorized redirect URIs. For example for a localhost setup the redirect url would be: http://localhost:8081/public/google/callback

Local Authentication Setup Instructions

For small teams or pre-configured images Slack or Google authentication may not be an option. For this scenario you can configure authentication working with a local flat file.

Check the wiki for more information.

DB Setup Instructions

If you don’t configure a DB the training portal will just use a local SQLite DB

You can also install MySQL and create a DB and credentials for that DB. Note your user name and password you will need them for later.

Encryption Key Seeds and Environment Variables

You will have to setup encryption keys as OS environment variables. On *nix/mac modify .bash_profile as follows

export ENC_KEY="put something random here"
export ENC_KEY_IV="put something random here"

The following is to prevent participants from generating their own challenge codes.

export CHALLENGE_MASTER_SALT="put something random here"

Extending the Secure Coding Dojo

You can add new lessons by following the model of existing ones.

Challenges

Challenges are defined in ./trainingportal/static/lessons The file definitions.json points to the corresponding html challenge description, play link and corresponding code blocks by code block id. Follow the already defined examples to create a new one.

.
+-- /trainingportal/static/lessons
|   +-- modules.json //configuration file where lesson modules are defined
|   +-- /attack-grams //visual representations of attacks included in challenge descriptions
|   +-- /blackBelt //lesson module
|       +--definitions.json //individual lesson definitions
|       +--cwe494.md // html or markdown file including the lesson description
|       +--cwe494.sol.md //solution for the lesson
|       ....
|       +--quiz.html 
|   +-- /secondDegreeBlackBelt

Code Blocks

Code Blocks are defined in ./trainingportal/static/codeBlocks. This folder has a similar structure with a definition json and a bunch of html files for each challenge.

.
+-- /trainingportal/static/codeBlocks
|   +-- codeBlocksDefinitions.json //configuration file where code blocks are defined
|   +-- authenticationByDefault.html //code block description html
|   ...
|   +-- useStrongDataEncryption.html