Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Subscribing to multiple issues when deploying a playbook to GKE fails #4

Open
jonnymcgow7 opened this issue Jul 23, 2019 · 4 comments

Comments

@jonnymcgow7
Copy link

Due to the join method being used in the deploy_playbook_gke script, it is not possible to deploy a function with multiple subscriptions.

The current implementation uses commas as delimiters for both the dictionary containing environment variables, and the subscribed_alerts themselves. This results in an incorrect split happening between the multiple subscriptions, which causes the script to crash.

To replicate just use multiple -s tags, ie:
$ ./deploy_playbook_gke -p delete -t falco-alerts -s falco.notice.terminal_shell_in_container -s falco.info.* -k <cluster_name> -z <gcloud_zone> -n <gcloud_project>

To fix this issue I suggest changing the join function to

function join { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }

And then you can use multiple characters for each delimiter, which will allow you to use two commas to separate env variables, and one comma to separate subscriptions.

I'll submit a PR with this functionality and link it below.

@jonnymcgow7
Copy link
Author

PR with fix: #5

@eihwaz-kob
Copy link

I fix this adding ^:^ and : in the --set-env-vars in the gcloud functions command.
--set-env-vars=^:^"$(join : ${environment[@]})"

I hope it helps

@poiana
Copy link

poiana commented Nov 20, 2020

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

1 similar comment
@poiana
Copy link

poiana commented Feb 18, 2021

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants