Skip to content

Latest commit

 

History

History
executable file
·
110 lines (79 loc) · 3.87 KB

File metadata and controls

executable file
·
110 lines (79 loc) · 3.87 KB

Cloud Security Posture Kibana Plugin

Cloud Posture automates the identification and remediation of risks across cloud infrastructures


Development

Read Kibana Contributing Guide for more details

Testing

For general guidelines, read Kibana Testing Guide for more details

Tests

  1. Unit Tests (Jest) - located in sibling files to the source code
  2. API Integration Tests
  3. Telemetry Integration Tests
  4. End-to-End Tests
  5. Serverless API Integration tests
  6. Serverless End-to-End Tests

Tools

Run TypeScript:

node scripts/type_check.js --project=x-pack/plugins/cloud_security_posture/tsconfig.json

Run ESLint:

yarn lint:es x-pack/plugins/cloud_security_posture

Run i18n check:

node scripts/i18n_check.js

Note

i18n should run on project scope as it checks translations files outside of our plugin.

Fixes can be applied using the --fix flag

Run Unit Tests:

yarn test:jest --config x-pack/plugins/cloud_security_posture/jest.config.js

Note

for a coverage report, add the --coverage flag, and run open target/kibana-coverage/jest/x-pack/plugins/cloud_security_posture/index.html

Run Integration Tests:

yarn test:ftr --config x-pack/test/api_integration/config.ts

Run End-to-End Tests:

yarn test:ftr --config x-pack/test/cloud_security_posture_functional/config.ts
yarn test:ftr --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts
yarn test:ftr --config x-pack/test/cloud_security_posture_api/config.ts
yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture
yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts

Run FTR tests (integration or e2e) for development

Functional test runner (FTR) can be used separately with ftr:runner and ftr:server. This is convenient while developing tests.

For example,

run ESS (stateful) api integration tests:

yarn test:ftr:server --config x-pack/test/api_integration/config.ts
yarn test:ftr:runner --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts

run ESS (stateful) telemetry integration tests:

yarn test:ftr:server --config x-pack/test/cloud_security_posture_api/config.ts
yarn test:ftr:runner --config x-pack/test/cloud_security_posture_api/config.ts

run ESS (stateful) e2e tests:

yarn test:ftr:server --config x-pack/test/cloud_security_posture_functional/config.ts
yarn test:ftr:runner --config x-pack/test/cloud_security_posture_functional/config.ts

run serverless api integration tests:

yarn test:ftr:server --config x-pack/test_serverless/api_integration/test_suites/security/config.ts
yarn test:ftr:runner --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture

run serverless e2e tests:

yarn test:ftr:server --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
yarn test:ftr:runner ---config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts