GithubHelp home page GithubHelp logo

kubescape / gateway Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 5.0 399 KB

Gateway is an in-cluster component of the Kubescape security platform. It broadcasts a message received to its registered clients. When a client registers itself in a Gateway it must provide a set of attributes, which will serve as identification, for message routing purposes.

License: Apache License 2.0

Dockerfile 1.33% Shell 1.66% Go 79.84% Python 17.18%
kubescape kubescape-helm

gateway's Introduction

Gateway

The Gateway enables broadcasting a single message to the different microservices running in the cluster.

The gateway works as a tree: there is the root and the different leafs. The leafs “attach” to the root using a set of attributes, while the root provides an API.

When broadcasting a message, the message must contain the attributes to whom it should be broadcast. The root will broadcast the message to all the leafs that registered with those attributes.

Building gateway

To build the gateway run: go build .

Configuration

Load config file using the CONFIG environment variable

export CONFIG=path/to/clusterData.json

example/clusterData.json
{
   "gatewayWebsocketURL": "127.0.0.1:8001",
   "gatewayRestURL": "127.0.0.1:8002",
   "kubevulnURL": "127.0.0.1:8081",
   "kubescapeURL": "127.0.0.1:8080",
   "eventReceiverRestURL": "https://report.armo.cloud",
   "eventReceiverWebsocketURL": "wss://report.armo.cloud",
   "rootGatewayURL": "wss://ens.euprod1.cyberarmorsoft.com/v1/waitfornotification",
   "accountID": "*********************",
   "clusterName": "******" 
  } 

API Documentation

As mentioned before, the Gateway exposes an HTTP API. You can learn more about the API using one of the provided interactive OpenAPI UIs:

  • SwaggerUI, available at /openapi/v2/swaggerui
  • RapiDoc, available at /openapi/v2/rapi
  • Redoc, available at /openapi/v2/docs

Supported environment variables

  • WEBSOCKET_PORT: websocket port (default 8001)
  • HTTP_PORT: restAPI port (default 8002)

For more details on environment variables, check out pkg/environmentvariables.go.

VS code configuration samples

You can use the sample file below to setup your VS code environment for building and debugging purposes.

.vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program":  "${workspaceRoot}",
                 "env": {
                     "NAMESPACE": "armo-system",
                     "CONFIG": "${workspaceRoot}/.vscode/clusterData.json",
            },
            "args": [
                "-alsologtostderr", "-v=4", "2>&1"
            ]
        }
    ]
}

gateway's People

Contributors

amirmalka avatar bezbran avatar dependabot[bot] avatar dwertent avatar matanshk avatar matanshk2 avatar matthyx avatar moshe-rappaport-ca avatar rcohencyberarmor avatar slashben avatar testwill avatar vladklokun avatar

Stargazers

 avatar

Watchers

 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.