S'S ALGORITHM

AWS安全专家考试相关内容。

时间戳2024年3月。

不同视角的服务启发

在 AWS 中,可以使用以下服务和功能来应对各种安全威胁:

  1. 数据泄露
    • 使用 AWS IAM 和 AWS KMS 管理和控制对存储在云中的数据的访问权限。
    • 使用 Amazon S3 Bucket Policies 和 AWS IAM 来限制对 S3 存储桶中对象的访问。
    • 使用 Amazon Macie 来监控和发现 S3 存储桶中的敏感数据,并实施数据分类和保护策略。
    • CloudWatch Logs 作为全部数据存储。
  2. 账户和凭证泄露
    • 使用 AWS IAM 进行身份和访问管理,强制实施多因素身份验证(MFA)、定期轮换凭证、使用 IAM 角色等安全最佳实践。
    • 使用 AWS Secrets Manager 或 AWS Systems Manager Parameter Store 管理和保护敏感的凭证和密钥。
  3. 拒绝服务(DoS)攻击
    • 使用 AWS Shield 提供 DDoS 保护,帮助防止和缓解网络层攻击。
    • 使用 AWS WAF 防火墙来过滤和阻止 Web 请求中的恶意流量。
  4. 恶意软件和恶意行为
    • 使用 AWS WAF 防火墙和 AWS Firewall Manager 来监控和阻止恶意流量。
    • 使用 AWS GuardDuty 和 Amazon Macie 监控和检测恶意行为和异常活动。
  5. 不安全的 API 和管理接口
    • 使用 AWS IAM 和 AWS Organizations 来限制和管理对 AWS 管理控制台和 API 的访问权限。
    • 使用 AWS Config 和 AWS CloudTrail 记录和监控对 AWS 资源的操作和事件。
  6. 数据隔离问题
    • 使用 AWS VPC 和安全组来隔离和保护云中的网络流量和资源。VPC Flow Logs/ELB Access Logs/CloudFront Logs/WAF Logs
    • 使用 AWS IAM 和资源标签来实现对资源的访问控制和隔离。
  7. 身份和访问管理(IAM)问题
    • 使用 AWS IAM 进行身份和访问管理,实施最小权限原则,并定期审查和轮换访问凭证。
  8. 社会工程和钓鱼攻击
    • 提供员工培训以提高安全意识,并教育他们识别和防范社会工程攻击。
    • 使用 AWS IAM、AWS SSO 和 AWS Organizations 实施统一的身份和访问管理策略,减少钓鱼攻击的成功率。
  9. 未经授权的配置更改
    • 使用 AWS Config 实时监控和评估 AWS 资源的配置,并确保符合安全和合规标准。
    • 使用 AWS CloudFormation 和 AWS Config Rules 自动化和强制实施安全配置。
  10. 系统漏洞
    • Inspector 可以检测 EC2,ECR,lambda 的漏洞和风险。
  11. 其他
    • 所以存在S3中的log都可以用Athena进行分析。
    • Log的深度存储:Glacier

以上列出的 AWS 服务和功能只是一部分可以用来应对各种安全威胁的示例。实际上,AWS 提供了更多的安全工具和功能,组合使用可以帮助用户建立高度安全的云环境,并保护其数据和应用程序不受安全威胁的影响。


AWS安全服务一共包括六个板块:

1 - Treat detection and Incident response

Guard Duty

AWS Security Hub

Detective

Penetration Testing

EC2 instance connect

EC2 Serial Console

如果ssh到EC2的AccessKey丢了怎么更新EC2内的公钥

EC2Rescue Tool for Linux

IAM Access Analyzer

其他概念

2 - Security Logging and Monitoring

定义和术语

Inspector

System Manager

Cloud Watch

Amazon EventBridge

Amazon Athena

AWS CloudTrail

AWS Macie

S3 Notifications

VPC Flow Logs

VPC Traffic Mirroring

VPC Network Access Analyzer

Route53 Resolver Query Logging

OpenSearch

3 - Infrastructure Security

Bastion Hosts

一种保护私有网络的方法,我的GCP项目中就使用到了这种构架。bastion的意思是堡垒,向外部开放22端口允许公开访问,外部的访问通过bastion访问私有服务器的内容,bastion和私有服务器中也是通过私有IP进行链接,以此保护私有服务器的地址不暴露,私有服务器不对外链接。

Site to site VPN

Direct Connect

AWSVPN CloudHub

AWS Client VPN

VPC Peering

DNS Resolution

VPC Endpoint

-(在GCP中也有同样的暴露方法)

NACL & SG

AWS Transit Gateway

CloudFront

WAF

Shield

WAF & Shield & Firewall manager

API Gateway

AWS Artifact

Route53

AWS Network Firewall

EKS

XRay

AWS Workspaces

CloudShell

4 - Identity and Access Manager

文档howdoesIAMworks:https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html

IAM Policy

STS

SCP的相关Policy示例

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "RequireMicroInstanceType",
      "Effect": "Deny",
      "Action": "ec2:RunInstances",
      "Resource": [
        "arn:aws:ec2:*:*:instance/*"
      ],
      "Condition": {
        "StringNotEquals": {
          "ec2:InstanceType": "t2.micro"
        }
      }
    }
  ]
}
点击展开/折叠 ```json { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyAllOutsideEU", "Effect": "Deny", "NotAction": [ "a4b:*", "acm:*", "aws-marketplace-management:*", "aws-marketplace:*", "aws-portal:*", "budgets:*", "ce:*", "chime:*", "cloudfront:*", "config:*", "cur:*", "directconnect:*", "ec2:DescribeRegions", "ec2:DescribeTransitGateways", "ec2:DescribeVpnGateways", "fms:*", "globalaccelerator:*", "health:*", "iam:*", "importexport:*", "kms:*", "mobileanalytics:*", "networkmanager:*", "organizations:*", "pricing:*", "route53:*", "route53domains:*", "s3:GetAccountPublic*", "s3:ListAllMyBuckets", "s3:PutAccountPublic*", "shield:*", "sts:*", "support:*", "trustedadvisor:*", "waf-regional:*", "waf:*", "wafv2:*", "wellarchitected:*" ], "Resource": "*", "Condition": { "StringNotEquals": { "aws:RequestedRegion": [ "eu-central-1", "eu-west-1" ] }, "ArnNotLike": { "aws:PrincipalARN": [ "arn:aws:iam::*:role/Role1AllowedToBypassThisSCP", "arn:aws:iam::*:role/Role2AllowedToBypassThisSCP" ] } } } ] } ```

IMDS(instance metadate service)

S3和对象的跨账户访问权限

以下是一个示例 S3 CORS 配置的 JSON 格式:

{
  "CORSRules": [
    {
      "AllowedOrigins": ["http://example.com"],
      "AllowedMethods": ["GET", "PUT"],
      "AllowedHeaders": ["*"],
      "MaxAgeSeconds": 3000
    }
  ]
}

在这个示例中,配置了允许来自 http://example.com 域名的网站通过 GETPUT 方法访问 S3 存储桶中的资源,允许任意标头,并设置了一个最大缓存时间为 3000 秒。Headers的部分可以设置Authorization。这里Origin设置最好是特定的网站或者S3bucket,防止别人重新搞一个网站用你的资源。

Origin=scheme(Protocol)+host(domain)+port same origin:www.example.com/app1 & www.example.com/app2 diff origin:www.example.com & other.example.com

Cognito

Identity Federation

IAM Identity Center(SSO)

AWS Directory Services

AWS Verified Access

5 - Data Protection

加密类型

CloudHSM

KMS

Secrets Manager

S3数据加密

Load Balancing

ACM

AWS Backup

Amazon Data LifeCycle Manager

AWS Nitro Enclaves

ECR

AWS Signer

AWS Glue

EBS data wiping

RDS&Aurora

6 - Management and Security Governance

AWS Organization

Control Tower

AWS Config

Trusted Advisor

Cost Explorer

AWS Cost Anomaly Detection

CloudFormation

(一个在各种环节都很重要的服务)

Service Catalog

EC2 Image Builder

RAM: Resource Access Manager

AWS Audit Manager

Well Architected Framework Tool