-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-logs: LogGroup.addToResourcePolicy 'ARNs must start with "arn:" and have at least 6 components: *' #27783
Comments
Investigating. |
@ahammond Is your intention to grant everyone access? With |
It looks like the issue is that @msambol if you haven't started work on a patch already, I can take what I've done to look into this and open a PR. |
@kylelaker I haven't but I did confirm the API doesn't allow wildcard (*) principals for this:
However, it does work when you specify a principal:
The docs don't explicity state this, but I put in a feedback request for them to clarify. I was thinking of adding a check here to throw an error if |
So I think this is one of those cases where |
@kylelaker ah, you are right! I thought those two were always synonymous, but alas, I learned something! Curious if you think this should come with a warning (I don't know what protocol is here?) ? Using |
Probably best for a core team member to weigh in on that. But as a user, my expectation is that if the service lets me do something, the CDK should probably let me do it. Having insecure defaults isn't ideal but it should be configurable. Most of the big security reminders (imo) are probably best left to tools like cdk-nag that are built do do it across the whole stack for a variety of concerns or custom aspects to enforce security constraints on a more granular scale. |
Our plans are all around leveraging conditions for ABAC. I could probably
hack together an ARN Principal to get unblocked here. Thanks for the
insight!!!
…On Tue, Oct 31, 2023 at 7:42 PM Kyle Laker ***@***.***> wrote:
Curious if you think this should come with a warning (I don't know what
protocol is here?)
Probably best for a core team member to weigh in on that. But as a user,
my expectation is that if the service lets me do something, the CDK should
probably let me do it. Having insecure *defaults* isn't ideal but it
should be configurable. Most of the big security reminders (imo) are
probably best left to tools like cdk-nag
<https://github.com/cdklabs/cdk-nag> that are built do do it across the
whole stack for a variety of concerns or custom aspects to enforce security
constraints on a more granular scale.
—
Reply to this email directly, view it on GitHub
<#27783 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADM2RBMV3WMPN77XIWPMMDYCGZKHAVCNFSM6AAAAAA6YPCNPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGMYTIMRXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I should have read more carefully:
Oh well. I did
And my UTs barfed with:
So it appears that to solve this I need to use a
|
Also, I was going to ask why there's no linkage between the LogGroup and the ResourcePolicy, but... wow. Ok. So... ABAC for LogGroups is pretty much off the table? |
…ls (#27787) Because `AnyPrincipal` extends `ArnPrincipal` it gets caught up in the checks for parsing the ARN from the principal to get the account. This check should be skipped when the ARN is set to `"*"` because that can't be parsed. Closes #27783. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When I create a new LogGroup and then call addToResourcePolicy with a valid policy, I get the error message
Expected Behavior
I should be able to
addToResourcePolicy
.Current Behavior
Error message.
Reproduction Steps
https://github.com/ahammond/repro-loggroup-addtoresourcepolicy
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.103.1 (build 3bb19ac)
Framework Version
same
Node.js Version
20.5.1
OS
MacOS latest
Language
TypeScript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: