This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: force securetransport traffic only for buckets with dynamic buck…
…et policies (#832) Co-authored-by: Jeet <68876606+jn1119@users.noreply.github.com>
- Loading branch information
1 parent
93dc465
commit 33a4346
Showing
25 changed files
with
789 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Addon for performing S3 Bucket Policy update | ||
|
||
The purpose of this add-on is to edit S3 Bucket Policies | ||
|
||
## npm packages | ||
|
||
- @aws-ee/edit-s3-bucket-policy |
26 changes: 26 additions & 0 deletions
26
addons/addon-edit-s3-bucket-policy/packages/edit-s3-bucket-policy/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"extends": ["plugin:jest/recommended", "airbnb-base", "prettier"], | ||
"plugins": ["jest", "prettier"], | ||
"rules": { | ||
"prettier/prettier": ["error"], | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "^_.+", | ||
"argsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_", | ||
"args": "after-used", | ||
"ignoreRestSiblings": true | ||
} | ||
], | ||
"prefer-destructuring": 0, | ||
"no-underscore-dangle": 0, | ||
"no-param-reassign": 0, | ||
"class-methods-use-this": 0, | ||
"no-use-before-define": 0, | ||
"import/no-unresolved": 0 | ||
}, | ||
"env": { | ||
"jest/globals": true | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
addons/addon-edit-s3-bucket-policy/packages/edit-s3-bucket-policy/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
**/.class | ||
**/.DS_Store | ||
**/coverage | ||
**/node_modules | ||
|
||
**/npm-debug.log | ||
**/pnpm-debug.log | ||
**/npm-debug.log* | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# VisualStudioCode.gitignore | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# dependencies | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# transpiled code | ||
dist | ||
|
||
# misc | ||
.env.local | ||
.env.development | ||
.env.development.local | ||
.env.test.local | ||
.env.production | ||
.env.production.local | ||
|
||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. |
7 changes: 7 additions & 0 deletions
7
addons/addon-edit-s3-bucket-policy/packages/edit-s3-bucket-policy/.prettierrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"tabWidth": 2, | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"quoteProps": "consistent", | ||
"trailingComma": "all" | ||
} |
25 changes: 25 additions & 0 deletions
25
addons/addon-edit-s3-bucket-policy/packages/edit-s3-bucket-policy/jest.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
// jest.config.js | ||
module.exports = { | ||
// verbose: true, | ||
notify: false, | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['/node_modules/', '/.history/', '/__tests__/__fixtures__/'], | ||
// Configure JUnit reporter as CodeBuild currently only supports JUnit or Cucumber reports | ||
// See https://docs.aws.amazon.com/codebuild/latest/userguide/test-reporting.html | ||
reporters: ['default', ['jest-junit', { suiteName: 'jest tests', outputDirectory: './.build/test' }]], | ||
}; |
6 changes: 6 additions & 0 deletions
6
addons/addon-edit-s3-bucket-policy/packages/edit-s3-bucket-policy/jsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"exclude": [ | ||
"node_modules", | ||
"**/node_modules/*" | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
...-bucket-policy/packages/edit-s3-bucket-policy/lib/plugins/edit-s3-bucket-policy-plugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
const EditS3BucketPolicyService = require('../steps/edit-s3-bucket-policy-service'); | ||
|
||
/** | ||
* Returns a map of post deployment steps | ||
* | ||
* @param existingStepsMap Map of existing post deployment steps | ||
* @param pluginRegistry A registry that provides plugins registered by various addons for the specified extension point. | ||
* | ||
* @returns {Promise<*>} | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
async function getSteps(existingStepsMap, pluginRegistry) { | ||
const stepsMap = new Map([['EditS3BucketPolicyService', new EditS3BucketPolicyService()], ...existingStepsMap]); | ||
return stepsMap; | ||
} | ||
|
||
const plugin = { | ||
getSteps, | ||
}; | ||
|
||
module.exports = plugin; |
Oops, something went wrong.