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
760
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
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
110
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
600
いまあるチームにフィットさせる 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
Other Decks in Programming
See All in Programming
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
Criando Commits Incríveis no Git
marcelgsantos
2
170
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
42 best practices for Symfony, a decade later
tucksaun
1
180
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Practical Orchestrator
shlominoach
186
10k
Being A Developer After 40
akosma
87
590k
How STYLIGHT went responsive
nonsquared
95
5.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Making Projects Easy
brettharned
116
5.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
The Invisible Side of Design
smashingmag
298
50k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠