ããã«ã¡ã¯ãç¢é(å¬)ã§ãã
以åã¯é«ãã£ãAWS Configã®ã«ã¼ã«ã®è²»ç¨ã大å¹
ã«å¼ãä¸ãããã¦ãããå©ç¨ãããæ¹ãå¢ãã¦ããã®ã§ã¯ãªããã¨æãã¾ãã
æ¬è¨äºã§ã¯AWS Configã®ããã¼ã¸ãã«ã¼ã«ã®ã²ã¨ã¤ã§ãããrequired-tagsããè¨å®ããã«ã¼ã«è©ä¾¡å¯¾è±¡ã¨ãããªã½ã¼ã¹ãéæºæ å¤å®ãããæã«ãEã¡ã¼ã«ã§éç¥ãããããã«ãã¦ã¿ã¾ããã
ç¸å¤ããã親åãªAWSå
¬å¼ã«è¨äºãããã¾ããã®ã§åèã«ãã¤ã¤é²ãã¦ã¿ã¾ãã
- æ§æå³
- æ§ç¯é
- ç°å¢æ§ç¯æé 詳細
- 1ï¼AWS Configã«ã¼ã«ã®ä½æ
- 1-1ï¼AWS Configã«ç§»åããã«ã¼ã«ã追å ããã¯ãªãã¯
- 1-2ï¼ã«ã¼ã«ã¿ã¤ããAWSããã¼ã¸ãåã«ãã¦ãrequired-tagsããé¸æãã次ã¸ãã§é²ã
- 1-3ï¼ãã«ã¼ã«ã®è¨å®ãã§ä»¥ä¸ã®ããã«æå®ãã次ã¸ãã§é²ã
- 1-4ï¼è¨å®å 容ã確èªããã«ã¼ã«ã追å ããã¯ãªãã¯
- 2ï¼SNSãããã¯ã®ä½æ
- 3ï¼EventBridgeã«ã¼ã«ã®ä½æ
- 4ï¼åä½ç¢ºèª
- ãã¾ã
- æé
- 1ï¼AWS Configã«ã¼ã«ã®ä½æ
- ãããã«
æ§æå³
AWS Configã«ã¼ã«ããrequired-tagsãã§æ°è¦ä½æããEC2ã¤ã³ã¹ã¿ã³ã¹ã¨S3ãã±ããã®ã¿ã°ã«ãNameããApplicationãã®2ã¤ãå«ã¾ãã¦ããããå¤å®ãã¾ã
å¤å®ãNGã§ãã£ãå ´åã«Amazon EventBridge(以é EventBridge)ãæ¤ç¥ããç´ä»ããããAmazon SNS (以é SNS)ã使ã£ã¦Eã¡ã¼ã«ã対象è
ã«éç¥ãããä»çµã¿ã§ã
æ§ç¯é
1ï¼AWS Configã«ã¼ã«ã®ä½æ
2ï¼SNSãããã¯ã®ä½æ
3ï¼EventBridgeã«ã¼ã«ã®ä½æ
4ï¼åä½ç¢ºèª
ç°å¢æ§ç¯æé 詳細
1ï¼AWS Configã«ã¼ã«ã®ä½æ
1-1ï¼AWS Configã«ç§»åããã«ã¼ã«ã追å ããã¯ãªãã¯
1-2ï¼ã«ã¼ã«ã¿ã¤ããAWSããã¼ã¸ãåã«ãã¦ãrequired-tagsããé¸æãã次ã¸ãã§é²ã
1-3ï¼ãã«ã¼ã«ã®è¨å®ãã§ä»¥ä¸ã®ããã«æå®ãã次ã¸ãã§é²ã
ä»åã¯Nameã¿ã°ã¨Applicationã¿ã°ãæå®ãããªã½ã¼ã¹ã«å«ã¾ãã¦ãããã©ããã®å¤å®ã¨ãããã¨ã«ãã¾ã
- åå
- ä»»æã§OK(æ¬è¨äºã§ã¯ required-tags)
- 説æ
- ä»»æã§OK(æ¬è¨äºã¯ãããããã®ã¾ã¾)
- å¤æ´ç¯å²
- ãªã½ã¼ã¹
- ãªã½ã¼ã¹
- ä»åã¯EC2 InstanceãEC2 VolumeãS3 Bucket以å¤ããâãã§æ¶ãã¾ãã
- ãã©ã¡ã¼ã¿ãã¼
- tag1Key
- Name
- tag1Value
- ä»»æã«ãããã®ã§è¨è¼ãã
- tag2Key
- Application
- tag2Value
- ä»»æã«ãããã®ã§è¨è¼ãã
- 以éå ¨ã¦è¨è¼ãã
- tag1Key
1-4ï¼è¨å®å 容ã確èªããã«ã¼ã«ã追å ããã¯ãªãã¯
åé¡ç¡ãä½æããããã¨ã確èª
2ï¼SNSãããã¯ã®ä½æ
2-1ï¼SNSã«ç§»åããããããã¯ã®ä½æããã¯ãªãã¯
2-2ï¼ä»¥ä¸ã®éãè¨å®ããããã¯ãä½æ
ã¡ã¼ã«ä»¶åã§ããç¨åº¦ãããããã«ååãè¨å®ãã¾ã
- ã¿ã¤ã
- ã¹ã¿ã³ãã¼ã
- åå
- ä»»æã§OK (æ¬è¨äºã§ã¯ AWSConfig-NON_COMPLIANT )
- 表示å
- ä»»æã§OK (æ¬è¨äºã§ã¯ AWSConfig-NON_COMPLIANT )
2-3ï¼ä½æãããããã¯ã«ãµãã¹ã¯ãªãã·ã§ã³ãç»é²
ãµãã¹ã¯ãªãã·ã§ã³ã¿ãããããµãã¹ã¯ãªãã·ã§ã³ã®ä½æããã¯ãªãã¯
ãããã³ã«ã«ãEã¡ã¼ã«ããã¨ã³ããã¤ã³ãã«éãããå®å
(æ¬è¨äºã§ã¯èªèº«ã«å±ãããã«ãã¾ã)ãå
¥åãããµãã¹ã¯ãªãã·ã§ã³ã®ä½æããã¯ãªãã¯
2-4ï¼ãµãã¹ã¯ãªãã·ã§ã³ã®æå¹å
ç»é²ãããµãã¹ã¯ãªãã·ã§ã³ã¯æ¿è«¾ããå¿
è¦ããããããã¾ã§ã¯ã¹ãã¼ã¿ã¹ãä¿çä¸ã®ç¢ºèªãã¨ãªãå©ç¨åºæ¥ã¾ãã
ä½ææã«è¨è¼ããã¨ã³ããã¤ã³ã(Eã¡ã¼ã«ã¢ãã¬ã¹)ã«ç¢ºèªã¡ã¼ã«ãå±ãã¦ãããã¨ã確èªããConfirm subscriptionãã§æ¿è«¾
ã¹ãã¼ã¿ã¹ãã確èªæ¸ã¿ãã«ãªããã¨ã確èªã§ããã°OK
3ï¼EventBridgeã«ã¼ã«ã®ä½æ
3-1ï¼EventBridgeã«ç§»åããã«ã¼ã«ãä½æããã¯ãªãã¯
3-2ï¼ä»¥ä¸ã®éãè¨å®ããã«ã¼ã«ãä½æ
- åå
- ä»»æã§OK (æ¬è¨äºã§ã¯ notice-Config)
- ãã¿ã¼ã³
- ã¤ãã³ããã¿ã¼ã³
- ã¤ãã³ãä¸è´ãã¿ã¼ã³
- ã«ã¹ã¿ã ãã¿ã¼ã³
- å§ãã«ãç´¹ä»ãããã®è¨äºãåèã«è¨è¼
- ã«ã¹ã¿ã ãã¿ã¼ã³
è¨è¼å
容ã¯ãã¡ã
required-tagsã¨ããã«ã¼ã«ã§NON_COMPLIANTå¤å®ãããæã«ä¸è´ããããã«ãã¾ã
{ "source": ["aws.config"], "detail-type": ["Config Rules Compliance Change"], "detail": { "messageType": ["ComplianceChangeNotification"], "configRuleName": ["required-tags"], "newEvaluationResult": { "complianceType": ["NON_COMPLIANT"] } } }
- ã¿ã¼ã²ãã
- SNSãããã¯
- ãããã¯
- ä½æããSNSãããã¯(AWSConfig-NON_COMPLIANT)
- å
¥åã®è¨å®
- å
¥åãã©ã³ã¹ãã©ã¼ãã¼
- å§ãã«ãç´¹ä»ãããã®è¨äºãåèã«è¨è¼
- å
¥åãã©ã³ã¹ãã©ã¼ãã¼
è¨äºãåèã«ãã¹ã¯ãã¡ã
{ "awsRegion": "$.detail.awsRegion", "resourceId": "$.detail.resourceId", "awsAccountId": "$.detail.awsAccountId", "compliance": "$.detail.newEvaluationResult.complianceType", "rule": "$.detail.configRuleName", "time": "$.detail.newEvaluationResult.resultRecordedTime", "resourceType": "$.detail.resourceType" }
ãã³ãã¬ã¼ãã¯ãã¡ã
ã" "ãã§å²ã¾ãªãã¨ãã¾ãæ¹è¡ãã¦è¨è¼ã§ããªãã¨ãã¡ãã®è¨äºã«è¨è¼ããã¦ãã¾ããã®ã§æ³¨æ
注æ: æ¹è¡ãå«ããã³ãã¬ã¼ããä¿åããéã« Invalid InputTemplate ã¨ã©ã¼ã表示ãããå ´åã¯ãåè¡ã¯å¿ ãäºéå¼ç¨ç¬¦ã§éããããã«ãã¦ãã ãã
"çºçæå» : <time>" "ã«ã¼ã«å : <rule> " "ãªã½ã¼ã¹ã¿ã¤ã : <resourceType>" "ãªã½ã¼ã¹ID : <resourceId>" "AWSã¢ã«ã¦ã³ã : <awsAccountId>" "ä¸è¨ãªã½ã¼ã¹ã <compliance> å¤å®ã¨ãªãã¾ããã" "詳細ã¯ä»¥ä¸URLããã確èªãã ããã" "https://console.aws.amazon.com/config/home?region=<awsRegion>#/timeline/<resourceType>/<resourceId>/configuration"
ããã§æºåãæ´ãã¾ãã
4ï¼åä½ç¢ºèª
4-1ï¼å ã ã«ã¼ã«ã«æºæ ãã¦ãããªã½ã¼ã¹ãéæºæ ã¸
ãNameããApplicationãã¿ã°ãæã£ã¦ããS3ãã±ããã®ã¿ã°ãç·¨éãã¾ã
â
ç¾å¨ã¯ã¿ã°ãã«ã¼ã«ã«æºæ ãã¦ããç¶æ
ã§ããAWS Configã«ã¼ã«ç»é¢ã®ã³ã³ãã©ã¤ã¢ã³ã¹ã¹ãã¼ã¿ã¹ããæºæ ãã¨ãã¦å¤å®ããã¦ãã¾ã
ãããããApplicationãã¿ã°ãæ¶ãã¦ã¿ã¾ã
æ¶ããå¾ã¯ãã°ããå¾
æ©ããããã
ããã¨ã(ã«ã¼ã«éæºæ å¤å®ãEventBridgeâSNSã¨ä¼ãã)以ä¸ã¡ã¼ã«ãå±ãã¾ãã
AWS Configã«ã¼ã«ç»é¢ã®ã³ã³ãã©ã¤ã¢ã³ã¹ã¹ãã¼ã¿ã¹ããéæºæ ãã¨ãã¦å¤å®ããã¦ãããã¨ããããã¾ã
ãªã½ã¼ã¹å¤æ´ã«ããã«ã¼ã«éæºæ æã«éç¥ããããã¨ã確èªã§ãã¾ãã
4-2ï¼ã«ã¼ã«éæºæ ã®ãªã½ã¼ã¹ãä½æ
å¤å®ãããªã½ã¼ã¹ã®ä¸ã¤ã§ããEC2 Volumeã§ç¢ºèªãã¦ã¿ã¾ã
EC2ã«ç§»åãé©å½ãªã¹ãããã·ã§ãããå³ã¯ãªãã¯âããªã¥ã¼ã ã®ä½æãã¯ãªãã¯ãããNameãã¿ã°ã ããä»ä¸ãã¦ä½æãã¦ã¿ã¾ã
ããã§ãã°ãå¾
æ©ããããã
2ï½3åå¾ã«ä»¥ä¸ã®ããã«ã¡ã¼ã«ãå±ãã¾ãããããªã¥ã¼ã ããã¡ãã¨ã«ã¼ã«éæºæ å¤å®ãããããã§ã
ããã«å§ãã«ãç´¹ä»ãããã®è¨äºã®ãã³ãã¬ã¼ããåèã«ãã¦ä½ã£ããªã³ã¯ãã¯ãªãã¯ãã¦ã¿ã¾ã
âã®éãAWS Configã®è©²å½ãªã½ã¼ã¹ããã¤ã©ã®ã«ã¼ã«ãåå ã§éæºæ ã¨ãªã£ãããããããã¼ã¸ã«é£ã¶ãã¨ãã§ãã¾ãã(å©ãã)
æ°è¦ä½æãããªã½ã¼ã¹ã®å¤å®ãåé¡ãªããã¨ããããã¾ãã
ãã¾ã
ä»åSNSã§éãæé¢ç¨ã«å
¥åãã©ã³ã¹ãã©ã¼ãã¼ã§ã¯é
ç®ãçµã£ã¦å¤ãåå¾ãã¦ãã¾ããããä»ã®é
ç®ãæ°ã«ãªã£ãã®ã§ç¢ºèªãã¦ã¿ã¾ãã
ãã®é
ç®å
ããå¿
è¦ãªå¤ãåå¾ãã¦ãå¿
è¦ãªå
容ãå«ãã ã¡ã¼ã«æé¢ãä½æãããã¨ã«ãªãã¾ã
(è¨äºã®é
ç®ã§ååããã§ããæ°ã«ãªã£ãã®ã§)
{ "version": "0", "id": "XXXXX", "detail-type": "Config Rules Compliance Change", "source": "aws.config", "account": "AWSã¢ã«ã¦ã³ãçªå·", "time": "2021-03-24T11:08:34Z", "region": "ap-northeast-1", "resources": [], "detail": { "resourceId": "S3ãã±ããå", "awsRegion": "ap-northeast-1", "awsAccountId": "AWSã¢ã«ã¦ã³ãçªå·", "configRuleName": "required-tags", "recordVersion": "1.0", "configRuleARN": "arn:aws:config:ap-northeast-1:AWSã¢ã«ã¦ã³ãçªå·:config-rule/config-rule-XXXXX", "messageType": "ComplianceChangeNotification", "newEvaluationResult": { "evaluationResultIdentifier": { "evaluationResultQualifier": { "configRuleName": "required-tags", "resourceType": "AWS::S3::Bucket", "resourceId": "S3ãã±ããå" }, "orderingTimestamp": "2021-03-24T11:08:25.808Z" }, "complianceType": "NON_COMPLIANT", "resultRecordedTime": "2021-03-24T11:08:33.749Z", "configRuleInvokedTime": "2021-03-24T11:08:33.572Z" }, "oldEvaluationResult": { "evaluationResultIdentifier": { "evaluationResultQualifier": { "configRuleName": "required-tags", "resourceType": "AWS::S3::Bucket", "resourceId": "S3ãã±ããå" }, "orderingTimestamp": "2021-03-24T07:22:25.230Z" }, "complianceType": "COMPLIANT", "resultRecordedTime": "2021-03-24T11:07:29.843Z", "configRuleInvokedTime": "2021-03-24T11:07:29.660Z" }, "notificationCreationTime": "2021-03-24T11:08:34.572Z", "resourceType": "AWS::S3::Bucket" } }
æé
å®éã«ä»åã®ä¸é£ã®ä½æ¥ã§è¿½å è²»ç¨ãæããã調ã¹ã¦ã¿ã¾ã
æ±äº¬ãªã¼ã¸ã§ã³ã®å ´å
Config
- æé - AWS Config | AWS
- AWS ãªã¼ã¸ã§ã³ãã¨ã«ãAWS ã¢ã«ã¦ã³ãã«è¨é²ãããè¨å®é ç®ããã 0.003USD
- æåã® 100,000 件ã®ã«ã¼ã«è©ä¾¡ ãªã¼ã¸ã§ã³ãã¨ã®ã«ã¼ã«è©ä¾¡ãã¨ã« 0.001USD
â ã«ã¼ã«è¿½å ã«ãããªã½ã¼ã¹ã®è¨å®é ç®ã®å¢å * 0.003USDã注æãã¦ããã°è¯ãããã§ã
EventBridge
- æé - Amazon EventBridge | AWS
- ç¡æå©ç¨æ : AWS ã®ãµã¼ãã¹ã«ãã£ã¦çºè¡ããããã¹ã¦ã®ç¶æ å¤æ´ã¤ãã³ãã¯ç¡æã§ã
â AWSå ã®ãªã½ã¼ã¹ã®ã¤ãã³ããªã®ã§èæ ®ä¸è¦ã®ããã§ã
SNS
- æé - Amazon SNS | AWS
- Email/Email-JSON ç¡æ1,000 件ã®éç¥ 2.00USD/10 ä¸éç¥
- ãã¼ã¿åä¿¡ ãã¹ã¦ã®ãã¼ã¿åä¿¡ 0.00USD/GBãã¼ã¿éä¿¡ *** 1 GB/æã¾ã§ 0.00USD/GB
- æ¯ææåã® 100 ä¸ Amazon SNS ãªã¯ã¨ã¹ãã¯ç¡æã§ãããã®ä¸éãè¶ ããå¾ã®æé㯠100 ä¸ ãªã¯ã¨ã¹ããã¨ã« 0.50USD
â ä»®ã«10ä¸ãªã¯ã¨ã¹ããEmail1000éããµã¤ãº1GBã¨ãã¦ããç¡æå©ç¨æ ã«ããè²»ç¨ã¯0åãéæºæ ã®å¤å®ã ãã§è²»ç¨ãæããç¨ä½¿ããããã¨ã¯ç¡ãããã§ã
ãããã«
ãããããã¨AWSå
¬å¼æ§ãã¾ã¨ãã¦ããã¦ããã®ã§ãã¹ã ã¼ãºã«å®è£
ãããã¨ãã§ãã¾ãã
SNSã®æç« ãä¸ç·ã«EventBridgeã«ã¼ã«ã§å å·¥åºæ¥ã¦ãã¾ãã®ã¯é常ã«ä¾¿å©ãªã®ã§ãè²ã
ã¨å¿ç¨ãå¹ãããã§ã
å¤å®ãããªã½ã¼ã¹ã®é
ç®æ°ãè²»ç¨ã«ç´çµãã¦ããã®ã§ããã®ç¹ã«ã¯ã注æãã ãã
ãããã¨ããããã¾ããã
ç¢é å¬äº® (è¨äºä¸è¦§)
ã«ã¹ã¿ãã¼ãµã¯ã»ã¹é¨
ã¦ã¯ã¬ã¬ã¨é¶è¸ã¨MediaServicesã好ãã§ã