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

INT-1561 - Add isPublic and isOpenToTheInternet to IAM bindings #296

Merged
merged 5 commits into from
Aug 27, 2021

Conversation

mknoedel
Copy link
Contributor

Added

  • New properties added to resources:

    Entity Properties
    google_iam_bindings isReadOnly
    google_iam_bindings isOpenToTheInternet

Notes

Why Put Access Info on the Binding instead of the Resource?

Per @ndowmon's suggestion in the previous INT-1561 PR, instead of allowing users to find the access level of various resources via querying that resource directly. Example:

FIND
  google_storage_bucket WITH accessLevel != 'private'

We can instead put the access information on the IAM binding and have users do a traversal query. Example:

FIND 
  google_storage_bucket 
  THAT ALLOWS google_iam_binding WITH accessLevel != 'private'

From the users perspective, this is slightly worse as they are expected to know the data structure of Role Bindings to Resources in order to form the query. However, from the ingestion perspective, this is far easier because we do not need to enhance entities with information, which our sdk does not support yet (See sdk issue #532).

If we needed to support the first query today, we would need to restructure the graph project in such a way where all access information is available at the time of creating entities, which I did in these 2 PRs (INT-1142, INT-1561). Unfortunately, doing so makes this project significantly more difficult to work with in the future. Take a look for yourself, it's a bit hard to follow.

Why use isReadOnly and isOpenToTheInternet instead of an accessLevel of 'private', 'publicRead 'and 'publicWrite' values?

It felt to me that it would more clear to users making queries to put things into booleans instead of needing to have the user guess what the possible enum values of an entity property could be. How would a user know that the available accessLevels are private | publicRead | publicWrite? From what I can tell, the only ways would be we tell them or they look at the code. This problem goes away when you use boolean properties because each property is returned in J1QL queries. My guess is that people can guess the available values of isReadOnly and isOpenToTheInternet quite easily. Of course another way to solve this problem would be to provide type docs for each entity, but we do not have those yet.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@austinkelleher austinkelleher left a comment

Choose a reason for hiding this comment

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

@mknoedel @ndowmon and I spoke about this in a call. There is a lot to consider and think about. We are going to pause on isOpenToTheInternet and have further conversations.

CHANGELOG.md Outdated Show resolved Hide resolved
src/steps/cloud-asset/converters.ts Outdated Show resolved Hide resolved
src/steps/cloud-asset/converters.ts Outdated Show resolved Hide resolved
@mknoedel mknoedel merged commit a61aacc into main Aug 27, 2021
@mknoedel mknoedel deleted the INT-1561-add-is-public-to-bindings branch August 27, 2021 18:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants