Giter VIP home page Giter VIP logo

siwecos-core-api's Introduction

SIWECOS-Core-API

API DOCS SCANNER INTERFACE DOCS

With this project you can simply run any of the offical SIWECOS scanners.

Editing the API-Documentation via Docker

See this project for a How-To use the Docker slate image: https://github.com/davidheryanto/slate-docker

Make sure you first build the image and than run the docker run command in the actual siwecos-business-layer directory on the latest develop branch.

siwecos-core-api's People

Contributors

dependabot[bot] avatar lednerb avatar skeeve avatar snipersister avatar weegy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

itsjw skeeve

siwecos-core-api's Issues

Domain verification fails

We tried to validate botfrei.de (See id 16 and 17 in domains table).

Both domain tokens are in index.html.

Domain token for id 17 is also stored as a file.

Nevertheless validation fails.

We tested between 08:05 and 08:10 this morning in case this helps.

Implement Token@status functionality

Diese Route soll zusätzlich folgende Informationen ausgeben:

  1. Zeitpunkt der Registrierung des Nutzers (des Tokens)
  2. Zeitpunkt des letzten Scans

Bestimmte Scanner starten

Möglichkeit, verschiedene Scanner einzeln zu starten, basierend auf einer ACL bzw. über die Business Logic, damit ein Free-Scan ohne Registrierung möglich ist.

scan status updated by scanners - I think this is wrong

ScanJobs update table "scans" by setting the status to "2" (again: No clear understanding what "2" means here).

I also can see that in ScanController.php this field is updated to contain "3".

Are you sure it is correct that every scanner updates this one field, possibly overwriting values from other scanners?

Add credits middleware

Bevor ein Scanner gestartet werden kann, soll überprüft werden, ob genügend Credits auf dem Token vorhanden sind.

Dies soll über eine Middleware realisiert werden

Scanners are not configurable

In CoreApi/app/Http/Controllers/ScanController.php

you have

        // dispatch each scanner to the queue
        ScanHeadersJob::dispatch($scan);
        ScanDOMXSSJob::dispatch($scan);
        ScanInfoLeakJob::dispatch($scan);
        // TODO: dispatch TLS-Scanner
        // TODO: Send Response

The consequence is that we have to compile the CoreAPI each time a new scanner is introduced or another scanner has to be decommissioned.

This does not meet the requirements as far as I know.

The scanners must be configurable. Best would be to have it in the database and have API Calls to add, remove, enable and disable them.

Cleanup database entries upon failed scanner start

Before starting a scanner, database entries are created so that the results can be acceppted.

But when the scanner couldn't be started, the entries remain unchanged.

Especially the status remains at "2" (whatever that might mean) instead of being updated to something indicating "failed to start".

Create Token fails to set correct aclLevel

Request

POST /api/v1/token/add HTTP/1.1
Host: siwecos-core-api.dev
Accept: application/json
Content-Type: application/json
masterToken: wD7YVVc6v4IS8eeghVaTRC/x
Cache-Control: no-cache
Postman-Token: f1fae26e-a1b6-5f8a-6f9a-f231f9b58535

{
"aclLevel":1,
"credits":65536
}

! Response

{
    "token": "THe9eO22P0Fjx0WxZKffbRb2",
    "hasFailed": false,
    "message": "token successful created"
}

Store this token in Postman as mysite.dev's token.

Database

Query

select * from tokens where token = 'THe9eO22P0Fjx0WxZKffbRb2'

Result

id created_at updated_at token credits active acl_level
7 2018-02-08 09:43:36 2018-02-08 09:43:36 THe9eO22P0Fjx0WxZKffbRb2 65536 true 0

Question

aclLevel is 0 but 1 was requested.

Error in Documentation/api/swagger/scannerapi.yaml

In

TranslateableMessage:
  required:
    - placeholder
  properties:
    placeholder:
      type: string
      description: human readable language placeholder name i.e. HACKED_FILE_FOUND
    values:
      type: string
      description: Key-value pairs that will be used within the language string

values should be an object of key-value pairs.

/domain/remove fails

Request

POST /api/v1/domain/remove HTTP/1.1
Host: siwecos-core-api.dev
Accept: application/json
Content-Type: application/json
siwecosToken: THe9eO22P0Fjx0WxZKffbRb2
Cache-Control: no-cache
Postman-Token: d98d4108-bf38-1e43-a0de-256b7d42ec43

{ "domain":"http://mysite.dev" }

Response

{
    "domain": [
        "The domain has already been taken."
    ]
}

Question

Why did removal fail? Found a bug?

Scanner integration more complicated than required

Currently it seems to me that the integration of a new scanner is much more complicated than it need to be. As a matter of fact every scanner has to work according to a defined API. Due to this it should be sufficient to have the scanner's entry URL in order to utilize it. So the only thing which I would expect to configure is this URL in a configuration file.

Unfortunately this isn't the case. In order to integrate a new scanner you have to (possibly incomplete)

  1. "use" it in ScanController.php
  2. Dispatch it in the same file
  3. Create a new job-php - seems the existing 3 are pretty much identical besides some names
  4. add it to 2 autoload files (or is this done automatically?

// TODO: Send Response

I just discovered the comment given in the subject in file ScannerController.php

This gives me a bad feeling… Is it a leftover or are the scan results really not sent to the business layer?

Scan Result Mocks

Beispielergebnisse im JSON-Format, die von den Scannern zurückgeliefert werden, sollen als Mock gespeichert werden, sodass für die Entwicklung kein direkter Scan-Aufruf benötigt wird.

Dockerize easy scanners

Die Scanner sollten ein Docker-File beinhalten, sodass diese schnell und einfach genutzt werden können.

Benötigt für die Travis-Tests / Test-Setup

ScannerController tries to start unconfigured scanners

The Scan…Job.php files use environment variables without testing for their existance.

So they try to start a scanner even if the entry URL isn't configured.

Better log an errr/warning telling which scanner failed to be started.

Domain verification seems to happen just once

Is it intended that domain verification happens just once?

I think a verification should be done either before each scan.

Otherwise a domain which changed owner could be scanned by an unauthorized person.

Tested by removing my token from my site.

Update: Even worse: A second run on verify fails, but does not change the database entry. Domain is still verified.

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.