Skip to content

Commit

Permalink
Develop (#283)
Browse files Browse the repository at this point in the history
* Adding integration with new tool horusec-dart analysis dart language and flutter framework
* Update LDAP connection with Microsoft AD
* Update horusec-java, horusec-kotlin, horusec-leaks, horusec-nodejs, horusec-kubernetes, horusec-csharp to run with limit of units by analysis
* Update manager to logout forced
  • Loading branch information
wiliansilvazup authored Jan 21, 2021
1 parent c6b4229 commit d5d8aac
Show file tree
Hide file tree
Showing 112 changed files with 3,033 additions and 967 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/dart-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: HorusecDartPipeline

on:
pull_request:
branches: [ "**" ]

jobs:
install-build-test-fmt-lint:
name: install-build-test-fmt-lint
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v2
- name: fmt
run: |
echo "==> Checking that code complies with gofmt requirements..."
gofmt_files=$(gofmt -l `find ./horusec-dart -name '*.go' | grep -v vendor`)
echo $gofmt_files
if [ ! -z $gofmt_files ]; then
echo 'gofmt needs running on the following files:'
echo "$gofmt_files"
echo "You can use the command: \`gofmt -w \$(gofmt -l \'find ./horusec-dart -name \'*.go\' | grep -v vendor)\` to reformat code."
exit 1
fi
echo "=) The project horusec-dart it's OK!"
- name: lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.25.0
./bin/golangci-lint run -v --timeout=2m -c .golangci.yml ./horusec-dart/...
- name: test
run: |
go clean -testcache
go test -v ./horusec-dart/... -timeout=2m -parallel=1 -failfast -short
- name: coverage
run: make coverage-horusec-dart
- name: build
run: go build -o "./tmp/bin/horusec-dart" ./horusec-dart/cmd/app/main.go

13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage: coverage-development-kit coverage-horusec-api coverage-horusec-cli cov

coverage-development-kit:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 88 "./development-kit"
deployments/scripts/coverage.sh 87 "./development-kit"
coverage-horusec-api:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 99 "./horusec-api"
Expand All @@ -25,7 +25,7 @@ coverage-horusec-messages:
deployments/scripts/coverage.sh 98 "./horusec-messages"
coverage-horusec-account:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 98 "./horusec-account"
deployments/scripts/coverage.sh 97 "./horusec-account"
coverage-horusec-analytic:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 98 "./horusec-analytic"
Expand Down Expand Up @@ -53,6 +53,9 @@ coverage-horusec-kubernetes:
coverage-horusec-nodejs:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 99 "./horusec-nodejs"
coverage-horusec-dart:
chmod +x deployments/scripts/coverage.sh
deployments/scripts/coverage.sh 99 "./horusec-dart"
# Check lint of project setup on file .golangci.yml
lint:
ifeq ($(wildcard $(GOCILINT)), $(GOCILINT))
Expand Down Expand Up @@ -213,6 +216,12 @@ build-install-nodejs-cli:
chmod +x "$(PATH_BINARY_BUILD_CLI)/horusec-nodejs"
horusec-nodejs version

build-install-dart-cli:
rm -rf "$(PATH_BINARY_BUILD_CLI)/horusec-dart" &> /dev/null
$(GO) build -o "$(PATH_BINARY_BUILD_CLI)/horusec-dart" ./horusec-dart/cmd/app/main.go
chmod +x "$(PATH_BINARY_BUILD_CLI)/horusec-dart"
horusec-dart version

# ========================================================================================= #

# HELM_SERVICE_NAME="horusec-account" make helm-upgrade
Expand Down
33 changes: 15 additions & 18 deletions deployments/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@ version: '3'
services:
# ldap-service:
# container_name: ldap-service
# image: osixia/openldap:1.1.8
# image: dwimberger/ldap-ad-it
# ports:
# - "389:389"
# - "636:636"
# ldap-admin:
# container_name: ldap-admin
# image: osixia/phpldapadmin:0.9.0
# ports:
# - "6443:443"
# depends_on:
# - "ldap-service"
# environment:
# PHPLDAPADMIN_LDAP_HOSTS: ldap-service
# - "10389:10389"
# postgresql_keycloak:
# container_name: postgresql_keycloak
# image: postgres:12
Expand Down Expand Up @@ -92,6 +82,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8004"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
Expand All @@ -117,23 +108,24 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8006"
HORUSEC_GRPC_PORT: "8007"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_KEYCLOAK_BASE_PATH: "http://127.0.0.1:8080"
HORUSEC_KEYCLOAK_CLIENT_ID: "account"
HORUSEC_KEYCLOAK_CLIENT_SECRET: "00000000-0000-0000-0000-000000000000" # Get secret inside of keycloak server
HORUSEC_KEYCLOAK_REALM: "master"
HORUSEC_LDAP_BASE: "dc=example,dc=org"
HORUSEC_LDAP_BASE: "dc=wimpi,dc=net"
HORUSEC_LDAP_HOST: "127.0.0.1"
HORUSEC_LDAP_PORT: "389"
HORUSEC_LDAP_PORT: "10389"
HORUSEC_LDAP_USESSL: "false"
HORUSEC_LDAP_SKIP_TLS: "true"
HORUSEC_LDAP_INSECURE_SKIP_VERIFY: "true"
HORUSEC_LDAP_BINDDN: "cn=admin,dc=example,dc=org"
HORUSEC_LDAP_BINDPASSWORD: "admin"
HORUSEC_LDAP_USERFILTER: "(uid=%s)"
HORUSEC_LDAP_GROUPFILTER: "(memberUid=%s)"
HORUSEC_LDAP_BINDDN: "uid=admin,ou=system"
HORUSEC_LDAP_BINDPASSWORD: "secret"
HORUSEC_LDAP_USERFILTER: "(sAMAccountName=%s)"
HORUSEC_LDAP_ADMIN_GROUP: "admin"
HORUSEC_ENABLE_APPLICATION_ADMIN: "false"
HORUSEC_APPLICATION_ADMIN_DATA: "{\"username\": \"horusec-admin\", \"email\":\"horusec-admin@example.com\", \"password\":\"Devpass0*\"}"
Expand All @@ -150,6 +142,7 @@ services:
depends_on:
- "rabbit"
- "postgresql"
- "horusec-auth"
restart: always
container_name: horusec-account
network_mode: "host"
Expand All @@ -158,6 +151,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8003"
HORUSEC_DISABLED_BROKER: "true"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
Expand All @@ -180,6 +174,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8005"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -198,6 +193,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8000"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -221,6 +217,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8008"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand Down
33 changes: 15 additions & 18 deletions deployments/docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@ version: '3'
services:
# ldap-service:
# container_name: ldap-service
# image: osixia/openldap:1.1.8
# image: dwimberger/ldap-ad-it
# ports:
# - "389:389"
# - "636:636"
# ldap-admin:
# container_name: ldap-admin
# image: osixia/phpldapadmin:0.9.0
# ports:
# - "6443:443"
# depends_on:
# - "ldap-service"
# environment:
# PHPLDAPADMIN_LDAP_HOSTS: ldap-service
# - "10389:10389"
# postgresql_keycloak:
# container_name: postgresql_keycloak
# image: postgres:12
Expand Down Expand Up @@ -90,6 +80,7 @@ services:
ports:
- "8004:8004"
environment:
HORUSEC_PORT: "8004"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
Expand All @@ -113,23 +104,24 @@ services:
- "8006:8006"
- "8007:8007"
environment:
HORUSEC_PORT: "8006"
HORUSEC_GRPC_PORT: "8007"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_KEYCLOAK_BASE_PATH: "http://127.0.0.1:8080"
HORUSEC_KEYCLOAK_CLIENT_ID: "account"
HORUSEC_KEYCLOAK_CLIENT_SECRET: "00000000-0000-0000-0000-000000000000" # Get secret inside of keycloak server
HORUSEC_KEYCLOAK_REALM: "master"
HORUSEC_LDAP_BASE: "dc=example,dc=org"
HORUSEC_LDAP_BASE: "dc=wimpi,dc=net"
HORUSEC_LDAP_HOST: "127.0.0.1"
HORUSEC_LDAP_PORT: "389"
HORUSEC_LDAP_PORT: "10389"
HORUSEC_LDAP_USESSL: "false"
HORUSEC_LDAP_SKIP_TLS: "true"
HORUSEC_LDAP_INSECURE_SKIP_VERIFY: "true"
HORUSEC_LDAP_BINDDN: "cn=admin,dc=example,dc=org"
HORUSEC_LDAP_BINDPASSWORD: "admin"
HORUSEC_LDAP_USERFILTER: "(uid=%s)"
HORUSEC_LDAP_GROUPFILTER: "(memberUid=%s)"
HORUSEC_LDAP_BINDDN: "uid=admin,ou=system"
HORUSEC_LDAP_BINDPASSWORD: "secret"
HORUSEC_LDAP_USERFILTER: "(sAMAccountName=%s)"
HORUSEC_LDAP_ADMIN_GROUP: "admin"
HORUSEC_ENABLE_APPLICATION_ADMIN: "false"
HORUSEC_APPLICATION_ADMIN_DATA: "{\"username\": \"horusec-admin\", \"email\":\"horusec-admin@example.com\", \"password\":\"Devpass0*\"}"
Expand All @@ -146,12 +138,14 @@ services:
depends_on:
- "rabbit"
- "postgresql"
- "horusec-auth"
restart: always
container_name: horusec-account
network_mode: "host"
ports:
- "8003:8003"
environment:
HORUSEC_PORT: "8003"
HORUSEC_DISABLED_BROKER: "true"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
Expand All @@ -172,6 +166,7 @@ services:
ports:
- "8005:8005"
environment:
HORUSEC_PORT: "8005"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -188,6 +183,7 @@ services:
ports:
- "8000:8000"
environment:
HORUSEC_PORT: "8000"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -211,6 +207,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8008"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand Down
33 changes: 15 additions & 18 deletions deployments/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@ version: '3'
services:
# ldap-service:
# container_name: ldap-service
# image: osixia/openldap:1.1.8
# image: dwimberger/ldap-ad-it
# ports:
# - "389:389"
# - "636:636"
# ldap-admin:
# container_name: ldap-admin
# image: osixia/phpldapadmin:0.9.0
# ports:
# - "6443:443"
# depends_on:
# - "ldap-service"
# environment:
# PHPLDAPADMIN_LDAP_HOSTS: ldap-service
# - "10389:10389"
# postgresql_keycloak:
# container_name: postgresql_keycloak
# image: postgres:12
Expand Down Expand Up @@ -88,6 +78,7 @@ services:
ports:
- "8004:8004"
environment:
HORUSEC_PORT: "8004"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
Expand All @@ -109,23 +100,24 @@ services:
- "8006:8006"
- "8007:8007"
environment:
HORUSEC_PORT: "8006"
HORUSEC_GRPC_PORT: "8007"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_KEYCLOAK_BASE_PATH: "http://127.0.0.1:8080"
HORUSEC_KEYCLOAK_CLIENT_ID: "account"
HORUSEC_KEYCLOAK_CLIENT_SECRET: "00000000-0000-0000-0000-000000000000" # Get secret inside of keycloak server
HORUSEC_KEYCLOAK_REALM: "master"
HORUSEC_LDAP_BASE: "dc=example,dc=org"
HORUSEC_LDAP_BASE: "dc=wimpi,dc=net"
HORUSEC_LDAP_HOST: "127.0.0.1"
HORUSEC_LDAP_PORT: "389"
HORUSEC_LDAP_PORT: "10389"
HORUSEC_LDAP_USESSL: "false"
HORUSEC_LDAP_SKIP_TLS: "true"
HORUSEC_LDAP_INSECURE_SKIP_VERIFY: "true"
HORUSEC_LDAP_BINDDN: "cn=admin,dc=example,dc=org"
HORUSEC_LDAP_BINDPASSWORD: "admin"
HORUSEC_LDAP_USERFILTER: "(uid=%s)"
HORUSEC_LDAP_GROUPFILTER: "(memberUid=%s)"
HORUSEC_LDAP_BINDDN: "uid=admin,ou=system"
HORUSEC_LDAP_BINDPASSWORD: "secret"
HORUSEC_LDAP_USERFILTER: "(sAMAccountName=%s)"
HORUSEC_LDAP_ADMIN_GROUP: "admin"
HORUSEC_ENABLE_APPLICATION_ADMIN: "false"
HORUSEC_APPLICATION_ADMIN_DATA: "{\"username\": \"horusec-admin\", \"email\":\"horusec-admin@example.com\", \"password\":\"Devpass0*\"}"
Expand All @@ -140,12 +132,14 @@ services:
depends_on:
- "rabbit"
- "postgresql"
- "horusec-auth"
restart: always
container_name: horusec-account
network_mode: "host"
ports:
- "8003:8003"
environment:
HORUSEC_PORT: "8003"
HORUSEC_DISABLED_BROKER: "true"
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
Expand All @@ -164,6 +158,7 @@ services:
ports:
- "8005:8005"
environment:
HORUSEC_PORT: "8005"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -178,6 +173,7 @@ services:
ports:
- "8000:8000"
environment:
HORUSEC_PORT: "8000"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand All @@ -199,6 +195,7 @@ services:
volumes:
- ../:/usr/app
environment:
HORUSEC_PORT: "8008"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_GRPC_AUTH_URL: "127.0.0.1:8007"
Expand Down
Loading

0 comments on commit d5d8aac

Please sign in to comment.