ECS Fargate ワークロードを Sysdig Serverless Agent で保護する (3)

Amazon Elastic Container Service (ECS) の実行環境に AWS Fargate を用いた構成(以下、ECS Fargate )は、AWS でコンテナの実行環境を整える際の強力な選択肢のひとつです。
Fargate を用いることで、ユーザが考慮すべきセキュリティリスクは( EC2 を用いるよりも)少なくなりますが、すべてがカバーされるものではありません。

この連載記事では、ECS Fargate で実行されるワークロードを Sysdig の Serverless Agent を使って保護するための方法をご紹介します。
第 3 回となる今回は、Serverless Agent がアプリケーションに与える性能影響に触れます。

  1. Sysdig と Serverless Agent の概要
  2. Serverless Agent のセットアップとイベントキャプチャ
  3. Serverless Agent がアプリケーションに与える性能影響 (この記事)

Serverless Agent 利用時の性能への影響

前々回 ご紹介したように、Serverless Agent は通常 Sysdig Agent が行っているようなカーネルインストゥルメンテーションが適用できないため、ptrace を使ってワークロードのシステムコールを検出しています。
以下では、Serverless Agent の導入によってアプリケーションの性能にどの程度の影響が及ぶのかを見てゆきます。

公開されているベンチマーク結果

まずは Sysdig から公開されているベンチマークの結果をご紹介します。
以下は、Sysdig のブログに掲載されている、Fargate で I / O 集約型のワークロード ( 100k IOPS以上 ) を実行した際の所要時間の計測結果です。

f:id:polar3130:20220324144205p:plain 引用元

このケースでは、通常の Sysdig Agent が行っているカーネルインストゥルメンテーションにやや劣る程度の性能が出ており、単純な ptrace の実行時よりもかなり良好な結果が得られているようです。

また、pdig のリポジトリでは OSBench というベンチマークツールを使ったシナリオ毎のベンチマーク結果も紹介されています。1
ここでは、システムコールが多量に発生するワークロードにおいて、元の性能と比して 1 / 4 程度まで性能劣化したケースがあったと紹介されています。

f:id:polar3130:20220324144445p:plain 引用元

アプリケーションの稼働中に ptrace を実行し続けると聞くとかなりの性能低下が起きてもおかしくないように思えますが、pdig では seccomp フィルタを用いてインストゥルメンテーションを行うシステムコールの種類を限定することにより、大幅な性能劣化が起きないよう工夫しているようです。

UNIX Benchmarks を使った実測

自身の環境でもベンチマークを使って Serverless Agent の影響を計測してみます。
今回は計測のために以下の環境を用意しました。

Sysdig

  • Orchestrator Agent : v2.3.0 ( latest )
  • Workload Agent : v2.3.0 ( latest )
  • ランタイムポリシ : デフォルトで定義済みのポリシのみを利用(キャプチャなし)

ECS Fargate

  • プラットフォームバージョン : 1.4
  • タスク定義 : CPU - 0.25 core, Memory - 512 MiB
  • コンテナイメージ : debian:11.2

ベンチマークツール

今回は、アプリケーションの正常稼働時をイメージして Serverless Agent の有無による性能影響を比較したいと考えたため、ポリシに基づくキャプチャは設定していません。
ベンチマークの実行中にキャプチャの取得も行うと、更に性能への影響が大きくなるのではと推測していますが、ポリシに基づいて構成されたキャプチャが実行されるのは、本来想定されていない(例えばアプリケーションの脆弱性が悪用されるなどした際の)異常な振る舞いが検出されている状況に相当すると考えられます。

UNIX Bench の実行結果は以下のとおりです。

UNIX Bench シナリオ別 Index 値の比較(1 コア使用)

f:id:polar3130:20220324143723p:plain

コンソールの出力も残しておきます。
マルチコア環境のため、1 コアのみを使用した場合とすべてのコアを使用した場合の 2 通りの結果が得られています。
Serverless Agent なしの結果は、単純な ECS Fargate タスク ( CPU 0.25 core, Memory 512 MiB ) のベンチマーク結果としてもみることができますね。

Serverless Agent なし

root@ip-10-0-2-155:/byte-unixbench/UnixBench# ./Run
gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c 
gcc -o pgms/register -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum='register int' src/arith.c 
gcc -o pgms/short -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=short src/arith.c 
gcc -o pgms/int -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=int src/arith.c 
gcc -o pgms/long -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=long src/arith.c 
gcc -o pgms/float -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c 
gcc -o pgms/double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=double src/arith.c 
gcc -o pgms/hanoi -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/hanoi.c 
gcc -o pgms/syscall -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/syscall.c 
gcc -o pgms/context1 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/context1.c 
gcc -o pgms/pipe -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/pipe.c 
gcc -o pgms/spawn -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/spawn.c 
gcc -o pgms/execl -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/execl.c 
gcc -o pgms/dhry2 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/dhry2reg -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= -DREG=register ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/looper -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/looper.c 
gcc -o pgms/fstime -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/fstime.c 
gcc -o pgms/whetstone-double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DDP -DGTODay -DUNIXBENCH src/whets.c -lm
make all
make[1]: Entering directory '/byte-unixbench/UnixBench'
make distr
make[2]: Entering directory '/byte-unixbench/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[2]: Leaving directory '/byte-unixbench/UnixBench'
make programs
make[2]: Entering directory '/byte-unixbench/UnixBench'
make[2]: Nothing to be done for 'programs'.
make[2]: Leaving directory '/byte-unixbench/UnixBench'
make[1]: Leaving directory '/byte-unixbench/UnixBench'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /byte-unixbench/UnixBench/tmp
      * Results                      = /byte-unixbench/UnixBench/results
------------------------------------------------------------------------------

Use of uninitialized value in printf at ./Run line 1479.
Use of uninitialized value in printf at ./Run line 1739.

1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

2 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

2 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

2 x Execl Throughput  1 2 3

2 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

2 x File Copy 256 bufsize 500 maxblocks  1 2 3

2 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

2 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

2 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

2 x Process Creation  1 2 3

2 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

2 x Shell Scripts (1 concurrent)  1 2 3

2 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: ip-10-0-2-155.ec2.internal: GNU/Linux
   OS: GNU/Linux -- 4.14.262-200.489.amzn2.x86_64 -- #1 SMP Fri Feb 4 20:34:30 UTC 2022
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   CPU 0: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (5000.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 1: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (5000.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   ; runlevel 

------------------------------------------------------------------------
Benchmark Run: Tue Mar 22 2022 11:36:09 - 12:04:11
2 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        9969676.8 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     1606.8 MWIPS (9.8 s, 7 samples)
Execl Throughput                                999.1 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        111280.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           30110.6 KBps  (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        324679.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                              166992.3 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                   8030.5 lps   (10.0 s, 7 samples)
Process Creation                               1990.5 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   1834.1 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    213.3 lpm   (60.2 s, 2 samples)
System Call Overhead                          90003.2 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    9969676.8    854.3
Double-Precision Whetstone                       55.0       1606.8    292.1
Execl Throughput                                 43.0        999.1    232.4
File Copy 1024 bufsize 2000 maxblocks          3960.0     111280.7    281.0
File Copy 256 bufsize 500 maxblocks            1655.0      30110.6    181.9
File Copy 4096 bufsize 8000 maxblocks          5800.0     324679.7    559.8
Pipe Throughput                               12440.0     166992.3    134.2
Pipe-based Context Switching                   4000.0       8030.5     20.1
Process Creation                                126.0       1990.5    158.0
Shell Scripts (1 concurrent)                     42.4       1834.1    432.6
Shell Scripts (8 concurrent)                      6.0        213.3    355.6
System Call Overhead                          15000.0      90003.2     60.0
                                                                   ========
System Benchmarks Index Score                                         207.9

------------------------------------------------------------------------
Benchmark Run: Tue Mar 22 2022 12:04:11 - 12:32:30
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables        7625041.1 lps   (10.1 s, 7 samples)
Double-Precision Whetstone                     1508.2 MWIPS (9.6 s, 7 samples)
Execl Throughput                                730.5 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         79684.4 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           21435.4 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        234122.1 KBps  (30.0 s, 2 samples)
Pipe Throughput                              120705.5 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                  22937.9 lps   (10.1 s, 7 samples)
Process Creation                               1755.0 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                   1675.1 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                    206.6 lpm   (60.4 s, 2 samples)
System Call Overhead                          62776.6 lps   (10.1 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    7625041.1    653.4
Double-Precision Whetstone                       55.0       1508.2    274.2
Execl Throughput                                 43.0        730.5    169.9
File Copy 1024 bufsize 2000 maxblocks          3960.0      79684.4    201.2
File Copy 256 bufsize 500 maxblocks            1655.0      21435.4    129.5
File Copy 4096 bufsize 8000 maxblocks          5800.0     234122.1    403.7
Pipe Throughput                               12440.0     120705.5     97.0
Pipe-based Context Switching                   4000.0      22937.9     57.3
Process Creation                                126.0       1755.0    139.3
Shell Scripts (1 concurrent)                     42.4       1675.1    395.1
Shell Scripts (8 concurrent)                      6.0        206.6    344.3
System Call Overhead                          15000.0      62776.6     41.9
                                                                   ========
System Benchmarks Index Score                                         183.0

Serverless Agent あり

root@ip-10-0-1-237:/byte-unixbench/UnixBench# /opt/draios/bin/pdig -t 0 ./Run
gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c 
gcc -o pgms/register -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum='register int' src/arith.c 
gcc -o pgms/short -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=short src/arith.c 
gcc -o pgms/int -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=int src/arith.c 
gcc -o pgms/long -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=long src/arith.c 
gcc -o pgms/float -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c 
gcc -o pgms/double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=double src/arith.c 
gcc -o pgms/hanoi -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/hanoi.c 
gcc -o pgms/syscall -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/syscall.c 
gcc -o pgms/context1 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/context1.c 
gcc -o pgms/pipe -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/pipe.c 
gcc -o pgms/spawn -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/spawn.c 
gcc -o pgms/execl -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/execl.c 
gcc -o pgms/dhry2 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/dhry2reg -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= -DREG=register ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/looper -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/looper.c 
gcc -o pgms/fstime -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/fstime.c 
gcc -o pgms/whetstone-double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DDP -DGTODay -DUNIXBENCH src/whets.c -lm
make all
make[1]: Entering directory '/byte-unixbench/UnixBench'
make distr
make[2]: Entering directory '/byte-unixbench/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[2]: Leaving directory '/byte-unixbench/UnixBench'
make programs
make[2]: Entering directory '/byte-unixbench/UnixBench'
make[2]: Nothing to be done for 'programs'.
make[2]: Leaving directory '/byte-unixbench/UnixBench'
make[1]: Leaving directory '/byte-unixbench/UnixBench'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /byte-unixbench/UnixBench/tmp
      * Results                      = /byte-unixbench/UnixBench/results
------------------------------------------------------------------------------


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

2 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

2 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

2 x Execl Throughput  1 2 3

2 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

2 x File Copy 256 bufsize 500 maxblocks  1 2 3

2 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

2 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

2 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

2 x Process Creation  1 2 3

2 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

2 x Shell Scripts (1 concurrent)  1 2 3

2 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: ip-10-0-1-237.ec2.internal: GNU/Linux
   OS: GNU/Linux -- 4.14.262-200.489.amzn2.x86_64 -- #1 SMP Fri Feb 4 20:34:30 UTC 2022
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   CPU 0: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (5000.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 1: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (5000.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   12:03:52 up 40 min,  0 users,  load average: 0.03, 0.05, 0.06; runlevel 

------------------------------------------------------------------------
Benchmark Run: Tue Mar 22 2022 12:03:52 - 12:31:58
2 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        9977280.2 lps   (10.1 s, 7 samples)
Double-Precision Whetstone                     1611.5 MWIPS (9.6 s, 7 samples)
Execl Throughput                                167.3 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        105244.6 KBps  (30.1 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           29112.7 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        309992.6 KBps  (30.0 s, 2 samples)
Pipe Throughput                              156500.2 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                   8305.2 lps   (10.1 s, 7 samples)
Process Creation                                546.5 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                    426.9 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                     61.4 lpm   (60.6 s, 2 samples)
System Call Overhead                           2077.6 lps   (10.1 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    9977280.2    855.0
Double-Precision Whetstone                       55.0       1611.5    293.0
Execl Throughput                                 43.0        167.3     38.9
File Copy 1024 bufsize 2000 maxblocks          3960.0     105244.6    265.8
File Copy 256 bufsize 500 maxblocks            1655.0      29112.7    175.9
File Copy 4096 bufsize 8000 maxblocks          5800.0     309992.6    534.5
Pipe Throughput                               12440.0     156500.2    125.8
Pipe-based Context Switching                   4000.0       8305.2     20.8
Process Creation                                126.0        546.5     43.4
Shell Scripts (1 concurrent)                     42.4        426.9    100.7
Shell Scripts (8 concurrent)                      6.0         61.4    102.3
System Call Overhead                          15000.0       2077.6      1.4
                                                                   ========
System Benchmarks Index Score                                          92.5

------------------------------------------------------------------------
Benchmark Run: Tue Mar 22 2022 12:31:58 - 13:00:25
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables        7069816.8 lps   (10.1 s, 7 samples)
Double-Precision Whetstone                     1484.8 MWIPS (9.7 s, 7 samples)
Execl Throughput                                194.1 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         76349.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           20649.5 KBps  (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        223618.9 KBps  (30.0 s, 2 samples)
Pipe Throughput                              114207.0 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                  22455.3 lps   (10.1 s, 7 samples)
Process Creation                                531.1 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                    454.6 lpm   (60.2 s, 2 samples)
Shell Scripts (8 concurrent)                     60.7 lpm   (61.3 s, 2 samples)
System Call Overhead                           3124.8 lps   (10.1 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    7069816.8    605.8
Double-Precision Whetstone                       55.0       1484.8    270.0
Execl Throughput                                 43.0        194.1     45.1
File Copy 1024 bufsize 2000 maxblocks          3960.0      76349.2    192.8
File Copy 256 bufsize 500 maxblocks            1655.0      20649.5    124.8
File Copy 4096 bufsize 8000 maxblocks          5800.0     223618.9    385.5
Pipe Throughput                               12440.0     114207.0     91.8
Pipe-based Context Switching                   4000.0      22455.3     56.1
Process Creation                                126.0        531.1     42.1
Shell Scripts (1 concurrent)                     42.4        454.6    107.2
Shell Scripts (8 concurrent)                      6.0         60.7    101.2
System Call Overhead                          15000.0       3124.8      2.1
                                                                   ========
System Benchmarks Index Score                                          91.3

多くのシナリオで、Serverless Agent をインストールした場合には性能が劣化する結果となりました。
System Benchmarks Index Score は以下のとおりでした。

  • Serverless Agent なしの場合 : 207.9
  • Serverless Agent ありの場合 : 92.5

50 %程度スコアが落ち込んでいることがわかります。
シナリオによってはスコアに差がないものもあり、これらは別のボトルネックにぶつかっているか、インストゥルメンテーションの影響を受けにくい状況になっていると考えられます。2

Sysdig Agent との比較

Sysdig のドキュメントやブログによると、Serverless Agent と比べ、通常の Sysdig Agent はカーネルインストゥルメンテーションが行えるため性能への影響を与えにくいとされています。
影響の度合いを比較するため、EC2 に Sysdig Agent を入れたときの UNIX Bench のスコアも計測しました。

EC2 インスタンスは以下の設定のものを用意しました。

実行結果は以下のとおりです。
前述の Fargate タスクの検証時よりも CPU, メモリ が多く割り当てられている環境なので、ベースラインが異なる点にご注意ください。

UNIX Bench シナリオ別 Index 値の比較(1 コア使用)

f:id:polar3130:20220324143727p:plain

コンソールの出力も残しておきます。
Sysdig Agent なしの結果は、単純な EC2 (t2.micro) のベンチマーク結果としてもみることができますね。

Sysdig Agent なし

root@ip-10-0-101-148:~/byte-unixbench/UnixBench# ./Run
gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c 
gcc -o pgms/register -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum='register int' src/arith.c 
gcc -o pgms/short -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=short src/arith.c 
gcc -o pgms/int -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=int src/arith.c 
gcc -o pgms/long -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=long src/arith.c 
gcc -o pgms/float -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c 
gcc -o pgms/double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=double src/arith.c 
gcc -o pgms/hanoi -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/hanoi.c 
gcc -o pgms/syscall -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/syscall.c 
gcc -o pgms/context1 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/context1.c 
gcc -o pgms/pipe -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/pipe.c 
gcc -o pgms/spawn -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/spawn.c 
gcc -o pgms/execl -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/execl.c 
gcc -o pgms/dhry2 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/dhry2reg -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= -DREG=register ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/looper -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/looper.c 
gcc -o pgms/fstime -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/fstime.c 
gcc -o pgms/whetstone-double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DDP -DGTODay -DUNIXBENCH src/whets.c -lm
make all
make[1]: Entering directory '/root/byte-unixbench/UnixBench'
make distr
make[2]: Entering directory '/root/byte-unixbench/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[2]: Leaving directory '/root/byte-unixbench/UnixBench'
make programs
make[2]: Entering directory '/root/byte-unixbench/UnixBench'
make[2]: Nothing to be done for 'programs'.
make[2]: Leaving directory '/root/byte-unixbench/UnixBench'
make[1]: Leaving directory '/root/byte-unixbench/UnixBench'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /root/byte-unixbench/UnixBench/tmp
      * Results                      = /root/byte-unixbench/UnixBench/results
------------------------------------------------------------------------------


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: ip-10-0-101-148: GNU/Linux
   OS: GNU/Linux -- 4.19.0-14-cloud-amd64 -- #1 SMP Debian 4.19.171-2 (2021-01-30)
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   CPU 0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz (4788.9 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   12:19:51 up 18 min,  1 user,  load average: 0.39, 0.20, 0.08; runlevel Mar

------------------------------------------------------------------------
Benchmark Run: Wed Mar 23 2022 12:19:51 - 12:47:47
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       33428472.8 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     5339.8 MWIPS (9.1 s, 7 samples)
Execl Throughput                               3989.5 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        545115.4 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          139827.1 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1704837.6 KBps  (30.0 s, 2 samples)
Pipe Throughput                              683291.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 198564.9 lps   (10.0 s, 7 samples)
Process Creation                              11331.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   8369.9 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1099.6 lpm   (60.0 s, 2 samples)
System Call Overhead                         385521.0 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   33428472.8   2864.5
Double-Precision Whetstone                       55.0       5339.8    970.9
Execl Throughput                                 43.0       3989.5    927.8
File Copy 1024 bufsize 2000 maxblocks          3960.0     545115.4   1376.6
File Copy 256 bufsize 500 maxblocks            1655.0     139827.1    844.9
File Copy 4096 bufsize 8000 maxblocks          5800.0    1704837.6   2939.4
Pipe Throughput                               12440.0     683291.4    549.3
Pipe-based Context Switching                   4000.0     198564.9    496.4
Process Creation                                126.0      11331.7    899.3
Shell Scripts (1 concurrent)                     42.4       8369.9   1974.0
Shell Scripts (8 concurrent)                      6.0       1099.6   1832.7
System Call Overhead                          15000.0     385521.0    257.0
                                                                   ========
System Benchmarks Index Score                                        1060.0

Sysdig Agent あり

root@ip-10-0-101-110:~/byte-unixbench/UnixBench# ./Run
gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c 
gcc -o pgms/register -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum='register int' src/arith.c 
gcc -o pgms/short -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=short src/arith.c 
gcc -o pgms/int -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=int src/arith.c 
gcc -o pgms/long -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=long src/arith.c 
gcc -o pgms/float -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c 
gcc -o pgms/double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=double src/arith.c 
gcc -o pgms/hanoi -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/hanoi.c 
gcc -o pgms/syscall -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/syscall.c 
gcc -o pgms/context1 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/context1.c 
gcc -o pgms/pipe -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/pipe.c 
gcc -o pgms/spawn -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/spawn.c 
gcc -o pgms/execl -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/execl.c 
gcc -o pgms/dhry2 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/dhry2reg -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= -DREG=register ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/looper -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/looper.c 
gcc -o pgms/fstime -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/fstime.c 
gcc -o pgms/whetstone-double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DDP -DGTODay -DUNIXBENCH src/whets.c -lm
make all
make[1]: Entering directory '/root/byte-unixbench/UnixBench'
make distr
make[2]: Entering directory '/root/byte-unixbench/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[2]: Leaving directory '/root/byte-unixbench/UnixBench'
make programs
make[2]: Entering directory '/root/byte-unixbench/UnixBench'
make[2]: Nothing to be done for 'programs'.
make[2]: Leaving directory '/root/byte-unixbench/UnixBench'
make[1]: Leaving directory '/root/byte-unixbench/UnixBench'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /root/byte-unixbench/UnixBench/tmp
      * Results                      = /root/byte-unixbench/UnixBench/results
------------------------------------------------------------------------------


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: ip-10-0-101-110: GNU/Linux
   OS: GNU/Linux -- 4.19.0-14-cloud-amd64 -- #1 SMP Debian 4.19.171-2 (2021-01-30)
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   CPU 0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz (4800.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   12:16:57 up 16 min,  1 user,  load average: 0.27, 0.28, 0.12; runlevel Mar

------------------------------------------------------------------------
Benchmark Run: Wed Mar 23 2022 12:16:57 - 12:44:59
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       33409055.1 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     5323.8 MWIPS (9.1 s, 7 samples)
Execl Throughput                               2359.3 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        440257.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          109575.1 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1401446.4 KBps  (30.0 s, 2 samples)
Pipe Throughput                              515217.8 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 159861.0 lps   (10.0 s, 7 samples)
Process Creation                               6785.3 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5027.4 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    762.4 lpm   (60.0 s, 2 samples)
System Call Overhead                         137465.4 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   33409055.1   2862.8
Double-Precision Whetstone                       55.0       5323.8    968.0
Execl Throughput                                 43.0       2359.3    548.7
File Copy 1024 bufsize 2000 maxblocks          3960.0     440257.2   1111.8
File Copy 256 bufsize 500 maxblocks            1655.0     109575.1    662.1
File Copy 4096 bufsize 8000 maxblocks          5800.0    1401446.4   2416.3
Pipe Throughput                               12440.0     515217.8    414.2
Pipe-based Context Switching                   4000.0     159861.0    399.7
Process Creation                                126.0       6785.3    538.5
Shell Scripts (1 concurrent)                     42.4       5027.4   1185.7
Shell Scripts (8 concurrent)                      6.0        762.4   1270.6
System Call Overhead                          15000.0     137465.4     91.6
                                                                   ========
System Benchmarks Index Score                                         753.1

多くのシナリオで、Sysdig Agent をインストールした場合には性能が劣化する結果となりました。
System Benchmarks Index Score は以下のとおりでした。

  • Sysdig Agent なしの場合 : 1060.0
  • Sysdig Agent ありの場合 : 753.1

25 %程度スコアが落ち込んでいることがわかります。
割り当てリソースの差などもあるため一概には言えませんが、Serverless Agent よりは性能影響は少なそうだという印象です。

簡単にですが、Serverless Agent および Sysdig Agent でインストゥルメンテーションを行うことでベンチマークのスコアにどの程度の影響があるのかを見ることができました。
当然ながら、アプリケーションの特性に応じて性能への影響度合いは変化するため、条件によっては今回の結果より悪くなることもあれば良くなることもあると考えられます。
また、ランタイムポリシ(Sysdig Secure Rules)の数や内容、エージェントのバージョン、タスク定義で設定しているリソース( CPU, メモリ)など様々な影響要によって結果が変わってくると思います。

補足 (1)

いくつかの仕様やセットアップ手順の確認のために Sysdig のサポートへ問い合わせをしたのですが、大変親切に対応頂きました。
とてもレスポンスが早く、技術的な内容にも正確に回答頂き、サポート品質の重要性を再認識しました。
なお、サポートとのやり取りは英語になります。

補足 (2)

今回は ECS Fargate で起動した Debian のコンテナに ECS Exec でログインしてベンチマークを叩いていたのですが、その際 ECS Exec 実行時の気付きがあったのでこちらも書き残しておきます。

ECS Exec 実行時、以下のエラーメッセージが表示された場合は、タスクロールの権限 が不足している可能性があります。
本当に内部エラーの場合もあるかもしれませんが、まずは必要な IAM アクセス許可 (ssmmessages:...) が付与できているか確認することをおすすめします。

$ aws ecs execute-command ...

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.

An error occurred (TargetNotConnectedException) when calling the ExecuteCommand operation: The execute command failed due to an internal error. Try again later.

まとめ

全 3 回の連載を通じて、ECS Fargate ワークロードを Sysdig Serverless Agent で保護する方法をご紹介しました。
Sysdig Serverless Agent や ECS Fargate 環境のランタイム保護については海外を含めてまだ情報が少なく、実際に使ってみることで色々と新しい気付きを得られました。
今回の記事が、ECS Fargate ワークロードのセキュリティ対策を検討されている方や Sysdig の利用を検討されている方のお役に立てば幸いです。

参考

記事執筆にあたり参考にさせて頂いた情報へのリンクを列挙しておきます。

Sysdig のアーキテクチャを理解するにあたり、少し古い情報ですが以下のホワイトペーパーなどが役立ちました。

Fargate 利用時にユーザが考慮すべきセキュリティ対策については、以下に挙げる AWS re:Invent 2019 の Fargate 環境におけるセキュリティベストプラクティスを紹介したセッションや、Sysdig のブログに掲載されている Fargate 環境の脅威モデリングに関する記事が参考になりました。

サンプルアプリケーションの CloudFormation テンプレート作成時に以下を参考にさせて頂きました。


  1. ブログのほうではどのようなベンチマークツールを使用したのかが書かれていませんでしたが、もしかすると同じベンチマークの結果を指しているのかもしれません

  2. あくまで推測ですが、Serverless Agent は性能とのバランスを取るために一部のシステムコールの検出を seccomp で除外しているため、除外対象のシステムコールが多かったことで性能差が生じにくいシナリオがあった可能性もあるのではと考えます