質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
AWS Lambda

AWS Lambdaは、クラウド上でアプリを実行できるコンピューティングサービス。サーバーのプロビジョニングや管理を要せず複数のイベントに対してコードを実行します。カスタムロジック用いた他AWSサービスの拡張やAWSの規模やパフォーマンスを用いたバックエンドサービスを作成できます。

Q&A

解決済

1回答

3494閲覧

AWS lambdaを使用したウイルススキャンについて

pen_ari

総合スコア50

AWS Lambda

AWS Lambdaは、クラウド上でアプリを実行できるコンピューティングサービス。サーバーのプロビジョニングや管理を要せず複数のイベントに対してコードを実行します。カスタムロジック用いた他AWSサービスの拡張やAWSの規模やパフォーマンスを用いたバックエンドサービスを作成できます。

0グッド

0クリップ

投稿2021/04/19 04:31

編集2021/04/19 04:39

前提・実現したいこと

以下のgitリポジトリを利用してAWS lambdaを使用したS3Bucketに対するウイルススキャンを実装したいです
https://github.com/upsidetravel/bucket-antivirus-function

readmeを参考にlambda関数を作成しておりますが、
ウイルス定義ファイルを更新する関数
update.lambda_handler
を実行すると以下のエラーメッセージが返却され、実行ウイルス定義ファイルがダウンロードされません
メッセージから察するにlambdaから共有フォルダが見えていないか存在していないことが原因のようですが、
リポジトリが更新されていないことによるものなのか、私の環境でしか起きないことなのかもわからず困っております。
どなたか詳しい方がいらっしゃいましたらご教示ください

発生している問題・エラーメッセージ

START RequestId: xxxxxxxxxxxxxxxxxxxxxxxx Version: $LATEST Script starting at 2021/04/19 04:37:41 UTC Attempting to create directory /tmp/clamav_defs. Starting freshclam with defs in /tmp/clamav_defs. freshclam output: b'./bin/freshclam: error while loading shared libraries: libprelude.so.28: cannot open shared object file: No such file or directory\n' Unexpected exit code from freshclam: 127. File does not exist: main.cld File does not exist: main.cvd File does not exist: daily.cld File does not exist: daily.cvd File does not exist: bytecode.cld File does not exist: bytecode.cvd Script finished at 2021/04/19 04:37:42 UTC END RequestId: xxxxxxxxxxxxxxxxxxxxxxxx REPORT RequestId: xxxxxxxxxxxxxxxxxxxxxxxx Duration: 2604.36 ms Billed Duration: 2605 ms Memory Size: 128 MB Max Memory Used: 85 MB Init Duration: 334.40 ms

補足情報(FW/ツールのバージョンなど)

今気になっているのはリポジトリ内のDockerfileはベースがamazonlinux:2
なのに対し、lambdaはランタイムがPython3.7でありAMIはamazonlinux1であることですが、これが関係しているのかもよくわかりません。
ランタイムをpython3.8に変更すると以下のエラーが発生するため、3.7で実行すべきかとは思いますが。。

{ "errorMessage": "[Errno 2] No such file or directory: 'ld'", "errorType": "FileNotFoundError", "stackTrace": [ " File \"/var/task/update.py\", line 44, in lambda_handler\n clamav.update_defs_from_freshclam(AV_DEFINITION_PATH, CLAMAVLIB_PATH)\n", " File \"/var/task/clamav.py\", line 115, in update_defs_from_freshclam\n \":\".join(current_library_search_path()),\n", " File \"/var/task/clamav.py\", line 45, in current_library_search_path\n ld_verbose = subprocess.check_output([\"ld\", \"--verbose\"]).decode(\"utf-8\")\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 415, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 493, in run\n with Popen(*popenargs, **kwargs) as process:\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 858, in __init__\n self._execute_child(args, executable, preexec_fn, close_fds,\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 1706, in _execute_child\n raise child_exception_type(errno_num, err_msg, err_filename)\n" ] }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

https://github.com/upsidetravel/bucket-antivirus-function/issues/125
こちら参考にDockerfile書き換えたら動きました

投稿2021/04/19 04:50

pen_ari

総合スコア50

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問