Skip to content

Instantly share code, notes, and snippets.

View knqyf263's full-sized avatar

Teppei Fukuda knqyf263

View GitHub Profile
@knqyf263
knqyf263 / ghtopdep.table
Last active August 31, 2023 08:55
trivy-action users
root@4694e6d13588:/# ghtopdep --minstar 200 --rows 200 https://github.com/aquasecurity/trivy-action
| url | stars |
|-------------------------------------------------------------------------|---------|
| https://github.com/coder/code-server | 62K |
| https://github.com/metabase/metabase | 34K |
| https://github.com/swagger-api/swagger-ui | 24K |
| https://github.com/goharbor/harbor | 21K |
| https://github.com/dgraph-io/dgraph | 20K |
| https://github.com/aquasecurity/trivy | 18K |
| https://github.com/keycloak/keycloak | 17K |
@knqyf263
knqyf263 / ami-snapshot.sh
Last active November 25, 2022 18:38
AMI scanning with Trivy
#!/bin/bash
AMI_ID=$1
KEY_NAME=xxxxxxx
SECURITY_GROUP_ID=sg-xxxxxxxxxxx
SUBNET_ID=subnet-xxxxxxxxxxxxxxx
INSTANCE_TYPE=t2.micro
echo $AMI_ID
@knqyf263
knqyf263 / snapshot.sh
Last active November 24, 2022 13:46
EBS snapshot scanning with Trivy
#!/bin/bash
AMI_ID=$1
echo $AMI_ID
KEY_NAME=xxxx
SECURITY_GROUP_ID=sg-xxxxxxxxxxx
SUBNET_ID=subnet-xxxxxxxxxxxxx
INSTANCE_TYPE=t2.micro
@knqyf263
knqyf263 / policy.yaml
Last active July 29, 2022 18:56
Kyverno Vulnerability Attestation
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: check-vulnerabilities
spec:
validationFailureAction: enforce
webhookTimeoutSeconds: 10
failurePolicy: Fail
rules:
- name: no-critical-vuln
@knqyf263
knqyf263 / main.go
Last active March 30, 2020 16:20
mmap panic
package main
import (
"fmt"
"io/ioutil"
"os"
"syscall"
"unsafe"
"golang.org/x/sys/unix"
@knqyf263
knqyf263 / Dockerfile
Last active May 3, 2019 18:08
rpm debug
FROM centos:7
RUN yum -y update \
&& yum -y groupinstall "Development tools" \
&& yum -y install git vim openssl openssl-devel nspr nspr-devel nss nss-devel \
file file-devel popt popt-devel lua-static lua-devel db4 db4-devel wget tar \
libarchive libarchive-devel strace gdb-gdbserver libdb-devel lzma xz-devel
RUN git clone https://github.com/rpm-software-management/rpm.git \
&& cd rpm \
&& git checkout rpm-4.11.3-release \
@knqyf263
knqyf263 / README.md
Last active January 30, 2019 08:09
Infinite loop
#!/usr/bin/python
#coding:utf-8
import json, toml, hashlib
groups = {
'default': [],
'develop': []
}
http.HandleFunc("/slash", func(w http.ResponseWriter, r *http.Request) {
s, err := slack.SlashCommandParse(r)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
if !s.ValidateToken(verificationToken) {
w.WriteHeader(http.StatusUnauthorized)
return
@knqyf263
knqyf263 / redis_test.go
Last active May 16, 2023 14:11
go-redis pipeline
func TestRedis(t *testing.T) {
s, _ := testutil.PrepareTestRedis()
for i := 0; i < 10000; i++ {
s.Set("key"+strconv.Itoa(i), "hoge"+strconv.Itoa(i))
}
client := redis.NewClient(&redis.Options{Addr: s.Addr()})
// 普通にループ
result := map[string]string{}
for i := 0; i < 10000; i++ {