Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Ingest the remaining entities and relationships #5

Merged
merged 5 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions docs/jupiterone.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ The following entities are created:
| User | `artifactory_user` | `User` |
| Repository | `artifactory_repository` | `Repository` |
| ArtifactCodeModule | `artifactory_artifact_codemodule` | `CodeModule` |
| ArtifactImage | `artifactory_artifact_image` | `Image` |
| Build | `artifactory_build` | `Configuration` |
| Permission | `artifactory_permission` | `AccessPolicy` |
| PipelineSource | `artifactory_pipeline_source` | `CodeRepo` |
Expand All @@ -40,23 +39,21 @@ The following entities are created:

The following relationships are created/mapped:

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| ------------------------ | --------------------- | --------------------------------- |
| `artifactory_account` | **HAS** | `artifactory_access_token` |
| `artifactory_account` | **HAS** | `artifactory_group` |
| `artifactory_account` | **HAS** | `artifactory_user` |
| `artifactory_group` | **HAS** | `artifactory_user` |
| `artifactory_account` | **HAS** | `artifactory_repository` |
| `artifactory_repository` | **HAS** | `artifactory_artifact_codemodule` |
| `artifactory_repository` | **HAS** | `artifactory_artifact_image` |
| `artifactory_build` | **CREATED** | `artifactory_artifact_codemodule` |
| `artifactory_build` | **CREATED** | `artifactory_artifact_image` |
| `artifactory_permission` | **ASSIGNED** | `artifactory_user` |
| `artifactory_permission` | **ASSIGNED** | `artifactory_group` |
| `artifactory_permission` | **ALLOWS** | `artifactory_repository` |
| `artifactory_permission` | **ALLOWS** | `artifactory_build` |
| `artifactory_permission` | **DENIES** | `artifactory_build` |
| `artifactory_account` | **HAS** | `artifactory_pipeline_source` |
| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| -------------------------- | --------------------- | --------------------------------- |
| `artifactory_account` | **HAS** | `artifactory_access_token` |
| `artifactory_access_token` | **ASSIGNED** | `artifactory_user` |
| `artifactory_account` | **HAS** | `artifactory_group` |
| `artifactory_account` | **HAS** | `artifactory_user` |
| `artifactory_group` | **HAS** | `artifactory_user` |
| `artifactory_account` | **HAS** | `artifactory_repository` |
| `artifactory_repository` | **HAS** | `artifactory_artifact_codemodule` |
| `artifactory_build` | **CREATED** | `artifactory_artifact_codemodule` |
| `artifactory_permission` | **ASSIGNED** | `artifactory_user` |
| `artifactory_permission` | **ASSIGNED** | `artifactory_group` |
| `artifactory_permission` | **ALLOWS** | `artifactory_repository` |
| `artifactory_permission` | **ALLOWS** | `artifactory_build` |
| `artifactory_account` | **HAS** | `artifactory_pipeline_source` |

<!--
********************************************************************************
Expand Down
36 changes: 8 additions & 28 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type EntityConstantKeys =
| 'ACCESS_TOKEN'
| 'PIPELINE_SOURCE'
| 'ARTIFACT_CODEMODULE'
| 'ARTIFACT_IMAGE'
| 'BUILD'
| 'PERMISSION';

Expand Down Expand Up @@ -54,11 +53,6 @@ export const entities: Record<EntityConstantKeys, StepEntityMetadata> = {
_type: 'artifactory_artifact_codemodule',
_class: 'CodeModule',
},
ARTIFACT_IMAGE: {
resourceName: 'ArtifactImage',
_type: 'artifactory_artifact_image',
_class: 'Image',
},
BUILD: {
resourceName: 'Build',
_type: 'artifactory_build',
Expand All @@ -76,17 +70,15 @@ type RelationshipConstantKeys =
| 'ACCOUNT_HAS_REPOSITORY'
| 'ACCOUNT_HAS_USER'
| 'ACCOUNT_HAS_ACCESS_TOKEN'
| 'ACCESS_TOKEN_ASSIGNED_USER'
| 'ACCOUNT_HAS_PIPELINE_SOURCE'
| 'GROUP_HAS_USER'
| 'REPOSITORY_HAS_ARTIFACT_CODEMODULE'
| 'BUILD_CREATED_ARTIFACT_CODEMODULE'
| 'REPOSITORY_HAS_ARTIFACT_IMAGE'
| 'BUILD_CREATED_ARTIFACT_IMAGE'
| 'PERMISSION_ASSIGNED_USER'
| 'PERMISSION_ASSIGNED_GROUP'
| 'PERMISSION_ALLOWS_REPOSITORY'
| 'PERMISSION_ALLOWS_BUILD'
| 'PERMISSION_DENIES_BUILD';
| 'PERMISSION_ALLOWS_BUILD';

export const relationships: Record<
RelationshipConstantKeys,
Expand Down Expand Up @@ -116,6 +108,12 @@ export const relationships: Record<
sourceType: entities.ACCOUNT._type,
targetType: entities.ACCESS_TOKEN._type,
},
ACCESS_TOKEN_ASSIGNED_USER: {
_type: 'artifactory_access_token_assigned_user',
_class: RelationshipClass.ASSIGNED,
sourceType: entities.ACCESS_TOKEN._type,
targetType: entities.USER._type,
},
ACCOUNT_HAS_PIPELINE_SOURCE: {
_type: 'artifactory_account_has_pipeline_source',
_class: RelationshipClass.HAS,
Expand All @@ -140,18 +138,6 @@ export const relationships: Record<
sourceType: entities.BUILD._type,
targetType: entities.ARTIFACT_CODEMODULE._type,
},
REPOSITORY_HAS_ARTIFACT_IMAGE: {
_type: 'artifactory_repository_has_artifact_image',
_class: RelationshipClass.HAS,
sourceType: entities.REPOSITORY._type,
targetType: entities.ARTIFACT_IMAGE._type,
},
BUILD_CREATED_ARTIFACT_IMAGE: {
_type: 'artifactory_build_created_artifact_image',
_class: RelationshipClass.CREATED,
sourceType: entities.BUILD._type,
targetType: entities.ARTIFACT_IMAGE._type,
},
PERMISSION_ASSIGNED_USER: {
_type: 'artifactory_permission_assigned_user',
_class: RelationshipClass.ASSIGNED,
Expand All @@ -176,10 +162,4 @@ export const relationships: Record<
sourceType: entities.PERMISSION._type,
targetType: entities.BUILD._type,
},
PERMISSION_DENIES_BUILD: {
_type: 'artifactory_permission_denies_build',
_class: RelationshipClass.DENIES,
sourceType: entities.PERMISSION._type,
targetType: entities.BUILD._type,
},
};
Loading