Skip to content

Instantly share code, notes, and snippets.

View ihcsim's full-sized avatar

Ivan Sim ihcsim

  • SUSE
  • BC, Canada
  • 19:44 (UTC -07:00)
View GitHub Profile

Goals

Assess GitHub Copilot's efficiency and accuracy to detect code weaknesses in Go and Bash.

Strategy

Submit a number of pull requests to the ihcsim/harvester repository containing deliberate code weaknesses and vulnerabilities.

Do not provide Copilot with any hints that these exploits are intentionally added to the files.

@ihcsim
ihcsim / config.toml
Last active April 8, 2026 22:14
version = 2
disabled_plugins = ["io.containerd.grpc.v1.cri"]
root = "/var/lib/firecracker-containerd/containerd"
state = "/run/firecracker-containerd"
[grpc]
address = "/run/firecracker-containerd/containerd.sock"
[plugins]
[plugins."io.containerd.snapshotter.v1.devmapper"]
pool_name = "fc-dev-thinpool"
base_image_size = "10GB"

To view etcd logs using crictl:

$ sudo /var/lib/rancher/rke2/bin/crictl --runtime-endpoint /run/k3s/containerd/containerd.sock ps -a | grep -i etcd
bf290fb65f79c       405516f27f18a       3 minutes ago       Running             etcd                                  8                   e720a5d2a0f71       etcd-isim-dev                                           kube-system

$ sudo /var/lib/rancher/rke2/bin/crictl --runtime-endpoint /run/k3s/containerd/containerd.sock logs bf290fb65f79c

RKE2 kubelet logs located at /var/lib/rancher/rke2/agent/logs/kubelet.log.

@ihcsim
ihcsim / add_cluster_network.md
Last active July 18, 2025 21:02
Add cluster network to Harvester

To create a new cluster network using the Harvester UI, navigate to Networks > Cluster Network Configuration.

Use the Create a Cluster Network option to create the new cluster network. E.g., name it cluznet.

Once the network is created, configure its uplink NIC via the Create Network Configuration option.

To configure the uplink link, a new NIC device must be made available to the Harvester host by performing the following steps using the Linux VMM:

  • create a new virtual network
  • use the new virtual network as the source of the NIC
scheme_version: 1
os:
hostname: sand.isim.dev
ssh_authorized_keys:
- ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNtRt9WeQJNVU9IXsqY8taNCdAeMEP8RRGU1QSFF7SD4aX21f1zQ5KmVTPYRllt95rh2RKpk3uRuiURBBej0d68= isim@pop-os
ntpServers:
- 0.suse.pool.ntp.org
- 1.suse.pool.ntp.org
install:
wipeAllDisks: true
# Port-Forward To RKE2 Prometheus In Harvester
Retrieve the `web.external-url` from the Prometheus pod:
```sh
k -n cattle-monitoring-system get po prometheus-rancher-monitoring-prometheus-0 -ojsonpath='{.spec.containers[?(@.name=="prometheus")].args}' | grep "web.ext
ernal-url"
```

How To Retrieve SSH Key To Harvester Guest Cluster From Rancher UI

  • Navigate to Cluster Management page on Rancher
  • Find the Machine Pool section of the cluster
  • Right-click to access the Download SSH Key option

image

Changing RKE2 etcd storage size:

echo 'etcd-arg: "quota-backend-bytes=4294967296"' > /etc/rancher/rke2/config.yaml.d/etcd.yaml

Reset RKE2 on Harvester

The rke2 server --cluster-reset command can be used to reset etcd to a single-node cluster, with its data intact.

See https://docs.rke2.io/datastore/backup_restore

Stop the RKE2 server:

sudo systemctl stop rke2-server