[{"data":1,"prerenderedAt":451},["ShallowReactive",2],{"/en-us/the-source/authors/jlongo/":3,"footer-en-us":32,"the-source-navigation-en-us":340,"the-source-newsletter-en-us":367,"jlongo-articles-list-authors-en-us":379,"jlongo-articles-list-en-us":410,"jlongo-page-categories-en-us":450},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"config":8,"seo":10,"content":12,"type":23,"slug":24,"_id":25,"_type":26,"title":27,"_source":28,"_file":29,"_stem":30,"_extension":31},"/en-us/the-source/authors/jlongo","authors",false,"",{"layout":9},"the-source",{"title":11},"Joseph Longo",[13,21],{"componentName":14,"type":14,"componentContent":15},"TheSourceAuthorHero",{"config":16,"name":11,"headshot":18},{"gitlabHandle":17},"jlongo_gitlab",{"altText":11,"config":19},{"src":20},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1751463434/uoxaknpmoposbbgzqji8.png",{"componentName":22,"type":22},"TheSourceArticlesList","author","jlongo","content:en-us:the-source:authors:jlongo.yml","yaml","Jlongo","content","en-us/the-source/authors/jlongo.yml","en-us/the-source/authors/jlongo","yml",{"_path":33,"_dir":34,"_draft":6,"_partial":6,"_locale":7,"data":35,"_id":336,"_type":26,"title":337,"_source":28,"_file":338,"_stem":339,"_extension":31},"/shared/en-us/main-footer","en-us",{"text":36,"source":37,"edit":43,"contribute":48,"config":53,"items":58,"minimal":328},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"text":38,"config":39},"View page source",{"href":40,"dataGaName":41,"dataGaLocation":42},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/","page source","footer",{"text":44,"config":45},"Edit this page",{"href":46,"dataGaName":47,"dataGaLocation":42},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/content/","web ide",{"text":49,"config":50},"Please contribute",{"href":51,"dataGaName":52,"dataGaLocation":42},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/CONTRIBUTING.md/","please contribute",{"twitter":54,"facebook":55,"youtube":56,"linkedin":57},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[59,86,159,227,289],{"title":60,"links":61,"subMenu":67},"Platform",[62],{"text":63,"config":64},"DevSecOps platform",{"href":65,"dataGaName":66,"dataGaLocation":42},"/platform/","devsecops platform",[68],{"title":69,"links":70},"Pricing",[71,76,81],{"text":72,"config":73},"View plans",{"href":74,"dataGaName":75,"dataGaLocation":42},"/pricing/","view plans",{"text":77,"config":78},"Why Premium?",{"href":79,"dataGaName":80,"dataGaLocation":42},"/pricing/premium/","why premium",{"text":82,"config":83},"Why Ultimate?",{"href":84,"dataGaName":85,"dataGaLocation":42},"/pricing/ultimate/","why ultimate",{"title":87,"links":88},"Solutions",[89,94,99,104,109,114,119,124,129,134,139,144,149,154],{"text":90,"config":91},"Digital transformation",{"href":92,"dataGaName":93,"dataGaLocation":42},"/topics/digital-transformation/","digital transformation",{"text":95,"config":96},"Security & Compliance",{"href":97,"dataGaName":98,"dataGaLocation":42},"/solutions/security-compliance/","security & compliance",{"text":100,"config":101},"Automated software delivery",{"href":102,"dataGaName":103,"dataGaLocation":42},"/solutions/delivery-automation/","automated software delivery",{"text":105,"config":106},"Agile development",{"href":107,"dataGaName":108,"dataGaLocation":42},"/solutions/agile-delivery/","agile delivery",{"text":110,"config":111},"Cloud transformation",{"href":112,"dataGaName":113,"dataGaLocation":42},"/topics/cloud-native/","cloud transformation",{"text":115,"config":116},"SCM",{"href":117,"dataGaName":118,"dataGaLocation":42},"/solutions/source-code-management/","source code management",{"text":120,"config":121},"CI/CD",{"href":122,"dataGaName":123,"dataGaLocation":42},"/solutions/continuous-integration/","continuous integration & delivery",{"text":125,"config":126},"Value stream management",{"href":127,"dataGaName":128,"dataGaLocation":42},"/solutions/value-stream-management/","value stream management",{"text":130,"config":131},"GitOps",{"href":132,"dataGaName":133,"dataGaLocation":42},"/solutions/gitops/","gitops",{"text":135,"config":136},"Enterprise",{"href":137,"dataGaName":138,"dataGaLocation":42},"/enterprise/","enterprise",{"text":140,"config":141},"Small business",{"href":142,"dataGaName":143,"dataGaLocation":42},"/small-business/","small business",{"text":145,"config":146},"Public sector",{"href":147,"dataGaName":148,"dataGaLocation":42},"/solutions/public-sector/","public sector",{"text":150,"config":151},"Education",{"href":152,"dataGaName":153,"dataGaLocation":42},"/solutions/education/","education",{"text":155,"config":156},"Financial services",{"href":157,"dataGaName":158,"dataGaLocation":42},"/solutions/finance/","financial services",{"title":160,"links":161},"Resources",[162,167,172,177,182,187,192,197,202,207,212,217,222],{"text":163,"config":164},"Install",{"href":165,"dataGaName":166,"dataGaLocation":42},"/install/","install",{"text":168,"config":169},"Quick start guides",{"href":170,"dataGaName":171,"dataGaLocation":42},"/get-started/","quick setup checklists",{"text":173,"config":174},"Learn",{"href":175,"dataGaName":176,"dataGaLocation":42},"https://university.gitlab.com/","learn",{"text":178,"config":179},"Product documentation",{"href":180,"dataGaName":181,"dataGaLocation":42},"https://docs.gitlab.com/","docs",{"text":183,"config":184},"Blog",{"href":185,"dataGaName":186,"dataGaLocation":42},"/blog/","blog",{"text":188,"config":189},"Customer success stories",{"href":190,"dataGaName":191,"dataGaLocation":42},"/customers/","customer success stories",{"text":193,"config":194},"Remote",{"href":195,"dataGaName":196,"dataGaLocation":42},"https://handbook.gitlab.com/handbook/company/culture/all-remote/","remote",{"text":198,"config":199},"GitLab Services",{"href":200,"dataGaName":201,"dataGaLocation":42},"/services/","services",{"text":203,"config":204},"TeamOps",{"href":205,"dataGaName":206,"dataGaLocation":42},"/teamops/","teamops",{"text":208,"config":209},"Community",{"href":210,"dataGaName":211,"dataGaLocation":42},"/community/","community",{"text":213,"config":214},"Forum",{"href":215,"dataGaName":216,"dataGaLocation":42},"https://forum.gitlab.com/","forum",{"text":218,"config":219},"Events",{"href":220,"dataGaName":221,"dataGaLocation":42},"/events/","events",{"text":223,"config":224},"Partners",{"href":225,"dataGaName":226,"dataGaLocation":42},"/partners/","partners",{"title":228,"links":229},"Company",[230,235,240,245,250,255,260,264,269,274,279,284],{"text":231,"config":232},"About",{"href":233,"dataGaName":234,"dataGaLocation":42},"/company/","company",{"text":236,"config":237},"Jobs",{"href":238,"dataGaName":239,"dataGaLocation":42},"/jobs/","jobs",{"text":241,"config":242},"Leadership",{"href":243,"dataGaName":244,"dataGaLocation":42},"/company/team/e-group/","leadership",{"text":246,"config":247},"Team",{"href":248,"dataGaName":249,"dataGaLocation":42},"/company/team/","team",{"text":251,"config":252},"Handbook",{"href":253,"dataGaName":254,"dataGaLocation":42},"https://handbook.gitlab.com/","handbook",{"text":256,"config":257},"Investor relations",{"href":258,"dataGaName":259,"dataGaLocation":42},"https://ir.gitlab.com/","investor relations",{"text":261,"config":262},"Sustainability",{"href":263,"dataGaName":261,"dataGaLocation":42},"/sustainability/",{"text":265,"config":266},"Diversity, inclusion and belonging (DIB)",{"href":267,"dataGaName":268,"dataGaLocation":42},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":270,"config":271},"Trust Center",{"href":272,"dataGaName":273,"dataGaLocation":42},"/security/","trust center",{"text":275,"config":276},"Newsletter",{"href":277,"dataGaName":278,"dataGaLocation":42},"/company/contact/","newsletter",{"text":280,"config":281},"Press",{"href":282,"dataGaName":283,"dataGaLocation":42},"/press/","press",{"text":285,"config":286},"Modern Slavery Transparency Statement",{"href":287,"dataGaName":288,"dataGaLocation":42},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"title":290,"links":291},"Contact Us",[292,297,302,307,312,317,322],{"text":293,"config":294},"Contact an expert",{"href":295,"dataGaName":296,"dataGaLocation":42},"/sales/","sales",{"text":298,"config":299},"Get help",{"href":300,"dataGaName":301,"dataGaLocation":42},"/support/","get help",{"text":303,"config":304},"Customer portal",{"href":305,"dataGaName":306,"dataGaLocation":42},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"text":308,"config":309},"Status",{"href":310,"dataGaName":311,"dataGaLocation":42},"https://status.gitlab.com/","status",{"text":313,"config":314},"Terms of use",{"href":315,"dataGaName":316,"dataGaLocation":42},"/terms/","terms of use",{"text":318,"config":319},"Privacy statement",{"href":320,"dataGaName":321,"dataGaLocation":42},"/privacy/","privacy statement",{"text":323,"config":324},"Cookie preferences",{"dataGaName":325,"dataGaLocation":42,"id":326,"isOneTrustButton":327},"cookie preferences","ot-sdk-btn",true,{"items":329},[330,332,334],{"text":313,"config":331},{"href":315,"dataGaName":316,"dataGaLocation":42},{"text":318,"config":333},{"href":320,"dataGaName":321,"dataGaLocation":42},{"text":323,"config":335},{"dataGaName":325,"dataGaLocation":42,"id":326,"isOneTrustButton":327},"content:shared:en-us:main-footer.yml","Main Footer","shared/en-us/main-footer.yml","shared/en-us/main-footer",{"_path":341,"_dir":9,"_draft":6,"_partial":6,"_locale":7,"logo":342,"subscribeLink":347,"navItems":351,"_id":363,"_type":26,"title":364,"_source":28,"_file":365,"_stem":366,"_extension":31},"/shared/en-us/the-source/navigation",{"altText":343,"config":344},"the source logo",{"src":345,"href":346},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1750191004/t7wz1klfb2kxkezksv9t.svg","/the-source/",{"text":348,"config":349},"Subscribe",{"href":350},"#subscribe",[352,356,359],{"text":353,"config":354},"Artificial Intelligence",{"href":355},"/the-source/ai/",{"text":95,"config":357},{"href":358},"/the-source/security/",{"text":360,"config":361},"Platform & Infrastructure",{"href":362},"/the-source/platform/","content:shared:en-us:the-source:navigation.yml","Navigation","shared/en-us/the-source/navigation.yml","shared/en-us/the-source/navigation",{"_path":368,"_dir":9,"_draft":6,"_partial":6,"_locale":7,"title":369,"description":370,"submitMessage":371,"formData":372,"_id":376,"_type":26,"_source":28,"_file":377,"_stem":378,"_extension":31},"/shared/en-us/the-source/newsletter","The Source Newsletter","Stay updated with insights for the future of software development.","You have successfully signed up for The Source’s newsletter.",{"config":373},{"formId":374,"formName":375,"hideRequiredLabel":327},1077,"thesourcenewsletter","content:shared:en-us:the-source:newsletter.yml","shared/en-us/the-source/newsletter.yml","shared/en-us/the-source/newsletter",{"amanda-rueda":380,"andre-michael-braun":381,"andrew-haschka":382,"ayoub-fandi":383,"bob-stevens":384,"brian-wald":385,"bryan-ross":386,"chandler-gibbons":387,"dave-steer":388,"ddesanto":389,"derek-debellis":390,"emilio-salvador":391,"erika-feldman":392,"george-kichukov":393,"gitlab":394,"grant-hickman":395,"haim-snir":396,"iganbaruch":397,"jlongo":11,"joel-krooswyk":398,"josh-lemos":399,"julie-griffin":400,"kristina-weis":401,"lee-faus":402,"ncregan":403,"rschulman":404,"sabrina-farmer":405,"sandra-gittlen":406,"sharon-gaudin":407,"stephen-walters":408,"taylor-mccaslin":409},"Amanda Rueda","Andre Michael Braun","Andrew Haschka","Ayoub Fandi","Bob Stevens","Brian Wald","Bryan Ross","Chandler Gibbons","Dave Steer","David DeSanto","Derek DeBellis","Emilio Salvador","Erika Feldman","George Kichukov","GitLab","Grant Hickman","Haim Snir","Itzik Gan Baruch","Joel Krooswyk","Josh Lemos","Julie Griffin","Kristina Weis","Lee Faus","Niall Cregan","Robin Schulman","Sabrina Farmer","Sandra Gittlen","Sharon Gaudin","Stephen Walters","Taylor McCaslin",{"allArticles":411,"visibleArticles":449,"showAllBtn":327},[412],{"_path":413,"_dir":414,"_draft":6,"_partial":6,"_locale":7,"config":415,"seo":418,"content":423,"type":444,"slug":445,"category":414,"_id":446,"_type":26,"title":419,"_source":28,"_file":447,"_stem":448,"_extension":31,"date":424,"description":420,"timeToRead":425,"heroImage":421,"keyTakeaways":426,"articleBody":430,"faq":431},"/en-us/the-source/security/how-to-implement-secret-management-best-practices-with-gitlab","security",{"layout":9,"template":416,"articleType":417,"author":24,"featured":6,"isHighlighted":6,"authorName":11},"TheSourceArticle","Regular",{"title":419,"description":420,"ogImage":421,"config":422},"How to implement secret management best practices with GitLab","Learn how companies tasked with storage and protection of customer data can reduce risk and increase trust with secure secret management.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1751463593/wgbh2snwpsyle9jom1k1.png",{"ignoreTitleCharLimit":327},{"title":419,"date":424,"description":420,"timeToRead":425,"heroImage":421,"keyTakeaways":426,"articleBody":430,"faq":431},"2024-03-12","5 min read",[427,428,429],"Insecure secret management risks data breaches; GitLab's native integration enhances security.","Auditable and attributable secret management allows security teams to monitor for anomalous or malicious activity and quickly respond.","GitLab supports secret storage and usage with robust access controls and detection tools.","Insecure secret management practices (SMPs) pose a significant risk to any company, especially those tasked with the storage and protection of their customers' data. It's a common problem, and it is often at the core of a company's risk register. A leaked secret can result in a loss of confidentiality and potentially a data breach. These types of incidents can lead to significant financial losses and a loss of trust amongst an entity's customer base.\n\nFor many companies, insecure SMPs may result from a lack of expertise or being unaware of the tools and strategies that exist to solve this issue. Appropriate SMPs can help reduce the potential for compromise and increase trust in an organization's secret management strategy. In this post, we will discuss secret management best practices, GitLab's ability to support those practices, and our strategy for improving the DevSecOps platform's native secret management capabilities.\n\n## Develop a cryptographic strategy\n\nEvery company needs a cryptographic strategy as a foundation to ensure developers are operating in a standardized way and all applications and their components are being developed in accordance with the company's cryptographic requirements.\n\nUnderstanding the data your company processes, and your company's risk tolerance and threat landscape will help you develop a strong cryptographic strategy.\n\n### Secret generation\n\nSecrets, including access tokens and SSH keys, should be generated using cryptographic devices such as Hardware Security Modules (HSM). These devices help generate cryptographically strong secrets and store them in a tamper- and intrusion-resistant manner.\n\nWhile relying on physical devices can be costly and operationally prohibitive for companies, the leading cloud service providers offer cloud HSM services – for example, [AWS CloudHSM](https://aws.amazon.com/cloudhsm/) and [GCP Cloud HSM](https://cloud.google.com/kms/docs/hsm).\n\n### Secret storage\n\nStoring secrets is just as critical as generating them. Generated secrets must be stored in a manner that supports secure long-term storage and enables users to securely retrieve and use them when necessary.\n\nThe leading cloud service providers, as well as security companies such as [HashiCorp](https://www.vaultproject.io/), offer cloud-based services for securely storing and retrieving secrets. These services enable users to seamlessly leverage secrets within their processes and code, thereby eliminating the need to hardcode secrets.\n\n#### How does GitLab support secret storage?\n\nGitLab provides native support for the following [secret management providers](https://docs.gitlab.com/ee/ci/secrets/index.html):\n\n- Vault by HashiCorp\n- Google Cloud Secret Manager\n- Azure Key Vault\n\nBy configuring GitLab to connect with a secret management provider, secrets are explicitly requested only when needed by a CI job. When secrets aren't needed by CI jobs, they remain securely stored in the secret management service's environment, thereby reducing the potential for compromise. In addition to native support for the above secret management providers, GitLab also offers [OIDC authentication](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html) to authenticate against other providers (i.e. AWS Secret Manager). This is a much more secure and preferred method of storing secrets when compared to storing and [masking](https://docs.gitlab.com/ee/ci/variables/#mask-a-cicd-variable) secrets as CI/CD variables.\n\n### Secret use\n\nSecrets should be used for a single purpose. Reusing secrets across different applications or services increases the potential for exposure and increases the impact if the secrets are compromised.\n\nTo reduce the potential for exposure or malicious activity, access to secrets should be controlled with the [principle of least privilege](https://about.gitlab.com/blog/the-ultimate-guide-to-least-privilege-access-with-gitlab/) in mind. Access should only be granted to the individuals or services that require such access in order to support their work and operational activities.\n\n#### How does GitLab support secret use?\n\nGitLab provides administrators with a strong [role-based access control model](https://docs.gitlab.com/ee/user/permissions.html) and also offers the ability to create [custom roles](https://docs.gitlab.com/ee/user/custom_roles.html), thereby allowing administrators to align access profiles with their organizational standards and risk tolerance.\n\nGitLab also allows users to perform [secret detection](https://docs.gitlab.com/ee/user/application_security/secret_detection/) to check for unintentionally committed secrets and credentials. GitLab Ultimate users can enforce [automatic responses to leaked secrets](https://docs.gitlab.com/ee/user/application_security/secret_detection/automatic_response/), such as revoking the secret, to mitigate the impact of leaked credentials.\n\n### Auditability\n\nAccess and use of secrets should be auditable and attributable. In an ideal scenario, individuals would not have access to view secrets in plaintext, but the state of a company's operations are not always ideal.\n\nAuditable and attributable secret management allows security teams to monitor for anomalous or malicious activity, and quickly respond to such activity through automated and manual intervention.\n\n#### How does GitLab support auditability?\n\nGitLab's [audit events](https://docs.gitlab.com/ee/administration/audit_events.html) capture activities related to tokens and keys that are created within GitLab. Some examples include:\n\n- personal access token events\n- deploy token events\n- cluster agent token events\n\nThese activities are saved to the database and are also available for [audit event streaming](https://docs.gitlab.com/ee/administration/audit_event_streaming/) for GitLab Ultimate customers.\n\n## Upcoming: GitLab Secret Manager\n\nGitLab plans to launch a native secret management experience in late 2024. GitLab Secret Manager is a multi-tenant, cloud-based solution and will be accessible to both GitLab.com and self-managed customers via our Cloud Connector service. This new service offers an easy-to-use interface, consistent with the current CI/CD variables interface, making adoption easier than a third-party product with a minimal learning curve. The GitLab Secret Manager will ensure the security and protection of sensitive information in your CI pipelines.\n\n> For more information or questions about GitLab Secret Manager, please visit our [MVC epic](https://gitlab.com/groups/gitlab-org/-/epics/10723) and leave a comment.",[432,435,438,441],{"header":433,"content":434},"What are the best practices for generating and using secrets?","- __Secret Generation__: Use cryptographic devices like Hardware Security Modules (HSMs) for generating strong secrets. Cloud HSM services (e.g., AWS CloudHSM, GCP Cloud HSM) offer cost-effective, tamper-resistant secret generation.\n- __Secret Use__: Implement the principle of least privilege, ensuring secrets are used for a single purpose and accessed only by authorized users or services. Refrain from hardcoding secrets to minimize exposure.",{"header":436,"content":437},"What is secret management and why is it important for software security?","Secret management involves securely storing, accessing, and using sensitive information such as API keys, access tokens, and passwords. Proper secret management prevents unauthorized access, reduces the risk of data breaches, and ensures the confidentiality and integrity of sensitive data in software development and deployment processes.",{"header":439,"content":440},"How does GitLab help with secret detection and auditability?","GitLab provides secret detection to check for inadvertently committed secrets and credentials. Administrators can enforce automated responses, such as revoking leaked secrets, to minimize security risks. Additionally, audit events capture and stream activities related to token and key usage, enabling continuous monitoring and anomaly detection.",{"header":442,"content":443},"How does GitLab support secure secret storage and retrieval?","GitLab integrates with leading secret management providers, including Vault by HashiCorp, Google Cloud Secret Manager, and Azure Key Vault. These integrations allow secrets to be securely stored and explicitly retrieved only when needed by CI jobs, reducing the risk of exposure and unauthorized access.","article","how-to-implement-secret-management-best-practices-with-gitlab","content:en-us:the-source:security:how-to-implement-secret-management-best-practices-with-gitlab:index.yml","en-us/the-source/security/how-to-implement-secret-management-best-practices-with-gitlab/index.yml","en-us/the-source/security/how-to-implement-secret-management-best-practices-with-gitlab/index",[412],{"ai":353,"platform":360,"security":95},1753475371582]