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

Empty access_by_lua_block breaks satisfy any #3649

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Jan 10, 2019

What this PR does / why we need it:

When access_by_lua_block is empty and satisfy any is specified in a snippet (or custom template),
any restriction is broken due the fact an empty access_by_lua_block block means 'OK'

Example:

nginx.ingress.kubernetes.io/configuration-snippet: |-
  allow 127.0.0.0/8;
  allow 10.0.0.0/8;
  deny all;
  satisfy any;

This PR enables the access_by_lua_block only if the waf module is enabled

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #3480

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 10, 2019
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 10, 2019
@ElvinEfendi
Copy link
Member

/lgtm

Good catch!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

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

@k8s-ci-robot k8s-ci-robot merged commit fc30351 into kubernetes:master Jan 10, 2019
@aledbf aledbf deleted the fix-auth branch January 11, 2019 00:28
@proligde
Copy link

proligde commented May 22, 2020

@aledbf not sure if I'm missing sth. here but I'm using ingress-nginx version 0.25.1 (the one currently bundled with microk8s) and it seems that the issue still exists. No matter if I use:

nginx.ingress.kubernetes.io/configuration-snippet: |-
  allow 127.0.0.0/8;  
  allow 10.0.0.0/8;  
  deny all;  
  satisfy any;

or

    nginx.ingress.kubernetes.io/auth-type: basic  
    nginx.ingress.kubernetes.io/auth-secret: my-basic-auth-secret  
    nginx.ingress.kubernetes.io/satisfy: "any"  
    nginx.ingress.kubernetes.io/whitelist-source-range: "1.2.3.4"  

Access is never blocked.

@aledbf
Copy link
Member Author

aledbf commented May 22, 2020

@proligde I suggest you update to 0.32.0. Not sure why microk8s is using a version from Aug 14, 2019.

@proligde
Copy link

@aledbf me neither ;-) but according to https://microk8s.io/docs/release-notes they do. Anyway thanks for the suggestion. I'll see if I can exchange the bundled version with a from-scratch installation of ingress-nginx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

basic auth broken in 0.21.0
4 participants