Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

1.0.0 updates #206

Open
wants to merge 195 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
dd8a047
updating KinD to v0.11.1
mlbiam Nov 21, 2021
5d6cd3a
for #5 removed dynamic audit since not in k8s anymore
mlbiam Nov 21, 2021
d8fb8b2
for #5 updating k8s pkg meant can't just pass in path to ca anymore
mlbiam Nov 21, 2021
0bdca9a
for #1 update node image
mlbiam Nov 21, 2021
b1088ef
for #5 updated dependencies
mlbiam Nov 22, 2021
15479d6
for #5 moved to latest to make easier to update with simple rebuild
mlbiam Nov 22, 2021
f109b62
for #5 fixed the label
mlbiam Nov 22, 2021
bb8a778
for #5 upgraded go
mlbiam Nov 22, 2021
64ee2d8
for #2 added success and failure logging
mlbiam Nov 25, 2021
d5367f6
for #2 added docs
mlbiam Nov 25, 2021
2d25986
for #3 functional code working and tested, need to integrate into proxy
mlbiam Dec 1, 2021
3b75de8
for #3 moved to k8s user.Info for better compat with codebase
mlbiam Dec 2, 2021
21764a1
made the subjectaccessreview more transaction based
mlbiam Dec 2, 2021
b0a08fd
made New consistent, used in tests
mlbiam Dec 2, 2021
9574d93
better handle go's cannonicalizing header names
mlbiam Dec 3, 2021
5d90c19
for #3 integrated into the proxy, made impersonation header checking …
mlbiam Dec 3, 2021
7e13847
for #3 integrate into the proxy's run
mlbiam Dec 8, 2021
f64f868
for #3 started updated e2e
mlbiam Dec 8, 2021
a54f85c
for #3 updating tests
mlbiam Dec 8, 2021
70ed81f
for #3 added rbac for subjectaccessreviews to test suite
mlbiam Dec 8, 2021
248714f
for #3 update test rbac
mlbiam Dec 8, 2021
81f55e0
for #3 set error messages
mlbiam Dec 8, 2021
b3761ae
for #3 body isn't matching
mlbiam Dec 8, 2021
c521633
for #3 update checks
mlbiam Dec 8, 2021
189db88
for #3 confused on checks
mlbiam Dec 8, 2021
40ca6c8
for #3 testing
mlbiam Dec 8, 2021
a636757
for #3 better failure reporting
mlbiam Dec 8, 2021
e50da04
for #3 fix error reporting
mlbiam Dec 8, 2021
4b0b7da
for #3 trying to isolate
mlbiam Dec 8, 2021
92a30ce
for #3 finally found issue
mlbiam Dec 8, 2021
66e0b6b
for #3 fix check
mlbiam Dec 8, 2021
4e89ca5
for #3 break out tests
mlbiam Dec 8, 2021
4bb6cfa
for #3 Added rbac bindings for better impersonation testing
mlbiam Dec 8, 2021
c6e9493
for #3 fix clusterrole
mlbiam Dec 8, 2021
35969b3
for #3 fix overlap of declaration
mlbiam Dec 8, 2021
ce417ee
for #3 add happy path
mlbiam Dec 8, 2021
0e777cc
for #3 fix test for happy path
mlbiam Dec 8, 2021
e3fa2c6
for #3 force extra names to lowercase for subjectaccessreview
mlbiam Dec 8, 2021
6295c90
for #3 fix test case
mlbiam Dec 8, 2021
28c5f78
for #3 don't check resource name for extra?
mlbiam Dec 8, 2021
9d07586
for #3 check if rbac issue is extra
mlbiam Dec 8, 2021
dd241b9
for #3 add support for successful impersonation
mlbiam Dec 8, 2021
c99018d
for #3 looking for success
mlbiam Dec 8, 2021
faf0081
for #3 add rbac for happy path
mlbiam Dec 8, 2021
9e534f4
for #3 fix error check
mlbiam Dec 9, 2021
3b04ce6
for #3 fix rbac in test
mlbiam Dec 9, 2021
11639b7
for #3 fix rbac
mlbiam Dec 9, 2021
68b123a
for #3 trying to debug
mlbiam Dec 9, 2021
13ee636
for #3 condensed inbound extras to single outbound header
mlbiam Dec 9, 2021
f5a875e
for #3 add extra to happy path
mlbiam Dec 9, 2021
5f6f86a
for #3 checking extra impersonation
mlbiam Dec 9, 2021
c9eb8e7
for #3 fixed subjectaccessreview for extras
mlbiam Dec 9, 2021
c32d5b3
for #3 need to let proxy impersonate extra for test
mlbiam Dec 9, 2021
254120f
for #3 updated docs and templates
mlbiam Dec 9, 2021
2cb1d02
get test to run
mlbiam Dec 14, 2021
7195fed
make test work
mlbiam Dec 14, 2021
3a08ebc
for #3 removing unneeded generate
mlbiam Dec 14, 2021
ebd8d9e
creating automated build
mlbiam Dec 14, 2021
3257ed1
update action
mlbiam Dec 14, 2021
3846126
fix branch name
mlbiam Dec 14, 2021
a90ca2a
fix go version
mlbiam Dec 14, 2021
8be0669
for #8 go version
mlbiam Dec 14, 2021
687f73e
for #8 make container locally
mlbiam Dec 14, 2021
1881f00
for #8 making easier to build with actions
mlbiam Dec 14, 2021
7908b54
for #8 added docker build and push
mlbiam Dec 14, 2021
faf4402
for #8 docker build isn't working from action
mlbiam Dec 14, 2021
5e6f0be
for #8 docker build can't pickup bin dir
mlbiam Dec 14, 2021
2628194
for #8 making the build consistent with docker_build
mlbiam Dec 14, 2021
d88c105
for #8 updated ignore to not ignore our binay
mlbiam Dec 14, 2021
1979994
for build #8 re-add test
mlbiam Dec 14, 2021
ffc61b2
for #9 switched dockerfile
mlbiam Dec 14, 2021
a6ccdef
for #8 update e2e
mlbiam Dec 14, 2021
44fcea0
for #2 strip off proxy IP from x-forwarded-for
mlbiam Dec 16, 2021
44944da
for #5 bumped dependencies again
mlbiam Dec 16, 2021
5e100b6
for #10 added files for auto-updates, updated docs, added changelog
mlbiam Dec 16, 2021
e8a54be
updates for all tasks
mlbiam Dec 16, 2021
d863625
Merge pull request #11 from mlbiam/master
mlbiam Dec 16, 2021
7db5d8a
pass make test
mlbiam Dec 16, 2021
87eb58c
Merge pull request #12 from mlbiam/master
mlbiam Dec 16, 2021
de7e0f5
Automatic Update - 20211216T025617.851Z
mlbiam Dec 16, 2021
0df7339
for #14 bumped versions
mlbiam Jan 29, 2022
55473a6
upgrade ingress to v1
Feb 5, 2022
11f113d
support ingressClassName for v1 Ingress
Feb 5, 2022
a403b72
Merge pull request #15 from kingdonb/ingress-v1
mlbiam Feb 6, 2022
b144f59
Automatic Update - 20220311T201831.205Z
mlbiam Mar 11, 2022
5f0346e
Automatic Update - 20220318T020336.250Z
mlbiam Mar 18, 2022
deffe9c
Automatic Update - 20220403T020307.625Z
mlbiam Apr 3, 2022
79cbfab
Merge branch 'TremoloSecurity:master' into master
mlbiam Apr 4, 2022
27dc4a0
Automatic Update - 20220415T020318.763Z
mlbiam Apr 15, 2022
3abe88b
Automatic Update - 20220422T020314.907Z
mlbiam Apr 22, 2022
daa4a72
Automatic Update - 20220429T020319.615Z
mlbiam Apr 29, 2022
84b9cdd
Automatic Update - 20220506T020321.057Z
mlbiam May 6, 2022
9687f2d
Automatic Update - 20220519T020313.080Z
mlbiam May 19, 2022
a2b9536
for #17 moved logging into its own package, added test cases
mlbiam May 25, 2022
14aa141
Merge branch 'master' of github.com:mlbiam/kube-oidc-proxy
mlbiam May 25, 2022
bb2475d
Automatic Update - 20220529T020344.385Z
mlbiam May 29, 2022
dbaea98
Automatic Update - 20220609T020332.886Z
mlbiam Jun 9, 2022
29d4b3a
for #18 added more checks to slow down tests
mlbiam Jun 14, 2022
92f18dc
for #14 bumped versions, updated tests to use TokenRequest
mlbiam Jun 14, 2022
89b6e41
for #14 bumped go version in build
mlbiam Jun 14, 2022
aa23a46
for #14 update changelog
mlbiam Jun 14, 2022
55ebc45
Merge pull request #19 from mlbiam/master
mlbiam Jun 14, 2022
a3d32db
Automatic Update - 20220624T020345.647Z
mlbiam Jun 24, 2022
4477c73
Automatic Update - 20220707T020312.276Z
mlbiam Jul 7, 2022
4ca1add
for #20 bumped to latest k8s client
mlbiam Jul 20, 2022
d32c509
for #20 manually over-rode the dependency version.
mlbiam Jul 25, 2022
a2b43bb
update for release
mlbiam Jul 26, 2022
b1a58cc
Merge pull request #22 from mlbiam/master
mlbiam Jul 26, 2022
7cfe0b2
Automatic Update - 20220807T020800.447Z
mlbiam Aug 7, 2022
3efd24d
Automatic Update - 20220925T020336.718Z
mlbiam Sep 25, 2022
ca36d19
Automatic Update - 20221014T020348.280Z
mlbiam Oct 14, 2022
cfdd37a
for #26 bumped versions
mlbiam Oct 17, 2022
d462b2e
Merge branch 'master' of github.com:mlbiam/kube-oidc-proxy
mlbiam Oct 17, 2022
c76cf20
for #26 ran e2e tests
mlbiam Oct 17, 2022
b1a8574
Merge pull request #27 from mlbiam/master
mlbiam Oct 17, 2022
f694ff3
for #26 bump go version in workflow
mlbiam Oct 17, 2022
ef7123a
Merge pull request #28 from mlbiam/master
mlbiam Oct 17, 2022
6322218
Automatic Update - 20221020T020349.425Z
mlbiam Oct 20, 2022
b5d08d0
Automatic Update - 20221130T020413.421Z
mlbiam Nov 30, 2022
d5ed1c2
Automatic Update - 20221211T020437.196Z
mlbiam Dec 11, 2022
d9ac616
Automatic Update - 20230131T020526.940Z
mlbiam Jan 31, 2023
7b383f0
Automatic Update - 20230214T020526.050Z
mlbiam Feb 14, 2023
b85a8db
for #29 bumped versions
mlbiam Feb 22, 2023
6b7b645
Merge branch 'master' of github.com:mlbiam/kube-oidc-proxy
mlbiam Feb 22, 2023
ac9f0a7
for #29 added changelog
mlbiam Feb 22, 2023
4d4f83a
Merge branch 'TremoloSecurity:master' into master
mlbiam Feb 22, 2023
0f8b0b0
Merge pull request #30 from mlbiam/master
mlbiam Feb 22, 2023
ed55dc5
Automatic Update - 20230306T020416.148Z
mlbiam Mar 6, 2023
cc14111
Automatic Update - 20230310T020312.894Z
mlbiam Mar 10, 2023
54e9103
push to ghcr.io
mlbiam Mar 15, 2023
35c5a3f
Merge branch 'master' of github.com:mlbiam/kube-oidc-proxy
mlbiam Mar 15, 2023
e32fe06
Merge pull request #31 from mlbiam/master
mlbiam Mar 15, 2023
fcc542c
Automatic Update - 20230427T020320.801Z
mlbiam Apr 27, 2023
5adde48
Automatic Update - 20230525T020428.881Z
mlbiam May 25, 2023
292d388
Automatic Update - 20230601T020342.442Z
mlbiam Jun 1, 2023
009c984
Automatic Update - 20230607T020351.116Z
mlbiam Jun 7, 2023
4052033
Automatic Update - 20230616T020248.766Z
mlbiam Jun 16, 2023
d636af6
tag and sign
mlbiam Jul 27, 2023
563d9d2
fix typo
mlbiam Jul 27, 2023
363a7c3
i hate yaml
mlbiam Jul 27, 2023
894c550
add token
mlbiam Jul 27, 2023
71d0f9d
Merge pull request #33 from mlbiam/master
mlbiam Jul 27, 2023
a53e701
for #34 bumped versions
mlbiam Jul 28, 2023
f384c9f
for #34 updated changelog
mlbiam Jul 28, 2023
fa94b94
Merge pull request #35 from mlbiam/master
mlbiam Jul 28, 2023
b694eae
Bump to new Klog
Sep 8, 2023
b481718
Automatic Update - 20231005T020301.893Z
mlbiam Oct 5, 2023
896a4c2
Automatic Update - 20231026T020312.403Z
mlbiam Oct 26, 2023
469f9c6
Automatic Update - 20231108T020319.537Z
mlbiam Nov 8, 2023
34abf48
Automatic Update - 20231116T020337.574Z
mlbiam Nov 16, 2023
085bd40
Automatic Update - 20231123T020342.310Z
mlbiam Nov 23, 2023
9e7de7c
for #41 bump direct dependencies
mlbiam Nov 25, 2023
c497ed7
Merge pull request #37 from jynolen/fix/normalize-logs
mlbiam Nov 25, 2023
2fe9825
Merge branch 'master' into master
mlbiam Nov 25, 2023
315944d
Merge pull request #42 from mlbiam/master
mlbiam Nov 25, 2023
7b72d0f
for #41 bumped logging version
mlbiam Nov 25, 2023
f149efb
for #41 removed vulns reported by snyk
mlbiam Nov 25, 2023
15f5062
for #41 fixed formatting
mlbiam Nov 25, 2023
7d221a4
update pdbs to policy/v1
sellitforcache Nov 27, 2023
f83fc96
serve on container port 8443
sellitforcache Nov 27, 2023
28c77f1
Merge pull request #44 from sellitforcache/port-8443
mlbiam Nov 27, 2023
e214d63
Merge pull request #43 from sellitforcache/pdb-update
mlbiam Nov 27, 2023
b68d367
for #39 needed to add auditinit to the request and to user the user t…
mlbiam Nov 28, 2023
8fc6b01
for #41 bumped the version
mlbiam Nov 28, 2023
22a859a
for #39 removed test case for 401, since that would never make it to …
mlbiam Nov 28, 2023
ec5de30
for #41 bump kubernetes to 1.28
mlbiam Nov 28, 2023
278b7ac
for #45 the delete was writing the path as the file contents
mlbiam Nov 28, 2023
10fad6d
Merge pull request #46 from mlbiam/master
mlbiam Nov 30, 2023
015c34f
for #41 updated changelog
mlbiam Nov 30, 2023
6dbd344
Merge pull request #47 from mlbiam/master
mlbiam Nov 30, 2023
25fc258
Automatic Update - 20231209T020329.153Z
mlbiam Dec 9, 2023
24ae8e2
Automatic Update - 20231213T020333.022Z
mlbiam Dec 13, 2023
414005b
Automatic Update - 20240119T020325.770Z
mlbiam Jan 19, 2024
cec60f3
Automatic Update - 20240124T020357.219Z
mlbiam Jan 24, 2024
c451a51
Automatic Update - 20240207T020401.740Z
mlbiam Feb 7, 2024
1acdbd9
Automatic Update - 20240217T020411.845Z
mlbiam Feb 17, 2024
ec4068f
Automatic Update - 20240320T020336.148Z
mlbiam Mar 20, 2024
21733e2
Automatic Update - 20240329T020424.531Z
mlbiam Mar 29, 2024
1896b96
Automatic Update - 20240417T020415.214Z
mlbiam Apr 17, 2024
4c78126
Automatic Update - 20240420T020411.899Z
mlbiam Apr 20, 2024
0dce34c
Automatic Update - 20240602T020353.512Z
mlbiam Jun 2, 2024
89eb8d6
Automatic Update - 20240629T020356.989Z
mlbiam Jun 29, 2024
f1baa6b
Automatic Update - 20240802T020420.511Z
mlbiam Aug 2, 2024
f1a6c31
Automatic Update - 20240810T020429.835Z
mlbiam Aug 10, 2024
6b1dd2f
helm/add-cert-manager
ronaldmiranda Sep 10, 2024
e24311e
Merge pull request #53 from ronaldmiranda/helm/add-cert-manager
mlbiam Sep 15, 2024
f314b00
for #54 bumped versions
mlbiam Sep 15, 2024
8a33e36
for #55 map to new configuration
mlbiam Sep 15, 2024
d905305
for #54 bump version, change kind version
mlbiam Sep 15, 2024
c5052dd
for #55 added audience and ca from file
mlbiam Sep 15, 2024
ded6171
for #54 updated changelog
mlbiam Sep 15, 2024
f8f47de
Merge branch 'TremoloSecurity:master' into master
mlbiam Sep 15, 2024
e3f1c1f
Merge pull request #56 from mlbiam/master
mlbiam Sep 15, 2024
279bea9
Update patchlog.txt
mlbiam Sep 15, 2024
7c38afd
remove signature from dockerhub image
mlbiam Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
!/bin/kube-oidc-proxy-linux
!/bin/kube-oidc-proxy
113 changes: 113 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: build
on:
push:
branches:
- 'master'

permissions:
id-token: write
packages: write

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v1

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "^1.20.0"

- name: Install Cosign
uses: sigstore/cosign-installer@main

- name: Update go deps
run: go mod tidy

- name: install go mock
run: go install github.com/golang/mock/mockgen@v1.6.0

- name: install go-junit
run: go get -u github.com/jstemmer/go-junit-report

- name: run tests
run: make test

- name: build executable
run: make build; ls; ls bin




-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.OU_REG_USER }}
password: ${{ secrets.OU_REG_PASSWORD }}

- name: Login to container Registry
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

- name: generate tag
run: |-
export PROJ_VERSION="1.0.7"
echo "Project Version: $PROJ_VERSION"
echo "TAG=$PROJ_VERSION-$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
echo "SHORT_TAG=$PROJ_VERSION" >> $GITHUB_ENV


-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: "."
push: true
tags: |
${{ secrets.OU_CONTAINER_DEST }}:${{ env.TAG }}
${{ secrets.OU_CONTAINER_DEST }}:${{ env.SHORT_TAG }}
${{ secrets.OU_CONTAINER_DEST }}
ghcr.io/${{ env.REPO }}:${{ env.TAG }}
ghcr.io/${{ env.REPO }}:${{ env.SHORT_TAG }}
ghcr.io/${{ env.REPO }}:latest

- name: sign images
run: |-
cosign sign -y ghcr.io/${{ env.REPO }}:${{ env.TAG }}

- uses: anchore/sbom-action@v0
with:
image: ghcr.io/${{ env.REPO }}:${{ env.TAG }}
format: spdx
output-file: /tmp/spdxg

- name: attach sbom to images
run: |-
cosign attach sbom --sbom /tmp/spdxg ghcr.io/${{ env.REPO }}:${{ env.TAG }}


GH_SBOM_SHA=$(cosign verify --certificate-oidc-issuer-regexp='.*' --certificate-identity-regexp='.*' ghcr.io/${{ env.REPO }}:${{ env.TAG }} 2>/dev/null | jq -r '.[0].critical.image["docker-manifest-digest"]' | cut -c 8-)


echo "GH_SBOM_SHA: $GH_SBOM_SHA"


cosign sign -y ghcr.io/${{ env.REPO }}:sha256-$GH_SBOM_SHA.sbom

59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 1.0.7

**enhancements:**
- change oidc config to line up with new kube authenticator [\#55](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/55)

**tasks:**
- 1.0.7 Release [\#54](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/54)

# 1.0.6

**bugs:**
- e2e tests failing to complete [\#45](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/45)
- Auditing is not working anymore [\#39](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/39)

**tasks:**
- 1.0.6 build [\#41](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/41)

# 1.0.5

**tasks:**
- 1.0.5 build [\#34](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/34)

# 1.0.4

**tasks:**
- 1.0.4 build [\#29](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/29)

# 1.0.3

**enhancements:**
- 1.0.3 release [\#26](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/26)

# 1.0.2

**bugs:**
- CVE-2022-1996 [\#20](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/20)

# 1.0.1

**enhancements:**
- 1.0.1 [\#14](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/14)

**bugs:**
- fix timing issues in e2e tests [\#18](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/18)
- runtime error: slice bounds out of range [:-2] [\#17](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/17)

# 1.0.0

**enhancements:**
- 1.0.0 Release [\#10](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/10)
- Access logging to standard out [\#2](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/2)
- create github action to automate builds [\#8](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/8)
- Switch from alpine --> ubuntu 20.04 [\#9](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/9)
- Support `kubectl --as` [\#3](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/3)
- Upgrade KinD [\#1](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/1)

**bugs:**
- update dependencies [\#5](https://github.com/TremoloSecurity/kube-oidc-proxy/issues/5)

7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright Jetstack Ltd. See LICENSE for details.
FROM alpine:3.10
FROM ubuntu:22.04
LABEL description="OIDC reverse proxy authenticator based on Kubernetes"

RUN apk --no-cache add ca-certificates \
&& apk --no-cache add --upgrade openssl
RUN apt-get update;apt-get -y install ca-certificates;apt-get -y upgrade;apt-get clean;rm -rf /var/lib/apt/lists/*

COPY ./bin/kube-oidc-proxy-linux /usr/bin/kube-oidc-proxy
COPY ./bin/kube-oidc-proxy /usr/bin/kube-oidc-proxy

CMD ["/usr/bin/kube-oidc-proxy"]
88 changes: 88 additions & 0 deletions GenGitChangeLog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Copyright Jetstack Ltd. See LICENSE for details.

# Generates kube-oidc-proxy Changelog
# Call from the branch with 3 parameters:
# 1. Date from which to start looking
# 2. Github Token

# requires python-dateutil and requests from pip

from subprocess import *
import re
from datetime import datetime
import dateutil.parser
import sys
import requests



def parseIssues(message):
issuesRet = []
issues = re.findall('[#][0-9]+',message)
if issues != None:
for issue in issues:
issuesRet.append(issue[1:])
return issuesRet


def f4(seq):
# order preserving
noDupes = []
[noDupes.append(i) for i in seq if not noDupes.count(i)]
return noDupes






headers = {'Authorization':'token ' + sys.argv[2]}


GIT_COMMIT_FIELDS = ['id', 'author_name', 'author_email', 'date', 'message']
GIT_LOG_FORMAT = ['%H', '%an', '%ae', '%ai', '%s']
GIT_LOG_FORMAT = '%x1f'.join(GIT_LOG_FORMAT) + '%x1e'

#print repo.git.log(p=False)

allIssues = []

p = Popen('git log --format="%s" ' % GIT_LOG_FORMAT, shell=True, stdout=PIPE)
(logb, _) = p.communicate()
log = str(logb,"utf-8")
log = log.strip('\n\x1e').split("\x1e")
log = [row.strip().split("\x1f") for row in log]
log = [dict(zip(GIT_COMMIT_FIELDS, row)) for row in log]

notbefore = dateutil.parser.parse(sys.argv[1] + ' 00:00:00 -0400')

for commit in log:
created = dateutil.parser.parse(commit['date'])
if created > notbefore:
message = commit['message']
allIssues.extend(parseIssues(message))


allIssues = f4(allIssues)

bylabels = {}

for issue in allIssues:
issueURL = 'https://api.github.com/repos/TremoloSecurity/kube-oidc-proxy/issues/' + issue
r = requests.get(issueURL,headers=headers)
json = r.json();

if "labels" in json:
for label in json['labels']:
if not (label['name'] in bylabels):
labelGroup = []
bylabels[label["name"]] = labelGroup
labelGroup = bylabels[label['name']]
labelGroup.append(json)


for label in bylabels:
print('**' + label + 's:**')
for issue in bylabels[label]:
print(' - ' + issue['title'] + ' [\\#' + str(issue['number']) + '](' + issue['html_url'] + ')')
print()
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ build: generate ## build kube-oidc-proxy
CGO_ENABLED=0 go build -ldflags '-w $(shell hack/version-ldflags.sh)' -o ./bin/kube-oidc-proxy ./cmd/.

docker_build: generate test build ## build docker image
GOARCH=$(ARCH) GOOS=linux CGO_ENABLED=0 go build -ldflags '-w $(shell hack/version-ldflags.sh)' -o ./bin/kube-oidc-proxy-linux ./cmd/.
GOARCH=$(ARCH) GOOS=linux CGO_ENABLED=0 go build -ldflags '-w $(shell hack/version-ldflags.sh)' -o ./bin/kube-oidc-proxy ./cmd/.
docker build -t kube-oidc-proxy .

all: test build ## runs tests, build
Expand Down
53 changes: 42 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# kube-oidc-proxy

> :warning:
>
> kube-oidc-proxy is an experimental tool that we would like to get feedback
> on from the community. Jetstack makes no guarantees on the soundness of the
> security in this project, nor any suggestion that it's 'production ready'.
> This server sits in the critical path of authentication to the Kubernetes
> API.
>
> :warning:

`kube-oidc-proxy` is a reverse proxy server to authenticate users using OIDC to
Kubernetes API servers where OIDC authentication is not available (i.e. managed
Kubernetes providers such as GKE, EKS, etc).
Expand All @@ -33,6 +23,10 @@ The following is a diagram of the request flow for a user request.
![kube-oidc-proxy request
flow](https://storage.googleapis.com/kube-oidc-proxy/diagram-d9623e38a6cd3b585b45f47d80ca1e1c43c7e695.png)

## Quickest Start

OpenUnison integrates kube-oidc-proxy directly, and includes an identity provider and access portal for Kubernetes. The quickest way to get started with kube-oidc-proxy is to follow the directions for OpenUnison's deployment at https://openunison.github.io/.

## Tutorial

Directions on how to deploy OIDC authentication with multi-cluster can be found
Expand Down Expand Up @@ -131,8 +125,45 @@ users:
- [Extra Impersonations Headers](./docs/tasks/extra-impersonation-headers.md)
- [Auditing](./docs/tasks/auditing.md)

## Logging

In addition to auditing, kube-oidc-proxy logs all requests to standard out so the requests can be captured by a common Security Information and Event Management (SIEM) system. SIEMs will typically import logs directly from containers via tools like fluentd. This logging is also useful in debugging. An example successful event:

```
[2021-11-25T01:05:17+0000] AuSuccess src:[10.42.0.5 / 10.42.1.3, 10.42.0.5] URI:/api/v1/namespaces/openunison/pods?limit=500 inbound:[mlbadmin1 / system:masters|system:authenticated /]
```

The first block, between `[]` is an ISO-8601 timestamp. The next text, `AuSuccess`, indicates that authentication was successful. the `src` block containers the remote address of the request, followed by the value of the `X-Forwarded-For` HTTP header if provided. The `URI` is the URL path of the request. The `inbound` section provides the user name, groups, and extra-info provided to the proxy from the JWT.

When there's an error or failure:

```
[2021-11-25T01:05:24+0000] AuFail src:[10.42.0.5 / 10.42.1.3] URI:/api/v1/nodes
```

This is similar to success, but without the token information.

## End-User Impersonation

kube-oidc-proxy supports the impersonation headers for inbound requests. This allowes the proxy to support `kubectl --as`. When impersonation headers are included in a request, the proxy checks that the authenticated user is able to assume the identity of the impersonation headers by submitting `SubjectAccessReview` requests to the API server. Once authorized, the proxy will send those identity headers instead of headers generated for the authenticated user. In addition, three `Extra` impersonation headers are sent to the API server to identify the authenticated user who's making the request:

| Header | Description |
| ------ | ----------- |
| `originaluser.jetstack.io-user` | The original username |
| `originaluser.jetstack.io-groups` | The original groups |
| `originaluser.jetstack.io-extra` | A JSON encoded map of arrays representing all of the `extra` headers included in the original identity |

In addition to sending this `extra` information, the proxy adds an additional section to the logfile that will identify outbound identity data. When impersonation headers are present, the `AuSuccess` log will look like:

```
[2021-11-25T01:05:17+0000] AuSuccess src:[10.42.0.5 / 10.42.1.3] URI:/api/v1/namespaces/openunison/pods?limit=500 inbound:[mlbadmin1 / system:masters|system:authenticated /] outbound:[mlbadmin2 / group2|system:authenticated /]
```

When using `Impersonate-Extra-` headers, the proxy's `ServiceAccount` must be explicitly authorized via RBAC to impersonate whatever the extra key is named. This is because extras are treated as subresources which must be explicitly authorized.


## Development
*NOTE*: building kube-oidc-proxy requires Go version 1.12 or higher.
*NOTE*: building kube-oidc-proxy requires Go version 1.17 or higher.

To help with development, there is a suite of tools you can use to deploy a
functioning proxy from source locally. You can read more
Expand Down
9 changes: 3 additions & 6 deletions cmd/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"fmt"

"github.com/spf13/cobra"
"golang.org/x/term"
k8sErrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apiserver/pkg/util/term"

cliflag "k8s.io/component-base/cli/flag"
)

Expand Down Expand Up @@ -45,7 +46,7 @@ func New() *Options {
func (o *Options) AddFlags(cmd *cobra.Command) {
// pretty output from kube-apiserver
usageFmt := "Usage:\n %s\n"
cols, _, _ := term.TerminalSize(cmd.OutOrStdout())
cols, _, _ := term.GetSize(0)
cmd.SetUsageFunc(func(cmd *cobra.Command) error {
fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
cliflag.PrintSections(cmd.OutOrStderr(), *o.nfs, cols)
Expand Down Expand Up @@ -91,10 +92,6 @@ func (o *Options) Validate(cmd *cobra.Command) error {
errs = append(errs, errors.New("cannot add extra user headers when impersonation disabled"))
}

if o.Audit.DynamicOptions.Enabled {
errs = append(errs, errors.New("The flag --audit-dynamic-configuration may not be set"))
}

if len(errs) > 0 {
return k8sErrors.NewAggregate(errs)
}
Expand Down
Loading