Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#758 - Introduce ModuleSyncMetadata node for AWS S3Bucket syncs #763

Merged
merged 9 commits into from Feb 11, 2022

Conversation

ramonpetgrave64
Copy link
Contributor

@ramonpetgrave64 ramonpetgrave64 commented Feb 9, 2022

#758 Introduce cartography SyncMetadata node to surface data freshness
add a node ModuleSyncMetaData containing freshness information for when S3Buckets are synced.

@ramonpetgrave64 ramonpetgrave64 marked this pull request as ready for review February 10, 2022 20:15
@ramonpetgrave64 ramonpetgrave64 changed the title Ramonpetgrave64 s3 sync metadata Ramonpetgrave64 add a ModuleSyncMetaData node for AWS S3Bucket syncs Feb 10, 2022
@achantavy achantavy changed the title Ramonpetgrave64 add a ModuleSyncMetaData node for AWS S3Bucket syncs #758 - Introduce ModuleSyncMetadata node for AWS S3Bucket syncs Feb 10, 2022
cartography/util.py Show resolved Hide resolved
cartography/util.py Outdated Show resolved Hide resolved
cartography/util.py Outdated Show resolved Hide resolved
Comment on lines 71 to 73
MERGE (n:ModuleSyncMetadata{id:'${group_type}_${group_id}_${synced_type}'})
ON CREATE SET n:SyncMetadata, n.firstseen=timestamp()
SET n.syncedtype='${synced_type}', n.grouptype='${group_type}', n.groupid={group_id}, n.lastupdated={UPDATE_TAG}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MERGE (n:ModuleSyncMetadata{id:'${group_type}_${group_id}_${synced_type}'})
ON CREATE SET n:SyncMetadata, n.firstseen=timestamp()
SET n.syncedtype='${synced_type}', n.grouptype='${group_type}', n.groupid={group_id}, n.lastupdated={UPDATE_TAG}
MERGE (n:ModuleSyncMetadata{id:'${group_type}_${group_id}_${synced_type}'})
ON CREATE SET
n:SyncMetadata,
n.firstseen=timestamp()
SET n.syncedtype='${synced_type}',
n.grouptype='${group_type}',
n.groupid={group_id},
n.lastupdated={UPDATE_TAG}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

:param neo4j_session: Neo4j session object
:param group_type: The parent module's type
:param group_id: The parent module's id
:param syncd_type: The sub-module's type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param syncd_type: The sub-module's type
:param synced_type: The sub-module's type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

'AWS_ID': None,
'UPDATE_TAG': None,
'OKTA_ORG_ID': None,
'AWS_ID': 'my_aw_saccount_id',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'AWS_ID': 'my_aw_saccount_id',
'AWS_ID': 'my_aws_account_id',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@achantavy achantavy merged commit 60c5474 into master Feb 11, 2022
@achantavy achantavy deleted the ramonpetgrave64-s3-sync-metadata branch February 11, 2022 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants