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

Fix GCP deployment manager formatting #2530

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Fix GCP deployment manager formatting #2530

merged 1 commit into from
Sep 30, 2024

Conversation

orouz
Copy link
Collaborator

@orouz orouz commented Sep 15, 2024

Summary of your changes

there were 2 issues preventing GCP CSPM on agentless from successfully deploying a service account for organizations. the first was a slightly off copy-paste command in kibana which ended up not passing ORG_ID to the deployment script, so the deployment assumed it's for a project. the second issue, after providing ORG_ID, the deployment script complained about it being a number and not a string (as per its schema). this is what this PR fixes.

after fixing both of these, i've deployed GCP CSPM on agentless and got findings for an organization account:

Screenshot/Data

Screenshot 2024-09-15 at 17 59 46

Related Issues

@@ -35,7 +35,7 @@ fi

result="$(gcloud deployment-manager deployments create --automatic-rollback-on-error "${DEPLOYMENT_NAME}" --project "${PROJECT_NAME}" \
--template service_account.py \
--properties scope:"${SCOPE}",parentId:"${PARENT_ID}",serviceAccountName:"${SERVICE_ACCOUNT_NAME}")"
--properties "scope:'${SCOPE}',parentId:'${PARENT_ID}',serviceAccountName:'${SERVICE_ACCOUNT_NAME}'")"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this format is required to ensure the values passed are treated as strings

see https://cloud.google.com/sdk/gcloud/reference/deployment-manager/deployments/create

in this specific case, ORG_ID is actually a number, but we need it as a string

@mergify mergify bot assigned orouz Sep 15, 2024
Copy link

mergify bot commented Sep 15, 2024

This pull request does not have a backport label. Could you fix it @orouz? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
    NOTE: backport-v8.x has been added to help with the transition to the new branch 8.x.

@orouz orouz force-pushed the gcp_dm_fix branch 2 times, most recently from 08a2cb8 to feea7c8 Compare September 22, 2024 12:19
@orouz orouz marked this pull request as ready for review September 29, 2024 16:37
@orouz orouz requested a review from a team as a code owner September 29, 2024 16:37
@orouz
Copy link
Collaborator Author

orouz commented Sep 29, 2024

for some reason there is a bit of flakiness in service account deployments which i can't exactly pin

@orouz orouz merged commit 676dde6 into main Sep 30, 2024
13 checks passed
@orouz orouz deleted the gcp_dm_fix branch September 30, 2024 08:35
mergify bot pushed a commit that referenced this pull request Sep 30, 2024
orouz added a commit that referenced this pull request Sep 30, 2024
Fix GCP deployment manager formatting (#2530)

(cherry picked from commit 676dde6)

Co-authored-by: Or Ouziel <or.ouziel@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agentless service account deployment lacks organization permissions
2 participants