Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/clbs-io/cloudflare-tunnel-ingress-controller
As the name suggests, this is a Kubernetes Ingress Controller that uses Cloudflare Tunnel to expose services to the Internet. This controller is based on the Kubernetes Ingress Controller for Cloudflare Argo Tunnel and the community made project STRRL / cloudflare-tunnel-ingress-controller.
Before installing, you need a Cloudflare API token. To create a token, go to Cloudflare / Profile / API Tokens.
You must allow Account:Cloudflare Tunnel:Edit
and Zone:DNS:Edit
for the zones that you want to manage (can be multiple or all that you have).
[!IMPORTANT] Set up correct permissions for the API token:
- Set a correct account for the token. Do not use the option All accounts, unless you have to!
- Set a correct zone for the token. Do not use the option All zones, unless you have to!
When creating a new API token, your screen should look like this:
After obtaining an API token, create a Kubernetes Secret:
Create secret with shell command:
kubectl create secret generic --namespace cloudflare-tunnel-system cloudflare-api-token --from-literal=token=<your-cloudflare-api-token>
Or create it from a YAML manifest:
# cloudflare-api-token.yaml
apiVersion: v1
kind: Secret
metadata:
name: cloudflare-api-token
namespace: cloudflare-tunnel-system
type: Opaque
stringData:
token: <your-cloudflare-api-token> # CHANGE ME !!!
kubectl apply -f cloudflare-api-token.yaml
You will also need your Cloudflare Account ID, for DNS.
The Helm chart is stored in the OCI format in our company Helm repository, so there is no need to add another Helm repository.
export CLOUDFLARE_ACCOUNT_ID=<your-cloudflare-account-id>
helm upgrade --install \
--namespace cloudflare-tunnel-system --create-namespace \
cloudflare-tunnel-ingress oci://registry.clbs.io/cloudflare-tunnel-ingress-controller/cloudflare-tunnel-ingress-controller \
--set config.cloudflare.apiToken.existingSecret.name=cloudflare-api-token \
--set config.cloudflare.accountID=$CLOUDFLARE_ACCOUNT_ID \
--set config.cloudflare.tunnelName=tunnel-ingress-demo
helm uninstall --namespace cloudflare-tunnel-system cloudflare-tunnel-ingress
The kubectl port-forward
command utilizes an HTTP connection upgrade, which can fail if the connection is established via a Cloudflare (CF) Tunnel.
To resolve this issue, direct TCP access to the Kubernetes API server is required.
The clbs Cloudflare Tunnel Ingress Controller automatically creates access records that allow the use of the cloudflared access tcp
command to directly forward to the Kubernetes API server.
The cloudflared access tcp
command requires two arguments:
host:port
value on which the tcp access shall locally listen on. Typically it should be 127.0.0.1:6443
.Example command:
cloudflared access tcp --hostname k.example.com --url 127.0.0.1:6443
You can then extend your kubeconfig by setting the proxy-url value to route traffic through the TCP tunnel.
clusters:
- cluster:
server: https://127.0.0.1:6443 # The value just has to be set.
proxy-url: socks5://localhost:6443 # The same as the --url value in cloudflared access command.
This setup ensures that your kubectl commands will work correctly when using a Cloudflare Tunnel.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.