cloud-native-security-hub-backend
所属分类:云原生工具
开发工具:GO
文件大小:93KB
下载次数:0
上传日期:2020-01-20 19:30:39
上 传 者:
sh-1993
说明: 云本机安全中心-后端
(Cloud Native Security Hub - Backend)
文件列表:
.circleci (0, 2020-01-21)
.circleci\config.yml (22, 2020-01-21)
Dockerfile.dbimport (351, 2020-01-21)
Dockerfile.server (339, 2020-01-21)
LICENSE (11357, 2020-01-21)
Makefile (904, 2020-01-21)
OWNERS (99, 2020-01-21)
build (0, 2020-01-21)
build\ci (0, 2020-01-21)
build\ci\config.yml (1034, 2020-01-21)
cmd (0, 2020-01-21)
cmd\dbimport (0, 2020-01-21)
cmd\dbimport\main.go (1771, 2020-01-21)
cmd\server (0, 2020-01-21)
cmd\server\main.go (264, 2020-01-21)
db (0, 2020-01-21)
db\migrations (0, 2020-01-21)
db\migrations\1572893872_create_security_resources_table.down.sql (41, 2020-01-21)
db\migrations\1572893872_create_security_resources_table.up.sql (200, 2020-01-21)
db\migrations\1573146110_add_unique_restriction_to_security_resources_table.down.sql (65, 2020-01-21)
db\migrations\1573146110_add_unique_restriction_to_security_resources_table.up.sql (162, 2020-01-21)
db\migrations\1573226695_vendors_table.down.sql (30, 2020-01-21)
db\migrations\1573226695_vendors_table.up.sql (252, 2020-01-21)
db\migrations\1573467085_create_latest_security_resources_table.down.sql (52, 2020-01-21)
db\migrations\1573467085_create_latest_security_resources_table.up.sql (367, 2020-01-21)
db\migrations\1574858751_create_available_versions_column.down.sql (178, 2020-01-21)
db\migrations\1574858751_create_available_versions_column.up.sql (198, 2020-01-21)
deployments (0, 2020-01-21)
deployments\kubernetes (0, 2020-01-21)
deployments\kubernetes\backend-deployment.yaml (660, 2020-01-21)
deployments\kubernetes\dbimport-job.yaml (1857, 2020-01-21)
deployments\kubernetes\frontend-deployment.yaml (567, 2020-01-21)
deployments\kubernetes\ingress.yaml (880, 2020-01-21)
deployments\kubernetes\namespace.yaml (61, 2020-01-21)
deployments\kubernetes\service.yaml (408, 2020-01-21)
go.mod (446, 2020-01-21)
go.sum (26586, 2020-01-21)
... ...
# Cloud Native Security Hub
![last commit](https://flat.badgen.net/github/last-commit/falcosecurity/cloud-native-security-hub-backend?icon=github) ![licence](https://flat.badgen.net/github/license/falcosecurity/cloud-native-security-hub-backend)
Cloud Native Security Hub is a platform for discovering and sharing rules and
configurations for cloud native security tools.
This repository contains the HTTP API and backend code that runs the
https://securityhub.dev site
## Usage
This code requires a recent golang version (1.13) and it uses modules to handle
the dependencies.
### Configuration
This project requires a PostgreSQL 11 server running. And you configure the app
to attack the database using the `DATABASE_URL` environment variable, which contains
the connection string for your server.
For example: `DATABASE_URL="postgres://username:password@127.0.0.1/db_name?sslmode=disable"`
### cmd/server
This is the HTTP API server and it will listen to requests on the `8080` port.
```
$ go run cmd/server/main.go
```
### cmd/dbimport
You need to setup a couple of environment variables previously to import any
data in the database:
* `RESOURCES_PATH`: Path to securityhub/resources directory
* `VENDOR_PATH`: Path to securityhub/vendors directory
These directories can be found in the [Cloud Native Security Hub Resources repository](https://github.com/falcosecurity/cloud-native-security-hub).
Then with the `DATABASE_URL` set, execute:
```
$ go run cmd/dbimport/main.go
```
And voila!
## Contributing
Contributors are welcome! You will need a quick package overview to understand
some design decisions:
* `pkg/usecases`: You will find the entry points in the `pkg/usecases` directory.
One action per file, modeled like a command.
* `pkg/resource` and `pkg/vendor`: This is the domain code for security resources
and vendors. You will find the repositories, entities and value objects.
* `test`: All our code is test driven, in this directory we have some fixtures
to avoid repeating test data in the test code.
* `web`: The web is just a delivery mechanism, it is separated from the backend code
and can be used as a library if you need to. Is responsible to JSON
marshalling and HTTP communications.
* `db`: Contains the migration files for the database. For every change
in the schema, you will need to create the corresponding migration file.
近期下载者:
相关文件:
收藏者: