From 5343cdc97ba6dd0ccc8df1da4223d0feb05b6f93 Mon Sep 17 00:00:00 2001 From: artaasadi Date: Thu, 14 Nov 2024 12:12:48 +0100 Subject: [PATCH] fix: update vault --- go.mod | 2 +- go.sum | 2 + .../azure/common_columns.go | 4 +- steampipe-plugin-azure/azure/plugin.go | 3 - .../azure/table_azure_ad_group.go | 95 ------------ .../azure/table_azure_ad_service_principal.go | 139 ------------------ .../azure/table_azure_ad_user.go | 124 ---------------- 7 files changed, 5 insertions(+), 364 deletions(-) delete mode 100644 steampipe-plugin-azure/azure/table_azure_ad_group.go delete mode 100644 steampipe-plugin-azure/azure/table_azure_ad_service_principal.go delete mode 100644 steampipe-plugin-azure/azure/table_azure_ad_user.go diff --git a/go.mod b/go.mod index 8e69ed34..95fae0cf 100755 --- a/go.mod +++ b/go.mod @@ -111,7 +111,7 @@ require ( github.com/manicminer/hamilton v0.44.0 github.com/microsoftgraph/msgraph-sdk-go v1.51.0 github.com/nats-io/nats.go v1.36.0 - github.com/opengovern/og-util v1.1.0 + github.com/opengovern/og-util v1.1.5 github.com/opengovern/opengovernance v0.434.59-feat-integrations-service.0 github.com/spf13/cobra v1.8.1 github.com/tombuildsstuff/giovanni v0.18.0 diff --git a/go.sum b/go.sum index 491f42dc..b00a85ac 100644 --- a/go.sum +++ b/go.sum @@ -988,6 +988,8 @@ github.com/opengovern/og-util v1.0.6-0.20241108102418-e20a35efc8ca h1:yeF0lhv15W github.com/opengovern/og-util v1.0.6-0.20241108102418-e20a35efc8ca/go.mod h1:7l7fNhK6uewIwA0cs7QagJuhjt/E6hEAC01SR8Y0kKk= github.com/opengovern/og-util v1.1.0 h1:bV2XKX8aIpJGC2CR4kh9CU/rJWPQed76gtVXM2zBDXM= github.com/opengovern/og-util v1.1.0/go.mod h1:dyn8rhmxq59o1jnbgGfmcUvW7iB/eN6OxoTUUx6jEHA= +github.com/opengovern/og-util v1.1.5 h1:D53Z669MsaKJJFHpIYnJe0iK0HX2jnYUTFTFkKd9lWg= +github.com/opengovern/og-util v1.1.5/go.mod h1:dyn8rhmxq59o1jnbgGfmcUvW7iB/eN6OxoTUUx6jEHA= github.com/opengovern/opengovernance v0.434.55-feat-integrations-service.0 h1:N7aSSdY9c3nUqyGnVyUDKnrsqyNBtgnJl3ccYXxrAIQ= github.com/opengovern/opengovernance v0.434.55-feat-integrations-service.0/go.mod h1:R0o3Yf92y4p6onI7bYOWL2VhFmO1Crti2EG2l6MWglA= github.com/opengovern/opengovernance v0.434.58-feat-integrations-service.0 h1:+Wk+p1thvGe3I1cwxZl5jo//w3WZFTK9ZmfBCiCufLQ= diff --git a/steampipe-plugin-azure/azure/common_columns.go b/steampipe-plugin-azure/azure/common_columns.go index d5cba476..28ef4bce 100644 --- a/steampipe-plugin-azure/azure/common_columns.go +++ b/steampipe-plugin-azure/azure/common_columns.go @@ -54,7 +54,7 @@ func commonKaytuColumns() []*plugin.Column { Name: "og_account_id", Type: proto.ColumnType_STRING, Description: "The Platform Account ID in which the resource is located.", - Transform: transform.FromField("Metadata.IntegrationID"), + Transform: transform.FromField("IntegrationID"), }, { Name: "og_resource_id", @@ -64,7 +64,7 @@ func commonKaytuColumns() []*plugin.Column { }, { Name: "og_metadata", - Type: proto.ColumnType_STRING, + Type: proto.ColumnType_JSON, Description: ColumnDescriptionMetadata, Transform: transform.FromField("Metadata").Transform(marshalJSON), }, diff --git a/steampipe-plugin-azure/azure/plugin.go b/steampipe-plugin-azure/azure/plugin.go index 8b27f0ab..c5338533 100644 --- a/steampipe-plugin-azure/azure/plugin.go +++ b/steampipe-plugin-azure/azure/plugin.go @@ -58,9 +58,6 @@ func Plugin(ctx context.Context) *plugin.Plugin { "azure_timeseriesinsights_environments": tableAzureTimeSeriesInsightsEnvironments(ctx), "azure_virtualmachineimages_imagetemplates": tableAzureVirtualMachineImagesImageTemplates(ctx), "azure_web_serverfarms": tableAzureWebServerFarms(ctx), - "azure_ad_group": tableAzureAdGroup(ctx), - "azure_ad_service_principal": tableAzureAdServicePrincipal(ctx), - "azure_ad_user": tableAzureAdUser(ctx), "azure_api_management": tableAzureAPIManagement(ctx), "azure_api_management_backend": tableAzureAPIManagementBackend(ctx), "azure_app_configuration": tableAzureAppConfiguration(ctx), diff --git a/steampipe-plugin-azure/azure/table_azure_ad_group.go b/steampipe-plugin-azure/azure/table_azure_ad_group.go deleted file mode 100644 index 5aab1a64..00000000 --- a/steampipe-plugin-azure/azure/table_azure_ad_group.go +++ /dev/null @@ -1,95 +0,0 @@ -package azure - -import ( - "context" - "errors" - - "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" - - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -//// TABLE DEFINITION - -func tableAzureAdGroup(_ context.Context) *plugin.Table { - return &plugin.Table{ - Name: "azure_ad_group", - Description: "[DEPRECATED] This table has been deprecated and will be removed in a future release. Please use the azuread_group table in the azuread plugin instead.", - List: &plugin.ListConfig{ - Hydrate: listAdGroups, - }, - - Columns: []*plugin.Column{ - { - Name: "object_id", - Type: proto.ColumnType_STRING, - Description: "The unique ID that identifies a group.", - Transform: transform.FromField("Description.AdGroup.DirectoryObject.ODataId"), - }, - { - Name: "object_type", - Description: "A string that identifies the object type.", - Type: proto.ColumnType_STRING, - - Transform: transform.FromField("Description.AdGroup.DirectoryObject.ODataType"), - }, - { - Name: "display_name", - Description: "A friendly name that identifies a group.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("Description.AdGroup.DisplayName")}, - { - Name: "mail", - Description: "The primary email address of the group.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("Description.AdGroup.Mail")}, - { - Name: "mail_enabled", - Description: "Indicates whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API.", - Type: proto.ColumnType_BOOL, - Transform: transform.FromField("Description.AdGroup.MailEnabled")}, - { - Name: "mail_nickname", - Description: "The mail alias for the group.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("Description.AdGroup.MailNickname")}, - { - Name: "deletion_timestamp", - Description: "The time at which the directory object was deleted.", - Type: proto.ColumnType_TIMESTAMP, - Transform: transform.FromField("Description.AdGroup.DeletedDateTime").Transform(convertDateToTime), - }, - { - Name: "security_enabled", - Description: "Specifies whether the group is a security group.", - Type: proto.ColumnType_BOOL, - Transform: transform.FromField("Description.AdGroup.SecurityEnabled")}, - { - Name: "additional_properties", - Description: "A list of unmatched properties from the message are deserialized this collection.", - Type: proto.ColumnType_JSON, - Transform: transform.FromField("Description.AdGroup.SecurityEnabled")}, - - // Steampipe standard columns - { - Name: "title", - Description: ColumnDescriptionTitle, - Type: proto.ColumnType_STRING, - }, - { - Name: "akas", - Description: ColumnDescriptionAkas, - Type: proto.ColumnType_JSON, - Transform: transform. - - //// LIST FUNCTION - FromField("Description.AdGroup.MailNickname")}, - }, - } -} - -func listAdGroups(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { - err := errors.New("The azure_ad_group table has been deprecated and removed, please use azuread_group table instead.") - return nil, err -} diff --git a/steampipe-plugin-azure/azure/table_azure_ad_service_principal.go b/steampipe-plugin-azure/azure/table_azure_ad_service_principal.go deleted file mode 100644 index 1514a080..00000000 --- a/steampipe-plugin-azure/azure/table_azure_ad_service_principal.go +++ /dev/null @@ -1,139 +0,0 @@ -package azure - -import ( - "context" - "errors" - - "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" - - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -//// TABLE DEFINITION - -func tableAzureAdServicePrincipal(_ context.Context) *plugin.Table { - return &plugin.Table{ - Name: "azure_ad_service_principal", - Description: "[DEPRECATED] This table has been deprecated and will be removed in a future release. Please use the azuread_service_principal table in the azuread plugin instead.", - List: &plugin.ListConfig{ - Hydrate: listAdServicePrincipals, - }, - Columns: []*plugin.Column{ - { - Name: "object_id", - Type: proto.ColumnType_STRING, - Description: "The unique ID that identifies a service principal.", - Transform: transform.FromField("ObjectID"), - }, - { - Name: "object_type", - Description: "A string that identifies the object type.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ObjectType"), - }, - { - Name: "display_name", - Description: "A friendly name that identifies a service principal.", - Type: proto.ColumnType_STRING, - }, - { - Name: "account_enabled", - Description: "Indicates whether or not the service principal account is enabled.", - Type: proto.ColumnType_BOOL, - }, - { - Name: "app_role_assignment_required", - Description: "Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application.", - Type: proto.ColumnType_BOOL, - }, - { - Name: "deletion_timestamp", - Description: "The time at which the directory object was deleted.", - Type: proto.ColumnType_TIMESTAMP, - }, - { - Name: "error_url", - Description: "An URL provided by the author of the associated application to report errors when using the application.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ErrorURL"), - }, - { - Name: "homepage", - Description: "The URL to the homepage of the associated application.", - Type: proto.ColumnType_STRING, - }, - { - Name: "logout_url", - Description: "An URL provided by the author of the associated application to logout.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("LogoutURL"), - }, - { - Name: "saml_metadata_url", - Description: "The URL to the SAML metadata of the associated application.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("SamlMetadataURL"), - }, - { - Name: "additional_properties", - Description: "A list of unmatched properties from the message are deserialized this collection.", - Type: proto.ColumnType_JSON, - }, - { - Name: "alternative_names", - Description: "A list of alternative names.", - Type: proto.ColumnType_JSON, - }, - { - Name: "app_roles", - Description: "A list of application roles that an application may declare. These roles can be assigned to users, groups or service principals.", - Type: proto.ColumnType_JSON, - }, - { - Name: "key_credentials", - Description: "A list of key credentials associated with the service principal.", - Type: proto.ColumnType_JSON, - }, - { - Name: "oauth2_permissions", - Description: "The OAuth 2.0 permissions exposed by the associated application.", - Type: proto.ColumnType_JSON, - }, - { - Name: "password_credentials", - Description: "A list of password credentials associated with the service principal.", - Type: proto.ColumnType_JSON, - }, - { - Name: "reply_urls", - Description: "The URLs that user tokens are sent to for sign in with the associated application. The redirect URIs that the oAuth 2.0 authorization code and access tokens are sent to for the associated application.", - Type: proto.ColumnType_JSON, - }, - { - Name: "service_principal_names", - Description: "A list of service principal names.", - Type: proto.ColumnType_JSON, - }, - - // Steampipe standard columns - { - Name: "title", - Description: ColumnDescriptionTitle, - Type: proto.ColumnType_STRING, - }, - { - Name: "akas", - Description: ColumnDescriptionAkas, - Type: proto.ColumnType_JSON, - }, - }, - } -} - -//// FETCH FUNCTIONS - -func listAdServicePrincipals(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { - err := errors.New("The azure_ad_service_principal table has been deprecated and removed, please use azuread_service_principal table instead.") - return nil, err -} diff --git a/steampipe-plugin-azure/azure/table_azure_ad_user.go b/steampipe-plugin-azure/azure/table_azure_ad_user.go deleted file mode 100644 index a2a7d1e6..00000000 --- a/steampipe-plugin-azure/azure/table_azure_ad_user.go +++ /dev/null @@ -1,124 +0,0 @@ -package azure - -import ( - "context" - "errors" - - "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" - - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -//// TABLE DEFINITION - -func tableAzureAdUser(_ context.Context) *plugin.Table { - return &plugin.Table{ - Name: "azure_ad_user", - Description: "[DEPRECATED] This table has been deprecated and will be removed in a future release. Please use the azuread_user table in the azuread plugin instead.", - List: &plugin.ListConfig{ - Hydrate: listAdUsers, - }, - - Columns: []*plugin.Column{ - { - Name: "object_id", - Type: proto.ColumnType_STRING, - Description: "The unique ID that identifies an active directory user.", - Transform: transform.FromField("ObjectID"), - }, - { - Name: "user_principal_name", - Description: "Principal email of the active directory user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "display_name", - Description: "A friendly name that identifies an active directory user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "object_type", - Description: "A string that identifies the object type.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ObjectType"), - }, - { - Name: "user_type", - Description: "A string value that can be used to classify user types in your directory.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("UserType"), - }, - { - Name: "given_name", - Description: "The given name(first name) of the active directory user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "surname", - Description: "Family name or last name of the active directory user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "account_enabled", - Description: "Specifies the account status of the active directory user.", - Type: proto.ColumnType_BOOL, - }, - { - Name: "deletion_timestamp", - Description: " The time at which the directory object was deleted.", - Type: proto.ColumnType_TIMESTAMP, - }, - { - Name: "immutable_id", - Description: "Used to associate an on-premises Active Directory user account with their Azure AD user object.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ImmutableID"), - }, - { - Name: "mail", - Description: "The SMTP address for the user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "mail_nickname", - Description: "The mail alias for the user.", - Type: proto.ColumnType_STRING, - }, - { - Name: "usage_location", - Description: "A two letter country code (ISO standard 3166), required for users that will be assigned licenses due to legal requirement to check for availability of services in countries.", - Type: proto.ColumnType_STRING, - }, - { - Name: "additional_properties", - Description: "A list of unmatched properties from the message are deserialized this collection.", - Type: proto.ColumnType_JSON, - }, - { - Name: "sign_in_names", - Description: "A list of sign-in names for a local account in an Azure Active Directory B2C tenant.", - Type: proto.ColumnType_JSON, - }, - - // Steampipe standard columns - { - Name: "title", - Description: ColumnDescriptionTitle, - Type: proto.ColumnType_STRING, - }, - { - Name: "akas", - Description: ColumnDescriptionAkas, - Type: proto.ColumnType_JSON, - }, - }, - } -} - -//// LIST FUNCTION - -func listAdUsers(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { - err := errors.New("The azure_ad_user table has been deprecated and removed, please use azuread_user table instead.") - return nil, err -}