doc/administration/dedicated/encryption.md
{{< details >}}
{{< /details >}}
GitLab Dedicated encrypts all data at rest and in transit using Advanced Encryption Standard (AES) 256-bit encryption with the AWS Key Management Service (KMS).
All data at rest uses envelope encryption, where your data is protected by multiple layers of encryption keys.
Each service implements encryption differently:
| Service | Encryption method |
|---|---|
| Amazon S3 (SSE-S3) | Uses per-object encryption where each object is encrypted with its own unique key, which is then encrypted by an AWS-managed root key. |
| Amazon EBS | Uses volume-level encryption with a data encryption key (DEK) generated by KMS. |
| Amazon RDS (PostgreSQL) | Uses storage-level encryption with a DEK generated by KMS. |
| KMS | Manages encryption keys in an AWS-managed key hierarchy, protected by a hardware security module (HSM). |
In this envelope encryption system:
This envelope encryption process works by having KMS derive the data encryption keys specifically for each encryption operation. The data encryption key (DEK) directly encrypts your data, while the DEK itself is encrypted by the encryption key, creating a secure envelope around your data.
All data in transit uses Transport Layer Security (TLS) with strong cipher suites to protect data as it moves between services and across network connections.
Each service uses TLS:
| Service | Encryption method |
|---|---|
| Web application | TLS 1.2/1.3 for client-server communication |
| Amazon S3 | TLS 1.2/1.3 for HTTPS access |
| Amazon EBS | TLS for data replication between AWS data centers |
| Amazon RDS (PostgreSQL) | Secure Sockets Layer (SSL)/TLS (minimum TLS 1.2) for database connections |
| AWS KMS | TLS for API requests |
TLS certificates are generated and managed by default. You can optionally configure custom TLS certificates to use your organization's certificates instead. For more information, see custom certificate authorities for external services.
The following encryption options are available:
By default, GitLab handles all encryption setup for your instance. No setup is required and GitLab configures encryption across all services automatically.
The keys are protected by AWS Hardware Security Module (HSM) based security controls that prevent unauthorized access to your encryption keys and ensure your data remains encrypted.
[!warning] Customer-managed encryption keys must be configured during instance onboarding. Once enabled, they cannot be disabled or changed after provisioning.
Customer-managed encryption keys give you direct control over the keys that protect your data at rest.
You create and manage AWS KMS keys in your own AWS account, then configure them when you create your instance. GitLab uses your keys to encrypt data, but you retain full control over key access policies, rotation, and lifecycle management through your AWS account.
You can configure keys at different levels:
Due to key rotation requirements, your instance only supports keys where AWS generates the cryptographic key material
(the AWS_KMS origin type), rather than keys where you import your own key material.
For more information, see create multi-region primary keys.
Prerequisites:
To create your own encryption keys:
Sign in to the AWS Management Console and go to the KMS service.
Select the region where you want to create a key.
Select Create key.
In the Configure key section:
Enter an alias, description, and tags for your key.
Select the IAM users and roles that can administer the key.
Optional. Clear Allow key administrators to delete this key to prevent accidental deletion.
On the Define key usage permissions page, in the Other AWS accounts section, enter the GitLab AWS account ID provided by your account team.
Verify the KMS key policy matches the following example. Replace placeholder values with your account IDs and usernames. Additional restrictions beyond this policy are not supported.
[!note] Remove any additional conditions or restrictions, including those that AWS might auto-generate like
kms:GrantIsForAWSResource.
{
"Version": "2012-10-17",
"Id": "byok-key-policy",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<CUSTOMER-ACCOUNT-ID>:root"
},
"Action": "kms:*",
"Resource": "*"
},
{
"Sid": "Allow access for Key Administrators",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<CUSTOMER-ACCOUNT-ID>:user/<CUSTOMER-USER>"
]
},
"Action": [
"kms:Create*",
"kms:Describe*",
"kms:Enable*",
"kms:List*",
"kms:Put*",
"kms:Update*",
"kms:Revoke*",
"kms:Disable*",
"kms:Get*",
"kms:Delete*",
"kms:TagResource",
"kms:UntagResource",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion",
"kms:ReplicateKey",
"kms:UpdatePrimaryRegion"
],
"Resource": "*"
},
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<GITLAB-ACCOUNT-ID>:root"
]
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "*"
},
{
"Sid": "Allow attachment of persistent resources",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<GITLAB-ACCOUNT-ID>:root"
]
},
"Action": [
"kms:CreateGrant",
"kms:ListGrants",
"kms:RevokeGrant"
],
"Resource": "*"
}
]
}
Create replica keys when you want to use the same encryption key across multiple Geo instances in different regions. For more information, see create multi-region replica keys.
Prerequisites:
To create replica keys: