Skip to content

Enforce PROXY protocol in filtering-proxy-psc blueprint #968

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

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

kunzese
Copy link
Collaborator

@kunzese kunzese commented Nov 11, 2022

This PR enables the PROXY protocol in the filtering-proxy-psc blueprint. Consumer workload IPs are now visible in the Squid access logs via docker exec squid cat /var/log/squid/access.log.

FYI @gaspar-chilingarov @ludoo

@gaspar-chilingarov
Copy link

gaspar-chilingarov commented Nov 11, 2022

Can we change the readme to mention that it collects logs + how to view them?

Possibly even the configuration of config-agent to ship them to Cloud Logging, so it's fully integrated w/Cloud Ops out of box. If customers don't want such logging - they can remove it later.

@kunzese
Copy link
Collaborator Author

kunzese commented Nov 14, 2022

Can we change the readme to mention that it collects logs + how to view them?

Possibly even the configuration of config-agent to ship them to Cloud Logging, so it's fully integrated w/Cloud Ops out of box. If customers don't want such logging - they can remove it later.

So here's the thing: Squid runs inside a Docker container. The Docker logs are already streamed to Cloud Logging via the gcplogs driver, but Squid apparently can not log to stdout. I tried it with

access_log stdio:/proc/self/fd/1
access_log stdio:/proc/1/fd/1
access_log stdio:/dev/stdout

but without any success. So either we start poking around some privilege escalation or it is what it is at the moment. What do you think @gaspar-chilingarov @ludoo - any other ideas?

@ludoo
Copy link
Collaborator

ludoo commented Nov 14, 2022

but without any success. So either we start poking around some privilege escalation or it is what it is at the moment. What do you think @gaspar-chilingarov @ludoo - any other ideas?

One option would be to write logs to a mount, and run a second container to tail them.

BTW I seem to remember gcplogs is suboptimal and it's better to run the logging agent by enabling it via metadata on COS. Not important, but if you have a spare cycle maybe it's better to switch (and we'll also have to check other COS modules/blueprints too). Ah, and I did not check your source, but can you make sure the docker logs are set to a maximum size via docker daemon opts or filesystem will be filled (sorry if you did it already!).

@kunzese
Copy link
Collaborator Author

kunzese commented Nov 14, 2022

Then let's do it like this: i merge this PR, because this enables the PROXY protocol @gaspar-chilingarov asked about, then i will have look at the ./modules/cloud-config-container/squid part (and potentially others) to replace the gcplogs driver with the Cloud Logging in the COS image, and then i will come back here for the access log visibility. If i don't get any vetos by tomorrow morning, i will start working on this.

@ludoo
Copy link
Collaborator

ludoo commented Nov 14, 2022

Then let's do it like this: i merge this PR, because this enables the PROXY protocol @gaspar-chilingarov asked about, then i will have look at the ./modules/cloud-config-container/squid part (and potentially others) to replace the gcplogs driver with the Cloud Logging in the COS image, and then i will come back here for the access log visibility. If i don't get any vetos by tomorrow morning, i will start working on this.

great plan! as always, you should be able to merge once checks and review are in as in this case :)

@kunzese kunzese enabled auto-merge (squash) November 15, 2022 07:12
@kunzese kunzese merged commit bcffb67 into master Nov 15, 2022
@kunzese kunzese deleted the kunzese/enforce-proxy-protocol branch November 15, 2022 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants