Skip to main content

Antivirus for Amazon S3

Project description

cloudcomponents Logo

@cloudcomponents/cdk-s3-antivirus

Build Status cdkdx typescript python

Antivirus for Amazon S3

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-s3-antivirus

Python:

pip install cloudcomponents.cdk-s3-antivirus

How to use

import { Scanner } from '@cloudcomponents/cdk-s3-antivirus';
import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { SnsDestination } from 'aws-cdk-lib/aws-lambda-destinations';
import { Bucket } from 'aws-cdk-lib/aws-s3';
import { Topic } from 'aws-cdk-lib/aws-sns';
import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
import { Construct } from 'constructs';

export class S3AntivirusStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps) {
    super(scope, id, props);

    const bucket = new Bucket(this, 'Bucket', {
      autoDeleteObjects: true,
      removalPolicy: RemovalPolicy.DESTROY,
    });

    const topic = new Topic(this, 'Topic');
    if (process.env.DEVSECOPS_TEAM_EMAIL) {
      topic.addSubscription(new EmailSubscription(process.env.DEVSECOPS_TEAM_EMAIL));
    }

    const scanner = new Scanner(this, 'Scanner', {
      onResult: new SnsDestination(topic),
      onError: new SnsDestination(topic),
    });

    scanner.addSourceBucket(bucket);
  }
}

API Reference

See API.md.

Example

See more complete examples.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudcomponents.cdk-s3-antivirus-2.4.0.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

File details

Details for the file cloudcomponents.cdk-s3-antivirus-2.4.0.tar.gz.

File metadata

File hashes

Hashes for cloudcomponents.cdk-s3-antivirus-2.4.0.tar.gz
Algorithm Hash digest
SHA256 bf8f0474b78f9e12d1172ab793c9431c8f0890b53b67b3ba738721ab20a1c22b
MD5 fba44dfd03b1545a8c2baf65dec8af37
BLAKE2b-256 ef252e6efcbb7a9ca36914e56e55c989fe151f2f87304be70e95fa6239a22217

See more details on using hashes here.

File details

Details for the file cloudcomponents.cdk_s3_antivirus-2.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudcomponents.cdk_s3_antivirus-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49638fda8bd9b3117c0f55253d5c6597a24c99e7e13bb802301b97845f3f2121
MD5 8e91fd9a782877bc8fce39003194ce35
BLAKE2b-256 acc9566ac4b119f94acf3cd0ca3c4ff99fc60972ceeee64860805c55873b369e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page