manage and applies data policies to events
.
├── README.md
├── event.json
├── response.json
├── script
│ ├── create-bucket
│ ├── deploy
│ └── package
├── src
│ ├── __tests__
│ │ └── unit
│ │ └── test-handler.js
│ ├── index.js
│ └── package.json
└── template.yaml- AWS CLI already configured with Administrator permission
- NodeJS 8.10+ installed
- Docker installed
. script/buildBy default, this command writes built artifacts to .aws-sam/build folder.
. script/invokeIf you need to create the bucket for this package...
. script/create-bucketRun the following command to package our Lambda function to S3:
. script/packageNext, the following command will create a Cloudformation Stack and deploy your SAM resources.
. script/deploy- put a file on your pod for testing policies
# /data-policy/test-data-policy.json
HTTP PUT /public/test-data-policy.json
content-type: application/json
x-api-key: xxxx
{
"type": "test",
"description": "this object had two fields that should have policies applied, additionalProperty.originalAffiliationDate and additionalProperty.",
"testdate": "2020-10-21T19:49:01Z"
}- get the file and note the value of "testdate"
HTTP GET /public/test-data-policy.json
{
"type": "test",
"description": "this object had two fields that should have policies applied, additionalProperty.originalAffiliationDate and additionalProperty.",
"testdate": "2020-10-21T19:49:01Z"
}
- put a @redact data policy on that field in your pod data-policiy file
/public/yodata/data-policy.json
# /data-policy/data-policy.json
HTTP PUT /public/yodata/data-policy.json
content-type: application/json
x-api-key: xxx
{
"redacttestdate": {
"effect": "Transform",
"processor": "Yodata",
"type": "DataPolicy",
"value": "{\"testdate\":{\"@redacted\":true}}"
}
}
- get the file again and confirm the value of "testdate" has been redacted
HTTP GET /public/test-data-policy.json
{
"type": "test",
"description": "this object had two fields that should have policies applied, additionalProperty.originalAffiliationDate and additionalProperty.",
"testdate": "@redacted"
}