이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.
AWS CLI를 사용한 Security Hub 예시
다음 코드 예시에서는 Security Hub에서 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.
각 예시에는 컨텍스트에서 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있는 전체 소스 코드에 대한 링크가 포함되어 있습니다.
주제
작업
다음 코드 예시에서는 accept-administrator-invitation
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에서 초대를 수락하는 방법
다음
accept-administrator-invitation
예시에서는 지정된 관리자 계정에서 지정된 초대를 수락합니다.aws securityhub accept-invitation \ --administrator-id
123456789012
\ --invitation-id7ab938c5d52d7904ad09f9e7c20cc4eb
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 AcceptAdministratorInvitation
섹션을 참조하세요.
-
다음 코드 예시에서는 accept-invitation
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에서 초대를 수락하는 방법
다음
accept-invitation
예시에서는 지정된 관리자 계정에서 지정된 초대를 수락합니다.aws securityhub accept-invitation \ --master-id
123456789012
\ --invitation-id7ab938c5d52d7904ad09f9e7c20cc4eb
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 AcceptInvitation
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-delete-automation-rules
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
자동화 규칙을 삭제하는 방법
다음
batch-delete-automation-rules
예시에서는 지정된 자동화 규칙을 삭제합니다. 한 번의 명령으로 하나 이상의 규칙을 삭제할 수 있습니다. Security Hub 관리자 계정만 이 명령을 실행할 수 있습니다.aws securityhub batch-delete-automation-rules \ --automation-rules-arns '
["arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"]
'출력:
{ "ProcessedAutomationRules": [ "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" ], "UnprocessedAutomationRules": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 자동화 규칙 삭제 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchDeleteAutomationRules
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-disable-standards
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
표준 비활성화
다음
batch-disable-standards
예시에서는 지정된 구독 ARN과 연결된 표준을 비활성화합니다.aws securityhub batch-disable-standards \ --standards-subscription-arns
"arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1"
출력:
{ "StandardsSubscriptions": [ { "StandardsArn": "arn:aws:securityhub:eu-central-1::standards/pci-dss/v/3.2.1", "StandardsInput": { }, "StandardsStatus": "DELETING", "StandardsSubscriptionArn": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 보안 표준 비활성화 또는 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchDisableStandards
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-enable-standards
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
표준 활성화
다음
batch-enable-standards
예시에서는 요청 계정에 대한 PCI DSS 표준을 활성화합니다.aws securityhub batch-enable-standards \ --standards-subscription-requests '
{"StandardsArn":"arn:aws:securityhub:us-west-1::standards/pci-dss/v/3.2.1"}
'출력:
{ "StandardsSubscriptions": [ { "StandardsArn": "arn:aws:securityhub:us-west-1::standards/pci-dss/v/3.2.1", "StandardsInput": { }, "StandardsStatus": "PENDING", "StandardsSubscriptionArn": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 보안 표준 비활성화 또는 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchEnableStandards
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-get-automation-rules
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
자동화 규칙에 대한 세부 정보를 가져오는 방법
다음
batch-get-automation-rules
예시에서는 지정된 자동화 규칙에 대한 세부 정보를 가져옵니다. 명령 한 번으로 하나 이상의 자동화 규칙에 대한 세부 정보를 얻을 수 있습니다.aws securityhub batch-get-automation-rules \ --automation-rules-arns '
["arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"]
'출력:
{ "Rules": [ { "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "RuleStatus": "ENABLED", "RuleOrder": 1, "RuleName": "Suppress informational findings", "Description": "Suppress GuardDuty findings with Informational severity", "IsTerminal": false, "Criteria": { "ProductName": [ { "Value": "GuardDuty", "Comparison": "EQUALS" } ], "SeverityLabel": [ { "Value": "INFORMATIONAL", "Comparison": "EQUALS" } ], "WorkflowStatus": [ { "Value": "NEW", "Comparison": "EQUALS" } ], "RecordState": [ { "Value": "ACTIVE", "Comparison": "EQUALS" } ] }, "Actions": [ { "Type": "FINDING_FIELDS_UPDATE", "FindingFieldsUpdate": { "Note": { "Text": "Automatically suppress GuardDuty findings with Informational severity", "UpdatedBy": "sechub-automation" }, "Workflow": { "Status": "SUPPRESSED" } } } ], "CreatedAt": "2023-05-31T17:56:14.837000+00:00", "UpdatedAt": "2023-05-31T17:59:38.466000+00:00", "CreatedBy": "arn:aws:iam::123456789012:role/Admin" } ], "UnprocessedAutomationRules": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 자동화 규칙 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchGetAutomationRules
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-get-configuration-policy-associations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
대상 배치에 대한 구성 연결 세부 정보를 가져오는 방법
다음
batch-get-configuration-policy-associations
예시에서는 지정된 대상에 대한 연결 세부 정보를 검색합니다. 계정 ID, 조직 단위 ID 또는 대상의 루트 ID를 제공할 수 있습니다.aws securityhub batch-get-configuration-policy-associations \ --target '
{"OrganizationalUnitId": "ou-6hi7-8j91kl2m"}
'출력:
{ "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "TargetId": "ou-6hi7-8j91kl2m", "TargetType": "ORGANIZATIONAL_UNIT", "AssociationType": "APPLIED", "UpdatedAt": "2023-09-26T21:13:01.816000+00:00", "AssociationStatus": "SUCCESS", "AssociationStatusMessage": "Association applied successfully on this target." }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchGetConfigurationPolicyAssociations
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-get-security-controls
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
보안 제어 세부 정보를 가져오는 방법
다음
batch-get-security-controls
예시에서는 현재 AWS 계정 및 AWS 리전의 보안 제어 ACM.1 및 IAM.1에 대한 세부 정보를 가져옵니다.aws securityhub batch-get-security-controls \ --security-control-ids '
["ACM.1", "IAM.1"]
'출력:
{ "SecurityControls": [ { "SecurityControlId": "ACM.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/ACM.1", "Title": "Imported and ACM-issued certificates should be renewed after a specified time period", "Description": "This control checks whether an AWS Certificate Manager (ACM) certificate is renewed within the specified time period. It checks both imported certificates and certificates provided by ACM. The control fails if the certificate isn't renewed within the specified time period. Unless you provide a custom parameter value for the renewal period, Security Hub uses a default value of 30 days.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/ACM.1/remediation", "SeverityRating": "MEDIUM", "SecurityControlStatus": "ENABLED" "UpdateStatus": "READY", "Parameters": { "daysToExpiration": { "ValueType": CUSTOM, "Value": { "Integer": 15 } } }, "LastUpdateReason": "Updated control parameter" }, { "SecurityControlId": "IAM.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/IAM.1", "Title": "IAM policies should not allow full \"*\" administrative privileges", "Description": "This AWS control checks whether the default version of AWS Identity and Access Management (IAM) policies (also known as customer managed policies) do not have administrator access with a statement that has \"Effect\": \"Allow\" with \"Action\": \"*\" over \"Resource\": \"*\". It only checks for the Customer Managed Policies that you created, but not inline and AWS Managed Policies.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/IAM.1/remediation", "SeverityRating": "HIGH", "SecurityControlStatus": "ENABLED" "UpdateStatus": "READY", "Parameters": {} } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 제어에 대한 세부 정보 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchGetSecurityControls
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-get-standards-control-associations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
제어의 활성화 상태 가져오기
다음
batch-get-standards-control-associations
예시에서는 지정된 제어가 지정된 표준에서 활성화되어 있는지 여부를 식별합니다.aws securityhub batch-get-standards-control-associations \ --standards-control-association-ids '
[{"SecurityControlId": "Config.1","StandardsArn": "arn:aws:securityhub:us-east-1:123456789012:ruleset/cis-aws-foundations-benchmark/v/1.2.0"}, {"SecurityControlId": "IAM.6","StandardsArn": "arn:aws:securityhub:us-east-1:123456789012:standards/aws-foundational-security-best-practices/v/1.0.0"}]
'출력:
{ "StandardsControlAssociationDetails": [ { "StandardsArn": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0", "SecurityControlId": "Config.1", "SecurityControlArn": "arn:aws:securityhub:us-east-1:068873283051:security-control/Config.1", "AssociationStatus": "ENABLED", "RelatedRequirements": [ "CIS AWS Foundations 2.5" ], "UpdatedAt": "2022-10-27T16:07:12.960000+00:00", "StandardsControlTitle": "Ensure AWS Config is enabled", "StandardsControlDescription": "AWS Config is a web service that performs configuration management of supported AWS resources within your account and delivers log files to you. The recorded information includes the configuration item (AWS resource), relationships between configuration items (AWS resources), and any configuration changes between resources. It is recommended to enable AWS Config in all regions.", "StandardsControlArns": [ "arn:aws:securityhub:us-east-1:068873283051:control/cis-aws-foundations-benchmark/v/1.2.0/2.5" ] }, { "StandardsArn": "arn:aws:securityhub:us-east-1::standards/aws-foundational-security-best-practices/v/1.0.0", "SecurityControlId": "IAM.6", "SecurityControlArn": "arn:aws:securityhub:us-east-1:068873283051:security-control/IAM.6", "AssociationStatus": "DISABLED", "RelatedRequirements": [], "UpdatedAt": "2022-11-22T21:30:35.080000+00:00", "UpdatedReason": "test", "StandardsControlTitle": "Hardware MFA should be enabled for the root user", "StandardsControlDescription": "This AWS control checks whether your AWS account is enabled to use a hardware multi-factor authentication (MFA) device to sign in with root user credentials.", "StandardsControlArns": [ "arn:aws:securityhub:us-east-1:068873283051:control/aws-foundational-security-best-practices/v/1.0.0/IAM.6" ] } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 특정 표준에서 제어 활성화 및 비활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchGetStandardsControlAssociations
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-import-findings
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
조사 결과 업데이트
다음
batch-import-findings
예시에서는 조사 결과를 업데이트합니다.aws securityhub batch-import-findings \ --findings '
[{ "AwsAccountId": "123456789012", "CreatedAt": "2020-05-27T17:05:54.832Z", "Description": "Vulnerability in a CloudTrail trail", "FindingProviderFields": { "Severity": { "Label": "LOW", "Original": "10" }, "Types": [ "Software and Configuration Checks/Vulnerabilities/CVE" ] }, "GeneratorId": "TestGeneratorId", "Id": "Id1", "ProductArn": "arn:aws:securityhub:us-west-1:123456789012:product/123456789012/default", "Resources": [ { "Id": "arn:aws:cloudtrail:us-west-1:123456789012:trail/TrailName", "Partition": "aws", "Region": "us-west-1", "Type": "AwsCloudTrailTrail" } ], "SchemaVersion": "2018-10-08", "Title": "CloudTrail trail vulnerability", "UpdatedAt": "2020-06-02T16:05:54.832Z" }]
'출력:
{ "FailedCount": 0, "SuccessCount": 1, "FailedFindings": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 BatchImportFindings를 사용하여 조사 결과 생성 및 업데이트 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchImportFindings
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-update-automation-rules
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
자동화 규칙을 업데이트하는 방법
다음
batch-update-automation-rules
예시에서는 지정된 자동화 규칙을 업데이트합니다. 한 번의 명령으로 하나 이상의 규칙을 업데이트할 수 있습니다. Security Hub 관리자 계정만 이 명령을 실행할 수 있습니다.aws securityhub batch-update-automation-rules \ --update-automation-rules-request-items '
[ \ { \ "Actions": [{ \ "Type": "FINDING_FIELDS_UPDATE", \ "FindingFieldsUpdate": { \ "Note": { \ "Text": "Known issue that is a risk", \ "UpdatedBy": "sechub-automation" \ }, \ "Workflow": { \ "Status": "NEW" \ } \ } \ }], \ "Criteria": { \ "SeverityLabel": [{ \ "Value": "LOW", \ "Comparison": "EQUALS" \ }] \ }, \ "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", \ "RuleOrder": 1, \ "RuleStatus": "DISABLED" \ } \ ]
'출력:
{ "ProcessedAutomationRules": [ "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" ], "UnprocessedAutomationRules": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 자동화 규칙 편집 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchUpdateAutomationRules
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-update-findings
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 조사 결과 업데이트
다음
batch-update-findings
예시에서는 두 개의 결과를 업데이트하여 메모를 추가하고, 심각도 레이블을 변경하고, 해결합니다.aws securityhub batch-update-findings \ --finding-identifiers '
[{"Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub"}, {"Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub"}]
' \ --note '{"Text": "Known issue that is not a risk.", "UpdatedBy": "user1"}
' \ --severity '{"Label": "LOW"}
' \ --workflow '{"Status": "RESOLVED"}
'출력:
{ "ProcessedFindings": [ { "Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub" }, { "Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub" } ], "UnprocessedFindings": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 BatchUpdateFindings를 사용하여 조사 결과 업데이트 섹션을 참조하세요.
예시 2: 단축형 구문을 사용하여 조사 결과 업데이트
다음
batch-update-findings
예시에서는 두 개의 결과를 업데이트하여 메모를 추가하고, 심각도 레이블을 변경하고, 속기 구문을 사용하여 문제를 해결합니다.aws securityhub batch-update-findings \ --finding-identifiers Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",ProductArn="arn:aws:securityhub:us-west-1::product/aws/securityhub" Id="arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",ProductArn="arn:aws:securityhub:us-west-1::product/aws/securityhub" \ --note Text="Known issue that is not a risk.",UpdatedBy="user1" \ --severity Label="LOW" \ --workflow Status="RESOLVED"
출력:
{ "ProcessedFindings": [ { "Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub" }, { "Id": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub" } ], "UnprocessedFindings": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 BatchUpdateFindings를 사용하여 조사 결과 업데이트 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchUpdateFindings
섹션을 참조하세요.
-
다음 코드 예시에서는 batch-update-standards-control-associations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
활성화된 표준에서 제어의 활성화 상태를 업데이트하는 방법
다음
batch-update-standards-control-associations
예시에서는 지정된 표준에서 CloudTrail.1을 비활성화합니다.aws securityhub batch-update-standards-control-associations \ --standards-control-association-updates '
[{"SecurityControlId": "CloudTrail.1", "StandardsArn": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0", "AssociationStatus": "DISABLED", "UpdatedReason": "Not applicable to environment"}, {"SecurityControlId": "CloudTrail.1", "StandardsArn": "arn:aws:securityhub:::standards/cis-aws-foundations-benchmark/v/1.4.0", "AssociationStatus": "DISABLED", "UpdatedReason": "Not applicable to environment"}]
'이 명령은 성공 시 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 특정 표준에서 제어 활성화 및 비활성화 섹션 및 모든 표준에서 제어 활성화 및 비활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 BatchUpdateStandardsControlAssociations
섹션을 참조하세요.
-
다음 코드 예시에서는 create-action-target
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 작업 생성
다음
create-action-target
예시에서는 사용자 지정 작업을 생성합니다. 작업의 이름, 설명 및 식별자를 제공합니다.aws securityhub create-action-target \ --name
"Send to remediation"
\ --description"Action to send the finding for remediation tracking"
\ --id"Remediation"
출력:
{ "ActionTargetArn": "arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation" }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 작업 생성 및 CloudWatch Events 규칙과 연결 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateActionTarget
섹션을 참조하세요.
-
다음 코드 예시에서는 create-automation-rule
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
자동화 규칙을 생성하는 방법
다음
create-automation-rule
예시에서는 현재 AWS 계정 및 AWS 리전에 자동화 규칙을 생성합니다. Security Hub는 지정된 기준에 따라 조사 결과를 필터링하고 일치하는 조사 결과에 대해 조치를 적용합니다. Security Hub 관리자 계정만 이 명령을 실행할 수 있습니다.aws securityhub create-automation-rule \ --actions '
[{ \ "Type": "FINDING_FIELDS_UPDATE", \ "FindingFieldsUpdate": { \ "Severity": { \ "Label": "HIGH" \ }, \ "Note": { \ "Text": "Known issue that is a risk. Updated by automation rules", \ "UpdatedBy": "sechub-automation" \ } \ } \ }]
' \ --criteria '{ \ "SeverityLabel": [{ \ "Value": "INFORMATIONAL", \ "Comparison": "EQUALS" \ }] \ }
' \ --description"A sample rule"
\ --no-is-terminal \ --rule-name"sample rule"
\ --rule-order1
\ --rule-status"ENABLED"
출력:
{ "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }
자세한 내용은 AWS Security Hub 사용 설명서의 자동화 규칙 생성 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateAutomationRule
섹션을 참조하세요.
-
다음 코드 예시에서는 create-configuration-policy
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 정책 생성
다음
create-configuration-policy
예시에서는 지정된 설정으로 구성 정책을 생성합니다.aws securityhub create-configuration-policy \ --name
"SampleConfigurationPolicy"
\ --description"SampleDescription"
\ --configuration-policy '{"SecurityHub": {"ServiceEnabled": true, "EnabledStandardIdentifiers": ["arn:aws:securityhub:eu-central-1::standards/aws-foundational-security-best-practices/v/1.0.0","arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0"],"SecurityControlsConfiguration":{"DisabledSecurityControlIdentifiers": ["CloudTrail.2"], "SecurityControlCustomParameters": [{"SecurityControlId": "ACM.1", "Parameters": {"daysToExpiration": {"ValueType": "CUSTOM", "Value": {"Integer": 15}}}}]}}}
' \ --tags '{"Environment": "Prod"}
'출력:
{ "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "SampleConfigurationPolicy", "Description": "SampleDescription", "UpdatedAt": "2023-11-28T20:28:04.494000+00:00", "CreatedAt": "2023-11-28T20:28:04.494000+00:00", "ConfigurationPolicy": { "SecurityHub": { "ServiceEnabled": true, "EnabledStandardIdentifiers": [ "arn:aws:securityhub:eu-central-1::standards/aws-foundational-security-best-practices/v/1.0.0", "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0" ], "SecurityControlsConfiguration": { "DisabledSecurityControlIdentifiers": [ "CloudTrail.2" ], "SecurityControlCustomParameters": [ { "SecurityControlId": "ACM.1", "Parameters": { "daysToExpiration": { "ValueType": "CUSTOM", "Value": { "Integer": 15 } } } } ] } } } }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 생성 및 연결 섹션을 참조하세요
-
API 세부 정보는 AWS CLI 명령 참조의 CreateConfigurationPolicy
섹션을 참조하세요.
-
다음 코드 예시에서는 create-finding-aggregator
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
결과 집계를 활성화하는 방법
다음
create-finding-aggregator
예시에서는 조사 결과 집계를 구성합니다. 미국 동부(버지니아)를 집계 영역으로 지정하는 미국 동부(버지니아)에서 운영됩니다. 지정된 리전만 연결하고 새 리전은 자동으로 연결하지 않음을 나타냅니다. 미국 서부(캘리포니아 북부)와 미국 서부(오레곤)를 연결 리전으로 선택합니다.aws securityhub create-finding-aggregator \ --region
us-east-1
\ --region-linking-modeSPECIFIED_REGIONS
\ --regionsus-west-1,us-west-2
출력:
{ "FindingAggregatorArn": "arn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000", "FindingAggregationRegion": "us-east-1", "RegionLinkingMode": "SPECIFIED_REGIONS", "Regions": "us-west-1,us-west-2" }
자세한 내용은 AWS Security Hub 사용 설명서의 조사 결과 집계 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateFindingAggregator
섹션을 참조하세요.
-
다음 코드 예시에서는 create-insight
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 인사이트 생성
다음
create-insight
예시에서는 AWS 역할과 관련된 중요한 조사 결과를 반환하는 중요한 역할 조사 결과라는 사용자 지정 인사이트를 생성합니다.aws securityhub create-insight \ --filters '
{"ResourceType": [{ "Comparison": "EQUALS", "Value": "AwsIamRole"}], "SeverityLabel": [{"Comparison": "EQUALS", "Value": "CRITICAL"}]}
' \ --group-by-attribute"ResourceId"
\ --name"Critical role findings"
출력:
{ "InsightArn": "arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 인사이트 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateInsight
섹션을 참조하세요.
-
다음 코드 예시에서는 create-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
계정을 멤버 계정으로 추가하는 방법
다음
create-members
예시에서는 두 계정을 요청 관리자 계정에 멤버 계정으로 추가합니다.aws securityhub create-members \ --account-details '
[{"AccountId": "123456789111"}, {"AccountId": "123456789222"}]
'출력:
{ "UnprocessedAccounts": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 CreateMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 decline-invitations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 초대 거부
다음
decline-invitations
예시에서는 지정된 관리자 계정의 멤버 계정이 되기 위한 초대를 거부합니다. 멤버 계정은 요청하는 계정입니다.aws securityhub decline-invitations \ --account-ids
"123456789012"
출력:
{ "UnprocessedAccounts": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeclineInvitations
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-action-target
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 작업 삭제
다음
delete-action-target
예시에서는 지정된 ARN으로 식별된 사용자 지정 작업을 삭제합니다.aws securityhub delete-action-target \ --action-target-arn
"arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation"
출력:
{ "ActionTargetArn": "arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation" }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 작업 생성 및 CloudWatch Events 규칙과 연결 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteActionTarget
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-configuration-policy
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 정책을 삭제하려면
다음
delete-configuration-policy
예시에서는 지정한 정책을 삭제합니다.aws securityhub delete-configuration-policy \ --identifier
"arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 삭제 및 연결 해제 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteConfigurationPolicy
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-finding-aggregator
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
집계 찾기를 중지하는 방법
다음
delete-finding-aggregator
예시에서는 조사 결과 집계를 중지합니다. 집계 영역인 미국 동부(버지니아)에서 운영됩니다.aws securityhub delete-finding-aggregator \ --region
us-east-1
\ --finding-aggregator-arnarn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 조사 결과 집계 중지 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteFindingAggregator
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-insight
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 인사이트 삭제
다음
delete-insight
예시에서는 지정된 ARN을 사용하여 사용자 지정 인사이트를 삭제합니다.aws securityhub delete-insight \ --insight-arn
"arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
출력:
{ "InsightArn": "arn:aws:securityhub:eu-central-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 인사이트 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteInsight
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-invitations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 초대 거부
다음
delete-invitations
예시에서는 지정된 관리자 계정의 멤버 계정이 되기 위한 초대를 삭제합니다. 멤버 계정은 요청하는 계정입니다.aws securityhub delete-invitations \ --account-ids
"123456789012"
출력:
{ "UnprocessedAccounts": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteInvitations
섹션을 참조하세요.
-
다음 코드 예시에서는 delete-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 삭제
다음
delete-members
예시에서는 요청 관리자 계정에서 지정된 멤버 계정을 삭제합니다.aws securityhub delete-members \ --account-ids
"123456789111"
"123456789222"
출력:
{ "UnprocessedAccounts": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DeleteMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-action-targets
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 작업에 대한 세부 정보를 검색하는 방법
다음
describe-action-targets
예시에서는 지정된 ARN으로 식별된 사용자 지정 작업에 대한 정보를 검색합니다.aws securityhub describe-action-targets \ --action-target-arns
"arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation"
출력:
{ "ActionTargets": [ { "ActionTargetArn": "arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation", "Description": "Action to send the finding for remediation tracking", "Name": "Send to remediation" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 작업 생성 및 CloudWatch Events 규칙과 연결 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeActionTargets
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-hub
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
허브 리소스에 대한 정보 가져오기
다음
describe-hub
예시에서는 지정된 허브 리소스의 구독 날짜를 반환합니다. 허브 리소스는 ARN으로 식별됩니다.aws securityhub describe-hub \ --hub-arn
"arn:aws:securityhub:us-west-1:123456789012:hub/default"
출력:
{ "HubArn": "arn:aws:securityhub:us-west-1:123456789012:hub/default", "SubscribedAt": "2019-11-19T23:15:10.046Z" }
자세한 내용은 AWS CloudFormation 사용 설명서의 AWS::SecurityHub::Hub 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeHub
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-organization-configuration
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
조직에 대해 Security Hub가 구성된 방법을 보는 방법
다음
describe-organization-configuration
예시는 Security Hub에서 조직이 구성된 방식에 대한 정보를 반환합니다. 이 예시에서는 조직에서 중앙 구성을 사용합니다. Security Hub 관리자 계정만 이 명령을 실행할 수 있습니다.aws securityhub describe-organization-configuration
출력:
{ "AutoEnable": false, "MemberAccountLimitReached": false, "AutoEnableStandards": "NONE", "OrganizationConfiguration": { "ConfigurationType": "LOCAL", "Status": "ENABLED", "StatusMessage": "Central configuration has been enabled successfully" } }
자세한 내용은 AWS Security Hub 사용 설명서의 AWS Organizations를 사용하여 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeOrganizationConfiguration
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-products
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용 가능한 제품 통합에 대한 정보를 반환하는 방법
다음
describe-products
예시에서는 사용 가능한 제품 통합을 한 번에 하나씩 반환합니다.aws securityhub describe-products \ --max-results
1
출력:
{ "NextToken": "U2FsdGVkX18vvPlOqb7RDrWRWVFBJI46MOIAb+nZmRJmR15NoRi2gm13sdQEn3O/pq/78dGs+bKpgA+7HMPHO0qX33/zoRI+uIG/F9yLNhcOrOWzFUdy36JcXLQji3Rpnn/cD1SVkGA98qI3zPOSDg==", "Products": [ { "ProductArn": "arn:aws:securityhub:us-west-1:123456789333:product/crowdstrike/crowdstrike-falcon", "ProductName": "CrowdStrike Falcon", "CompanyName": "CrowdStrike", "Description": "CrowdStrike Falcon's single lightweight sensor unifies next-gen antivirus, endpoint detection and response, and 24/7 managed hunting, via the cloud.", "Categories": [ "Endpoint Detection and Response (EDR)", "AV Scanning and Sandboxing", "Threat Intelligence Feeds and Reports", "Endpoint Forensics", "Network Forensics" ], "IntegrationTypes": [ "SEND_FINDINGS_TO_SECURITY_HUB" ], "MarketplaceUrl": "https://aws.amazon.com/marketplace/seller-profile?id=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ActivationUrl": "https://falcon.crowdstrike.com/support/documentation", "ProductSubscriptionResourcePolicy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"123456789333\"},\"Action\":[\"securityhub:BatchImportFindings\"],\"Resource\":\"arn:aws:securityhub:us-west-1:123456789012:product-subscription/crowdstrike/crowdstrike-falcon\",\"Condition\":{\"StringEquals\":{\"securityhub:TargetAccount\":\"123456789012\"}}},{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"123456789012\"},\"Action\":[\"securityhub:BatchImportFindings\"],\"Resource\":\"arn:aws:securityhub:us-west-1:123456789333:product/crowdstrike/crowdstrike-falcon\",\"Condition\":{\"StringEquals\":{\"securityhub:TargetAccount\":\"123456789012\"}}}]}" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 제품 통합 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeProducts
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-standards-controls
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
활성화된 표준에 대한 제어 목록 요청
다음
describe-standards-controls
예시에서는 PCI DSS 표준에 대한 요청자 계정의 구독에 있는 제어 목록을 요청합니다. 요청은 한 번에 두 개의 제어를 반환합니다.aws securityhub describe-standards-controls \ --standards-subscription-arn
"arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1"
\ --max-results2
출력:
{ "Controls": [ { "StandardsControlArn": "arn:aws:securityhub:us-west-1:123456789012:control/pci-dss/v/3.2.1/PCI.AutoScaling.1", "ControlStatus": "ENABLED", "ControlStatusUpdatedAt": "2020-05-15T18:49:04.473000+00:00", "ControlId": "PCI.AutoScaling.1", "Title": "Auto scaling groups associated with a load balancer should use health checks", "Description": "This AWS control checks whether your Auto Scaling groups that are associated with a load balancer are using Elastic Load Balancing health checks.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/PCI.AutoScaling.1/remediation", "SeverityRating": "LOW", "RelatedRequirements": [ "PCI DSS 2.2" ] }, { "StandardsControlArn": "arn:aws:securityhub:us-west-1:123456789012:control/pci-dss/v/3.2.1/PCI.CW.1", "ControlStatus": "ENABLED", "ControlStatusUpdatedAt": "2020-05-15T18:49:04.498000+00:00", "ControlId": "PCI.CW.1", "Title": "A log metric filter and alarm should exist for usage of the \"root\" user", "Description": "This control checks for the CloudWatch metric filters using the following pattern { $.userIdentity.type = \"Root\" && $.userIdentity.invokedBy NOT EXISTS && $.eventType != \"AwsServiceEvent\" } It checks that the log group name is configured for use with active multi-region CloudTrail, that there is at least one Event Selector for a Trail with IncludeManagementEvents set to true and ReadWriteType set to All, and that there is at least one active subscriber to an SNS topic associated with the alarm.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/PCI.CW.1/remediation", "SeverityRating": "MEDIUM", "RelatedRequirements": [ "PCI DSS 7.2.1" ] } ], "NextToken": "U2FsdGVkX1+eNkPoZHVl11ip5HUYQPWSWZGmftcmJiHL8JoKEsCDuaKayiPDyLK+LiTkShveoOdvfxXCkOBaGhohIXhsIedN+LSjQV/l7kfCfJcq4PziNC1N9xe9aq2pjlLVZnznTfSImrodT5bRNHe4fELCQq/z+5ka+5Lzmc11axcwTd5lKgQyQqmUVoeriHZhyIiBgWKf7oNYdBVG8OEortVWvSkoUTt+B2ThcnC7l43kI0UNxlkZ6sc64AsW" }
자세한 내용은 AWS Security Hub 사용 설명서의 제어에 대한 세부 정보 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeStandardsControls
섹션을 참조하세요.
-
다음 코드 예시에서는 describe-standards
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용 가능한 표준 목록을 반환하는 방법
다음
describe-standards
예시에서는 사용 가능한 표준 목록을 반환합니다.aws securityhub describe-standards
출력:
{ "Standards": [ { "StandardsArn": "arn:aws:securityhub:us-west-1::standards/aws-foundational-security-best-practices/v/1.0.0", "Name": "AWS Foundational Security Best Practices v1.0.0", "Description": "The AWS Foundational Security Best Practices standard is a set of automated security checks that detect when AWS accounts and deployed resources do not align to security best practices. The standard is defined by AWS security experts. This curated set of controls helps improve your security posture in AWS, and cover AWS's most popular and foundational services.", "EnabledByDefault": true }, { "StandardsArn": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0", "Name": "CIS AWS Foundations Benchmark v1.2.0", "Description": "The Center for Internet Security (CIS) AWS Foundations Benchmark v1.2.0 is a set of security configuration best practices for AWS. This Security Hub standard automatically checks for your compliance readiness against a subset of CIS requirements.", "EnabledByDefault": true }, { "StandardsArn": "arn:aws:securityhub:us-west-1::standards/pci-dss/v/3.2.1", "Name": "PCI DSS v3.2.1", "Description": "The Payment Card Industry Data Security Standard (PCI DSS) v3.2.1 is an information security standard for entities that store, process, and/or transmit cardholder data. This Security Hub standard automatically checks for your compliance readiness against a subset of PCI DSS requirements.", "EnabledByDefault": false } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 AWS Security Hub의 보안 표준 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DescribeStandards
섹션을 참조하세요.
-
다음 코드 예시에서는 disable-import-findings-for-product
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
제품 통합에서 결과 수신을 중지하는 방법
다음
disable-import-findings-for-product
예시에서는 지정된 제품 통합 구독에 대한 조사 결과의 흐름을 비활성화합니다.aws securityhub disable-import-findings-for-product \ --product-subscription-arn
"arn:aws:securityhub:us-west-1:123456789012:product-subscription/crowdstrike/crowdstrike-falcon"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 제품 통합 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisableImportFindingsForProduct
섹션을 참조하세요.
-
다음 코드 예시에서는 disable-organization-admin-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
Security Hub 관리자 계정 제거
다음
disable-organization-admin-account
예시에서는 지정된 계정의 AWS Organization용 Security Hub 관리자 계정 할당을 취소합니다.aws securityhub disable-organization-admin-account \ --admin-account-id
777788889999
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 관리자 계정 지정 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisableOrganizationAdminAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 disable-security-hub
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
AWS Security Hub 비활성화
다음
disable-security-hub
예시에서는 요청 계정의 AWS Security Hub를 비활성화합니다.aws securityhub disable-security-hub
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 안내서의 AWS Security Hub 비활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisableSecurityHub
섹션을 참조하세요.
-
다음 코드 예시에서는 disassociate-from-administrator-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에서 연결 해제
다음
disassociate-from-administrator-account
예시에서는 요청 계정을 현재 관리자 계정에서 연결 해제합니다.aws securityhub disassociate-from-administrator-account
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisassociateFromAdministratorAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 disassociate-from-master-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에서 연결 해제
다음
disassociate-from-master-account
예시에서는 요청 계정을 현재 관리자 계정에서 연결 해제합니다.aws securityhub disassociate-from-master-account
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisassociateFromMasterAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 disassociate-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 연결을 해제하려면
다음
disassociate-members
예시에서는 요청하는 관리자 계정에서 지정된 멤버 계정을 연결 해제합니다.aws securityhub disassociate-members \ --account-ids
"123456789111"
"123456789222"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 DisassociateMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 enable-import-findings-for-product
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
제품 통합에서 결과 수신을 시작하는 방법
다음
enable-import-findings-for-product
예시에서는 지정된 제품 통합의 조사 결과 흐름을 활성화합니다.aws securityhub enable-import-findings-for-product \ --product-arn
"arn:aws:securityhub:us-east-1:123456789333:product/crowdstrike/crowdstrike-falcon"
출력:
{ "ProductSubscriptionArn": "arn:aws:securityhub:us-east-1:123456789012:product-subscription/crowdstrike/crowdstrike-falcon" }
자세한 내용은 AWS Security Hub 사용 설명서의 제품 통합 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 EnableImportFindingsForProduct
섹션을 참조하세요.
-
다음 코드 예시에서는 enable-organization-admin-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
조직의 계정을 Security Hub 관리자 계정으로 지정
다음
enable-organization-admin-account
예시에서는 지정한 계정을 Security Hub 관리자 계정으로 지정합니다.aws securityhub enable-organization-admin-account \ --admin-account-id
777788889999
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 관리자 계정 지정 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 EnableOrganizationAdminAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 enable-security-hub
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
AWS Security Hub 활성화
다음
enable-security-hub
예시에서는 요청 계정에 대한 AWS Security Hub를 활성화합니다. 기본 표준을 활성화하도록 Security Hub를 구성합니다. 허브 리소스의 경우 태그Department
에 값Security
를 할당합니다.aws securityhub enable-security-hub \ --enable-default-standards \ --tags '
{"Department": "Security"}
'이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 안내서의 Security Hub 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 EnableSecurityHub
섹션을 참조하세요.
-
다음 코드 예시에서는 get-administrator-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에 대한 정보를 검색하는 방법
다음
get-administrator-account
예시에서는 요청 계정의 관리자 계정에 대한 정보를 검색합니다.aws securityhub get-administrator-account
출력:
{ "Master": { "AccountId": "123456789012", "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", "InvitedAt": 2020-06-01T20:21:18.042000+00:00, "MemberStatus": "ASSOCIATED" } }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetAdministratorAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 get-configuration-policy-association
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
대상에 대한 구성 연결 세부 정보를 가져오는 방법
다음
get-configuration-policy-association
예시에서는 지정된 대상에 대한 연결 세부 정보를 검색합니다. 대상의 계정 ID, 조직 단위 ID 또는 루트 ID를 제공할 수 있습니다.aws securityhub get-configuration-policy-association \ --target '
{"OrganizationalUnitId": "ou-6hi7-8j91kl2m"}
'출력:
{ "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "TargetId": "ou-6hi7-8j91kl2m", "TargetType": "ORGANIZATIONAL_UNIT", "AssociationType": "APPLIED", "UpdatedAt": "2023-09-26T21:13:01.816000+00:00", "AssociationStatus": "SUCCESS", "AssociationStatusMessage": "Association applied successfully on this target." }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetConfigurationPolicyAssociation
섹션을 참조하세요.
-
다음 코드 예시에서는 get-configuration-policy
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 정책 세부 정보를 보는 방법
다음
get-configuration-policy
예시에서는 지정된 구성 정책에 대한 세부 정보를 검색합니다.aws securityhub get-configuration-policy \ --identifier
"arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
출력:
{ "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Id": "ce5ed1e7-9639-4e2f-9313-fa87fcef944b", "Name": "SampleConfigurationPolicy", "Description": "SampleDescription", "UpdatedAt": "2023-11-28T20:28:04.494000+00:00", "CreatedAt": "2023-11-28T20:28:04.494000+00:00", "ConfigurationPolicy": { "SecurityHub": { "ServiceEnabled": true, "EnabledStandardIdentifiers": [ "arn:aws:securityhub:eu-central-1::standards/aws-foundational-security-best-practices/v/1.0.0", "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0" ], "SecurityControlsConfiguration": { "DisabledSecurityControlIdentifiers": [ "CloudTrail.2" ], "SecurityControlCustomParameters": [ { "SecurityControlId": "ACM.1", "Parameters": { "daysToExpiration": { "ValueType": "CUSTOM", "Value": { "Integer": 15 } } } } ] } } } }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetConfigurationPolicy
섹션을 참조하세요.
-
다음 코드 예시에서는 get-enabled-standards
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
활성화된 표준에 대한 정보를 검색하는 방법
다음
get-enabled-standards
예시에서는 PCI DSS 표준에 대한 정보를 검색합니다.aws securityhub get-enabled-standards \ --standards-subscription-arn
"arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1"
출력:
{ "StandardsSubscriptions": [ { "StandardsArn": "arn:aws:securityhub:us-west-1::standards/pci-dss/v/3.2.1", "StandardsInput": { }, "StandardsStatus": "READY", "StandardsSubscriptionArn": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 AWS Security Hub의 보안 표준 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetEnabledStandards
섹션을 참조하세요.
-
다음 코드 예시에서는 get-finding-aggregator
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
현재 결과 집계 구성을 검색하는 방법
다음
get-finding-aggregator
예시에서는 현재 조사 결과 집계 구성을 검색합니다.aws securityhub get-finding-aggregator \ --finding-aggregator-arn
arn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000
출력:
{ "FindingAggregatorArn": "arn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000", "FindingAggregationRegion": "us-east-1", "RegionLinkingMode": "SPECIFIED_REGIONS", "Regions": "us-west-1,us-west-2" }
자세한 내용은 AWS Security Hub 사용 설명서의 현재 조사 결과 집계 구성 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetFindingAggregator
섹션을 참조하세요.
-
다음 코드 예시에서는 get-finding-history
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
조사 결과 기록을 가져오는 방법
다음
get-finding-history
예시는 지정된 조사 결과에 대한 최근 90일간의 기록을 가져옵니다. 이 예시에서는 결과가 조사 결과 기록에 대한 두 개의 레코드로 제한됩니다.aws securityhub get-finding-history \ --finding-identifier Id="arn:aws:securityhub:us-east-1:123456789012:security-control/S3.17/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",ProductArn="arn:aws:securityhub:us-east-1::product/aws/securityhub"
출력:
{ "Records": [ { "FindingIdentifier": { "Id": "arn:aws:securityhub:us-east-1:123456789012:security-control/S3.17/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-east-1::product/aws/securityhub" }, "UpdateTime": "2023-06-02T03:15:25.685000+00:00", "FindingCreated": false, "UpdateSource": { "Type": "BATCH_IMPORT_FINDINGS", "Identity": "arn:aws:securityhub:us-east-1::product/aws/securityhub" }, "Updates": [ { "UpdatedField": "Compliance.RelatedRequirements", "OldValue": "[\"NIST.800-53.r5 SC-12(2)\",\"NIST.800-53.r5 SC-12(3)\",\"NIST.800-53.r5 SC-12(6)\",\"NIST.800-53.r5 CM-3(6)\",\"NIST.800-53.r5 SC-13\",\"NIST.800-53.r5 SC-28\",\"NIST.800-53.r5 SC-28(1)\",\"NIST.800-53.r5 SC-7(10)\"]", "NewValue": "[\"NIST.800-53.r5 SC-12(2)\",\"NIST.800-53.r5 CM-3(6)\",\"NIST.800-53.r5 SC-13\",\"NIST.800-53.r5 SC-28\",\"NIST.800-53.r5 SC-28(1)\",\"NIST.800-53.r5 SC-7(10)\",\"NIST.800-53.r5 CA-9(1)\",\"NIST.800-53.r5 SI-7(6)\",\"NIST.800-53.r5 AU-9\"]" }, { "UpdatedField": "LastObservedAt", "OldValue": "2023-06-01T09:15:38.587Z", "NewValue": "2023-06-02T03:15:22.946Z" }, { "UpdatedField": "UpdatedAt", "OldValue": "2023-06-01T09:15:31.049Z", "NewValue": "2023-06-02T03:15:14.861Z" }, { "UpdatedField": "ProcessedAt", "OldValue": "2023-06-01T09:15:41.058Z", "NewValue": "2023-06-02T03:15:25.685Z" } ] }, { "FindingIdentifier": { "Id": "arn:aws:securityhub:us-east-1:123456789012:security-control/S3.17/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-east-1::product/aws/securityhub" }, "UpdateTime": "2023-05-23T02:06:51.518000+00:00", "FindingCreated": "true", "UpdateSource": { "Type": "BATCH_IMPORT_FINDINGS", "Identity": "arn:aws:securityhub:us-east-1::product/aws/securityhub" }, "Updates": [] } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 조사 결과 기록 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetFindingHistory
섹션을 참조하세요.
-
다음 코드 예시에서는 get-findings
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 특정 표준에 대해 생성된 조사 결과 반환
다음
get-findings
예시에서는 PCI DSS 표준에 대한 조사 결과를 반환합니다.aws securityhub get-findings \ --filters '
{"GeneratorId":[{"Value": "pci-dss","Comparison":"PREFIX"}]}
' \ --max-items1
출력:
{ "Findings": [ { "SchemaVersion": "2018-10-08", "Id": "arn:aws:securityhub:eu-central-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-west-1::product/aws/securityhub", "GeneratorId": "pci-dss/v/3.2.1/PCI.Lambda.2", "AwsAccountId": "123456789012", "Types": [ "Software and Configuration Checks/Industry and Regulatory Standards/PCI-DSS" ], "FindingProviderFields": { "Severity": { "Original": 0, "Label": "INFORMATIONAL" }, "Types": [ "Software and Configuration Checks/Industry and Regulatory Standards/PCI-DSS" ] }, "FirstObservedAt": "2020-06-02T14:02:49.159Z", "LastObservedAt": "2020-06-02T14:02:52.397Z", "CreatedAt": "2020-06-02T14:02:49.159Z", "UpdatedAt": "2020-06-02T14:02:52.397Z", "Severity": { "Original": 0, "Label": "INFORMATIONAL", "Normalized": 0 }, "Title": "PCI.Lambda.2 Lambda functions should be in a VPC", "Description": "This AWS control checks whether a Lambda function is in a VPC.", "Remediation": { "Recommendation": { "Text": "For directions on how to fix this issue, please consult the AWS Security Hub PCI DSS documentation.", "Url": "https://docs.aws.amazon.com/console/securityhub/PCI.Lambda.2/remediation" } }, "ProductFields": { "StandardsArn": "arn:aws:securityhub:::standards/pci-dss/v/3.2.1", "StandardsSubscriptionArn": "arn:aws:securityhub:us-west-1:123456789012:subscription/pci-dss/v/3.2.1", "ControlId": "PCI.Lambda.2", "RecommendationUrl": "https://docs.aws.amazon.com/console/securityhub/PCI.Lambda.2/remediation", "RelatedAWSResources:0/name": "securityhub-lambda-inside-vpc-0e904a3b", "RelatedAWSResources:0/type": "AWS::Config::ConfigRule", "StandardsControlArn": "arn:aws:securityhub:us-west-1:123456789012:control/pci-dss/v/3.2.1/PCI.Lambda.2", "aws/securityhub/SeverityLabel": "INFORMATIONAL", "aws/securityhub/ProductName": "Security Hub", "aws/securityhub/CompanyName": "AWS", "aws/securityhub/FindingId": "arn:aws:securityhub:eu-central-1::product/aws/securityhub/arn:aws:securityhub:eu-central-1:123456789012:subscription/pci-dss/v/3.2.1/PCI.Lambda.2/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, "Resources": [ { "Type": "AwsAccount", "Id": "AWS::::Account:123456789012", "Partition": "aws", "Region": "us-west-1" } ], "Compliance": { "Status": "PASSED", "RelatedRequirements": [ "PCI DSS 1.2.1", "PCI DSS 1.3.1", "PCI DSS 1.3.2", "PCI DSS 1.3.4" ] }, "WorkflowState": "NEW", "Workflow": { "Status": "NEW" }, "RecordState": "ARCHIVED" } ], "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxfQ==" }
예시 2: 워크플로 상태가 NOTIFIED인 중요 심각도 조사 결과 반환
다음
get-findings
예시에서는 심각도 레이블 값이 CRITICAL이고 워크플로 상태가 NOTIFIED인 조사 결과를 반환합니다. 결과는 신뢰도 값에 따라 내림차순으로 정렬됩니다.aws securityhub get-findings \ --filters '
{"SeverityLabel":[{"Value": "CRITICAL","Comparison":"EQUALS"}],"WorkflowStatus": [{"Value":"NOTIFIED","Comparison":"EQUALS"}]}
' \ --sort-criteria '{ "Field": "Confidence", "SortOrder": "desc"}
' \ --max-items1
출력:
{ "Findings": [ { "SchemaVersion": "2018-10-08", "Id": "arn:aws:securityhub:us-west-1: 123456789012:subscription/cis-aws-foundations-benchmark/v/1.2.0/1.13/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ProductArn": "arn:aws:securityhub:us-west-2::product/aws/securityhub", "GeneratorId": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0/rule/1.13", "AwsAccountId": "123456789012", "Types": [ "Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark" ], "FindingProviderFields" { "Severity": { "Original": 90, "Label": "CRITICAL" }, "Types": [ "Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark" ] }, "FirstObservedAt": "2020-05-21T20:16:34.752Z", "LastObservedAt": "2020-06-09T08:16:37.171Z", "CreatedAt": "2020-05-21T20:16:34.752Z", "UpdatedAt": "2020-06-09T08:16:36.430Z", "Severity": { "Original": 90, "Label": "CRITICAL", "Normalized": 90 }, "Title": "1.13 Ensure MFA is enabled for the \"root\" account", "Description": "The root account is the most privileged user in an AWS account. MFA adds an extra layer of protection on top of a user name and password. With MFA enabled, when a user signs in to an AWS website, they will be prompted for their user name and password as well as for an authentication code from their AWS MFA device.", "Remediation": { "Recommendation": { "Text": "For directions on how to fix this issue, please consult the AWS Security Hub CIS documentation.", "Url": "https://docs.aws.amazon.com/console/securityhub/standards-cis-1.13/remediation" } }, "ProductFields": { "StandardsGuideArn": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0", "StandardsGuideSubscriptionArn": "arn:aws:securityhub:us-west-1:123456789012:subscription/cis-aws-foundations-benchmark/v/1.2.0", "RuleId": "1.13", "RecommendationUrl": "https://docs.aws.amazon.com/console/securityhub/standards-cis-1.13/remediation", "RelatedAWSResources:0/name": "securityhub-root-account-mfa-enabled-5pftha", "RelatedAWSResources:0/type": "AWS::Config::ConfigRule", "StandardsControlArn": "arn:aws:securityhub:us-west-1:123456789012:control/cis-aws-foundations-benchmark/v/1.2.0/1.13", "aws/securityhub/SeverityLabel": "CRITICAL", "aws/securityhub/ProductName": "Security Hub", "aws/securityhub/CompanyName": "AWS", "aws/securityhub/FindingId": "arn:aws:securityhub:us-west-1::product/aws/securityhub/arn:aws:securityhub:us-west-1:123456789012:subscription/cis-aws-foundations-benchmark/v/1.2.0/1.13/finding/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, "Resources": [ { "Type": "AwsAccount", "Id": "AWS::::Account:123456789012", "Partition": "aws", "Region": "us-west-1" } ], "Compliance": { "Status": "FAILED" }, "WorkflowState": "NEW", "Workflow": { "Status": "NOTIFIED" }, "RecordState": "ACTIVE" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 조사 결과 필터링 및 그룹화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetFindings
섹션을 참조하세요.
-
다음 코드 예시에서는 get-insight-results
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
인사이트에 대한 결과를 검색하는 방법
다음
get-insight-results
예시에서는 지정된 ARN을 가진 인사이트에 대한 인사이트 결과 목록을 반환합니다.aws securityhub get-insight-results \ --insight-arn
"arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
출력:
{ "InsightResults": { "GroupByAttribute": "ResourceId", "InsightArn": "arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "ResultValues": [ { "Count": 10, "GroupByAttributeValue": "AWS::::Account:123456789111" }, { "Count": 3, "GroupByAttributeValue": "AWS::::Account:123456789222" } ] } }
자세한 내용은 AWS Security Hub 사용 설명서의 인사이트 결과 및 조사 결과 보기 및 조치 실행 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetInsightResults
섹션을 참조하세요.
-
다음 코드 예시에서는 get-insights
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
인사이트에 대한 세부 정보를 검색하는 방법
다음
get-insights
예시에서는 지정된 ARN을 사용하여 인사이트에 대한 구성 세부 정보를 검색합니다.aws securityhub get-insights \ --insight-arns
"arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
출력:
{ "Insights": [ { "Filters": { "ResourceType": [ { "Comparison": "EQUALS", "Value": "AwsIamRole" } ], "SeverityLabel": [ { "Comparison": "EQUALS", "Value": "CRITICAL" } ], }, "GroupByAttribute": "ResourceId", "InsightArn": "arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "Critical role findings" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 AWS Security Hub의 인사이트 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetInsights
섹션을 참조하세요.
-
다음 코드 예시에서는 get-invitations-count
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
수락되지 않은 초대 수를 검색하는 방법
다음
get-invitations-count
예시에서는 요청하는 계정이 초대를 거부했거나 응답하지 않은 초대 수를 검색합니다.aws securityhub get-invitations-count
출력:
{ "InvitationsCount": 3 }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetInvitationsCount
섹션을 참조하세요.
-
다음 코드 예시에서는 get-master-account
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
관리자 계정에 대한 정보를 검색하는 방법
다음
get-master-account
예시에서는 요청 계정의 관리자 계정에 대한 정보를 검색합니다.aws securityhub get-master-account
출력:
{ "Master": { "AccountId": "123456789012", "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", "InvitedAt": 2020-06-01T20:21:18.042000+00:00, "MemberStatus": "ASSOCIATED" } }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetMasterAccount
섹션을 참조하세요.
-
다음 코드 예시에서는 get-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
선택한 멤버 계정에 대한 정보 검색
다음
get-members
예시에서는 지정된 멤버 계정에 대한 정보를 검색합니다.aws securityhub get-members \ --account-ids
"444455556666"
"777788889999"
출력:
{ "Members": [ { "AccountId": "123456789111", "AdministratorId": "123456789012", "InvitedAt": 2020-06-01T20:15:15.289000+00:00, "MasterId": "123456789012", "MemberStatus": "ASSOCIATED", "UpdatedAt": 2020-06-01T20:15:15.289000+00:00 }, { "AccountId": "123456789222", "AdministratorId": "123456789012", "InvitedAt": 2020-06-01T20:15:15.289000+00:00, "MasterId": "123456789012", "MemberStatus": "ASSOCIATED", "UpdatedAt": 2020-06-01T20:15:15.289000+00:00 } ], "UnprocessedAccounts": [ ] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 get-security-control-definition
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
보안 제어 정의 세부 정보를 가져오는 방법
다음
get-security-control-definition
예시에서는 Security Hub 보안 제어에 대한 정의 세부 정보를 검색합니다. 세부 정보에는 제어 제목, 설명, 리전 사용 가능성, 파라미터 및 기타 정보가 포함됩니다.aws securityhub get-security-control-definition \ --security-control-id
ACM.1
출력:
{ "SecurityControlDefinition": { "SecurityControlId": "ACM.1", "Title": "Imported and ACM-issued certificates should be renewed after a specified time period", "Description": "This control checks whether an AWS Certificate Manager (ACM) certificate is renewed within the specified time period. It checks both imported certificates and certificates provided by ACM. The control fails if the certificate isn't renewed within the specified time period. Unless you provide a custom parameter value for the renewal period, Security Hub uses a default value of 30 days.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/ACM.1/remediation", "SeverityRating": "MEDIUM", "CurrentRegionAvailability": "AVAILABLE", "ParameterDefinitions": { "daysToExpiration": { "Description": "Number of days within which the ACM certificate must be renewed", "ConfigurationOptions": { "Integer": { "DefaultValue": 30, "Min": 14, "Max": 365 } } } } } }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 제어 파라미터 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 GetSecurityControlDefinition
섹션을 참조하세요.
-
다음 코드 예시에서는 invite-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 초대장 보내기
다음
invite-members
예시에서는 지정된 멤버 계정으로 초대를 보냅니다.aws securityhub invite-members \ --account-ids
"123456789111"
"123456789222"
출력:
{ "UnprocessedAccounts": [] }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 InviteMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 list-automation-rules
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
자동화 규칙 목록을 보는 방법
다음
list-automation-rules
예시에서는 AWS 계정에 대한 자동화 규칙을 나열합니다. Security Hub 관리자 계정만 이 명령을 실행할 수 있습니다.aws securityhub list-automation-rules \ --max-results
3
\ --next-tokenNULL
출력:
{ "AutomationRulesMetadata": [ { "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "RuleStatus": "ENABLED", "RuleOrder": 1, "RuleName": "Suppress informational findings", "Description": "Suppress GuardDuty findings with Informational severity", "IsTerminal": false, "CreatedAt": "2023-05-31T17:56:14.837000+00:00", "UpdatedAt": "2023-05-31T17:59:38.466000+00:00", "CreatedBy": "arn:aws:iam::123456789012:role/Admin" }, { "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "RuleStatus": "ENABLED", "RuleOrder": 1, "RuleName": "sample rule", "Description": "A sample rule", "IsTerminal": false, "CreatedAt": "2023-07-15T23:37:20.223000+00:00", "UpdatedAt": "2023-07-15T23:37:20.223000+00:00", "CreatedBy": "arn:aws:iam::123456789012:role/Admin" }, { "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "RuleStatus": "ENABLED", "RuleOrder": 1, "RuleName": "sample rule", "Description": "A sample rule", "IsTerminal": false, "CreatedAt": "2023-07-15T23:45:25.126000+00:00", "UpdatedAt": "2023-07-15T23:45:25.126000+00:00", "CreatedBy": "arn:aws:iam::123456789012:role/Admin" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 자동화 규칙 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListAutomationRules
섹션을 참조하세요.
-
다음 코드 예시에서는 list-configuration-policies
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 정책 요약을 나열하는 방법
다음
list-configuration-policies
예시에서는 조직의 구성 정책 요약을 나열합니다.aws securityhub list-configuration-policies \ --max-items
3
출력:
{ "ConfigurationPolicySummaries": [ { "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "SampleConfigurationPolicy1", "Description": "SampleDescription1", "UpdatedAt": "2023-09-26T21:08:36.214000+00:00", "ServiceEnabled": true }, { "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Name": "SampleConfigurationPolicy2", "Description": "SampleDescription2" "UpdatedAt": "2023-11-28T19:26:25.207000+00:00", "ServiceEnabled": true }, { "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "Name": "SampleConfigurationPolicy3", "Description": "SampleDescription3", "UpdatedAt": "2023-11-28T20:28:04.494000+00:00", "ServiceEnabled": true } }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListConfigurationPolicies
섹션을 참조하세요.
-
다음 코드 예시에서는 list-configuration-policy-associations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 연결을 나열하는 방법
다음
list-configuration-policy-associations
예시에서는 조직의 구성 연결 요약을 나열합니다. 응답에는 구성 정책 및 자체 관리 동작과의 연결이 포함됩니다.aws securityhub list-configuration-policy-associations \ --association-type
"APPLIED"
\ --max-items4
출력:
{ "ConfigurationPolicyAssociationSummaries": [ { "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "TargetId": "r-1ab2", "TargetType": "ROOT", "AssociationType": "APPLIED", "UpdatedAt": "2023-11-28T19:26:49.417000+00:00", "AssociationStatus": "FAILED", "AssociationStatusMessage": "Policy association failed because 2 organizational units or accounts under this root failed." }, { "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "TargetId": "ou-1ab2-c3de4f5g", "TargetType": "ORGANIZATIONAL_UNIT", "AssociationType": "APPLIED", "UpdatedAt": "2023-09-26T21:14:05.283000+00:00", "AssociationStatus": "FAILED", "AssociationStatusMessage": "One or more children under this target failed association." }, { "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "TargetId": "ou-6hi7-8j91kl2m", "TargetType": "ORGANIZATIONAL_UNIT", "AssociationType": "APPLIED", "UpdatedAt": "2023-09-26T21:13:01.816000+00:00", "AssociationStatus": "SUCCESS", "AssociationStatusMessage": "Association applied successfully on this target." }, { "ConfigurationPolicyId": "SELF_MANAGED_SECURITY_HUB", "TargetId": "111122223333", "TargetType": "ACCOUNT", "AssociationType": "APPLIED", "UpdatedAt": "2023-11-28T22:01:26.409000+00:00", "AssociationStatus": "SUCCESS" } }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListConfigurationPolicyAssociations
섹션을 참조하세요.
-
다음 코드 예시에서는 list-enabled-products-for-import
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
활성화된 제품 통합 목록을 반환하는 방법
다음
list-enabled-products-for-import
예시에서는 현재 활성화된 제품 통합에 대한 구독 ARNS 목록을 반환합니다.aws securityhub list-enabled-products-for-import
출력:
{ "ProductSubscriptions": [ "arn:aws:securityhub:us-west-1:123456789012:product-subscription/crowdstrike/crowdstrike-falcon", "arn:aws:securityhub:us-west-1:123456789012:product-subscription/aws/securityhub" ] }
자세한 내용은 AWS Security Hub 사용 설명서의 제품 통합 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListEnabledProductsForImport
섹션을 참조하세요.
-
다음 코드 예시에서는 list-finding-aggregators
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용 가능한 위젯을 나열하는 방법
다음
list-finding-aggregators
예시에서는 조사 결과 집계 구성의 ARN을 반환합니다.aws securityhub list-finding-aggregators
출력:
{ "FindingAggregatorArn": "arn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000" }
자세한 내용은 AWS Security Hub 사용 설명서의 현재 조사 결과 집계 구성 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListFindingAggregators
섹션을 참조하세요.
-
다음 코드 예시에서는 list-invitations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
초대 목록을 표시하는 방법
다음
list-invitations
예시에서는 요청 계정으로 전송된 초대 목록을 검색합니다.aws securityhub list-invitations
출력:
{ "Invitations": [ { "AccountId": "123456789012", "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", "InvitedAt": 2020-06-01T20:21:18.042000+00:00, "MemberStatus": "ASSOCIATED" } ], }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListInvitations
섹션을 참조하세요.
-
다음 코드 예시에서는 list-members
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
멤버 계정 목록 검색
다음
list-members
예시에서는 요청하는 관리자 계정의 멤버 계정 목록을 반환합니다.aws securityhub list-members
출력:
{ "Members": [ { "AccountId": "123456789111", "AdministratorId": "123456789012", "InvitedAt": 2020-06-01T20:15:15.289000+00:00, "MasterId": "123456789012", "MemberStatus": "ASSOCIATED", "UpdatedAt": 2020-06-01T20:15:15.289000+00:00 }, { "AccountId": "123456789222", "AdministratorId": "123456789012", "InvitedAt": 2020-06-01T20:15:15.289000+00:00, "MasterId": "123456789012", "MemberStatus": "ASSOCIATED", "UpdatedAt": 2020-06-01T20:15:15.289000+00:00 } ], }
자세한 내용은 AWS Security Hub 사용 설명서의 관리자 및 멤버 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListMembers
섹션을 참조하세요.
-
다음 코드 예시에서는 list-organization-admin-accounts
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
지정된 Security Hub 관리자 계정 나열
다음
list-organization-admin-accounts
예시에서는 조직의 Security Hub 관리자 계정입니다.aws securityhub list-organization-admin-accounts
출력:
{ AdminAccounts": [ { "AccountId": "777788889999" }, { "Status": "ENABLED" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 관리자 계정 지정 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListOrganizationAdminAccounts
섹션을 참조하세요.
-
다음 코드 예시에서는 list-security-control-definitions
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 사용 가능한 모든 보안 제어를 나열
다음
list-security-control-definitions
예시에서는 모든 Security Hub 표준에서 사용 가능한 보안 제어를 나열합니다. 이 예시에서는 결과를 세 가지 제어로 제한합니다.aws securityhub list-security-control-definitions \ --max-items
3
출력:
{ "SecurityControlDefinitions": [ { "SecurityControlId": "ACM.1", "Title": "Imported and ACM-issued certificates should be renewed after a specified time period", "Description": "This control checks whether an AWS Certificate Manager (ACM) certificate is renewed within the specified time period. It checks both imported certificates and certificates provided by ACM. The control fails if the certificate isn't renewed within the specified time period. Unless you provide a custom parameter value for the renewal period, Security Hub uses a default value of 30 days.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/ACM.1/remediation", "SeverityRating": "MEDIUM", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [ "Parameters" ] }, { "SecurityControlId": "ACM.2", "Title": "RSA certificates managed by ACM should use a key length of at least 2,048 bits", "Description": "This control checks whether RSA certificates managed by AWS Certificate Manager use a key length of at least 2,048 bits. The control fails if the key length is smaller than 2,048 bits.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/ACM.2/remediation", "SeverityRating": "HIGH", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [] }, { "SecurityControlId": "APIGateway.1", "Title": "API Gateway REST and WebSocket API execution logging should be enabled", "Description": "This control checks whether all stages of an Amazon API Gateway REST or WebSocket API have logging enabled. The control fails if the 'loggingLevel' isn't 'ERROR' or 'INFO' for all stages of the API. Unless you provide custom parameter values to indicate that a specific log type should be enabled, Security Hub produces a passed finding if the logging level is either 'ERROR' or 'INFO'.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/APIGateway.1/remediation", "SeverityRating": "MEDIUM", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [ "Parameters" ] } ], "NextToken": "U2FsdGVkX1/UprCPzxVbkDeHikDXbDxfgJZ1w2RG1XWsFPTMTIQPVE0m/FduIGxS7ObRtAbaUt/8/RCQcg2PU0YXI20hH/GrhoOTgv+TSm0qvQVFhkJepWmqh+NYawjocVBeos6xzn/8qnbF9IuwGg==" }
자세한 내용은 AWS Security Hub 사용 설명서의 표준에 대한 세부 정보 보기 섹션을 참조하세요.
예시 2: 특정 표준에 사용 가능한 보안 제어 나열
다음
list-security-control-definitions
예시에서는 CIS AWS Foundation Benchmark v1.4.0에 사용 가능한 보안 제어를 나열합니다. 이 예시에서는 결과를 세 가지 제어로 제한합니다.aws securityhub list-security-control-definitions \ --standards-arn
"arn:aws:securityhub:us-east-1::standards/cis-aws-foundations-benchmark/v/1.4.0"
\ --max-items3
출력:
{ "SecurityControlDefinitions": [ { "SecurityControlId": "CloudTrail.1", "Title": "CloudTrail should be enabled and configured with at least one multi-Region trail that includes read and write management events", "Description": "This AWS control checks that there is at least one multi-region AWS CloudTrail trail includes read and write management events.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/CloudTrail.1/remediation", "SeverityRating": "HIGH", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [] }, { "SecurityControlId": "CloudTrail.2", "Title": "CloudTrail should have encryption at-rest enabled", "Description": "This AWS control checks whether AWS CloudTrail is configured to use the server side encryption (SSE) AWS Key Management Service (AWS KMS) customer master key (CMK) encryption. The check will pass if the KmsKeyId is defined.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/CloudTrail.2/remediation", "SeverityRating": "MEDIUM", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [] }, { "SecurityControlId": "CloudTrail.4", "Title": "CloudTrail log file validation should be enabled", "Description": "This AWS control checks whether CloudTrail log file validation is enabled.", "RemediationUrl": "https://docs.aws.amazon.com/console/securityhub/CloudTrail.4/remediation", "SeverityRating": "MEDIUM", "CurrentRegionAvailability": "AVAILABLE", "CustomizableProperties": [] } ], "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAzfQ==" }
자세한 내용은 AWS Security Hub 사용 설명서의 표준에 대한 세부 정보 보기 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListSecurityControlDefinitions
섹션을 참조하세요.
-
다음 코드 예시에서는 list-standards-control-associations
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
활성화된 각 표준에서 제어의 활성화 상태를 가져오는 방법
다음
list-standards-control-associations
예시에서는 활성화된 각 표준에서 CloudTrail.1의 활성화 상태를 나열합니다.aws securityhub list-standards-control-associations \ --security-control-id
CloudTrail.1
출력:
{ "StandardsControlAssociationSummaries": [ { "StandardsArn": "arn:aws:securityhub:us-east-2::standards/nist-800-53/v/5.0.0", "SecurityControlId": "CloudTrail.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/CloudTrail.1", "AssociationStatus": "ENABLED", "RelatedRequirements": [ "NIST.800-53.r5 AC-2(4)", "NIST.800-53.r5 AC-4(26)", "NIST.800-53.r5 AC-6(9)", "NIST.800-53.r5 AU-10", "NIST.800-53.r5 AU-12", "NIST.800-53.r5 AU-2", "NIST.800-53.r5 AU-3", "NIST.800-53.r5 AU-6(3)", "NIST.800-53.r5 AU-6(4)", "NIST.800-53.r5 AU-14(1)", "NIST.800-53.r5 CA-7", "NIST.800-53.r5 SC-7(9)", "NIST.800-53.r5 SI-3(8)", "NIST.800-53.r5 SI-4(20)", "NIST.800-53.r5 SI-7(8)", "NIST.800-53.r5 SA-8(22)" ], "UpdatedAt": "2023-05-15T17:52:21.304000+00:00", "StandardsControlTitle": "CloudTrail should be enabled and configured with at least one multi-Region trail that includes read and write management events", "StandardsControlDescription": "This AWS control checks that there is at least one multi-region AWS CloudTrail trail includes read and write management events." }, { "StandardsArn": "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0", "SecurityControlId": "CloudTrail.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/CloudTrail.1", "AssociationStatus": "ENABLED", "RelatedRequirements": [ "CIS AWS Foundations 2.1" ], "UpdatedAt": "2020-02-10T21:22:53.998000+00:00", "StandardsControlTitle": "Ensure CloudTrail is enabled in all regions", "StandardsControlDescription": "AWS CloudTrail is a web service that records AWS API calls for your account and delivers log files to you. The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service." }, { "StandardsArn": "arn:aws:securityhub:us-east-2::standards/aws-foundational-security-best-practices/v/1.0.0", "SecurityControlId": "CloudTrail.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/CloudTrail.1", "AssociationStatus": "DISABLED", "RelatedRequirements": [], "UpdatedAt": "2023-05-15T19:31:52.671000+00:00", "UpdatedReason": "Alternative compensating controls are in place", "StandardsControlTitle": "CloudTrail should be enabled and configured with at least one multi-Region trail that includes read and write management events", "StandardsControlDescription": "This AWS control checks that there is at least one multi-region AWS CloudTrail trail includes read and write management events." }, { "StandardsArn": "arn:aws:securityhub:us-east-2::standards/cis-aws-foundations-benchmark/v/1.4.0", "SecurityControlId": "CloudTrail.1", "SecurityControlArn": "arn:aws:securityhub:us-east-2:123456789012:security-control/CloudTrail.1", "AssociationStatus": "ENABLED", "RelatedRequirements": [ "CIS AWS Foundations Benchmark v1.4.0/3.1" ], "UpdatedAt": "2022-11-10T15:40:36.021000+00:00", "StandardsControlTitle": "Ensure CloudTrail is enabled in all regions", "StandardsControlDescription": "AWS CloudTrail is a web service that records AWS API calls for your account and delivers log files to you. The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service. CloudTrail provides a history of AWS API calls for an account, including API calls made via the Management Console, SDKs, command line tools, and higher-level AWS services (such as CloudFormation)." } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 특정 표준에서 제어 활성화 및 비활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 ListStandardsControlAssociations
섹션을 참조하세요.
-
다음 코드 예시에서는 list-tags-for-resource
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
리소스에 할당된 태그를 검색하는 방법
다음
list-tags-for-resource
예시에서는 지정된 허브 리소스에 할당된 태그를 반환합니다.aws securityhub list-tags-for-resource \ --resource-arn
"arn:aws:securityhub:us-west-1:123456789012:hub/default"
출력:
{ "Tags": { "Department" : "Operations", "Area" : "USMidwest" } }
자세한 내용은 AWS CloudFormation 사용 설명서의 AWS::SecurityHub::Hub 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI Command Reference의 ListTagsForResource
를 참조하세요.
-
다음 코드 예시에서는 start-configuration-policy-association
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 구성 정책 연결
다음
start-configuration-policy-association
예시에서는 지정된 구성 정책을 지정된 조직 단위와 연결합니다. 구성은 대상 계정, 조직 단위 또는 루트에 연결될 수 있습니다.aws securityhub start-configuration-policy-association \ --configuration-policy-identifier
"arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
\ --target '{"OrganizationalUnitId": "ou-6hi7-8j91kl2m"}
'출력:
{ "ConfigurationPolicyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "TargetId": "ou-6hi7-8j91kl2m", "TargetType": "ORGANIZATIONAL_UNIT", "AssociationType": "APPLIED", "UpdatedAt": "2023-11-29T17:40:52.468000+00:00", "AssociationStatus": "PENDING" }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 생성 및 연결 섹션을 참조하세요
예시 2: 자체 관리형 구성 연결
다음
start-configuration-policy-association
예시에서는 자체 관리형 구성을 지정된 계정과 연결합니다.aws securityhub start-configuration-policy-association \ --configuration-policy-identifier
"SELF_MANAGED_SECURITY_HUB"
\ --target '{"OrganizationalUnitId": "123456789012"}
'출력:
{ "ConfigurationPolicyId": "SELF_MANAGED_SECURITY_HUB", "TargetId": "123456789012", "TargetType": "ACCOUNT", "AssociationType": "APPLIED", "UpdatedAt": "2023-11-29T17:40:52.468000+00:00", "AssociationStatus": "PENDING" }
자세한 내용은 AWS Security Hub 사용 설명서의 Security Hub 구성 정책 생성 및 연결 섹션을 참조하세요
-
API 세부 정보는 AWS CLI 명령 참조의 StartConfigurationPolicyAssociation
섹션을 참조하세요.
-
다음 코드 예시에서는 start-configuration-policy-disassociation
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 구성 정책의 연결을 해제
다음
start-configuration-policy-disassociation
예시에서는 지정된 조직 단위에서 구성 정책을 연결 해제합니다. 구성은 대상 계정, 조직 단위 또는 루트에서 연결 해제될 수 있습니다.aws securityhub start-configuration-policy-disassociation \ --configuration-policy-identifier
"arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
\ --target '{"OrganizationalUnitId": "ou-6hi7-8j91kl2m"}
'이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 계정 및 OU에서 구성 연결 해제 섹션을 참조하세요.
예시 2: 자체 관리형 구성의 연결 해제
다음
start-configuration-policy-disassociation
예시에서는 지정된 계정에서 자체 관리형 구성을 연결 해제합니다.aws securityhub start-configuration-policy-disassociation \ --configuration-policy-identifier
"SELF_MANAGED_SECURITY_HUB"
\ --target '{"AccountId": "123456789012"}
'이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 계정 및 OU에서 구성 연결 해제 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 StartConfigurationPolicyDisassociation
섹션을 참조하세요.
-
다음 코드 예시에서는 tag-resource
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
리소스에 태그 할당
다음
tag-resource
예시에서는 부서 및 영역 태그의 값을 지정된 허브 리소스에 할당합니다.aws securityhub tag-resource \ --resource-arn
"arn:aws:securityhub:us-west-1:123456789012:hub/default"
\ --tags '{"Department":"Operations", "Area":"USMidwest"}
'이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS CloudFormation 사용 설명서의 AWS::SecurityHub::Hub 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 TagResource
를 참조하세요.
-
다음 코드 예시에서는 untag-resource
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
리소스에서 태그 값 제거
다음
untag-resource
예시에서는 지정된 허브 리소스에서 부서 태그를 제거합니다.aws securityhub untag-resource \ --resource-arn
"arn:aws:securityhub:us-west-1:123456789012:hub/default"
\ --tag-keys"Department"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS CloudFormation 사용 설명서의 AWS::SecurityHub::Hub 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI Command Reference의 UntagResource
를 참조하세요.
-
다음 코드 예시에서는 update-action-target
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
사용자 지정 작업을 업데이트하는 방법
다음
update-action-target
예시에서는 지정된 ARN으로 식별된 사용자 지정 작업의 이름을 업데이트합니다.aws securityhub update-action-target \ --action-target-arn
"arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation"
\ --name"Send to remediation"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 작업 생성 및 CloudWatch Events 규칙과 연결 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateActionTarget
섹션을 참조하세요.
-
다음 코드 예시에서는 update-configuration-policy
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
구성 정책 업데이트
다음
update-configuration-policy
예시에서는 지정된 설정을 사용하도록 기존 구성 정책을 업데이트합니다.aws securityhub update-configuration-policy \ --identifier
"arn:aws:securityhub:eu-central-1:508236694226:configuration-policy/09f37766-57d8-4ede-9d33-5d8b0fecf70e"
\ --name"SampleConfigurationPolicyUpdated"
\ --description"SampleDescriptionUpdated"
\ --configuration-policy '{"SecurityHub": {"ServiceEnabled": true, "EnabledStandardIdentifiers": ["arn:aws:securityhub:eu-central-1::standards/aws-foundational-security-best-practices/v/1.0.0","arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0"],"SecurityControlsConfiguration":{"DisabledSecurityControlIdentifiers": ["CloudWatch.1"], "SecurityControlCustomParameters": [{"SecurityControlId": "ACM.1", "Parameters": {"daysToExpiration": {"ValueType": "CUSTOM", "Value": {"Integer": 21}}}}]}}}
' \ --updated-reason"Disabling CloudWatch.1 and changing parameter value"
출력:
{ "Arn": "arn:aws:securityhub:eu-central-1:123456789012:configuration-policy/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "SampleConfigurationPolicyUpdated", "Description": "SampleDescriptionUpdated", "UpdatedAt": "2023-11-28T20:28:04.494000+00:00", "CreatedAt": "2023-11-28T20:28:04.494000+00:00", "ConfigurationPolicy": { "SecurityHub": { "ServiceEnabled": true, "EnabledStandardIdentifiers": [ "arn:aws:securityhub:eu-central-1::standards/aws-foundational-security-best-practices/v/1.0.0", "arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0" ], "SecurityControlsConfiguration": { "DisabledSecurityControlIdentifiers": [ "CloudWatch.1" ], "SecurityControlCustomParameters": [ { "SecurityControlId": "ACM.1", "Parameters": { "daysToExpiration": { "ValueType": "CUSTOM", "Value": { "Integer": 21 } } } } ] } } } }
자세한 내용은 AWS Security Hub 사용 안내서의 Security Hub 구성 정책 업데이트 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateConfigurationPolicy
섹션을 참조하세요.
-
다음 코드 예시에서는 update-finding-aggregator
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
현재 결과 집계 구성을 업데이트하는 방법
다음
update-finding-aggregator
예시에서는 조사 결과 집계 구성을 선택한 리전에서 연결하도록 변경합니다. 집계 영역인 미국 동부(버지니아)에서 운영됩니다. 미국 서부(캘리포니아 북부)와 미국 서부(오레곤)를 연결 리전으로 선택합니다.aws securityhub update-finding-aggregator \ --region
us-east-1
\ --finding-aggregator-arnarn:aws:securityhub:us-east-1:222222222222:finding-aggregator/123e4567-e89b-12d3-a456-426652340000
\ --region-linking-modeSPECIFIED_REGIONS
\ --regionsus-west-1,us-west-2
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 안내서의 조사 결과 집계 구성 업데이트 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateFindingAggregator
섹션을 참조하세요.
-
다음 코드 예시에서는 update-insight
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 사용자 지정 인사이트의 필터 변경
다음
update-insight
예시에서는 사용자 지정 인사이트의 필터를 변경합니다. 업데이트된 인사이트는 AWS 역할과 관련된 심각도가 높은 조사 결과를 찾습니다.aws securityhub update-insight \ --insight-arn
"arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
\ --filters '{"ResourceType": [{ "Comparison": "EQUALS", "Value": "AwsIamRole"}], "SeverityLabel": [{"Comparison": "EQUALS", "Value": "HIGH"}]}
' \ --name"High severity role findings"
예시 2: 사용자 지정 인사이트의 그룹화 속성 변경
다음
update-insight
예시에서는 지정된 ARN으로 사용자 지정 인사이트의 그룹화 속성을 변경합니다. 새 그룹화 속성은 리소스 ID입니다.aws securityhub update-insight \ --insight-arn
"arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
\ --group-by-attribute"ResourceId"
\ --name"Critical role findings"
출력:
{ "Insights": [ { "InsightArn": "arn:aws:securityhub:us-west-1:123456789012:insight/123456789012/custom/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Name": "Critical role findings", "Filters": { "SeverityLabel": [ { "Value": "CRITICAL", "Comparison": "EQUALS" } ], "ResourceType": [ { "Value": "AwsIamRole", "Comparison": "EQUALS" } ] }, "GroupByAttribute": "ResourceId" } ] }
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 인사이트 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateInsight
섹션을 참조하세요.
-
다음 코드 예시에서는 update-organization-configuration
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
조직에 대해 Security Hub를 구성하는 방법을 업데이트하는 방법
다음
update-organization-configuration
예시에서는 Security Hub가 중앙 구성을 사용하여 조직을 구성하도록 지정합니다. 이 명령을 실행한 후 위임받은 Security Hub 관리자는 조직을 구성하기 위한 구성 정책을 만들고 관리할 수 있습니다. 위임된 관리자는 이 명령을 사용하여 중앙 구성에서 로컬 구성으로 전환할 수도 있습니다. 로컬 구성이 구성 유형인 경우 위임된 관리자는 새 조직 계정에서 Security Hub 및 기본 보안 표준을 자동으로 사용 설정할지 여부를 선택할 수 있습니다.aws securityhub update-organization-configuration \ --no-auto-enable \ --organization-configuration '
{"ConfigurationType": "CENTRAL"}
'이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 AWS Organizations를 사용하여 계정 관리 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateOrganizationConfiguration
섹션을 참조하세요.
-
다음 코드 예시에서는 update-security-control
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
보안 제어 속성을 업데이트하는 방법
다음
update-security-control
예시에서는 Security Hub 보안 제어 파라미터에 대한 사용자 지정 값을 지정합니다.aws securityhub update-security-control \ --security-control-id
ACM.1
\ --parameters '{"daysToExpiration": {"ValueType": "CUSTOM", "Value": {"Integer": 15}}}
' \ --last-update-reason"Internal compliance requirement"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 사용자 지정 제어 파라미터 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateSecurityControl
섹션을 참조하세요.
-
다음 코드 예시에서는 update-security-hub-configuration
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
Security Hub 구성 업데이트
다음
update-security-hub-configuration
예시에서는 활성화된 표준에 대해 새로운 제어 기능을 자동으로 사용하도록 Security Hub를 구성합니다.aws securityhub update-security-hub-configuration \ --auto-enable-controls
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 새 제어 자동 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateSecurityHubConfiguration
섹션을 참조하세요.
-
다음 코드 예시에서는 update-standards-control
코드를 사용하는 방법을 보여줍니다.
- AWS CLI
-
예시 1: 제어 비활성화
다음
update-standards-control
예시에서는 PCI.AutoScaling.1 제어를 비활성화합니다.aws securityhub update-standards-control \ --standards-control-arn
"arn:aws:securityhub:us-west-1:123456789012:control/pci-dss/v/3.2.1/PCI.AutoScaling.1"
\ --control-status"DISABLED"
\ --disabled-reason"Not applicable for my service"
이 명령은 출력을 생성하지 않습니다.
예시 2: 제어 활성화
다음
update-standards-control
예시에서는 PCI.AutoScaling.1 제어를 활성화합니다.aws securityhub update-standards-control \ --standards-control-arn
"arn:aws:securityhub:us-west-1:123456789012:control/pci-dss/v/3.2.1/PCI.AutoScaling.1"
\ --control-status"ENABLED"
이 명령은 출력을 생성하지 않습니다.
자세한 내용은 AWS Security Hub 사용 설명서의 개별 제어 비활성화 및 활성화 섹션을 참조하세요.
-
API 세부 정보는 AWS CLI 명령 참조의 UpdateStandardsControl
섹션을 참조하세요.
-