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

Getting robust VCL with falco

ysugimoto
March 29, 2022

Getting robust VCL with falco

Talked on Fastly User Meetup #4

ysugimoto

March 29, 2022
Tweet

More Decks by ysugimoto

Other Decks in Technology

Transcript

  1. Apply custom VCLs using Fastly API 1. Build VCLs using

    template engine 2. Clone new version 3. Delete existing custom VCLs 4. Upload new VCL fi les ← Validate VCL 5. Activate new version CI/CD
  2. VCL statistics in ೔ܦిࢠ൛ 44 submodule inclusion 8,844 Lines (※

    include comments) 88 subroutines 124 backends 25 Directors ※ 2022/03/29࣌఺
  3. Improve CI/CD pipeline 1. Build VCLs using template engine 2.

    Lint built VCLs with falco ← Validate VCL 3. Clone new version 4. Delete existing custom VCLs 5. Upload new VCL fi les ← Ensured valid VCL 6. Activate new version CI/CD
  4. Configuration Design and Best Practices From a syntax perspective, the

    configuration language should offer the following: 1. Syntax highlighting in editors 2. Linter 3. Automatic syntax formatter https://sre.google/workbook/con fi guration-design/
  5. From a syntax perspective, the configuration language should offer the

    following: 1. Syntax highlighting in editors 2. Linter 3. Automatic syntax formatter Configuration Design and Best Practices https://sre.google/workbook/con fi guration-design/
  6. Underlying falco features • Completely runs on local machine /

    CI • Basic syntax check • Strict type check • Suggest Fastly recommended ways • Assuming problems in VCL
  7. Linter Rules • Root Statementsͷॏෳఆٛ • Backend/Directorͷඞਢఆٛݕࠪ • Boilerplate Macroͷهड़࿙Ε

    • ϩʔΧϧม਺ͷγϯλοΫεݕࠪ • ୅ೖ࣌ͷܕݕࠪ • Statementͷར༻Մೳείʔϓݕࠪ • ҙਤ͠ͳ͍Literalͷར༻ • ະ࢖༻ม਺ɾStatementͷݕग़ • ૊ΈࠐΈؔ਺ͷҾ਺ͷਖ਼౰ੑݕࠪ • ਖ਼نදݱΩϟϓνϟͷ্ॻ͖ܯࠂ • ਖ਼نදݱͷਖ਼౰ੑݕࠪ • Include͞ΕͨϞδϡʔϧͷ࠶ؼݕࠪ • IPܕ/CIDRͷਖ਼౰ੑݕࠪ • ૊ΈࠐΈม਺ͷset/unsetͷՄ൱ݕࠪ • Fastlyͷ੍ݶࣄ߲ݕࠪ • Subroutineͷείʔϓೝࣝ https://github.com/ysugimoto/falco/blob/main/docs/rules.md
  8. Remote Snippets Support • Edge Dictionary • Access Control Lists

    Fastly্ʹొ࿥͍ͯ͠ΔεχϖοτΛؚΊͯLinting
  9. From a syntax perspective, the configuration language should offer the

    following: 1. Syntax highlighting in editors 2. Linter 3. Automatic syntax formatter Configuration Design and Best Practices https://sre.google/workbook/con fi guration-design/