AWS Notes
5.6K subscribers
443 photos
42 videos
10 files
2.8K links
AWS Notes — Amazon Web Services Educational and Information Channel

Chat: https://t.iss.one/aws_notes_chat

Contacts: @apple_rom, https://www.linkedin.com/in/roman-siewko/
Download Telegram
​​Безопасность EKS — лучшие практики:

https://aws.github.io/aws-eks-best-practices/

Сетевая безопасность, защита подов, инфраструктура, compliance и так далее. Рекомендации, ссылки на другие ресурсы и инструменты.

Отличный, комплексно и качественно выполненный документ. Безопасникам — однозначно в закладки.

#security #best_practices #EKS
Проектируем и эксплуатируем Well-Architected аналитику с помощью Analytics Lens:

https://aws.amazon.com/blogs/big-data/build-an-aws-well-architected-environment-with-the-analytics-lens/

Даже если не связаны с проектами по аналитике, полезно глянуть, как рекомендуется выстраивать такие процессы. С помощью таких рекомендаций можно с ходу придумать схему, которая при этом подпадёт под #best_practices.

Например, данные собираются в S3 через Storage Gateway. Анализируем их с помощью Athena, метаданные отправляем в Elasticsearch для возможности классификации и поиска, везде используем шифрование с помощью своего KMS ключа, а пользовательский доступ к конечным данным реализуем с помощью Cognito.

#design
​​Как правильно писать питоновские Лямбды для девопс-задач:

https://medium.com/@jan.groth.de/10-recommendations-for-writing-pragmatic-aws-lambdas-in-python-5f4b038caafe

Отличный набор #best_practices, примеров и рекомендаций. Обязательно стоит почитать.

1. Используем линтеры
2. Отделяем handler от основной логики
3. Отдельная задача в отдельном методе
4. Внешние зависимости в отдельном методе
5. Инициализируем внешние зависимости в конструкторе
6. Незачем обрабатывать все возможные ошибки
7. Нужные ошибки обрабатываем отдельно
8. Логируем и задаём нужный уровень
9. Минимальный уровень логирования при деплое через CloudFormation
10. Декораторы полезны

#Lambda
Best Practices для шифрования EBS дисков:

https://aws.amazon.com/blogs/compute/must-know-best-practices-for-amazon-ebs-encryption/

Некоторые всегда полезные моменты по шифрованию:

🔹Совсем старые типы виртуалок (C1, M1, M2, T1) не поддерживают EBS шифрование
🔹Зашифрованный AMI нельзя сделать публичным
🔹Зашифрованный с помощью дефолтного ключа (AWS Managed) образ нельзя расшарить — для этого нужно шифровать с помощью AWS managed CMK

#EBS #best_practices
​​Стратегии тэгирования в AWS — с использованием CloudFormation и Terraform:

https://www.cloudforecast.io/blog/aws-tagging-best-practices-guide-part-2/

Часть вторая очень полезной серии.
(первая часть была здесь)

#tags #best_practices #CloudFormation #Terraform
​​Продолжение отличной серии по стратегии тэгирования AWS:

https://www.cloudforecast.io/blog/maintain-aws-tags-when-you-fall-behind-part-3/

#tags #best_practices
Советы по работе с AWS Organizations от производителя:

https://docs.aws.amazon.com/organizations/latest/userguide/orgs_best-practices.html

Рекомендации для мастер-аккаунта и для подаккаунтов.
Основные:
▪️ не используйте публичные почтовые сервисы (бо̀льшая вероятность взлома)
▪️ обязательно включайте MFA
▪️ блокируйте root-юзеров в подаккаунтах с помощью SCP
▪️ периодически проверяйте процесс восстановления доступа к аккаунту (чтобы проверить, что всё нужное для этого есть у нужных людей)
▪️ создайте/обновляйте документацию по процессу восстановления доступа

#best_practices #Organizations
​​Superwerker

Кто про что, а в̶ш̶и̶в̶ы̶й̶ ̶п̶р̶о̶ ̶б̶а̶н̶ю̶ я про AWS Organizations. Которой в этом году исполнится пять лет. И, значит, уже пятый год мы живём без гуманной процедуры удаления аккаунта, без временных аккаунтов.

За это время использование #multi_account_strategy стало обязательной практикой, в помощь чему появился сервис Control Tower, который в прошлом году обзавёлся возможностью работать в том числе и в существующей организации.

Однако порог входа для начала работы с лучшими практиками, которые даёт Organizations, пока по-прежнему высок. В попытке его снизить, намедни появился новый open source инструмент – superwerker:

https://github.com/superwerker/superwerker

Хороший набор #security #best_practices, правда, хороший – самое основное, что нужно иметь. Идеи по управлению аккаунтами в том числе позаимстованы из AWS Account Controller от Ian Mckay. Модный event-driven подход, (практически) бесплатные Лямбды.

Если бы хотел начать – точно бы обратил внимание. Заявленные фичи действительно самые нужные-востребованные:

▪️ Control Tower
▪️ AWS SSO
▪️ GuardDuty+dashboards
▪️ Security Hub+dashboards
▪️ AWS Backup
▪️ AWS Budgets
▪️ SCP guardrails
▪️ SSM+OpsCenter
▪️ CloudWatch dashboard

То, что (в первой версии) нет сетевой части, по мне так это и к лучшему. Система расширяемая и новые фичи вскоре наверняка будут с излишком.

Установка Superwerker официально доступна в качестве AWS Quick Start:

https://aws.amazon.com/quickstart/architecture/superwerker/

Хорошая штука, в общем. Можно рекомендовать.

#Organizations
S3 security — Top 10 best practices:

https://aws.amazon.com/blogs/security/top-10-security-best-practices-for-securing-data-in-amazon-s3/

1️⃣ Block public S3 buckets at the organization level
2️⃣ Use bucket policies to verify all access granted is restricted and specific
3️⃣ Ensure that any identity-based policies don’t use wildcard actions
4️⃣ Enable S3 protection in GuardDuty to detect suspicious activities
5️⃣ Use Macie to scan for sensitive data outside of designated areas
6️⃣ Encrypt your data in S3
7️⃣ Protect data in S3 from accidental deletion using S3 Versioning and S3 Object Lock
8️⃣ Enable logging for S3 using CloudTrail and S3 server access logging
9️⃣ Backup your data in S3
🔟 Monitor S3 using Security Hub and CloudWatch Logs

#S3 #security #best_practices
Security at the Edge — Core Principles:

https://d1.awsstatic.com/whitepapers/Security/security-at-the-edge.pdf

It’s critical to ensure that both the security of their environments and the security present in traditional cloud networks are extended to workloads at the edge. The whitepaper provides security executives the foundations for implementing a defense in depth strategy for security at the edge.

#security #best_practices
​​CI/CD best practices — AWS Whitepaper «Practicing Continuous Integration and Continuous Delivery on AWS»:

https://docs.aws.amazon.com/whitepapers/latest/practicing-continuous-integration-continuous-delivery/testing-stages-in-continuous-integration-and-continuous-delivery.html

90% рекомендаций не привязаны к AWS, потому полезны для подавляющего большинства проектов/команд.

👍Do:
▪️ Treat your infrastructure as code
▫️▪️ Use version control for your infrastructure code.
▫️▪️ Make use of bug tracking/ticketing systems.
▫️▪️ Have peers review changes before applying them.
▫️▪️ Establish infrastructure code patterns/designs.
▫️▪️ Test infrastructure changes like code changes.
▪️ Put developers into integrated teams of no more than 12 self-sustaining members.
▪️ Have all developers commit code to the main trunk frequently, with no long-running feature branches.
▪️ Consistently adopt a build system such as Maven or Gradle across your organization and standardize builds.
▪️ Have developers build unit tests toward 100% coverage of the code base.
▪️ Ensure that unit tests are 70% of the overall testing in duration, number, and scope.
▪️ Ensure that unit tests are up-to-date and not neglected. Unit test failures should be fixed, not bypassed.
▪️ Treat your continuous delivery configuration as code.
▪️ Establish role-based security controls (that is, who can do what and when).
▫️▪️ Monitor/track every resource possible.
▫️▪️ Alert on services, availability, and response times.
▫️▪️ Capture, learn, and improve.
▫️▪️ Share access with everyone on the team.
▫️▪️ Plan metrics and monitoring into the lifecycle.
▪️ Keep and track standard metrics.
▫️▪️ Number of builds.
▫️▪️ Number of deployments.
▫️▪️ Average time for changes to reach production.
▫️▪️ Average time from first pipeline stage to each stage.
▫️▪️ Number of changes reaching production.
▫️▪️ Average build time.
▪️ Use multiple distinct pipelines for each branch and team.

👎Don’t:
▪️ Have long-running branches with large complicated merges.
▪️ Have manual tests.
▪️ Have manual approval processes, gates, code reviews, and security reviews.


#devops #best_practices
​​Рекомендации по реализации микросервисной архитектуры на AWS:

https://docs.aws.amazon.com/whitepapers/latest/microservices-on-aws/microservices-on-aws.html

Документ AWS Whitepaper «Implementing Microservices on AWS» описывает подходы к реализации масштабируемой и надёжной микросервисной архитектуры, в том числе с использованием serverless подхода. Описываются подходы для мониторинга распределённых по сервисам окружений и реализации асинхронной работы.

#design #best_practices
Всесторонний документ, почему IAM – это боль:

https://www.effectiveiam.com/

Очень полезен и для того, чтобы разобраться в том, как работает IAM, и для того, чтобы глубже понять проблемы настройки политик, и для того, чтобы шире взглянуть на то, почему это так проблематично вообще (спойлер – всё сложно, в прямом смысле этого слова).

Описываются подходы и для настройки IAM политик в рамках одного аккаунта, и для выстраивания процессов в рамках Organizations.

#IAM #security #best_practices
​​SCP Best Practices

🔹 Deny list strategy
🔹 Allow list strategy

🔹 https://aws.amazon.com/blogs/mt/codify-your-best-practices-using-service-control-policies-part-1/

🔸 Organizational Units

🔸 https://aws.amazon.com/blogs/mt/best-practices-for-organizational-units-with-aws-organizations/

▪️ Deny Changes to CloudWatch monitors
▪️ Deny Changes to CloudWatch Logs
▪️ Deny Changes to Config
▪️ Deny accounts from leaving the organization
▪️ Deny all actions
▪️ Deny access to IAM with role exception
▪️ Deny actions outside approved regions
▪️ Deny ability to pass IAM roles
▪️ Deny changes to GuardDuty
▪️ Deny changes to AWS Budget Actions
▪️ Limit changes to Cost Anomaly Detection, except when using a specific IAM Role

▪️ https://aws.amazon.com/blogs/mt/codify-your-best-practices-using-service-control-policies-part-2/

☮️

#SCP #security #best_practices
👍6👎1