diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:56:52 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:56:52 +0000 |
commit | 58afbe719c65a53b1b0ae734d28af05621644c29 (patch) | |
tree | bffb5806eacae92554fe3370f27f712a6309ceea /python-cdk-serverless-clamscan.spec | |
parent | 7437723dfc23e894828e78a308f8c54e3327b4c5 (diff) |
automatic import of python-cdk-serverless-clamscan
Diffstat (limited to 'python-cdk-serverless-clamscan.spec')
-rw-r--r-- | python-cdk-serverless-clamscan.spec | 626 |
1 files changed, 626 insertions, 0 deletions
diff --git a/python-cdk-serverless-clamscan.spec b/python-cdk-serverless-clamscan.spec new file mode 100644 index 0000000..c24a7cb --- /dev/null +++ b/python-cdk-serverless-clamscan.spec @@ -0,0 +1,626 @@ +%global _empty_manifest_terminate_build 0 +Name: python-cdk-serverless-clamscan +Version: 2.4.211 +Release: 1 +Summary: Serverless architecture to virus scan objects in Amazon S3. +License: Apache-2.0 +URL: https://github.com/awslabs/cdk-serverless-clamscan +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a9/92/df46c581dc9fa7c2757242448166aff00013eab52b0bf09384c787a826bc/cdk-serverless-clamscan-2.4.211.tar.gz +BuildArch: noarch + +Requires: python3-aws-cdk-lib +Requires: python3-constructs +Requires: python3-jsii +Requires: python3-publication +Requires: python3-typeguard + +%description +# cdk-serverless-clamscan + +[](https://badge.fury.io/js/cdk-serverless-clamscan) +[](https://badge.fury.io/py/cdk-serverless-clamscan) + +An [aws-cdk](https://github.com/aws/aws-cdk) construct that uses [ClamAV®](https://www.clamav.net/) to scan newly uploaded objects to Amazon S3 for viruses. The construct provides a flexible interface for a system to act based on the results of a ClamAV virus scan. Check out this [blogpost](https://aws.amazon.com/blogs/developer/virus-scan-s3-buckets-with-a-serverless-clamav-based-cdk-construct/) for a guided walkthrough. + + + +## Pre-Requisites + +**Docker:** The ClamAV Lambda functions utilizes a [container image](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) that is built locally using [docker bundling](https://aws.amazon.com/blogs/devops/building-apps-with-aws-cdk/) + +## Examples + +This project uses [projen](https://github.com/projen/projen) and thus all the constructs follow language specific standards and naming patterns. For more information on how to translate the following examples into your desired language read the CDK guide on [Translating TypeScript AWS CDK code to other languages](https://docs.aws.amazon.com/cdk/latest/guide/multiple_languages.html) + +### Example 1. (Default destinations with rule target) + +<details><summary>typescript</summary> +<p> + +```python +import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; +import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const sc = new ServerlessClamscan(this, 'rClamscan', { + buckets: bucketList, + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + const infectedTopic = new Topic(this, 'rInfectedTopic'); + sc.infectedRule?.addTarget( + new SnsTopic(infectedTopic, { + message: RuleTargetInput.fromEventPath( + '$.detail.responsePayload.message', + ), + }), + ); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_events as events, + aws_events_targets as events_targets, + aws_s3 as s3, + aws_sns as sns +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) + infected_topic = sns.Topic(self, "rInfectedTopic") + if sc.infected_rule != None: + sc.infected_rule.add_target( + events_targets.SnsTopic( + infected_topic, + message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), + ) + ) +``` + +</p> +</details> + +### Example 2. (Bring your own destinations) + +<details><summary>typescript</summary> +<p> + +```python +import { + SqsDestination, + EventBridgeDestination, +} from 'aws-cdk-lib/aws-lambda-destinations'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Queue } from 'aws-cdk-lib/aws-sqs'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const queue = new Queue(this, 'rQueue'); + const sc = new ServerlessClamscan(this, 'default', { + buckets: bucketList, + onResult: new EventBridgeDestination(), + onError: new SqsDestination(queue), + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_lambda_destinations as lambda_destinations, + aws_s3 as s3, + aws_sqs as sqs +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + queue = sqs.Queue(self, "rQueue") + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + on_result=lambda_destinations.EventBridgeDestination(), + on_error=lambda_destinations.SqsDestination(queue), + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) +``` + +</p> +</details> + +## Operation and Maintenance + +When ClamAV publishes updates to the scanner you will see “Your ClamAV installation is OUTDATED” in your scan results. While the construct creates a system to keep the database definitions up to date, you must update the scanner to detect all the latest Viruses. + +Update the docker images of the Lambda functions with the latest version of ClamAV by re-running `cdk deploy`. + +## API Reference + +See [API.md](./API.md). + +## Contributing + +See [CONTRIBUTING](./CONTRIBUTING.md) for more information. + +## License + +This project is licensed under the Apache-2.0 License. + + +%package -n python3-cdk-serverless-clamscan +Summary: Serverless architecture to virus scan objects in Amazon S3. +Provides: python-cdk-serverless-clamscan +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-cdk-serverless-clamscan +# cdk-serverless-clamscan + +[](https://badge.fury.io/js/cdk-serverless-clamscan) +[](https://badge.fury.io/py/cdk-serverless-clamscan) + +An [aws-cdk](https://github.com/aws/aws-cdk) construct that uses [ClamAV®](https://www.clamav.net/) to scan newly uploaded objects to Amazon S3 for viruses. The construct provides a flexible interface for a system to act based on the results of a ClamAV virus scan. Check out this [blogpost](https://aws.amazon.com/blogs/developer/virus-scan-s3-buckets-with-a-serverless-clamav-based-cdk-construct/) for a guided walkthrough. + + + +## Pre-Requisites + +**Docker:** The ClamAV Lambda functions utilizes a [container image](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) that is built locally using [docker bundling](https://aws.amazon.com/blogs/devops/building-apps-with-aws-cdk/) + +## Examples + +This project uses [projen](https://github.com/projen/projen) and thus all the constructs follow language specific standards and naming patterns. For more information on how to translate the following examples into your desired language read the CDK guide on [Translating TypeScript AWS CDK code to other languages](https://docs.aws.amazon.com/cdk/latest/guide/multiple_languages.html) + +### Example 1. (Default destinations with rule target) + +<details><summary>typescript</summary> +<p> + +```python +import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; +import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const sc = new ServerlessClamscan(this, 'rClamscan', { + buckets: bucketList, + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + const infectedTopic = new Topic(this, 'rInfectedTopic'); + sc.infectedRule?.addTarget( + new SnsTopic(infectedTopic, { + message: RuleTargetInput.fromEventPath( + '$.detail.responsePayload.message', + ), + }), + ); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_events as events, + aws_events_targets as events_targets, + aws_s3 as s3, + aws_sns as sns +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) + infected_topic = sns.Topic(self, "rInfectedTopic") + if sc.infected_rule != None: + sc.infected_rule.add_target( + events_targets.SnsTopic( + infected_topic, + message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), + ) + ) +``` + +</p> +</details> + +### Example 2. (Bring your own destinations) + +<details><summary>typescript</summary> +<p> + +```python +import { + SqsDestination, + EventBridgeDestination, +} from 'aws-cdk-lib/aws-lambda-destinations'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Queue } from 'aws-cdk-lib/aws-sqs'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const queue = new Queue(this, 'rQueue'); + const sc = new ServerlessClamscan(this, 'default', { + buckets: bucketList, + onResult: new EventBridgeDestination(), + onError: new SqsDestination(queue), + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_lambda_destinations as lambda_destinations, + aws_s3 as s3, + aws_sqs as sqs +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + queue = sqs.Queue(self, "rQueue") + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + on_result=lambda_destinations.EventBridgeDestination(), + on_error=lambda_destinations.SqsDestination(queue), + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) +``` + +</p> +</details> + +## Operation and Maintenance + +When ClamAV publishes updates to the scanner you will see “Your ClamAV installation is OUTDATED” in your scan results. While the construct creates a system to keep the database definitions up to date, you must update the scanner to detect all the latest Viruses. + +Update the docker images of the Lambda functions with the latest version of ClamAV by re-running `cdk deploy`. + +## API Reference + +See [API.md](./API.md). + +## Contributing + +See [CONTRIBUTING](./CONTRIBUTING.md) for more information. + +## License + +This project is licensed under the Apache-2.0 License. + + +%package help +Summary: Development documents and examples for cdk-serverless-clamscan +Provides: python3-cdk-serverless-clamscan-doc +%description help +# cdk-serverless-clamscan + +[](https://badge.fury.io/js/cdk-serverless-clamscan) +[](https://badge.fury.io/py/cdk-serverless-clamscan) + +An [aws-cdk](https://github.com/aws/aws-cdk) construct that uses [ClamAV®](https://www.clamav.net/) to scan newly uploaded objects to Amazon S3 for viruses. The construct provides a flexible interface for a system to act based on the results of a ClamAV virus scan. Check out this [blogpost](https://aws.amazon.com/blogs/developer/virus-scan-s3-buckets-with-a-serverless-clamav-based-cdk-construct/) for a guided walkthrough. + + + +## Pre-Requisites + +**Docker:** The ClamAV Lambda functions utilizes a [container image](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) that is built locally using [docker bundling](https://aws.amazon.com/blogs/devops/building-apps-with-aws-cdk/) + +## Examples + +This project uses [projen](https://github.com/projen/projen) and thus all the constructs follow language specific standards and naming patterns. For more information on how to translate the following examples into your desired language read the CDK guide on [Translating TypeScript AWS CDK code to other languages](https://docs.aws.amazon.com/cdk/latest/guide/multiple_languages.html) + +### Example 1. (Default destinations with rule target) + +<details><summary>typescript</summary> +<p> + +```python +import { RuleTargetInput } from 'aws-cdk-lib/aws-events'; +import { SnsTopic } from 'aws-cdk-lib/aws-events-targets'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const sc = new ServerlessClamscan(this, 'rClamscan', { + buckets: bucketList, + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + const infectedTopic = new Topic(this, 'rInfectedTopic'); + sc.infectedRule?.addTarget( + new SnsTopic(infectedTopic, { + message: RuleTargetInput.fromEventPath( + '$.detail.responsePayload.message', + ), + }), + ); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_events as events, + aws_events_targets as events_targets, + aws_s3 as s3, + aws_sns as sns +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) + infected_topic = sns.Topic(self, "rInfectedTopic") + if sc.infected_rule != None: + sc.infected_rule.add_target( + events_targets.SnsTopic( + infected_topic, + message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'), + ) + ) +``` + +</p> +</details> + +### Example 2. (Bring your own destinations) + +<details><summary>typescript</summary> +<p> + +```python +import { + SqsDestination, + EventBridgeDestination, +} from 'aws-cdk-lib/aws-lambda-destinations'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Queue } from 'aws-cdk-lib/aws-sqs'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { ServerlessClamscan } from 'cdk-serverless-clamscan'; + +export class CdkTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const bucket_1 = new Bucket(this, 'rBucket1'); + const bucket_2 = new Bucket(this, 'rBucket2'); + const bucketList = [bucket_1, bucket_2]; + const queue = new Queue(this, 'rQueue'); + const sc = new ServerlessClamscan(this, 'default', { + buckets: bucketList, + onResult: new EventBridgeDestination(), + onError: new SqsDestination(queue), + }); + const bucket_3 = new Bucket(this, 'rBucket3'); + sc.addSourceBucket(bucket_3); + } +} +``` + +</p> +</details><details><summary>python</summary> +<p> + +```python +from aws_cdk import ( + Stack, + aws_lambda_destinations as lambda_destinations, + aws_s3 as s3, + aws_sqs as sqs +) +from cdk_serverless_clamscan import ServerlessClamscan +from constructs import Construct + +class CdkTestStack(Stack): + + def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: + super().__init__(scope, construct_id, **kwargs) + + bucket_1 = s3.Bucket(self, "rBucket1") + bucket_2 = s3.Bucket(self, "rBucket2") + bucketList = [ bucket_1, bucket_2 ] + queue = sqs.Queue(self, "rQueue") + sc = ServerlessClamscan(self, "rClamScan", + buckets=bucketList, + on_result=lambda_destinations.EventBridgeDestination(), + on_error=lambda_destinations.SqsDestination(queue), + ) + bucket_3 = s3.Bucket(self, "rBucket3") + sc.add_source_bucket(bucket_3) +``` + +</p> +</details> + +## Operation and Maintenance + +When ClamAV publishes updates to the scanner you will see “Your ClamAV installation is OUTDATED” in your scan results. While the construct creates a system to keep the database definitions up to date, you must update the scanner to detect all the latest Viruses. + +Update the docker images of the Lambda functions with the latest version of ClamAV by re-running `cdk deploy`. + +## API Reference + +See [API.md](./API.md). + +## Contributing + +See [CONTRIBUTING](./CONTRIBUTING.md) for more information. + +## License + +This project is licensed under the Apache-2.0 License. + + +%prep +%autosetup -n cdk-serverless-clamscan-2.4.211 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-cdk-serverless-clamscan -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 2.4.211-1 +- Package Spec generated |