Skip to content
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

cloud-auth: implement gcp(user-managed-service-account()) #4755

Merged

Conversation

alltilla
Copy link
Collaborator

@alltilla alltilla commented Dec 14, 2023

This authentication method can be used on VMs in GCP to use the linked service.

Example minimal config, which tries to use the "default" service account:

cloud-auth(
  gcp(
    user-managed-service-account()
  )
)

Full config:

cloud-auth(
  gcp(
    user-managed-service-account(
      name("alltilla@syslog-ng-test-project.iam.gserviceaccount.com")
      metadata-url("my-custom-metadata-server:8080")
    )
  )
)

This authentication method is extremely useful with syslog-ng's google-pubsub() destination,
when it is running on VMs in GCP, for example:

destination {
  google-pubsub(
    project("syslog-ng-test-project")
    topic("syslog-ng-test-topic")
    auth(user-managed-service-account())
  );
};

For more info about this GCP authentication method, see:

@alltilla alltilla requested a review from bazsi December 14, 2023 12:49
Copy link
Contributor

github-actions bot commented Dec 14, 2023

This Pull Request introduces config grammar changes

syslog-ng/2bbd52018ef8e991796f243337806eb7259d9730 -> alltilla/cloud-auth-gcp-user-managed-service-account

--- a/destination
+++ b/destination

 http(
     cloud-auth(
         gcp(
+            user-managed-service-account(
+                <empty>
+                metadata-url(<string>)
+                name(<string>)
+            )
         )
     )
 )

@alltilla alltilla force-pushed the cloud-auth-gcp-user-managed-service-account branch 2 times, most recently from 7a6649b to 8ca8d16 Compare December 14, 2023 14:47
@bazsi
Copy link
Collaborator

bazsi commented Dec 15, 2023

The Mac build fails, but strangely it uses ivykis from the system not from the submodule, where some of the fixes would be.

I am also puzzled why it does not find the picojson symbol, which it finds on all three other combinations (automake with both clang/gcc, and cmake with clang works, cmake with gcc does not).

That symbol is coming from a header only lib which has the symbol on my system.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@alltilla alltilla force-pushed the cloud-auth-gcp-user-managed-service-account branch from 8ca8d16 to 45b7498 Compare December 15, 2023 09:17
@alltilla
Copy link
Collaborator Author

According to http://demangler.com/

The missing symbol __ZN8picojson5value3getIlEERT_v is _long& picojson::value::get<long>().

The int64_t support is not always enabled in picojson: https://github.com/kazuho/picojson?tab=readme-ov-file#experimental-support-for-int64_t, probably that macOS build is not enabling it by default, but others do.

I'll just get a double and round it.

Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
@bazsi
Copy link
Collaborator

bazsi commented Dec 17, 2023

This is not performance critical so I am fine with using double here.

@bazsi bazsi merged commit 672f6a9 into syslog-ng:master Dec 17, 2023
20 checks passed
smortex added a commit to syslog-ng/vim-syslog-ng that referenced this pull request Jan 31, 2024
syslog-ng/syslog-ng#4755 added a `name` keyword
that cause confusion for our simle script.

Ensure we are processing an actual `{"name": "string"}` and not
somthing like `{"name": {...}}` to find keywords.
@ThomasDevoogdt
Copy link

The configure.ac should not longer automaticially enable cloud-auth, similar to enable_http, a check for curl should be done here.

ThomasDevoogdt added a commit to ThomasDevoogdt/buildroot that referenced this pull request Apr 27, 2024
arnout pushed a commit to buildroot/buildroot that referenced this pull request May 9, 2024
Announcement:
 - https://github.com/syslog-ng/syslog-ng/releases/tag/syslog-ng-4.4.0
 - https://github.com/syslog-ng/syslog-ng/releases/tag/syslog-ng-4.5.0
 - https://github.com/syslog-ng/syslog-ng/releases/tag/syslog-ng-4.6.0
 - https://github.com/syslog-ng/syslog-ng/releases/tag/syslog-ng-4.7.0
 - https://github.com/syslog-ng/syslog-ng/releases/tag/syslog-ng-4.7.1

Bump info:
 - sha256 update for COPYING:
 syslog-ng/syslog-ng@52e9e10

 - json-c is now a hard-dependency:
 syslog-ng/syslog-ng@d9220c7

 - enable-cloud-auth requires curl
 syslog-ng/syslog-ng#4755

 - 0001-fix-build-on-uclibc.patch upstream:
 buytenh/ivykis@5100a11 and
 syslog-ng/syslog-ng@468df07

 - 0002-lib-transport-tls-context.c-fix-libressl-build.patch upstream:
 syslog-ng/syslog-ng@065c09c

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants