-
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
feat: Collect DNS records from NS1 #629
Conversation
7425bd5
to
6097965
Compare
e8d50ae
to
62ebf8d
Compare
4ff64a7
to
748507c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👌
* | ||
* @see https://docs.cloudquery.io/docs/reference/source-spec | ||
*/ | ||
dockerDistributedPluginImage?: RepositoryImage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerDistributedPluginImage?: RepositoryImage; | |
additionalPluginImage?: RepositoryImage; |
or
dockerDistributedPluginImage?: RepositoryImage; | |
pluginContainer?: RepositoryImage; |
Think this would work with any kind of Container image right? Not just Docker images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used docker
here as a way to distinguish CloudQuery plugins written in Go, vs not-Go. The former is distributed as a binary, and the latter as a Docker image, see https://docs.cloudquery.io/docs/developers/creating-new-plugin/javascript-source#releasing-and-deploying-your-plugin.
{ | ||
image: dockerDistributedPluginImage, | ||
logging: fireLensLogDriver, | ||
essential: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this container would be essential no? I guess the main CloudQuery container will crash either way so probably not that important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got an error from this previously... I can't remember the exact error, I've a vague memory that CloudFormation failed to deploy the change.
95fb79d
to
154c931
Compare
A new read-only API key has now been created and is ready to be used. |
139be33
to
8091f18
Compare
8091f18
to
34383d8
Compare
Confirming this is how CloudQuery suggest doing this too! https://docs.cloudquery.io/docs/advanced-topics/using-cloud-query-docker-registry-plugins-inside-a-containerized-environment |
What does this change, and why?
The NS1 source plugin (https://github.com/guardian/cq-source-ns1) is written in TypeScript, and distributed as a Docker image.
Previous attempts (see #337) to use this plugin failed, because ECS containers cannot interact with Docker (see aws/containers-roadmap#1356).
In this change, we run the NS1 source plugin directly, in its own container, resulting in a GRPC server on
localhost:7777
. We then configure the CloudQuery sync container to connect to this endpoint.Collecting this data provides more information about our running services. For example, we can identify which services use Fastly, CloudFront, or no CDN.
We can also use this data to identify "dangling DNS records". That is, records whose answer no longer exist, and thus should be deleted, saving on the limited number of records available to us.
Resulting architecture
Standard task
NS1 task
How has it been verified?
Deployed to CODE, ran the task, and seen NS1 data in Grafana CODE 🎉.
Note
The NS1 API key used in CODE has been copied from https://github.com/guardian/dns-validation-lambda in CODE. This key has been limited to particular zones. We'd need to generate a new API key, with read-only access to all zones.