Code Monkey home page Code Monkey logo

iwa-java's Introduction

IWA (Insecure Web App) Java Edition

Overview

IWA (Insecure Web App) Java Edition is an example Java/Spring Web Application for use in DevSecOps scenarios and demonstrations. It includes some examples of bad and insecure code - which can be found using static and dynamic application security testing tools such as those provided by Micro Focus Fortify.

The application is intended to provide the functionality of a typical "online pharmacy", including purchasing Products (medication) and requesting Services (prescriptions, health checks etc). It has a modern-ish HTML front end (with some JavaScript) and a Swagger based API.

Please note: the application should not be used in a production environment!

Forking the Repository

In order to execute example scenarios for yourself it is recommended that you "fork" a copy of this repository into your own GitHub account. The process of "forking" is described in detail in the GitHub documentation - you can start the process by clicking on the "Fork" button at the top right.

Building the Application

To build the application, execute the following from the command line:

mvn clean package

This will create a JAR file (called iwa.jar) in the target directory.

To build a WAR file for deployment to an application server such as Apache Tomcat execute the following:

mvn -Pwar clean package

This will create a WAR file (called iwa.war) in the target directory.

Running the Application

Development (IDE/command line)

To run (and test) locally in development mode, execute the following from the command line:

mvn spring-boot:run

Release (Docker Image)

The JAR file can be built into a Docker image using the provided Dockerfile and the following commands:

mvn -Pjar clean package
docker build -t iwa -f Dockerfile .

or on Windows:

mvn -Pjar clean package
docker build -t iwa -f Dockerfile.win .

This image can then be executed using the following commands:

docker run -d -p 8888:8080 iwa

Using the Application

To use the application navigate to the URL: http://localhost:8888. You can carry out a number of actions unauthenticated, but if you want to login you can do so as one of the following users:

There is also an administrative user:

Upon login, you will be subsequently asked for a Multi-Factor Authentication (MFA) code. This functionality is not yet enabled and you can enter anything here, e.g. 12345.

REST APIs

To run (and test) locally in development mode, Go to Home Page -> My Account -> API Explorer OR use the following URL: http://localhost:8888/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config

API Authentication

every API endpoint is behind authenitcation and thus require to authenticate with JWT Token before pro Go To "Site" Operations and expand on :

/api/v3/site/sign-in

Click "Try it Out" button, provide administrative username and password mentioned above and hit "Execute" button.

Copy the "accessToken" value from response and paste into Swagger Authorization (padlock) icon.

Now, go ahead and try the API methods.

Licensing

This application is made available under the GNU General Public License V3

iwa-java's People

Contributors

bankierubybank avatar dylanbthomas avatar fransvanbuul avatar kadraman avatar rohitbaryha1 avatar varadhan-mf avatar young-s-park avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

iwa-java's Issues

Add AWS

Add (AWS CloudFormation YAML) code to IWA-Java to deploy this to AWS, using the EC2 and RDS services.

Introduce the "Missing RDS Encryption" and "Insecure transport" vulnerabilities for RDS. Detectable using SAST, not exploitable or detectable using DAST.

Introduce the "Missing EBS Encryption" vulnerability for EC2. Detectable using SAST, not exploitable or detectable using DAST.

Document all in exploits.md.

IWA-Java - A02:2021-Cryptographic Failures (full)

  • Ensure that IWA-Java has at least one vulnerability in the category A02:2021-Cryptographic Failures in its Java code that meets the criteria below. This might be an insecure random tied to access control, or maybe AES with ECB mode... this will require some creativity, it's not easy to find one.
  • Ensure that this is exploitable. The person running the demo must be able to show, using a browser or some other widely available tool, that the problem can be abused in a harmful way.
  • Document the exploit procedure in a file "EXPLOITS.md" for IWA-Java. This will be one file for all exploits for IWA-Java.
  • Ensure that the vulnerability can be found using a Fortify SCA scan. If this is not possible, find out why (ask for PM help as needed), and make any needed changes to make it detectable. As a matter of last resort, we can try to fix things in SCA and/or the rules, but the general idea is making a demo for Fortify SCA as-is.
  • Ensure that the vulnerability can be found using a WebInspect scan. If this is not possible, find out why (ask for PM help as needed), and make any needed changes to make it detectable. As a matter of last resort, we can try to fix things in SCA and/or the rules, but the general idea is making a demo for WebInspect as-is.

Seed REST API with some JWT vulnerabilities

DAST focus!

Some of these

11647 JWT Empty Signature Attack

11595 JWT None Algorithm Attack

11645 JWT Header Claims

11646 JWT Potential CSRF Misconfiguration

11648 JWT Random Signature Attack

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.