4. ¿Por qué AWS Identity and Access Management (IAM)?
Para que usted pueda controlar quién puede hacer qué en su cuenta AWS.
5. ¿Por qué AWS Identity and Access Management (IAM)?
Para que usted pueda controlar quién puede hacer qué en su cuenta AWS.
Primitivas:
- Usuarios, Grupos, Recursos, Acciones
- Políticas, Roles
6. ¿Por qué AWS Identity and Access Management (IAM)?
Para que usted pueda controlar quién puede hacer qué en su cuenta AWS.
Primitivas:
- Usuarios, Grupos, Recursos, Acciones
- Políticas, Roles
Control:
- Centralizado
- Granular (APIs), Recursos, Acceso a AWS Management Console
7. ¿Por qué AWS Identity and Access Management (IAM)?
Para que usted pueda controlar quién puede hacer qué en su cuenta AWS.
Primitivas:
- Usuarios, Grupos, Recursos, Acciones
- Políticas, Roles
Control:
- Centralizado
- Granular (APIs), Recursos, Acceso a AWS Management Console
Seguridad:
- Negación por defecto
- Múltiples usuarios: Credenciales y permisos individuales
10. Gestión de usuarios y permisos
0. Crear usuarios individuales. Ventajas
• Credenciales únicas
• Fácil rotación
• Permisos individuales
• Visibility into your user activity by recording AWS API calls to
an Amazon S3 bucket
11. Gestión de usuarios y permisos
0. Crear usuarios individuales.
1. Menor privilegio (LP and NtK).
Ventajas
- Menor probabilidad de error
humano
- Abordaje restrictivo ->
permisivo
- Control más granular
• Visibility into your user activity by
recording AWS calls to an Amazon
12. Gestión de usuarios y permisos
0. Crear usuarios individuales.
1. Menor privilegio (LP and NtK).
2. Usar grupos para administrar privilegios.
Ventajas
- Asignar los mismos permisos
a varios usuarios
- Fácil reasignación de
permisos
- Centralización de cambios
para múltiples usuarios
13. Gestión de usuarios y permisos
0. Crear usuarios individuales.
1. Menor privilegio (LP and NtK).
2. Usar grupos para administrar privilegios.
3. Usar ”Condiciones” para restricciones
adicionales.
Ventajas
- Granularidad adicional
- Disponible para cualquier
API AWS
- Reduce la posibilidad de
ejecutar accidentalmente
acciones privilegiadas
14. Gestión de usuarios y permisos
0. Crear usuarios individuales.
1. Menor privilegio (LP and NtK).
2. Usar grupos para administrar privilegios.
3. Usar ”Condiciones” para restricciones
adicionales.
4. Habilitar AWS CloudTrail.
Ventajas
- Visibilidad de las actividades
- Auditoria
15. Gestión de Credenciales
5. Definir una política fuerte de contraseñas. Ventajas
- Dificulta la explotación de
cuentas
16. Gestión de Credenciales
5. Definir una política fuerte de contraseñas.
6. Rotar regularmente las credenciales
Ventajas
- Dificulta la explotación de
cuentas
- Contiene el impacto de
credenciales explotadas
17. Gestión de Credenciales
5. Definir una política fuerte de contraseñas.
6. Rotar regularmente las credenciales
7. Configurar MFA.
Ventajas
- Autenticación fuerte
- Protección adicional para
acciones privilegiadas
18. Delegación
8. Usar roles IAM para acceso compartido.
Ventajas
- No compartir credenciales
- No almacenar credenciales
de largo plazo
- Varios casos de uso:
- Acceso cross-account
- Delegación intra-account
- Federación
19. Delegación
8. Usar roles IAM para acceso compartido.
9. Usar roles IAM para instancias EC2.
Ventajas
- Fácil manejo de credenciales
en instancias
- Rotación automática
- “Least privilege” a nivel de
aplicación
- Integrado con SDKs y CLI
20. Delegación
8. Usar roles IAM para acceso compartido.
9. Usar roles IAM para instancias EC2.
10. Elimine (o reduzca) el uso de root.
Ventajas
- Reduce la probabilidad de
mala utilización de la cuenta
- Reduce la probabilidad de
explotación
21. Top 11 IAM best practices
0. Usuarios – Cree usuarios individuales.
1. Permisos – “Least Privilege”.
2. Grupos – Administre permisos con grupos.
3. Condiciones – Restrinja acceso privilegiado con condiciones.
4. Auditoria – Habilite AWS CloudTrail para registrar las llamadas.
5. Contraseñas – Configure una política fuerte.
6. Rotación – Rote regularmente las credenciales de seguridad.
7. MFA – Habilite MFA para usuarios privilegiados.
8. Accesso compartido– Use roles IAM para compartir accesos.
9. Roles – Use roles IAM para instancias Amazon EC2.
10. Root – Elimine (o reduzca) el uso de root.
24. ¿ Usuario IAM ó Usuario Federado ?
• Depende del lugar donde está el repositorio de autenticación
– On-premises → Usuarios federados (roles IAM)
– Cuenta AWS → Usuarios IAM
25. ¿ Usuario IAM ó Usuario Federado ?
• Depende del lugar donde está el repositorio de autenticación
– On-premises → Usuarios federados (roles IAM)
– Cuenta AWS → Usuarios IAM
• Otros casos de uso:
– Delegar acceso a su cuenta → Usuarios federados (roles IAM)
– Acceso de aplicación móvil → SIEMPRE usuarios federados
26. ¿ Usuario IAM ó Usuario Federado ?
• Depende del lugar donde está el repositorio de autenticación
– On-premises → Usuarios federados (roles IAM)
– Cuenta AWS → Usuarios IAM
• Otros casos de uso:
– Delegar acceso a su cuenta → Usuarios federados (roles IAM)
– Acceso de aplicación móvil → SIEMPRE usuarios federados
IMPORTANTE: Nunca comparta credenciales.
29. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
test@ejemplo.com
Acct ID: 111111111111
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Usuario IAM user:
mauricio
STS
30. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
{ "Statement": [
{ "Action":
[
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:ListTables"
],
"Effect": "Allow",
"Resource": "*“
}]}
test@ejemplo.com
Acct ID: 111111111111
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Usuario IAM user:
mauricio
Permisos definidos para role-ddb
STS
31. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
{ "Statement": [
{ "Action":
[
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:ListTables"
],
"Effect": "Allow",
"Resource": "*“
}]}
test@ejemplo.com
Acct ID: 111111111111
{ "Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource":
"arn:aws:iam::999999999999:role/ddb-role"
}]}
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Permisos asignados a
mauricio, permitiéndole
asumir el role-ddb en la
cuenta 999999999999
Usuario IAM user:
mauricio
Permisos definidos para role-ddb
STS
32. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
{ "Statement": [
{ "Action":
[
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:ListTables"
],
"Effect": "Allow",
"Resource": "*“
}]}
test@ejemplo.com
Acct ID: 111111111111 Autentica con las
credenciales de
mauricio
{ "Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource":
"arn:aws:iam::999999999999:role/ddb-role"
}]}
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Usuario IAM user:
mauricio
Permisos definidos para role-ddb
STS
Permisos asignados a
mauricio, permitiéndole
asumir el role-ddb en la
cuenta 999999999999
33. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
{ "Statement": [
{ "Action":
[
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:ListTables"
],
"Effect": "Allow",
"Resource": "*“
}]}
test@ejemplo.com
Acct ID: 111111111111 Autentica con las
credenciales de
mauricio
Obtiene
credenciales
temporales para
role-ddb
{ "Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource":
"arn:aws:iam::999999999999:role/ddb-role"
}]}
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Usuario IAM user:
mauricio
Permisos definidos para role-ddb
STS
Permisos asignados a
mauricio, permitiéndole
asumir el role-ddb en la
cuenta 999999999999
34. prod@ejemplo.com
Acct ID: 999999999999
role-ddb
{ "Statement": [
{ "Action":
[
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:DescribeTable",
"dynamodb:ListTables"
],
"Effect": "Allow",
"Resource": "*“
}]}
test@ejemplo.com
Acct ID: 111111111111 Autentica con las
credenciales de
mauricio
Obtiene
credenciales
temporales para
role-ddb
Llama la API AWS,
usando las
credenciales
temporales de role-
ddb
{ "Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource":
"arn:aws:iam::999999999999:role/ddb-role"
}]}
{ "Statement": [
{
"Effect":"Allow",
"Principal":{"AWS":"111111111111"},
"Action":"sts:AssumeRole"
}]}
¿ Cómo funciona el acceso federado ?
role-ddb confía en los usuarios IAM de la cuenta
test@ejemplo.com (111111111111)
Usuario IAM user:
mauricio
Permisos definidos para role-ddb
STS
Permisos asignados a
mauricio, permitiéndole
asumir el role-ddb en la
cuenta 999999999999
35. ¿ Access Keys ó Contraseñas?
AWS Access Keys Contraseñas
36. ¿ Access Keys ó Contraseñas?
• Depende de cómo los usuarios accederán a AWS
– AWS Management Console → Contraseña
– API, CLI, SDK → Access keys
37. ¿ Access Keys ó Contraseñas?
• Depende de cómo los usuarios accederán a AWS
– AWS Management Console → Contraseña
– API, CLI, SDK → Access keys
• En cualquier caso, verifique la rotación periódica de credenciales
– Use el reporte “Credential Report” para auditar la rotación.
– Configure política de contraseñas.
– Configure la política de usuario para permitir la rotación.
38. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement":[
]}
39. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement": [{
"Effect": " ",
"Action": [
],
"Resource":
}]}
40. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
],
"Resource":
}]}
41. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:ListAccessKeys",
"iam:UpdateAccessKey"],
"Resource":
}]}
42. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:ListAccessKeys",
"iam:UpdateAccessKey"],
"Resource":
"arn:aws:iam::123456789012:
user/${aws:username}"
}]}
43. Política de ejemplo para permitir la rotación de llaves
(Usuario IAM)
Política IAM
{
"Version":"2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:ListAccessKeys",
"iam:UpdateAccessKey"],
"Resource":
"arn:aws:iam::123456789012:
user/${aws:username}"
}]}
1. Cree un segundo par de credenciales,
mientras todavía el primer par está activo.
2. Actualice las aplicaciones con las nuevas
credenciales.
3. Cambie el estado de las credenciales
originales para Inactive.
4. Verifique que las aplicaciones están
funcionando correctamente.
5. Borre las credenciales originales.
Procedimiento para la rotación
46. Políticas: ¿ Inline o Managed ?
Depende de qué tan “personal” quiera hacerse la política.
• Use Políticas Inline cuando necesite:
• Una relación estricta uno-a-uno entre la política y el principal.
• Evitar que la política sea asignada de forma errónea.
• Eliminar la política cuando se borra el principal.
47. Políticas: ¿ Inline o Managed ?
Depende de qué tan “personal” quiera hacerse la política.
• Use Políticas Inline cuando necesite:
• Una relación estricta uno-a-uno entre la política y el principal
• Evitar que la política sea asignada de forma errónea
• Eliminar la política cuando se borra el principal
• Use Políticas Managed cuando necesite:
• Reutilización.
• Gestión de cambios centralizada.
• Versionamiento y Rollback.
• Delegación de gestión de permisos.
• Actualizaciones automáticas para políticas AWS.
• Tamaños mayores de políticas.
48. ¿ Grupos o Managed Policies?
GRUPOS Managed Policies
49. • Ofrecen beneficios parecidos
– Asignar los mismos permisos a varios usuarios.
– Gerenciamiento centralizado de permisos.
– Actualizaciones cubren múltiples usuarios.
¿ Grupos o Managed Policies?
50. • Ofrecen beneficios parecidos
– Asignar los mismos permisos a varios usuarios.
– Gerenciamiento centralizado de permisos.
– Actualizaciones cubren múltiples usuarios.
• Use grupos cuando necesite:
– Gerenciar usuarios ….
¿ Grupos o Managed Policies?
agrupados.
51. • Ofrecen beneficios parecidos
– Asignar los mismos permisos a varios usuarios.
– Gerenciamiento centralizado de permisos.
– Actualizaciones cubren múltiples usuarios.
• Use grupos cuando necesite:
– Gerenciar usuarios …. agrupados.
• Use Managed Policies cuando necesite:
– Asignar la misma política a usuarios, grupos o roles.
¿ Grupos o Managed Policies?
52. Recomendación: Combine grupos Y Managed Policies
• Use grupos para organizar sus usuarios
• Asigne los permisos a los grupos usando Managed Policies
53. Recomendación: Combine grupos Y Managed Policies
• Use grupos para organizar sus usuarios
• Asigne los permisos a los grupos usando Managed Policies
• Sugerencia: Cree Managed Policies separadas, con permisos específicos
para una situación, servicio o proyecto y asigne varias políticas a cada
grupo.
55. Basado en recursos Basado en Tags
Políticas: ¿ Basadas en Recursos o en Tags?
56. • Use políticas basadas en recursos cuando necesite:
• Controlar acceso a un recurso específico.
• Controlar acceso a la mayoría de recursos AWS.
Políticas: ¿ Basadas en Recursos o en Tags?
57. • Use políticas basadas en recursos cuando necesite:
• Controlar acceso a un recurso específico.
• Controlar acceso a la mayoría de recursos AWS.
• Use políticas basadas en Tags cuando necesite:
• Tratar recursos como una unidad (p.ej: un proyecto).
• Aplicar permisos automáticamente al crear los recursos.
Políticas: ¿ Basadas en Recursos o en Tags?
58. • Use políticas basadas en recursos cuando necesite:
• Controlar acceso a un recurso específico.
• Controlar acceso a la mayoría de recursos AWS.
• Use políticas basadas en Tags cuando necesite:
• Tratar recursos como una unidad (p.ej: un proyecto).
• Aplicar permisos automáticamente al crear los recursos.
Nota:
Estos servicios actualmente soportan políticas de control basadas en Tags:
AWS CloudFormation, AWS Elastic Beanstalk, Amazon EC2 (Incluidos EBS),
Amazon EMR, Amazon ElastiCache, Amazon Glacier, Amazon Kinesis, Amazon
VPC, Amazon RDS, Amazon Redshift, Amazon Route 53 y Amazon S3
http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/supported-resources.html
Políticas: ¿ Basadas en Recursos o en Tags?
59. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : "Real"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
60. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Real"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
Proyecto=Barcelona
61. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Real"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
Proyecto=Barcelona
62. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Real"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
i-a4321r12
Proyecto=Barcelona
Proyecto=Barcelona
63. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Barcelona"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
i-a4321r12
Proyecto=Barcelona
64. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Barcelona"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
i-a4321r12
Proyecto=Barcelona
65. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Barcelona"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
i-a4321r12
Proyecto=Barcelona
i-a4321b12
Proyecto=Real
66. ¿ Cómo funciona el control de acceso basado en Tags?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Project" : ”Barcelona"
}
}
}
]
}
Privilegios asignados a Lionel, dándole permiso de
ejecutar cualquier acción EC2 en recursos
marcados con el Tag:
Proyecto=Barcelona
IAM user:
Lionel
i-a1234r12
i-a4321r12
Proyecto=Barcelona
i-a4321b12
Proyecto=Real
69. ¿ Una única cuenta AWS o varias?
Use una única cuenta AWS cuando:
• Quiera simplificar el control de quién hace qué en su ambiente AWS.
• No haya necesidad de aislar proyectos/productos/equipos.
• No tenga necesidad de separar costos.
70. ¿ Una única cuenta AWS o varias?
Use una única cuenta AWS cuando:
• Quiera simplificar el control de quién hace qué en su ambiente AWS.
• No haya necesidad de aislar proyectos/productos/equipos.
• No tenga necesidad de separar costos.
Use múltiples cuentas AWS cuando:
• Necesite aislar completamente proyectos/equipos/ambientes.
• Requiera aislar información de auditoria o de recuperación (p. ej:
enviar logs de auditoria (CloudTrail) a una cuenta diferente).
• Requiera una cuenta única, pero con costos y utilización discriminada.
81. ¿ Qué vimos hoy?
1. Top 10 de mejores prácticas.
2. Usuario IAM vs. Usuario Federado.
3. Access keys vs. Contraseñas.
4. Políticas Inline vs. managed policies.
5. Grupos vs. managed policies.
6. Políticas basadas en recursos vs. Políticas basadas en Tags.
7. Una única cuenta AWS vs. varias cuentas AWS.
X
11
More detail can be found in IAM documentation.
The presentation will focus in high-level concepts.
0. Create individual users.
Grant least privilege.
Manage permissions with groups.
Restrict privileged access further with conditions.
Enable AWS CloudTrail to get logs of API calls.
0. Create individual users.
Grant least privilege.
Manage permissions with groups.
Restrict privileged access further with conditions.
Enable AWS CloudTrail to get logs of API calls.
0. Create individual users.
Grant least privilege.
Manage permissions with groups.
Restrict privileged access further with conditions.
Enable AWS CloudTrail to get logs of API calls.
0. Create individual users.
Grant least privilege.
Manage permissions with groups.
Restrict privileged access further with conditions.
Enable AWS CloudTrail to get logs of API calls.
0. Create individual users.
Grant least privilege.
Manage permissions with groups.
Restrict privileged access further with conditions.
Enable AWS CloudTrail to get logs of API calls.
Configure a strong password policy.
Rotate security credentials regularly.
Enable MFA for privileged users.
Configure a strong password policy.
Rotate security credentials regularly.: Talk about user/passwd and Access Keys. Rotate all.
Enable MFA for privileged users.
Configure a strong password policy.
Rotate security credentials regularly.
Enable MFA for privileged users: Talk about Physical and Software tokens (Form factors)
Never share credentials!!!
Role: Introduce the concept of trust relationship.
Use IAM roles to share access.
Use IAM roles for Amazon EC2 instances.
Reduce or remove use of root.
Use IAM roles to share access.
Use IAM roles for Amazon EC2 instances: Don´t use access keys inside the instances.
Reduce or remove use of root.
Use IAM roles to share access.
Use IAM roles for Amazon EC2 instances.
Reduce or remove use of root.
All of these are described in more detail in IAM documentation.
0. Users – Create individual users.
Permissions – Grant least privilege.
Groups – Manage permissions with groups.
Conditions – Restrict privileged access further with conditions.
Auditing – Enable AWS CloudTrail to get logs of API calls.
Password – Configure a strong password policy.
Rotate – Rotate security credentials regularly.
MFA – Enable MFA for privileged users.
Sharing – Use IAM roles to share access.
Roles – Use IAM roles for Amazon EC2 instances.
Root – Reduce or remove use of root.
Depends on where you want to manage your users
On-premises → Federated users (IAM roles)
In your AWS account → IAM users
Other important use cases
Delegating access to your account → Federated users (IAM roles)
Mobile application access → Should always be federated access
Depends on where you want to manage your users
On-premises → Federated users (IAM roles)
In your AWS account → IAM users
Other important use cases
Delegating access to your account → Federated users (IAM roles)
Mobile application access → Should always be federated access
Use federated access as long as you can!
Depends on where you want to manage your users
On-premises → Federated users (IAM roles)
In your AWS account → IAM users
Other important use cases
Delegating access to your account → Federated users (IAM roles)
Mobile application access → Should always be federated access
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Permissions assigned to Mauricio granting him permission to assume role-ddb in account B
Depends on how your users will access AWS
Console → Password
API, CLI, SDK → Access keys
In either case make sure to rotate credentials regularly
Use Credential Report to audit credential rotation.
Configure password policy.
Configure policy to allow access key rotation.
Depends on how your users will access AWS
Console → Password
API, CLI, SDK → Access keys
In either case make sure to rotate credentials regularly
Use Credential Report to audit credential rotation.
Configure password policy.
Configure policy to allow access key rotation.
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
While the first set of credentials is still active, create a second set of credentials, which will also be active by default.
Update all applications to use the new credentials.
Change the state of the first set of credentials to Inactive.
Using only the new credentials, confirm that your applications are working well.
Delete the first set
Show credentials report (Technical-Info/Labs/IAM/CredentialsReport) – user: fernandabycli (two keys, one inactive)
Show Pasword Policies
Explain what is Inline Policy and Managed Policy
Managed Policy: Attached by reference
Inline Policy: Attached by value.
http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html
Use inline policies when you need to:
Enforce a strict one-to-one relationship between policy and principal.
Avoid the wrong policy being attached to a principal.
Ensure the policy is deleted when deleting the principal.
Use managed policies when you need:
Reusability.
Central change management.
Versioning and rollback.
Delegation of permissions management.
Automatic updates for AWS managed policies.
Larger policy size.
http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html
For inline policies: You can add as many inline policies as you want to a user, role, or group, but the total aggregate policy size (the sum size of all inline policies) per entity cannot exceed the following limits:
User policy size cannot exceed 2,048 characters
Role policy size cannot exceed 10,240 characters
Group policy size cannot exceed 5,120 characters
Note
IAM does not count whitespace when calculating the size of a policy against these limitations.
For managed policies: You can add up to 10 managed policies to a user, role, or group. The size of each managed policy cannot exceed 5,120 characters.
http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html
Use inline policies when you need to:
Enforce a strict one-to-one relationship between policy and principal.
Avoid the wrong policy being attached to a principal.
Ensure the policy is deleted when deleting the principal.
Use managed policies when you need:
Reusability.
Central change management.
Versioning and rollback.
Delegation of permissions management.
Automatic updates for AWS managed policies.
Larger policy size.
http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html
For inline policies: You can add as many inline policies as you want to a user, role, or group, but the total aggregate policy size (the sum size of all inline policies) per entity cannot exceed the following limits:
User policy size cannot exceed 2,048 characters
Role policy size cannot exceed 10,240 characters
Group policy size cannot exceed 5,120 characters
Note
IAM does not count whitespace when calculating the size of a policy against these limitations.
For managed policies: You can add up to 10 managed policies to a user, role, or group. The size of each managed policy cannot exceed 5,120 characters.
Provide similar benefits
Can be used to assign the same permission to many users.
Central location to manage permissions.
Policy updates affect multiple users.
Use groups when you need to
Logically group and manage users .
Use managed policies when you need to
Assign the same policy to users, groups, and roles.
Provide similar benefits
Can be used to assign the same permission to many users.
Central location to manage permissions.
Policy updates affect multiple users.
Use groups when you need to
Logically group and manage users .
Use managed policies when you need to
Assign the same policy to users, groups, and roles.
Provide similar benefits
Can be used to assign the same permission to many users.
Central location to manage permissions.
Policy updates affect multiple users.
Use groups when you need to
Logically group and manage users .
Use managed policies when you need to
Assign the same policy to users, groups, and roles.
Use groups to organize your users into logical clusters.
Attach managed policies to those groups with the permissions those groups need.
Pro tip: Create managed policies based on logically separated permissions such as AWS service or project, and attach managed policies mix-and-match style to your groups.
Use groups to organize your users into logical clusters.
Attach managed policies to those groups with the permissions those groups need.
Pro tip: Create managed policies based on logically separated permissions such as AWS service or project, and attach managed policies mix-and-match style to your groups.
Create smaller chunks and use as lego pieces.
Create an IAM policy for accessing S3 (read-only) - Managed
Test.
Change the S3 policy to read+write
Test.
Show the versioning
Mauricio: Use resources (bucket) and conditions
aws s3 ls --profile colombia
Use resource-specific policy when you need to:
Control access to a specific resource.
Control access to most AWS service resources.
Use tag-based access control when you need to:
Treat resources as a unit, such as a project.
Automatically enforce permissions when new resources are created.
Use resource-specific policy when you need to:
Control access to a specific resource.
Control access to most AWS service resources.
Use tag-based access control when you need to:
Treat resources as a unit, such as a project.
Automatically enforce permissions when new resources are created.
http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/supported-resources.html
Use resource-specific policy when you need to:
Control access to a specific resource.
Control access to most AWS service resources.
Use tag-based access control when you need to:
Treat resources as a unit, such as a project.
Automatically enforce permissions when new resources are created.
Create the Tag “Real” and use policies for Terminate, Stop and Start instances.
Show two instances, one for Real and other with Barcelona, and check what the user James can do.
Then, use a resource-specific policy to allow access to the Barcelona instance (stop or start) and check that now it can be done.
Use a single AWS account when you:
Want simpler control of who does what in your AWS environment.
Have no need to isolate projects/products/teams.
Have no need for breaking up the cost.
Use multiple AWS accounts when you:
Need full isolation between projects/teams/environments.
Want to isolate recovery data and/or auditing data (e.g., writing your CloudTrail logs to a different account).
Need a single bill, but want to break out the cost and usage.
Use a single AWS account when you:
Want simpler control of who does what in your AWS environment.
Have no need to isolate projects/products/teams.
Have no need for breaking up the cost.
Use multiple AWS accounts when you:
Need full isolation between projects/teams/environments.
Want to isolate recovery data and/or auditing data (e.g., writing your CloudTrail logs to a different account).
Need a single bill, but want to break out the cost and usage.
Start by attaching a pre-prepared policy (Assume Role)
Show that the user cannot execute actions on other instances.
Show that the role can execute those actions (based on tags, for example).
Go to Switch Role (in this case, using the same account, just for demonstration purposes).
Show that now the user has access to what the role allowed, but now doesn´t have access to previous permisions.
Top 1011 best practices.
IAM users vs. federated users.
Access keys vs. passwords.
Inline policies vs. managed policies.
Groups vs. managed policies.
Resource-specific policy vs. tag-based access control.
One AWS account vs. multiple AWS accounts.