AWS创建github相关的角色

创建github-actions角色

json 复制代码
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::11111111:oidc-provider/token.actions.githubusercontent.com"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
                },
                "StringLike": {
                    "token.actions.githubusercontent.com:sub": [
                        "repo:project-ventures/test-crawler:*",
                        "repo:project-ventures/test-dash:*",
                        "repo:project-ventures/test-fspa:*",
                        "repo:project-ventures/test-gep:*",
                        "repo:project-network/repl-monitor:*",
                        "repo:project-network/*",
                        "repo:projectdevops/github-actions-demo:*"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::11111111:root"
            },
            "Action": "sts:AssumeRole"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ec2.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

在创建一个github-actions用户,将github-actions角色添加到github-actions用户

创建github-cicd角色
json 复制代码
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::1111111:oidc-provider/token.actions.githubusercontent.com"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
                },
                "StringLike": {
                    "token.actions.githubusercontent.com:sub": "repo:project-network/*"
                }
            }
        }
    ]
}

AmazonS3FullAccess策略完全添加上到github-cicd

相关推荐
努力的小T4 分钟前
Ubuntu 系统grub日志级别设置
linux·运维·服务器·ubuntu·云计算
炎码工坊36 分钟前
云原生安全基石:深度解析HTTPS协议(从原理到实战)
网络协议·网络安全·云原生·https·云计算
无聊的烤苕皮1 小时前
Docker运维-5.3 配置私有仓库(Harbor)
linux·运维·docker·容器·云计算
炎码工坊2 小时前
云原生安全之HTTP协议:从基础到实战的安全指南
安全·http·网络安全·云原生·云计算
Gold Steps.2 小时前
Prometheus + Grafana 监控常用服务
云原生·云计算·prometheus
Johny_Zhao4 小时前
网络安全攻防演练实战指南
网络·人工智能·网络安全·信息安全·云计算·系统运维·攻防演练
云布道师5 小时前
中企出海大会|打造全球化云计算一张网,云网络助力中企出海和AI创新
网络·人工智能·阿里云·云计算·云布道师
数据与人工智能律师11 小时前
加密货币投资亏损后,能否以“欺诈”或“不当销售”索赔?
大数据·网络·算法·云计算·区块链
摸鱼的后端17 小时前
开源软件协议大白话分类指南
github·开源软件
zqh1767364646918 小时前
新消息!阿里云ACP大模型认证有变化!
阿里云·云计算