From 9177c9e780e04057f52860f863448d622f30f20a Mon Sep 17 00:00:00 2001 From: Paul Ilaga Date: Mon, 19 Dec 2022 17:32:46 +0800 Subject: [PATCH 1/2] Ingest findings and account --- .github/workflows/build.yml | 8 +- CHANGELOG.md | 20 + docs/jupiterone.md | 12 +- package.json | 10 +- .../recording.har | 26 +- src/provider/SonarqubeClient.ts | 13 + src/provider/types.ts | 27 + src/steps/account/converter.test.ts | 23 + src/steps/account/converter.ts | 29 + src/steps/account/index.test.ts | 51 + src/steps/account/index.ts | 26 + src/steps/constants.ts | 38 + .../recording.har | 590 +++ src/steps/finding/converter.test.ts | 101 + src/steps/finding/converter.ts | 70 + src/steps/finding/index.test.ts | 68 + src/steps/finding/index.ts | 63 + src/steps/index.ts | 10 +- .../recording.har | 48 +- src/steps/project/index.test.ts | 14 +- src/steps/project/index.ts | 27 +- src/steps/user-group/index.test.ts | 14 +- src/steps/user-group/index.ts | 26 +- src/steps/user/index.test.ts | 28 +- src/steps/user/index.ts | 23 +- yarn.lock | 3487 +++++++---------- 26 files changed, 2751 insertions(+), 2101 deletions(-) create mode 100644 src/steps/account/converter.test.ts create mode 100644 src/steps/account/converter.ts create mode 100644 src/steps/account/index.test.ts create mode 100644 src/steps/account/index.ts create mode 100644 src/steps/finding/__recordings__/fetchFindingsShouldCollectData_149947136/recording.har create mode 100644 src/steps/finding/converter.test.ts create mode 100644 src/steps/finding/converter.ts create mode 100644 src/steps/finding/index.test.ts create mode 100644 src/steps/finding/index.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d31485..62de6ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [12.x] + node-version: [14.x] os: [ubuntu-latest] steps: @@ -34,17 +34,17 @@ jobs: release: needs: test runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' strategy: fail-fast: false matrix: - node: [12] + node: [14] steps: - name: Setup Node uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 14.x - name: Check out repo uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 678189e..9e1e12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,26 @@ and this project adheres to ## [Unreleased] +### Added + +- Updated SDK versions to v8 + +- Entities: + + | Resources | Entity `_type` | Entity `_class` | + | --------- | ------------------- | --------------- | + | Account | `sonarqube_account` | `Account` | + | Finding | `sonarqube_finding` | `Finding` | + +- Relationships: + + | Source Entity `_type` | Relationship `_class` | Target Entity `_type` | + | --------------------- | --------------------- | ---------------------- | + | `sonarqube_account` | **HAS** | `sonarqube_project` | + | `sonarqube_account` | **HAS** | `sonarqube_user` | + | `sonarqube_account` | **HAS** | `sonarqube_user_group` | + | `sonarqube_project` | **HAS** | `sonarqube_finding` | + ## 0.1.0 2021-04-29 ### Added diff --git a/docs/jupiterone.md b/docs/jupiterone.md index 812d7f7..dc0c419 100644 --- a/docs/jupiterone.md +++ b/docs/jupiterone.md @@ -85,6 +85,8 @@ The following entities are created: | Resources | Entity `_type` | Entity `_class` | | --------- | ---------------------- | --------------- | +| Account | `sonarqube_account` | `Account` | +| Finding | `sonarqube_finding` | `Finding` | | Project | `sonarqube_project` | `Project` | | User | `sonarqube_user` | `User` | | UserGroup | `sonarqube_user_group` | `UserGroup` | @@ -93,9 +95,13 @@ The following entities are created: The following relationships are created: -| Source Entity `_type` | Relationship `_class` | Target Entity `_type` | -| ---------------------- | --------------------- | --------------------- | -| `sonarqube_user_group` | **HAS** | `sonarqube_user` | +| Source Entity `_type` | Relationship `_class` | Target Entity `_type` | +| ---------------------- | --------------------- | ---------------------- | +| `sonarqube_account` | **HAS** | `sonarqube_project` | +| `sonarqube_account` | **HAS** | `sonarqube_user` | +| `sonarqube_account` | **HAS** | `sonarqube_user_group` | +| `sonarqube_project` | **HAS** | `sonarqube_finding` | +| `sonarqube_user_group` | **HAS** | `sonarqube_user` |