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
700
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
260
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
320
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
560
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.9k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
170
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
110
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
170
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
500
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Click-free releases & the making of a CLI app
oheyadam
2
120
Contemporary Test Cases
maaretp
0
140
Jakarta EE meets AI
ivargrimstad
0
260
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
1k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Designing for humans not robots
tammielis
250
25k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
BBQ
matthewcrist
85
9.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
GitHub's CSS Performance
jonrohan
1030
460k
Site-Speed That Sticks
csswizardry
0
33
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠