1.3.1 • Published 8 days ago

@darsai/aws-toolbox v1.3.1

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
8 days ago

@darsai/aws-toolbox

AWS utilities TS library.

  • s3-helper
  • cognito-helper
  • dynamodb-helper

Sample policies and credentials used during tests (scrapbook)

policy: darsai-agent-01 s3 bucket upload with prefix path equals username

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "AgentUploadAllow",
			"Effect": "Allow",
			"Action": ["s3:PutObject"],
			"Resource": ["arn:aws:s3:::darsai-default-inbox/${aws:username}/*"]
		}
	]
}

policy: darsai-agent-01 s3 bucket upload with prefix path equals username and with source IP enforcing

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "AgentUploadAllow",
			"Effect": "Allow",
			"Action": ["s3:PutObject"],
			"Resource": ["arn:aws:s3:::darsai-default-inbox/${aws:username}/*"]
		},
		{
			"Sid": "AgentUploadDeny",
			"Effect": "Deny",
			"Action": ["s3:PutObject"],
			"Resource": ["arn:aws:s3:::darsai-default-inbox/${aws:username}/*"],
			"Condition": {
				"NotIpAddress": {
					"aws:SourceIp": ["80.26.84.243/32", "34.250.134.158/32"]
				}
			}
		}
	]
}

group: darsai-agents arn: arn:aws:iam::824109977555:group/darsai-agents

user: darsai-agent-01

"userIdentity": {
    "type": "IAMUser",
    "principalId": "AIDA37YGIJ7J5BHV2G5KF",
    "arn": "arn:aws:iam::824109977555:user/darsai-agent-01",
    "accountId": "824109977555",
    "accessKeyId": "AKIA37YGIJ7JWVHNIMFD",
    "userName": "darsai-agent-01"
},