Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'non-compliant' and 'compliant' samples for aws-missing-encryptio… #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=0}
import aws_cdk as cdk
from aws_cdk import aws_sqs as sqs


class Stack(cdk.Stack):

def missing_encryption_compliant(self):
# Compliant: encryption present
encrypted_queue = sqs.Queue(self, 'encrypted_queue',
encryption=sqs.QueueEncryption.KMS_MANAGED)
# {/fact}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=1}
import aws_cdk as cdk
from aws_cdk import aws_sqs as sqs


class Stack(cdk.Stack):

def missing_encryption_noncompliant(self):
# Noncompliant: missing encryption
unencrypted_queue = sqs.Queue(self, 'unencrypted_queue')
# {/fact}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=0}
import aws_cdk as cdk
from aws_cdk import aws_s3 as s3


class S3Stack(cdk.Stack):

def missing_authentication_compliant(self):
# Compliant: bucket is private
public_bucket = s3.Bucket(self, 'bucket')
# {/fact}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact [email protected] defects=1}
import aws_cdk as cdk
from aws_cdk import aws_s3 as s3


class S3Stack(cdk.Stack):

def missing_authentication_noncompliant(self):
# Noncompliant: bucket made public
public_bucket = s3.Bucket(self, 'bucket')
public_bucket.grant_public_access()
# {/fact}
Loading