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

[Asset Inventory][AWS & Azure] Support organization account deployment type #2591

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

kubasobon
Copy link
Member

@kubasobon kubasobon commented Oct 9, 2024

Summary of your changes

AWS: Clones CloudFormation templates for Asset Inventory and enables it to work in Organization mode.
Azure: Clones ARM templates.

Screenshot/Data

image
Kibana showing data from multiple accounts in the organization; Please note the absence of "Sandbox" account from "test-organization" OU

Related Issues

Fixes https://github.com/elastic/security-team/issues/10606

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary README/documentation (if appropriate)

Copy link

mergify bot commented Oct 9, 2024

This pull request does not have a backport label. Could you fix it @kubasobon? 🙏
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.

@mergify mergify bot added the backport-v8.x label Oct 9, 2024
@kubasobon kubasobon marked this pull request as ready for review October 14, 2024 09:54
@kubasobon kubasobon requested a review from a team as a code owner October 14, 2024 09:54
@@ -0,0 +1,444 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Isn't arm for Azure? I had understood this PR is for AWS only

Copy link
Member

Choose a reason for hiding this comment

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

This comment actually goes for this whole folder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the description and title. Azure needed me to just clone the ARM templates.

deploy/asset-inventory-cloudformation/README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,209 @@
// Licensed to Elasticsearch B.V. under one or more contributor
Copy link
Member

Choose a reason for hiding this comment

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

Do I understand correctly that running this will directly start a new stack?

Is this dev only? That's not how we use on pro, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is a copy of CSPM devtools. Just like we have just deploy-cloudformation, we now get just deploy-asset-inventory-cloudformation. Not used in CI, just by developers.

internal/flavors/assetinventory/strategy_aws.go Outdated Show resolved Hide resolved
internal/flavors/assetinventory/strategy_aws.go Outdated Show resolved Hide resolved

const (
rootRole = "cloudbeat-asset-inventory-root"
memberRole = "cloudbeat-asset-inventory-securityaudit"
Copy link
Member

Choose a reason for hiding this comment

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

Is this role expected to be created by the cloud formation?

Copy link
Member Author

@kubasobon kubasobon Oct 17, 2024

Choose a reason for hiding this comment

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

Yes. If account_type is set to organization-account we assume the deployment was done via updated CloudFormation or the proper roles have been created manually. Either way, we assume the roles are there.

@kubasobon kubasobon changed the title [Asset Inventory][AWS] Support organization account deployment type [Asset Inventory][AWS & Azure] Support organization account deployment type Oct 17, 2024
@kubasobon
Copy link
Member Author

@romulets Please take another look

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.

2 participants