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

correct k8s audit endpoint #1261

Merged
merged 1 commit into from
Jun 19, 2020
Merged

correct k8s audit endpoint #1261

merged 1 commit into from
Jun 19, 2020

Conversation

leogr
Copy link
Member

@leogr leogr commented Jun 11, 2020

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

This PR changes the value of webserver.k8s_audit_endpoint from /k8s_audit to /k8s-audit, because a path that contains an underscore (_) won't work when the audit sink webhook is configured with a service reference (instead of an URL).

To reproduce the issue just kubectl apply the following example:

apiVersion: auditregistration.k8s.io/v1alpha1
kind: AuditSink
metadata:
  name: falco-audit-sink
spec:
  policy:
    level: RequestResponse
    stages:
      - ResponseComplete
      - ResponseStarted
  webhook:
    throttle:
      qps: 10
      burst: 15
    clientConfig:
      service:
        namespace: default
        name: falco-service
        path: /k8s_audit
        port: 8765

Then you get the following error:

The AuditSink "falco-audit-sink" is invalid: spec.webhook.clientConfig.service.path: Invalid value: "/k8s_audit": segment[0]: a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

  • The helm chart has been using the correct endpoint (ie. /k8s-audit) since the initial k8s audit support (11 months ago, see here) and the latest version still has the correct endpoint
  • This problem has already been fixed by fix: k8s audit only evolution#26 with this commit in the k8s-audit-only example resources.

Does this PR introduce a user-facing change?:

update(falco.yaml): `webserver.k8s_audit_endpoint` default value changed from `/k8s_audit` to `/k8s-audit`

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
@leogr leogr changed the title fix(falco.yaml): correct k8s audit endpoint wip: correct k8s audit endpoint Jun 11, 2020
@poiana poiana requested review from Kaizhe and krisnova June 11, 2020 22:49
@leogr
Copy link
Member Author

leogr commented Jun 11, 2020

cc @maxgio92 @nibalizer FYI

@poiana poiana added the size/XS label Jun 11, 2020
@Kaizhe
Copy link
Contributor

Kaizhe commented Jun 11, 2020

/lgtm

@Kaizhe
Copy link
Contributor

Kaizhe commented Jun 11, 2020

looks like we will need to fix this file as well: https://github.com/falcosecurity/evolution/blob/abcf585fd7c9976a95d90dbd9ffcfdb9324f4855/examples/k8s_audit_config/webhook-config.yaml.in#L6

@poiana
Copy link

poiana commented Jun 11, 2020

LGTM label has been added.

Git tree hash: 351960acce30df3bcd417c6e3f7be7cf273332ed

1 similar comment
@poiana
Copy link

poiana commented Jun 11, 2020

LGTM label has been added.

Git tree hash: 351960acce30df3bcd417c6e3f7be7cf273332ed

leogr added a commit to falcosecurity/evolution that referenced this pull request Jun 12, 2020
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
poiana pushed a commit to falcosecurity/evolution that referenced this pull request Jun 12, 2020
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Copy link
Member

@leodido leodido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@poiana
Copy link

poiana commented Jun 13, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Kaizhe, leodido

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@leogr leogr changed the title wip: correct k8s audit endpoint correct k8s audit endpoint Jun 15, 2020
@leogr leogr added this to the 0.24.0 milestone Jun 17, 2020
@poiana poiana merged commit 8429256 into master Jun 19, 2020
@poiana poiana deleted the fix/k8s-audit-endpoint branch June 19, 2020 13:31
@fntlnz
Copy link
Contributor

fntlnz commented Jul 1, 2020

I just noticed that this is not complete. I'm folllowing up with a PR.

leogr added a commit to falcosecurity/contrib that referenced this pull request Aug 24, 2022
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
leogr added a commit to falcosecurity/contrib that referenced this pull request Aug 24, 2022
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
maxgio92 pushed a commit to falcosecurity/evolution that referenced this pull request Sep 8, 2022
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
maxgio92 pushed a commit to falcosecurity/evolution that referenced this pull request Sep 22, 2022
…udit`


See falcosecurity/falco#1261

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
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.

None yet

5 participants