-
Notifications
You must be signed in to change notification settings - Fork 0
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 tag based authorization for CW Logs #9
Comments
*** this is not supported by AWS as of today *** |
This can be implemented using tagging on Log Groups now, however it isn't supported by CloudFormation. Would need to implement tag-management after stack creation or update. Policy to support tag based authorization for the IAM roles. {
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:FilterLogEvents"
],
"Effect": "Allow",
"Resource": "arn:aws:logs:eu-west-1:[AWS-ACCOUNT-ID]:log-group:*",
"Condition": {
"StringLike": {
"logs:ResourceTag/gureume-groups": "${aws:PrincipalTag/gureume-groups}"
}
}
},
{
"Effect": "Allow",
"Action": "codecommit:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/gureume-groups": "${aws:PrincipalTag/gureume-groups}"
}
}
}
]
}``` |
Optimized policy that only requires one statement and can then include multiple actions. {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codecommit:*",
"logs:FilterLogEvents"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/gurum-groups": "${aws:PrincipalTag/gurum-groups}"
}
}
}
]
} |
Task that needs to be done is to automatically tag the log group with the right group tag since CloudFormation doesn't support this yet. |
Postponing until CloudFormation adds tag support for CloudWatch Log Groups. |
For now could add something like this to propagate tags from the CFN stack automatically. |
Add documentation for current process using CFN tag propagation |
Closing this since it's "solved" by using a helper tagging function. |
Right now CloudWatch Log Groups doesn't get tags inherited from their CloudFormation stags.
CW Logs doesn't support tag based authorization either.
Currently the Cognito IAM Roles inherited by users through Cognito Groups can read from any log group but when this is added we could easily tag the log groups and then modify the IAM Role that cognito users assume to add tag based authorization to their respective log group similar to CFN templates etc.
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html
The text was updated successfully, but these errors were encountered: