-
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
cli: allow disabling context lookups (was commit cdk.context.json) #6929
Comments
Same questions as OP. It would be good to understand better the pros and cons of commiting As far as I've understand you'd only commit the file if you want to be able to run synth without having to login to AWS and possible speed things up a bit since is saves some lookups. Another thing I'd like to understand is the difference between |
Not really, depending on what's in there. If there are 3 AZs in your region and you deploy a CDK app, a VPC will be created with a specific IP layout. If you don't commit Similarly, if you've started an instance off of an Amazon Linux AMI ID, and there now happens to be a new version of that AMI available... do you want your instance to be automatically replaced with a new version of the OS? What if you had state on that machine?
As for account IDs, we never considered them very sensitive, similar to how usernames aren't usually considered sensitive. AWS itself publishes many of its own account IDs for users to put in their IAM policies, for example. The keys to the castle are in the access credentials to the account, not the account ID itself. In fact, we generally expect people to put account IDs in their source as well (or build their application to read them from a configuration file), especially in the upcoming CI/CD implementation where we're going to force it. It may be possible that our opinions differ from other departments whose specialization is security. The biggest risk I personally see is bucket sniping. I see a couple of solutions to this, but they all come with their own downsides: Account IDs in context file:
Account IDs in source:
I think the end result of this will be that we may implement one of the solutions for the context, and it will be users responsibility to hide account IDs from their sources if desired, to be implemented in a way that suits them. |
thanks for taking the time @rix0rrr. That provided a lot of clarity on things I was wondering about. I'm still not completely clear though, I understand the use case I just think I'm missing the the development workflow. Since we run |
Yes. Honestly it's probably also a good idea to add a flag for the CLI to fail unexpected context lookups ( |
This one has a lot of good info in it. Definitely interested in this one. |
@shivlaks ping |
@eladb sorry, this one skipped my notifications inbox. That makes sense to me - saw that you already re-titled it. I dropped the guidance label as well. Let's use this issue to track the feature if there are no objections. |
@eladb Unless I have misread the thread above entirely, I believe this issue can now be closed as fixed:
|
Closing this issue based off the previous comment. |
|
The docs state that
cdk.context.json
should be checked-in to ensure reproducibility. However, that file may contain information that's usually considered sensitive like AWS account numbers (e.g. aws-samples). Such data shouldn't be commited and utilities like git-secrets actively try to prevent that. Could you please share what's the best practice in these cases?The text was updated successfully, but these errors were encountered: