Tell us what works and what could be better. We read every submission.
@aharonh·5 public vizzes
This example demonstrates a Kubernetes remediation script that scans all deployments and stateful sets across every namespace, appending the `LOG4J_FORMAT_MSG_NO_LOOKUPS=true` environment variable to any container lacking it, thereby mitigating the log4shell CVE-2021-44228 exploit. The code uses the official `kubernetes` Python client, loading the kubeconfig via `config.load_kube_config()` and leveraging `AppsV1Api` to list and patch resources with `list_deployment_for_all_namespaces()` and `patch_namespaced_deployment()`. It iterates through each app, checks existing environment variables for the marker, and only applies patches when changes are required, printing progress and error messages for each modified workload.
This visualization scans every pod in a Kubernetes cluster to determine whether its JVM version is vulnerable to CVE-2021-44228 (Log4Shell). It shows a tabular output of pod namespace, name, container, Java version, and a boolean vulnerability flag, skipping pods that have succeeded or lack the Java executable. The script uses the Kubernetes Python client’s `CoreV1Api` to list pods and `connect_get_namespaced_pod_exec` with a streaming response to run `java -version` in each container, parsing the stderr with regex to extract version numbers. It applies a hard-coded threshold check for Java 6, 7, 8, and 11 versions, explicitly noting that only the initial exploit vector is covered.
This script automates the renewal of temporary AWS credentials required when MFA is enabled for AWS CLI authentication. It shows the process of exchanging a one-time MFA token for session credentials by calling the AWS STS `get-session-token` API via the `aws` command-line tool. The code uses Python’s `subprocess.run`, `json.loads`, and `configparser` to parse the command output and update the specified `~/.aws/credentials` file with new access key, secret key, and session token. It takes five command-line arguments—start profile, MFA profile, credentials filename, MFA device ARN, and token—and writes the refreshed credentials to the designated profile section.
This example presents a Keybase proof as a structured, interactive visualization. It shows the cryptographic signature chain and identity verification details in a hierarchical layout, using d3.forceSimulation to position nodes representing the proof’s components. The code renders the JSON structure with d3.select and d3.hierarchy, while d3.forceLink draws the connections between the public key, user, and service nodes. The visualization makes the otherwise opaque cryptographic verification process immediately readable by exposing the nested object relationships and their data.
This visualization example shows a shell script that backs up every Docker image on the system to a compressed file. It demonstrates a practical workflow for system administration rather than a graphical chart. The script uses the `docker images` command to list images, filters out lines with "none" tags, and extracts image names with `awk`. It then loops through each image, transforms the name into a filename by replacing slashes and colons with hyphens, and saves the image using `docker save` piped through `pigz` for gzip compression with best quality. The process runs in real time as each image is processed sequentially.