monocdk-serverless-clamscan


Namemonocdk-serverless-clamscan JSON
Version 1.2.18 PyPI version JSON
download
home_pagehttps://github.com/awslabs/cdk-serverless-clamscan
SummaryServerless architecture to virus scan objects in Amazon S3.
upload_time2022-05-31 00:32:44
maintainer
docs_urlNone
authorAmazon Web Services<donti@amazon.com>
requires_python~=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cdk-serverless-clamscan

| Language   | cdk-serverless-clamscan                                                                                   | monocdk-serverless-clamscan                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Python     | [![PyPI version](https://badge.fury.io/py/cdk-serverless-clamscan.svg)](https://badge.fury.io/py/cdk-serverless-clamscan) | [![PyPI version](https://badge.fury.io/py/monocdk-serverless-clamscan.svg)](https://badge.fury.io/py/monocdk-serverless-clamscan) |
| TypeScript | [![npm version](https://badge.fury.io/js/cdk-serverless-clamscan.svg)](https://badge.fury.io/js/cdk-serverless-clamscan)  | [![npm version](https://badge.fury.io/js/monocdk-serverless-clamscan.svg)](https://badge.fury.io/js/monocdk-serverless-clamscan)  |

* If your project uses cdk version **1.x.x** use `cdk-serverless-clamscan` **^1.0.0**
* If your project uses cdk version **2.x.x** use `cdk-serverless-clamscan` **^2.0.0**
* If your project uses monocdk use `monocdk-serverless-clamscan` **^1.0.0**

An [aws-cdk](https://github.com/aws/aws-cdk) construct that uses [ClamAV®](https://www.clamav.net/) to scan objects in Amazon S3 for viruses. The construct provides a flexible interface for a system to act based on the results of a ClamAV virus scan.

![Overview](serverless-clamscan.png)

## 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/aws-events';
import { SnsTopic } from '@aws-cdk/aws-events-targets';
import { Bucket } from '@aws-cdk/aws-s3';
import { Topic } from '@aws-cdk/aws-sns';
import { Construct, Stack, StackProps } from '@aws-cdk/core';
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 (
  core as core,
  aws_events as events,
  aws_events_targets as events_targets,
  aws_s3 as s3,
  aws_sns as sns
)
from cdk_serverless_clamscan import ServerlessClamscan

class CdkTestStack(core.Stack):

  def __init__(self, scope: core.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/aws-lambda-destinations';
import { Bucket } from '@aws-cdk/aws-s3';
import { Queue } from '@aws-cdk/aws-sqs';
import { Construct, Stack, StackProps } from '@aws-cdk/core';
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 (
  core as core,
  aws_lambda_destinations as lambda_destinations,
  aws_s3 as s3,
  aws_sqs as sqs
)
from cdk_serverless_clamscan import ServerlessClamscan

class CdkTestStack(core.Stack):

  def __init__(self, scope: core.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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/awslabs/cdk-serverless-clamscan",
    "name": "monocdk-serverless-clamscan",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Amazon Web Services<donti@amazon.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/51/91/2fe4d74f5691be65c45bf2f72cc855048473ab4d844dc499ae151a5231d5/monocdk-serverless-clamscan-1.2.18.tar.gz",
    "platform": null,
    "description": "# cdk-serverless-clamscan\n\n| Language   | cdk-serverless-clamscan                                                                                   | monocdk-serverless-clamscan                                                                                       |\n| ---------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| Python     | [![PyPI version](https://badge.fury.io/py/cdk-serverless-clamscan.svg)](https://badge.fury.io/py/cdk-serverless-clamscan) | [![PyPI version](https://badge.fury.io/py/monocdk-serverless-clamscan.svg)](https://badge.fury.io/py/monocdk-serverless-clamscan) |\n| TypeScript | [![npm version](https://badge.fury.io/js/cdk-serverless-clamscan.svg)](https://badge.fury.io/js/cdk-serverless-clamscan)  | [![npm version](https://badge.fury.io/js/monocdk-serverless-clamscan.svg)](https://badge.fury.io/js/monocdk-serverless-clamscan)  |\n\n* If your project uses cdk version **1.x.x** use `cdk-serverless-clamscan` **^1.0.0**\n* If your project uses cdk version **2.x.x** use `cdk-serverless-clamscan` **^2.0.0**\n* If your project uses monocdk use `monocdk-serverless-clamscan` **^1.0.0**\n\nAn [aws-cdk](https://github.com/aws/aws-cdk) construct that uses [ClamAV\u00ae](https://www.clamav.net/) to scan objects in Amazon S3 for viruses. The construct provides a flexible interface for a system to act based on the results of a ClamAV virus scan.\n\n![Overview](serverless-clamscan.png)\n\n## Pre-Requisites\n\n**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/)\n\n## Examples\n\nThis 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)\n\n### Example 1. (Default destinations with rule target)\n\n<details><summary>typescript</summary>\n<p>\n\n```python\nimport { RuleTargetInput } from '@aws-cdk/aws-events';\nimport { SnsTopic } from '@aws-cdk/aws-events-targets';\nimport { Bucket } from '@aws-cdk/aws-s3';\nimport { Topic } from '@aws-cdk/aws-sns';\nimport { Construct, Stack, StackProps } from '@aws-cdk/core';\nimport { ServerlessClamscan } from 'cdk-serverless-clamscan';\n\nexport class CdkTestStack extends Stack {\n  constructor(scope: Construct, id: string, props?: StackProps) {\n    super(scope, id, props);\n\n    const bucket_1 = new Bucket(this, 'rBucket1');\n    const bucket_2 = new Bucket(this, 'rBucket2');\n    const bucketList = [bucket_1, bucket_2];\n    const sc = new ServerlessClamscan(this, 'rClamscan', {\n      buckets: bucketList,\n    });\n    const bucket_3 = new Bucket(this, 'rBucket3');\n    sc.addSourceBucket(bucket_3);\n    const infectedTopic = new Topic(this, 'rInfectedTopic');\n    sc.infectedRule?.addTarget(\n      new SnsTopic(infectedTopic, {\n        message: RuleTargetInput.fromEventPath(\n          '$.detail.responsePayload.message',\n        ),\n      }),\n    );\n  }\n}\n```\n\n</p>\n</details><details><summary>python</summary>\n<p>\n\n```python\nfrom aws_cdk import (\n  core as core,\n  aws_events as events,\n  aws_events_targets as events_targets,\n  aws_s3 as s3,\n  aws_sns as sns\n)\nfrom cdk_serverless_clamscan import ServerlessClamscan\n\nclass CdkTestStack(core.Stack):\n\n  def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:\n    super().__init__(scope, construct_id, **kwargs)\n\n    bucket_1 = s3.Bucket(self, \"rBucket1\")\n    bucket_2 = s3.Bucket(self, \"rBucket2\")\n    bucketList = [ bucket_1, bucket_2 ]\n    sc = ServerlessClamscan(self, \"rClamScan\",\n      buckets=bucketList,\n    )\n    bucket_3 = s3.Bucket(self, \"rBucket3\")\n    sc.add_source_bucket(bucket_3)\n    infected_topic = sns.Topic(self, \"rInfectedTopic\")\n    if sc.infected_rule != None:\n      sc.infected_rule.add_target(\n        events_targets.SnsTopic(\n          infected_topic,\n          message=events.RuleTargetInput.from_event_path('$.detail.responsePayload.message'),\n        )\n      )\n```\n\n</p>\n</details>\n\n### Example 2. (Bring your own destinations)\n\n<details><summary>typescript</summary>\n<p>\n\n```python\nimport {\n  SqsDestination,\n  EventBridgeDestination,\n} from '@aws-cdk/aws-lambda-destinations';\nimport { Bucket } from '@aws-cdk/aws-s3';\nimport { Queue } from '@aws-cdk/aws-sqs';\nimport { Construct, Stack, StackProps } from '@aws-cdk/core';\nimport { ServerlessClamscan } from 'cdk-serverless-clamscan';\n\nexport class CdkTestStack extends Stack {\n  constructor(scope: Construct, id: string, props?: StackProps) {\n    super(scope, id, props);\n\n    const bucket_1 = new Bucket(this, 'rBucket1');\n    const bucket_2 = new Bucket(this, 'rBucket2');\n    const bucketList = [bucket_1, bucket_2];\n    const queue = new Queue(this, 'rQueue');\n    const sc = new ServerlessClamscan(this, 'default', {\n      buckets: bucketList,\n      onResult: new EventBridgeDestination(),\n      onError: new SqsDestination(queue),\n    });\n    const bucket_3 = new Bucket(this, 'rBucket3');\n    sc.addSourceBucket(bucket_3);\n  }\n}\n```\n\n</p>\n</details><details><summary>python</summary>\n<p>\n\n```python\nfrom aws_cdk import (\n  core as core,\n  aws_lambda_destinations as lambda_destinations,\n  aws_s3 as s3,\n  aws_sqs as sqs\n)\nfrom cdk_serverless_clamscan import ServerlessClamscan\n\nclass CdkTestStack(core.Stack):\n\n  def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:\n    super().__init__(scope, construct_id, **kwargs)\n\n    bucket_1 = s3.Bucket(self, \"rBucket1\")\n    bucket_2 = s3.Bucket(self, \"rBucket2\")\n    bucketList = [ bucket_1, bucket_2 ]\n    queue = sqs.Queue(self, \"rQueue\")\n    sc = ServerlessClamscan(self, \"rClamScan\",\n      buckets=bucketList,\n      on_result=lambda_destinations.EventBridgeDestination(),\n      on_error=lambda_destinations.SqsDestination(queue),\n    )\n    bucket_3 = s3.Bucket(self, \"rBucket3\")\n    sc.add_source_bucket(bucket_3)\n```\n\n</p>\n</details>\n\n## Operation and Maintenance\n\nWhen ClamAV publishes updates to the scanner you will see \u201cYour ClamAV installation is OUTDATED\u201d 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.\n\nUpdate the docker images of the Lambda functions with the latest version of ClamAV by re-running `cdk deploy`.\n\n## API Reference\n\nSee [API.md](./API.md).\n\n## Contributing\n\nSee [CONTRIBUTING](./CONTRIBUTING.md) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Serverless architecture to virus scan objects in Amazon S3.",
    "version": "1.2.18",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "18c5663c8aad54fb5998debedf684baa",
                "sha256": "7103fff6bc18679a495b5f3ce653e0c40d203874e600fc7f57928e260e739717"
            },
            "downloads": -1,
            "filename": "monocdk_serverless_clamscan-1.2.18-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18c5663c8aad54fb5998debedf684baa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.7",
            "size": 154347,
            "upload_time": "2022-05-31T00:32:39",
            "upload_time_iso_8601": "2022-05-31T00:32:39.620726Z",
            "url": "https://files.pythonhosted.org/packages/cf/02/1fb9e42c1611eddc90b3035ab08e7f7726ca139fa91c2b853d9af9838c5d/monocdk_serverless_clamscan-1.2.18-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4b4fde3db086e3dfa7468d797e606eb2",
                "sha256": "13748f2c61e88415a277978ebcc42fe282722af69744a284869bbf59d59083d8"
            },
            "downloads": -1,
            "filename": "monocdk-serverless-clamscan-1.2.18.tar.gz",
            "has_sig": false,
            "md5_digest": "4b4fde3db086e3dfa7468d797e606eb2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.7",
            "size": 155060,
            "upload_time": "2022-05-31T00:32:44",
            "upload_time_iso_8601": "2022-05-31T00:32:44.303131Z",
            "url": "https://files.pythonhosted.org/packages/51/91/2fe4d74f5691be65c45bf2f72cc855048473ab4d844dc499ae151a5231d5/monocdk-serverless-clamscan-1.2.18.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-31 00:32:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "awslabs",
    "github_project": "cdk-serverless-clamscan",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "monocdk-serverless-clamscan"
}
        
Elapsed time: 0.38113s