From d9e67f92cee172ab47fed69858265e1b7d474ea5 Mon Sep 17 00:00:00 2001 From: Stephen Hinck Date: Tue, 14 May 2024 09:59:14 -0700 Subject: [PATCH] code gen updates (#610) --- cmd/ui/src/ducks/explore/saga.ts | 7 ++++++- packages/go/dawgs/graph/node_test.go | 16 ++++++++++++++++ packages/go/dawgs/graph/path_internal_test.go | 16 ++++++++++++++++ packages/go/dawgs/graph/relationships_test.go | 16 ++++++++++++++++ .../AZUserAccessAdministrator/Abuse.tsx | 19 +++++++++---------- .../AZUserAccessAdministrator/General.tsx | 2 +- 6 files changed, 64 insertions(+), 12 deletions(-) diff --git a/cmd/ui/src/ducks/explore/saga.ts b/cmd/ui/src/ducks/explore/saga.ts index 83a01fb46..9b885d72c 100644 --- a/cmd/ui/src/ducks/explore/saga.ts +++ b/cmd/ui/src/ducks/explore/saga.ts @@ -195,7 +195,12 @@ function* runCypherSearchQuery(payload: CypherQueryRequest): SagaIterator { if (resultNodesAreEmpty && !resultEdgesAreEmpty) { yield put(putGraphData({})); - yield put(addSnackbar('The results are not rendered since only edges were returned', 'cypherSearchOnlyContainsEdges')); + yield put( + addSnackbar( + 'The results are not rendered since only edges were returned', + 'cypherSearchOnlyContainsEdges' + ) + ); } else if (resultNodesAreEmpty && resultEdgesAreEmpty) { yield put(putGraphData({})); yield put(addSnackbar('Command completed successfully', 'cypherSuccessResponse')); diff --git a/packages/go/dawgs/graph/node_test.go b/packages/go/dawgs/graph/node_test.go index c33f06620..2c4b5f602 100644 --- a/packages/go/dawgs/graph/node_test.go +++ b/packages/go/dawgs/graph/node_test.go @@ -1,3 +1,19 @@ +// Copyright 2024 Specter Ops, Inc. +// +// Licensed under the Apache License, Version 2.0 +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + package graph_test import ( diff --git a/packages/go/dawgs/graph/path_internal_test.go b/packages/go/dawgs/graph/path_internal_test.go index 5083899cc..addebcc3b 100644 --- a/packages/go/dawgs/graph/path_internal_test.go +++ b/packages/go/dawgs/graph/path_internal_test.go @@ -1,3 +1,19 @@ +// Copyright 2024 Specter Ops, Inc. +// +// Licensed under the Apache License, Version 2.0 +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + package graph import ( diff --git a/packages/go/dawgs/graph/relationships_test.go b/packages/go/dawgs/graph/relationships_test.go index c57105733..009004b9e 100644 --- a/packages/go/dawgs/graph/relationships_test.go +++ b/packages/go/dawgs/graph/relationships_test.go @@ -1,3 +1,19 @@ +// Copyright 2024 Specter Ops, Inc. +// +// Licensed under the Apache License, Version 2.0 +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + package graph_test import ( diff --git a/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/Abuse.tsx b/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/Abuse.tsx index 82704e24d..badcd5d1d 100644 --- a/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/Abuse.tsx +++ b/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/Abuse.tsx @@ -22,29 +22,28 @@ const Abuse: FC = () => { <> This role can be used to grant yourself or another principal any privilege you want against Automation - Accounts, VMs, Key Vaults, and Resource Groups. For example, you can make yourself an administrator of + Accounts, VMs, Key Vaults, and Resource Groups. For example, you can make yourself an administrator of an Azure Subscription by assigning the Owner role at the Subscription scope. - The simplest way to execute this attack is to use the Azure portal to add a new, abusable role - assignment against the target object for yourself. + The simplest way to execute this attack is to use the Azure portal to add a new, abusable role + assignment against the target object for yourself. - If this role is assigned to a Service Principal, you won't be able to authenticate directly to the - Azure portal. In this case: + If this role is assigned to a Service Principal, you won't be able to authenticate directly to the Azure + portal. In this case: - You'll need to acquire a bearer token for the service principal with AzureRM as the audience. - This can be done using BARK's Get-AzureRMTokenWithClientCredentials cmdlet. - + You'll need to acquire a bearer token for the service principal with AzureRM as the audience. This can + be done using BARK's Get-AzureRMTokenWithClientCredentials cmdlet. - Using that token, you can make a call to the AzureRM API to create a new role assignment on the - target object, such as assigning yourself the Owner role. This can be done using BARK's + Using that token, you can make a call to the AzureRM API to create a new role assignment on the target + object, such as assigning yourself the Owner role. This can be done using BARK's New-AzureRMRoleAssignment cmdlet. diff --git a/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/General.tsx b/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/General.tsx index 63772940d..414cc574d 100644 --- a/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/General.tsx +++ b/packages/javascript/bh-shared-ui/src/components/HelpTexts/AZUserAccessAdministrator/General.tsx @@ -20,7 +20,7 @@ import { Typography } from '@mui/material'; const General: FC = () => { return ( - The User Access Administrator role can manage user access to Azure resources, assign roles in Azure RBAC, + The User Access Administrator role can manage user access to Azure resources, assign roles in Azure RBAC, and assign the Owner role to themselves or others. );