Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dome9で始めるAWSセキュリティリスク管理.pdf

wanda
October 11, 2019

 Dome9で始めるAWSセキュリティリスク管理.pdf

wanda

October 11, 2019
Tweet

More Decks by wanda

Other Decks in Technology

Transcript

  1. ຊ೔ͷ಺༰ • Dome9ͱ͸ʁ • Dome9ͷ3ͭͷಛ௃ • Network Security • Security

    Groupͷ؅ཧ • IAM Safety • ڧԽ͞ΕͨIAM • Complicence & Governance • ηΩϡϦςΟϑϨʔϜϫʔΫʹ४ڌͨ͠ηΩϡϦςΟΨόφϯε • ·ͱΊ
  2. 12 Dome9ͷಛ௃ Assess(ධՁ) • ωοτϫʔΫɾτϙϩδʔͷϏδϡΞϥΠζ • ϛείϯϑΟά΍ڴҖͷੋਖ਼ Contorl(੍ޚ) • ϕετϓϥΫςΟεͷڧ੍

    • ະೝূͳมߋͷ๷ࢭ • ίϯϓϥΠΞϯεඪ४ʹै͏ Remediate(ੋਖ਼) • ϙϦγʔઃఆʹΑΔ໰୊఺ͷमਖ਼ • Ϋϥ΢υ؀ڥͷΞΫςΟϒͳϓϩςΫτ
  3. 13 แׅతͳΫϥ΢υηΩϡϦςΟͷఏڙ - 3ͭͷػೳ Network Security • Security GroupͷՄࢹԽ •

    ૬ޓతͳڐՄϧʔϧͷՄࢹԽ • Security Groupͷ౷੍ • ڐՄ͞Ε͍ͯͳ͍มߋͷ੾Γ໭͠ IAM Safety • ڧԽ͞ΕͨIAMϓϩςΫγϣϯ • ࣌ݶతͳಛݖͷ෇༩ Complience & Governance • αϙʔτ͍ͯ͠ΔηΩϡϦςΟϑϨʔϜϫʔΫͷϧʔϧηοτͰAWS؀ڥΛධՁ • NISTɺCISɺPCI-DSSͳͲ • ಠࣗʹఆٛՄೳ
  4. 15 Security Group؅ཧ Security GroupͷՄࢹԽ • Ͳ͔͜ΒͲ͜΁௨৴͕ڐՄ͞Ε͍ͯΔͷ͔ʁ • ͲͷϦιʔε͕ؔ࿈͍͍ͮͯΔͷ͔ʁ •

    EC2΍RDSͳͲϦιʔεଆ͔Β͔͠ݟ͑ͳ͍ • άϧʔϓಉ࢜ͷؔ܎ੑ͕೺Ѳͮ͠Β͍ • ෼͔Γ΍͘͢ՄࢹԽ͞Εͨ΋ͷ͕ཉ͍͠
  5. 17 αϯϓϧߏ੒ͷSecurity Group Application Load Balancer • HTTP : 0.0.0.0/0

    BastionʢEC2ʣ • SSH : 203.0.113.4/32ʢ։ൃڌ఺ʣ WebʢEC2ʣ • HTTP : Application Load Balancer (Security Group) • SSH : Bastion (Security Group) DBʢRDSʣ • MySQL : Web (Security Group)
  6. 31 Dome9͔ΒSecurity GroupΛมߋ - SOURCEͷ௥Ճ 1.ʮ+ADD SOURCEʯΛΫϦοΫ 2. ܗࣜΛબ୒ •

    IP CIDR or DNS Name • IP LIST (Customer managed) • IP LIST (Dome9 managed) • AWS Security Group • AWS Peered VPC
  7. 34 AWS Configͷར༻ AWSͷαʔϏε͚ͩͰ΍ͬͯΈΔ • AWS Config ͷར༻ • Config

    RulesͰΞΫγϣϯͷࢦఆ • ྫɿηΩϡϦςΟάϧʔϓ͕ແ੍ݶڐՄͷSSHΛෆڐՄʹ͢Δ • શ͘ಉ͜͡ͱΛ΍ΔͳΒΧελϜϧʔϧΛࣗ࡞ • Dome9Ͱ΍Δ৔߹͸ɺॳظಋೖɺ؅ཧɺӡ༻͕༰қʹͳΔͷͰτϨʔυΦϑ https://dev.classmethod.jp/cloud/aws/auto-recovery-restricted-ssh-without-lambda/ https://dev.classmethod.jp/cloud/aws/automate-aws-config-remediation-action/
  8. 35 Tamper Protectionͷ·ͱΊ Tamper Protection • Dome9 Λܦ༝͠ͳ͍Seurity Groupͷมߋʢվ͟ΜʣΛ๷ࢭ͢Δ •

    Dome9͔Βมߋͨ͠ϧʔϧ͸΋ͱʹ໭͞ΕΔ͜ͱ͸ແ͍ • Dome9্Ͱͷมߋ΋Historyʹ࢒Δ
  9. 40 Dynamic Accessͷར༻ - Send Invitation Send Invitaion Dome9Ҏ֎ͷϝϯόʔ͔ΒͷΞΫηεΛڐՄ •

    ট଴ͷ༗ޮظݶ • ڐՄ͢Δ࣌ؒ • ϝʔϧΞυϨε • ௥ՃϢʔβͷΞυϨε • ࣗ෼ͷΞυϨε • ΞΫςΟϕʔγϣϯϦϯΫੜ੒ͷΈ
  10. 44 Network Security·ͱΊ Tamper Protection • Dome9 Λܦ༝͠ͳ͍Seurity GroupͷมߋΛ๷ࢭ͢Δ •

    Dome9͔Βมߋͨ͠ϧʔϧ͸΋ͱʹ໭͞ΕΔ͜ͱ͸ແ͍ • Dome9্Ͱͷมߋ΋Historyʹ࢒Δ Dynamic Access • ηΩϡϦςΟάϧʔϓʹҰ࣌తͳڐՄϧʔϧΛ௥ՃͰ͖Δ • ࢦఆ࣌ؒܦաޙʹ௥Ճϧʔϧ͸ࣗಈ࡟আͰɺҰ࣌తͳ௥Ճͷ໭͠๨ΕΛ๷ࢭ • มߋ͸Historyʹ࢒Δ
  11. 47 IAM؅ཧͷ՝୊ IAM؅ཧ͸೉͍͠ • ৗʹඞཁͰ͸ͳ͍ݖݶΛҰ࣌తʹڐՄ͍ͨ͠ • ౎౓ɺมߋ࡞ۀΛ͢Δͷ͸࡞ۀϛε΋͋Γආ͚͍ͨ • ؅ཧऀͱͯਓؒ •

    Systems ManagerͳͲΛۦ࢖ͯࣗ͠ಈԽ͸Մೳ • AutomationυΩϡϝϯτͷ࡞੒ͳͲࣄલ४උ͕ඞཁ
 https://dev.classmethod.jp/cloud/aws/workflow-to-add-temporary-privilege-by-ssm-automation/
  12. 48 IAM Safetyͷ࢓૊Έ Ұ࣌తʹࣄલఆٛͨ͠ಛݖΛ෇༩͢Δ͜ͱ͕Ͱ͖Δ - ݖݶͷঢ֨ • ฏ࣌͸੍ݶ͍ͨ͠಺༰Λ·ͱΊͨϙϦγʔΛIAM GroupͷϙϦγʔʹઃఆ •

    ϙϦγʔ͸Dome9্ͰGUIͰ࡞੒Մೳ • GUIૢ࡞ͰJSONͷϙϦγʔΛੜ੒ • Dome9ଆͰςϯϓϨʔτ΋༻ҙ • อޢର৅ͷIAM User/RoleΛબ୒ͯ͠อޢ • อޢ͢Δͱ֘౰ͷIAM User্͕هͷGroupʹॴଐʢ੍ݶϙϦγʔͷద༻ʣ • IAM Roleͷ৔߹͸੍ݶϙϦγʔ͕Ξλον • ಛݖΛ෇༩ʢঢ֨ʣ͍ͤͨ͞ͱ͖ʹɺ੍ݶϙϦγʔ͕σλον͞ΕΔ • ࢦఆ͕࣌ؒܦաޙʹࣗಈతʹ੍ݶϙϦγʔ͕Ξλονʢ߱֨ʣ
  13. 57 IAMϨϙʔτ Policy ReportʢϙϦγʔϨϙʔτʣ • Dome9Ͱ؅ཧ͢ΔAWSΞΧ΢ϯτશͯͷIAM Entityͷ૊Έ߹ΘͤΛҰཡදࣔ • ࡞੒ࡁΈͷIAM User/Roleͷݖݶ΍αʔϏεछผͰநग़Մೳ

    Credential Reportʢೝূ৘ใϨϙʔτʣ • IAM Userͷೝূ৘ใΛநग़ • ίϯιʔϧαΠϯΠϯͷύεϫʔυ͕༗ޮͳϢʔβ • ͦͷύεϫʔυͷར༻ཤྺ ͳͲ
  14. 67 GSLͱ͍͏Dome9ͷಠࣗݴޠ ྫɿAWS Kinesis Server data at rest has server

    side encryption ྫɿEnsure no security groups allow ingress from 0.0.0.0/0 to RDP (TCP:3389) ྫɿEnsure IAM policies are attached only to groups or roles Kinesis should have encrypted=true SecurityGroup should not have inboundRules with [scope = '0.0.0.0/0' and port<=3389 and portTo>=3389] IamUser where not (name regexMatch /^<root_account>$/i ) should have managedPolicies isEmpty() and inlinePolicies isEmpty()
  15. 72 ܧଓతͳηΩϡϦςΟνΣοΫ - ઃఆ ௨஌ઌΛઃఆ • νΣοΫ݁Ռͷ௨஌ • ௨஌ઌΞυϨεͷઃఆ •

    ௨஌εέδϡʔϧͷઃఆ • Ϩϙʔτछྨ • Summary, Detailed, CSV͋ • ௨஌ઃఆ͸ࣄલ࡞੒ or
 ͜ͷ΢Οβʔυதʹ࡞੒Մೳ
  16. 79 Remediationͷ࡞੒ • RulesetɿʮϙϦγʔʯͰࢦఆͨ͠ϧʔϧ
 ηοτͰҧ൓߲໨͕͋Ε͹ͦͷϧʔϧ
 ηοτʹରԠͨ͠मਖ਼ΞΫγϣϯ͕࣮ߦ
 ͞Ε·͢ • Remediate by

    Ruleɿमਖ਼ΞΫγϣϯΛ
 ࣮ߦ͍߲ͨ͠໨ͷࢦఆ • Remediate by Cloud Accountɿର৅ͷAWS
 ΞΧ΢ϯτΛࢦఆ • Remediate by EntityɿΞΫγϣϯର৅ͷ
 ࢦఆ • Cloud BotsɿCloud-botsͰ࣮ࢪ͢ΔΞΫ
 γϣϯͷࢦఆ • Commentɿίϝϯτ
  17. 80 Cloud BotͰͰ͖Δ͜ͱ • ami_set_to_private • cloudtrail_enable • cloudtrail_send_to_cloudwatch •

    cloudwatch_create_metric_filter • config_enable • ec2_attach_instance_role • ec2_create_snapshot • ec2_release_eips • ec2_quarantine_instance • ec2_stop_instance • ec2_terminate_instance • ec2_update_instance_role • iam_role_attach_policy • iam_user_attach_policy • iam_quarantine_role • iam_quarantine_user • iam_turn_on_password_policy • iam_user_force_password_change • igw_delete • kms_enable_rotation • mark_for_stop_ec2_resource • rds_quarantine_instance • s3_delete_acls • s3_delete_permissions • s3_enable_encryption • s3_enable_logging • s3_enable_versioning • sg_delete • sg_rules_delete • sg_single_rule_delete • tag_ec2_resource • vpc_turn_on_flow_logs
  18. 85 Remediationͷϝʔϧ௨஌ྫ • ʮRemediationOutputʯͱ͍͏໊݅ͷϝʔϧ { "ReportTime": "2019-10-03T05:30:37.559Z", "Account id": "xxxxxxxxxxxxxx",

    "findingKey": "xxxxxxxxxxxxxxxxx", "Rules violations found": [ { "Rule": "Ensure no security groups allow ingress from 0.0.0.0/0 to SSH (TCP:22)", "ID": "sg-xxxxxxxxxxxxxxxxx", "Name": "dome9-test-sg", "Remediation": "sg_single_rule_delete", "Execution status": "passed", "Bot message": "Split matching for the port to be remediated is set to False. If the port is contained within a larger scope, it will be skipped.\nThe protocol to be removed is TCP\nScope to be removed found: 0.0.0.0/0 \nThe rule to be removed is going to be for inbound traffic\nPort to be removed: 22 \nMatching rule found that is going to be deleted. Protocol:TCP Direction:inbound Port: 22 Scope:0.0.0.0/0\nSecurity Group rule from port 22 to port 22 successfully removed\n" } ] }
  19. 89 CloudBotsʹૹΔϝοηʔδϑΥʔϚοτ • id • AWSΞΧ΢ϯτID • accountNumber • AWSΞΧ΢ϯτID

    • entity • վળΞΫγϣϯͷର৅Ϧιʔε { "reportTime": "2018-03-20T05:40:42.043Z", "rule": { "name": "<name for rule>", "complianceTags": "AUTO: <bot-name>" }, "status": "Failed", "account": { "id": "************" }, "entity": { "accountNumber": "************", "id": "i-*****************", "name": "************", "region": "us_west_2", } }
  20. 91 ·ͱΊ ηΩϡϦςΟͷϦεΫͷൃݟɺ༧๷ɺ؅ཧ • ωοτϫʔΫͷՄࢹԽ • SecurityGroupͷՄࢹԽʹΑΔ௨৴ܦ࿏ͷՄࢹԽ • ෆ༻ҙͳมߋͷ཈੍ͱҰ࣌తͳมߋ࡞ۀʹΑΔϦεΫͷ౷੍ ୈࡾऀͷϙϦγʔʹجͮ͘؂ࠪͱҡ࣋

    • ୈࡾऀͷϙϦγʔ४ڌͷϧʔϧηοτʹΑΔηΩϡϦςΟνΣοΫ • ܧଓతͳνΣοΫͱࣗಈम෮ʹΑΔηΩϡϦςΟϨϕϧͷҡ࣋ ෳ਺ΞΧ΢ϯτͷҰݩ؅ཧ • Dome9ͰҰݩతʹνΣοΫɺ؅ཧɺվળɺϨϙʔςΟϯάΛ࣮ࢪ • ҟͳΔηΩϡϦςΟج४ͷෳ਺ΞΧ΢ϯτΛ༰қʹ؅ཧՄೳ