This repository was archived by the owner on Jun 25, 2024. It is now read-only.
generated from JupiterOne-Archives/integration-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Support for ingesting KSM crypto key rings and crypto keys #31
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,236 changes: 4,236 additions & 0 deletions
4,236
src/steps/kms/__recordings__/fetchKmsCryptoKeys_2580116173/recording.har
Large diffs are not rendered by default.
Oops, something went wrong.
3,880 changes: 3,880 additions & 0 deletions
3,880
src/steps/kms/__recordings__/fetchKmsKeyRings_3543545506/recording.har
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`#createKmsCryptoKeyEntity should convert to entity 1`] = ` | ||
Object { | ||
"_class": Array [ | ||
"Key", | ||
"CryptoKey", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:59:59.513564921Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"nextRotationTime": "2020-10-04T19:01:14.428484Z", | ||
"primary": Object { | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"createTime": "2020-10-03T19:01:13.428484662Z", | ||
"generateTime": "2020-10-03T19:01:13.428484662Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key/cryptoKeyVersions/68", | ||
"protectionLevel": "SOFTWARE", | ||
"state": "ENABLED", | ||
}, | ||
"purpose": "ENCRYPT_DECRYPT", | ||
"rotationPeriod": "86401s", | ||
"versionTemplate": Object { | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"protectionLevel": "SOFTWARE", | ||
}, | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_crypto_key", | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"createdOn": 1595962799513, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"keyUsage": "ENCRYPT_DECRYPT", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"nextRotationTime": 1601838074428, | ||
"primaryAlgorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"primaryCreateTime": 1601751673428, | ||
"primaryGenerateTime": 1601751673428, | ||
"primaryName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key/cryptoKeyVersions/68", | ||
"primaryProtectionLevel": "SOFTWARE", | ||
"primaryState": "ENABLED", | ||
"protectionLevel": "SOFTWARE", | ||
"purpose": "ENCRYPT_DECRYPT", | ||
"rotationPeriod": 86401, | ||
"webLink": "https://console.cloud.google.com/security/kms/key/manage/us/j1-gc-integration-dev-bucket-ring/projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key?project=j1-gc-integration-dev", | ||
} | ||
`; | ||
|
||
exports[`#createKmsKeyRingEntity should convert to entity 1`] = ` | ||
Object { | ||
"_class": Array [ | ||
"Vault", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:34:26.034565002Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_key_ring", | ||
"createdOn": 1595961266034, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"location": "us", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"projectId": "j1-gc-integration-dev", | ||
"shortName": "j1-gc-integration-dev-bucket-ring", | ||
"webLink": "https://console.cloud.google.com/security/kms/keyring/manage/us/j1-gc-integration-dev-bucket-ring/key?project=j1-gc-integration-dev", | ||
} | ||
`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`#fetchKmsCryptoKeys should collect data 1`] = ` | ||
Object { | ||
"collectedEntities": Array [ | ||
Object { | ||
"_class": Array [ | ||
"Vault", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:34:26.034565002Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_key_ring", | ||
"createdOn": 1595961266034, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"location": "us", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"projectId": "j1-gc-integration-dev", | ||
"shortName": "j1-gc-integration-dev-bucket-ring", | ||
"webLink": "https://console.cloud.google.com/security/kms/keyring/manage/us/j1-gc-integration-dev-bucket-ring/key?project=j1-gc-integration-dev", | ||
}, | ||
Object { | ||
"_class": Array [ | ||
"Vault", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:30:53.453045041Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_key_ring", | ||
"createdOn": 1595961053453, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"location": "us", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"projectId": "j1-gc-integration-dev", | ||
"shortName": "j1dev-bucket-ring", | ||
"webLink": "https://console.cloud.google.com/security/kms/keyring/manage/us/j1dev-bucket-ring/key?project=j1-gc-integration-dev", | ||
}, | ||
Object { | ||
"_class": Array [ | ||
"Key", | ||
"CryptoKey", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:59:59.513564921Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"nextRotationTime": "2020-10-04T19:01:14.428484Z", | ||
"primary": Object { | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"createTime": "2020-10-03T19:01:13.428484662Z", | ||
"generateTime": "2020-10-03T19:01:13.428484662Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key/cryptoKeyVersions/68", | ||
"protectionLevel": "SOFTWARE", | ||
"state": "ENABLED", | ||
}, | ||
"purpose": "ENCRYPT_DECRYPT", | ||
"rotationPeriod": "86401s", | ||
"versionTemplate": Object { | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"protectionLevel": "SOFTWARE", | ||
}, | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_crypto_key", | ||
"algorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"createdOn": 1595962799513, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"keyUsage": "ENCRYPT_DECRYPT", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"nextRotationTime": 1601838074428, | ||
"primaryAlgorithm": "GOOGLE_SYMMETRIC_ENCRYPTION", | ||
"primaryCreateTime": 1601751673428, | ||
"primaryGenerateTime": 1601751673428, | ||
"primaryName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key/cryptoKeyVersions/68", | ||
"primaryProtectionLevel": "SOFTWARE", | ||
"primaryState": "ENABLED", | ||
"protectionLevel": "SOFTWARE", | ||
"purpose": "ENCRYPT_DECRYPT", | ||
"rotationPeriod": 86401, | ||
"webLink": "https://console.cloud.google.com/security/kms/key/manage/us/j1-gc-integration-dev-bucket-ring/projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key?project=j1-gc-integration-dev", | ||
}, | ||
], | ||
"collectedRelationships": Array [ | ||
Object { | ||
"_class": "HAS", | ||
"_fromEntityKey": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring|has|projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"_toEntityKey": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring/cryptoKeys/j1-gc-integration-dev-bucket-key", | ||
"_type": "google_kms_key_ring_has_crypto_key", | ||
"displayName": "HAS", | ||
}, | ||
], | ||
"encounteredTypes": Array [ | ||
"google_kms_key_ring", | ||
"google_kms_crypto_key", | ||
"google_kms_key_ring_has_crypto_key", | ||
], | ||
"numCollectedEntities": 3, | ||
"numCollectedRelationships": 1, | ||
} | ||
`; | ||
|
||
exports[`#fetchKmsKeyRings should collect data 1`] = ` | ||
Object { | ||
"collectedEntities": Array [ | ||
Object { | ||
"_class": Array [ | ||
"Vault", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:34:26.034565002Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_key_ring", | ||
"createdOn": 1595961266034, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"location": "us", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1-gc-integration-dev-bucket-ring", | ||
"projectId": "j1-gc-integration-dev", | ||
"shortName": "j1-gc-integration-dev-bucket-ring", | ||
"webLink": "https://console.cloud.google.com/security/kms/keyring/manage/us/j1-gc-integration-dev-bucket-ring/key?project=j1-gc-integration-dev", | ||
}, | ||
Object { | ||
"_class": Array [ | ||
"Vault", | ||
], | ||
"_key": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"_rawData": Array [ | ||
Object { | ||
"name": "default", | ||
"rawData": Object { | ||
"createTime": "2020-07-28T18:30:53.453045041Z", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
}, | ||
}, | ||
], | ||
"_type": "google_kms_key_ring", | ||
"createdOn": 1595961053453, | ||
"displayName": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"location": "us", | ||
"name": "projects/j1-gc-integration-dev/locations/us/keyRings/j1dev-bucket-ring", | ||
"projectId": "j1-gc-integration-dev", | ||
"shortName": "j1dev-bucket-ring", | ||
"webLink": "https://console.cloud.google.com/security/kms/keyring/manage/us/j1dev-bucket-ring/key?project=j1-gc-integration-dev", | ||
}, | ||
], | ||
"collectedRelationships": Array [], | ||
"encounteredTypes": Array [ | ||
"google_kms_key_ring", | ||
], | ||
"numCollectedEntities": 2, | ||
"numCollectedRelationships": 0, | ||
} | ||
`; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any relationship that should be created between a higher-level account or service and
google_kms_key_ring
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no relationship between service account and crypto key/ring. Service account keys are different. We have a
google_iam_service_account_key
for that. We should consider creating the relationship with the account, but I'll tackle this separately.