Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure...
Search
shiro seike
PRO
September 25, 2024
Programming
3
750
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
JAWS-UG CDK支部 #16 ~CDK Conference 2024 Extra~
https://jawsug-cdk.connpass.com/event/328676/
shiro seike
PRO
September 25, 2024
Tweet
Share
More Decks by shiro seike
See All by shiro seike
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
510
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
1.1k
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
350
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
590
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
2.1k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
180
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
120
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
180
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
530
Other Decks in Programming
See All in Programming
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
760
CSC509 Lecture 14
javiergs
PRO
0
130
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
180
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
190
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
100
testcontainers のススメ
sgash708
1
120
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
Security_for_introducing_eBPF
kentatada
0
110
103 Early Hints
sugi_0000
1
210
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
What's in a price? How to price your products and services
michaelherold
243
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Building Your Own Lightsaber
phodgson
103
6.1k
Statistics for Hackers
jakevdp
796
220k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
How GitHub (no longer) Works
holman
311
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Unsuck your backbone
ammeep
669
57k
Transcript
©Fusic Co., Ltd.  1 AWS CDKΛ༻͍ͨ ηΩϡΞͳCI/CDύΠϓϥΠϯͷߏங 2024.09.25 @seike460
JAWS-UG CDKࢧ෦ #16 ~CDK Conference 2024 Extra~
©Fusic Co., Ltd. 2 ਗ਼Ո ࢙ @seike460 AWS Community Builder
Serverless ίϛϡχςΟ Fukuoka.php Fukuoka.go JAWS-UG Fukuoka Serverless Meetup Fukuoka Cloudflare Meetup Fukuoka JP_Stripes Fukuoka ࣗݾհ ͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. AWS CDKͱηΩϡϦςΟ 2.
cdk-nagɺCheckov 3. ࣮ࡍͷಈ࡞ 4. ·ͱΊ
©Fusic Co., Ltd. 4 AWS CDKͱηΩϡϦςΟ 1
©Fusic Co., Ltd. 5 AWS CDK AWS CDKɺͱͯศརͰ͢ΑͶ YAMLJSONͰͷهड़ʹΘΓɺPythonɺTypeScriptͷ ϓϩάϥϛϯάݴޠΛͬͯɺίʔυͰAWSϦιʔεΛఆٛͰ͖·͢ɻ
→ෳࡶͳΠϯϑϥετϥΫνϟͷઃఆΛ؆୯ʹ͠ɺ ࠶ར༻ੑՄಡੑΛߴΊΔ͜ͱ͕Ͱ͖ɺ ։ൃऀʹͱͬͯΑΓޮతͳӡ༻͕ՄೳͱͳΓ·͢
©Fusic Co., Ltd. 6 ෳࡶͳߏʹରԠ ෳࡶͳߏΛϓϩάϥϛϯάͰ੍ޚ
©Fusic Co., Ltd. 7 ෳࡶͳߏʹରԠग़དྷΔ͕… ෳࡶͳߏΛϓϩάϥϛϯάͰ੍ޚ ग़དྷΔ͕… ٯʹࠨͷΑ͏ͳڊେͳߏ ࡞Ͱ͖ͯ͠·͍ɺ ͯ͢ΛঠѲग़དྷΔ͔·ͨผͷ
©Fusic Co., Ltd. 8 ͯ͢ΛঠѲͰ͖ͳ͍ͱ… ηΩϡϦςΟϦεΫࡏͷՄೳੑ ▪S3 όέοτ͕ύϒϦοΫΞΫηεՄೳ ▪IAM ϩʔϧʹաͳݖݶΛ༩
▪ϓϥΠϕʔτͳLambda ͕ؔ ɹVPC ʹஔ͞Ε͍ͯͳ͍ ▪Secrets Manager γʔΫϨοτ ɹࣗಈϩʔςʔγϣϯ͕ະઃఆ ▪KMS ΩʔϙϦγʔͷաʹڐՄ
©Fusic Co., Ltd. 9 ਓͷͰνΣοΫͰةݥ ఆ͚ͩͰ੍ޚ͢Δͷ͍͠ ͦ͜ͰCIͰνΣοΫΛߦ͍ɺ ηΩϡϦςΟϦεΫΛ ݮ͢Δํ๏Λߟ͑·͢
©Fusic Co., Ltd. 10 cdk-nag + Checkov 2
©Fusic Co., Ltd. 11 cdk-nag CDK Labs at AWSͷϦϙδτϦͰ͋Δ cdk-nag
AWS CDKͰఆٛ͞ΕͨϦιʔε͕ ηΩϡϦςΟӡ༻ͷϕετϓϥΫςΟεʹ ै͍ͬͯΔ͔Λݕূ͢ΔͨΊͷϥΠϒϥϦ ▪ϧʔϧϕʔεͷݕূ AWS͕ਪ͢ΔηΩϡϦςΟج४ ϕετϓϥΫςΟεʹج͍ͮͨϧʔϧηοτ ▪ΧελϚΠζՄೳ ϓϩδΣΫτͷχʔζʹ߹Θͤͯ ϧʔϧΛՃɾআ֎ɾΧελϚΠζՄೳ ▪CI/CD౷߹ GitHub ActionsͳͲͷCI/CDύΠϓϥΠϯʹ ౷߹ՄೳͰࣗಈతʹίʔυͷ࣭ΛνΣοΫ
©Fusic Co., Ltd. 12 AWSʹΑΔެࣜϒϩά ࢸΕΓͤ͘Γͳ༰ͷެࣜϒϩά - AWSʹΑΔAWS CDK ͱ
cdk-nag Λ౷߹ͯ͠ɺ IaCͷηΩϡϦςΟͱίϯϓϥΠΞϯεΛ ࣗಈతʹཧɾݕূ͢Δํ๏Λղઆ - ۩ମతͳಋೖखॱϧʔϧͷΧελϚΠζɺ Τϥʔͷमਖ਼ɾ੍ํ๏͕հ͞Ε͓ͯΓɺ TypeScriptΛ༻͍࣮ͨྫఏڙ - cdk-nag Λ୯ମςετCI/CDͱ࿈ܞ ܧଓతͳηΩϡϦςΟνΣοΫΛ࣮ݱ͢Δํ๏
©Fusic Co., Ltd. 13 Checkov CheckovIaCͷηΩϡϦςΟͱίϯϓϥΠΞϯεΛ ࣗಈతʹݕূ͢ΔͨΊͷOSSͷ੩తղੳπʔϧ TerraformɺAWS CloudFormationɺKubernetes YAMLɺ
ͦͯ͠AWS CDKͳͲͷઃఆϑΝΠϧΛରʹɺ ϕετϓϥΫςΟεηΩϡϦςΟج४ʹ ج͍ͮͨνΣοΫΛ࣮ߦ͠·͢ - ෯͍αϙʔτର - IaCπʔϧͷछྨɺΫϥυϓϩόΠμʔʹରԠ - ๛ͳϧʔϧηοτ - CISɺNISTɺPCI DSSͳͲͷۀքඪ४ʹج͍ͮͨϧʔϧఏڙ - CI/CD౷߹ - GitHub ActionsɺGitLab CIɺJenkinsͳͲओཁͳCI/CDπʔϧͱ౷߹
©Fusic Co., Ltd. 14 cdk-nag + Checkov ͜ͷ̎ͭΛΈ߹ΘͤΔ - แׅతͳηΩϡϦςΟΧόϨοδͷ্
- cdk-nagAWS CDKಛ༗ͷৄࡉͳηΩϡϦςΟνΣοΫΛఏڙ CheckovʹͯΠϯϑϥશମͷηΩϡϦςΟΛཏతʹݕূ - ૬ิతͳϧʔϧηοτͷ׆༻ - cdk-nagͱCheckovͦΕͧΕҟͳΔϧʔϧϕετϓϥΫςΟεΛ࣋ͭͨΊɺ ྆ऀΛซ༻͢Δ͜ͱͰΤϥʔݕग़ͷਫ਼্͕͠ɺݟམͱ͠Λ͙ - ଟతͳCI/CDύΠϓϥΠϯͷڧԽ - ྆πʔϧΛCI/CDύΠϓϥΠϯʹ౷߹͢Δ͜ͱͰɺ CI࣌ʹࣗಈత͔ͭଟ֯తͳηΩϡϦςΟνΣοΫΛ࣮ߦՄೳ
©Fusic Co., Ltd. 15 ࣮ࡍͷಈ࡞ 3
©Fusic Co., Ltd. 16 GitHub Actions GitHub Actions npx cdk
synthΛ࣮ߦ͢Δ͜ͱͰ Cdk-nagͷνΣοΫΛ࣮ߦ͢Δ͜ͱ͕ग़དྷΔ checkovίϚϯυtemplate.yamlΛࢦఆͯ͠ ࣮ߦ͢Δ͜ͱͰtemplate.yamlΛ࣮ߦ͢Δ͜ͱ͕Մೳ
©Fusic Co., Ltd. 17 cdk-nag cdk-nagͷmoduleΛ cdkͷAspectsʹ৯ΘͤΔ͜ͱͰ ରͷStackͷνΣοΫ͕Մೳ ୯ମςετͱ࣮ͯ͠ߦ͢ΔࣄՄ
©Fusic Co., Ltd. 18 cdk-nagϧʔϧͷ੍ NagSuppressionsͷ addResourceSuppressions ʹͯϧʔϧͷ੍Λߦ͏IDΛࢦఆ ରϧʔϧΛ੍͕Մೳ
©Fusic Co., Ltd. 19 Checkov ࣮ߦ͢Δ͜ͱͰ ಉ͡Α͏ʹΤϥʔදࣔͱ ݪҼΛදࣔͯ͘͠ΕΔ ΤϥʔʹରԠ͢Δ੍ .checkov.ymlʹॻ͘͜ͱͰରԠՄೳ
©Fusic Co., Ltd. 20 ·ͱΊ 4
©Fusic Co., Ltd. 21 ·ͱΊ CDKͱͯศརɺศར͔ͩΒͦ͜ཧͷരൃ͕ى͜ΔՄೳੑ Point 01 ਓͷͰνΣοΫೝෛՙ͕ߴ͍ɺCIʹͯνΣοΫΛߦ͍ɺCDͷσϓϩΠʹͭͳ͛Δ Point
02 cdk-nag + CheckovΛར༻͢Δ͜ͱͰཏతͳνΣοΫ͕Մೳ Point 03 ඞཁͳ༰ΛνΣοΫ͞ΕΔ͜ͱ͋Δɺͦͷ߹ϧʔϧͷ੍ͰରԠՄೳ Point 04
©Fusic Co., Ltd. 22 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠