members
Creates, updates, deletes, gets or lists a members resource.
Overview
| Name | members |
| Type | Resource |
| Id | aws.securityhub.members |
Fields
The following fields are returned by SELECT queries:
- get_members
- list_members
| Name | Datatype | Description |
|---|---|---|
members | array | The list of details about the Security Hub CSPM member accounts. |
unprocessed_accounts | array | The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Amazon Web Services account ID of the member account. |
administrator_id | string | The Amazon Web Services account ID of the Security Hub CSPM administrator account associated with this member account. (pattern: <code>.\S.</code>) |
email | string | The email address of the member account. (pattern: <code>.\S.</code>) |
invited_at | string (date-time) | A timestamp for the date and time when the invitation was sent to the member account. |
master_id | string | This is replaced by AdministratorID. The Amazon Web Services account ID of the Security Hub CSPM administrator account associated with this member account. (pattern: <code>.\S.</code>) |
member_status | string | The status of the relationship between the member account and its administrator account. The status can have one of the following values: Created - Indicates that the administrator account added the member account, but has not yet invited the member account. Invited - Indicates that the administrator account invited the member account. The member account has not yet responded to the invitation. Enabled - Indicates that the member account is currently active. For manually invited member accounts, indicates that the member account accepted the invitation. Removed - Indicates that the administrator account disassociated the member account. Resigned - Indicates that the member account disassociated themselves from the administrator account. Deleted - Indicates that the administrator account deleted the member account. AccountSuspended - Indicates that an organization account was suspended from Amazon Web Services at the same time that the administrator account tried to enable the organization account as a member account. (pattern: <code>.\S.</code>) |
updated_at | string (date-time) | The timestamp for the date and time when the member account was updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_members | select | region | Returns the details for the Security Hub CSPM member accounts for the specified account IDs. An administrator account can be either the delegated Security Hub CSPM administrator account for an organization or an administrator account that enabled Security Hub CSPM manually. The results include both member accounts that are managed using Organizations and accounts that were invited manually. | |
list_members | select | region | OnlyAssociated, MaxResults, NextToken | Lists details about all member accounts for the current Security Hub CSPM administrator account. The results include both member accounts that belong to an organization and member accounts that were invited manually. |
create_members | insert | region, AccountDetails | Creates a member association in Security Hub CSPM between the specified accounts and the account used to make the request, which is the administrator account. If you are integrated with Organizations, then the administrator account is designated by the organization management account. CreateMembers is always used to add accounts that are not organization members. For accounts that are managed using Organizations, CreateMembers is only used in the following cases: Security Hub CSPM is not configured to automatically add new organization accounts. The account was disassociated or deleted in Security Hub CSPM. This action can only be used by an account that has Security Hub CSPM enabled. To enable Security Hub CSPM, you can use the EnableSecurityHub operation. For accounts that are not organization members, you create the account association and then send an invitation to the member account. To send the invitation, you use the InviteMembers operation. If the account owner accepts the invitation, the account becomes a member account in Security Hub CSPM. Accounts that are managed using Organizations don't receive an invitation. They automatically become a member account in Security Hub CSPM. If the organization account does not have Security Hub CSPM enabled, then Security Hub CSPM and the default standards are automatically enabled. Note that Security Hub CSPM cannot be enabled automatically for the organization management account. The organization management account must enable Security Hub CSPM before the administrator account enables it as a member account. For organization accounts that already have Security Hub CSPM enabled, Security Hub CSPM does not make any other changes to those accounts. It does not change their enabled standards or controls. A permissions policy is added that permits the administrator account to view the findings generated in the member account. To remove the association between the administrator and member accounts, use the DisassociateFromMasterAccount or DisassociateMembers operation. | |
disassociate_members | update | region, AccountIds | Disassociates the specified member accounts from the associated administrator account. Can be used to disassociate both accounts that are managed using Organizations and accounts that were invited manually. | |
delete_members | delete | region | Deletes the specified member accounts from Security Hub CSPM. You can invoke this API only to delete accounts that became members through invitation. You can't invoke this API to delete accounts that belong to an Organizations organization. | |
invite_members | exec | region, AccountIds | We recommend using Organizations instead of Security Hub CSPM invitations to manage your member accounts. For information, see Managing Security Hub CSPM administrator and member accounts with Organizations in the Security Hub CSPM User Guide. Invites other Amazon Web Services accounts to become member accounts for the Security Hub CSPM administrator account that the invitation is sent from. This operation is only used to invite accounts that don't belong to an Amazon Web Services organization. Organization accounts don't receive invitations. Before you can use this action to invite a member, you must first use the CreateMembers action to create the member account in Security Hub CSPM. When the account owner enables Security Hub CSPM and accepts the invitation to become a member account, the administrator account can view the findings generated in the member account. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
MaxResults | integer | The maximum number of items to return in the response. |
NextToken | string | The token that is required for pagination. On your first call to the ListMembers operation, set the value of this parameter to NULL. For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response. |
OnlyAssociated | boolean | Specifies which member accounts to include in the response based on their relationship status with the administrator account. The default value is TRUE. If OnlyAssociated is set to TRUE, the response includes member accounts whose relationship status with the administrator account is set to ENABLED. If OnlyAssociated is set to FALSE, the response includes all existing member accounts. |
SELECT examples
- get_members
- list_members
Returns the details for the Security Hub CSPM member accounts for the specified account IDs. An administrator account can be either the delegated Security Hub CSPM administrator account for an organization or an administrator account that enabled Security Hub CSPM manually. The results include both member accounts that are managed using Organizations and accounts that were invited manually.
SELECT
members,
unprocessed_accounts
FROM aws.securityhub.members
WHERE region = '{{ region }}' -- required
;
Lists details about all member accounts for the current Security Hub CSPM administrator account. The results include both member accounts that belong to an organization and member accounts that were invited manually.
SELECT
account_id,
administrator_id,
email,
invited_at,
master_id,
member_status,
updated_at
FROM aws.securityhub.members
WHERE region = '{{ region }}' -- required
AND OnlyAssociated = '{{ OnlyAssociated }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_members
- Manifest
Creates a member association in Security Hub CSPM between the specified accounts and the account used to make the request, which is the administrator account. If you are integrated with Organizations, then the administrator account is designated by the organization management account. CreateMembers is always used to add accounts that are not organization members. For accounts that are managed using Organizations, CreateMembers is only used in the following cases: Security Hub CSPM is not configured to automatically add new organization accounts. The account was disassociated or deleted in Security Hub CSPM. This action can only be used by an account that has Security Hub CSPM enabled. To enable Security Hub CSPM, you can use the EnableSecurityHub operation. For accounts that are not organization members, you create the account association and then send an invitation to the member account. To send the invitation, you use the InviteMembers operation. If the account owner accepts the invitation, the account becomes a member account in Security Hub CSPM. Accounts that are managed using Organizations don't receive an invitation. They automatically become a member account in Security Hub CSPM. If the organization account does not have Security Hub CSPM enabled, then Security Hub CSPM and the default standards are automatically enabled. Note that Security Hub CSPM cannot be enabled automatically for the organization management account. The organization management account must enable Security Hub CSPM before the administrator account enables it as a member account. For organization accounts that already have Security Hub CSPM enabled, Security Hub CSPM does not make any other changes to those accounts. It does not change their enabled standards or controls. A permissions policy is added that permits the administrator account to view the findings generated in the member account. To remove the association between the administrator and member accounts, use the DisassociateFromMasterAccount or DisassociateMembers operation.
INSERT INTO aws.securityhub.members (
AccountDetails,
region
)
SELECT
'{{ AccountDetails }}' /* required */,
'{{ region }}'
RETURNING
unprocessed_accounts
;
# Description fields are for documentation purposes
- name: members
props:
- name: region
value: "{{ region }}"
description: Required parameter for the members resource.
- name: AccountDetails
value:
- AccountId: "{{ AccountId }}"
Email: "{{ Email }}"
UPDATE examples
- disassociate_members
Disassociates the specified member accounts from the associated administrator account. Can be used to disassociate both accounts that are managed using Organizations and accounts that were invited manually.
UPDATE aws.securityhub.members
SET
AccountIds = '{{ AccountIds }}'
WHERE
region = '{{ region }}' --required
AND AccountIds = '{{ AccountIds }}' --required;
DELETE examples
- delete_members
Deletes the specified member accounts from Security Hub CSPM. You can invoke this API only to delete accounts that became members through invitation. You can't invoke this API to delete accounts that belong to an Organizations organization.
DELETE FROM aws.securityhub.members
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- invite_members
We recommend using Organizations instead of Security Hub CSPM invitations to manage your member accounts. For information, see Managing Security Hub CSPM administrator and member accounts with Organizations in the Security Hub CSPM User Guide. Invites other Amazon Web Services accounts to become member accounts for the Security Hub CSPM administrator account that the invitation is sent from. This operation is only used to invite accounts that don't belong to an Amazon Web Services organization. Organization accounts don't receive invitations. Before you can use this action to invite a member, you must first use the CreateMembers action to create the member account in Security Hub CSPM. When the account owner enables Security Hub CSPM and accepts the invitation to become a member account, the administrator account can view the findings generated in the member account.
EXEC aws.securityhub.members.invite_members
@region='{{ region }}' --required
@@json=
'{
"AccountIds": "{{ AccountIds }}"
}'
;