mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-25 20:34:33 -08:00
Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/
This commit is contained in:
@@ -4,191 +4,184 @@
|
||||
|
||||
## Basic Structure
|
||||
|
||||
The basic github environment structure of a big **company** is to own an **enterprise** which owns **several organizations** and each of them may contain **several repositories** and **several teams.**. Smaller companies may just **own one organization and no enterprises**.
|
||||
एक बड़े **कंपनी** का बुनियादी गिटहब वातावरण संरचना एक **उद्यम** है जो **कई संगठनों** का मालिक है और उनमें से प्रत्येक में **कई रिपॉजिटरी** और **कई टीमें** हो सकती हैं। छोटे कंपनियों के पास केवल **एक संगठन और कोई उद्यम** हो सकता है।
|
||||
|
||||
From a user point of view a **user** can be a **member** of **different enterprises and organizations**. Within them the user may have **different enterprise, organization and repository roles**.
|
||||
एक उपयोगकर्ता के दृष्टिकोण से, एक **उपयोगकर्ता** विभिन्न **उद्यमों और संगठनों** का **सदस्य** हो सकता है। उनके भीतर, उपयोगकर्ता के पास **विभिन्न उद्यम, संगठन और रिपॉजिटरी भूमिकाएँ** हो सकती हैं।
|
||||
|
||||
Moreover, a user may be **part of different teams** with different enterprise, organization or repository roles.
|
||||
इसके अलावा, एक उपयोगकर्ता **विभिन्न टीमों** का **भाग** हो सकता है जिनकी विभिन्न उद्यम, संगठन या रिपॉजिटरी भूमिकाएँ हैं।
|
||||
|
||||
And finally **repositories may have special protection mechanisms**.
|
||||
और अंत में, **रिपॉजिटरी में विशेष सुरक्षा तंत्र** हो सकते हैं।
|
||||
|
||||
## Privileges
|
||||
|
||||
### Enterprise Roles
|
||||
|
||||
- **Enterprise owner**: People with this role can **manage administrators, manage organizations within the enterprise, manage enterprise settings, enforce policy across organizations**. However, they **cannot access organization settings or content** unless they are made an organization owner or given direct access to an organization-owned repository
|
||||
- **Enterprise members**: Members of organizations owned by your enterprise are also **automatically members of the enterprise**.
|
||||
- **Enterprise owner**: इस भूमिका वाले लोग **व्यवस्थापकों का प्रबंधन, उद्यम के भीतर संगठनों का प्रबंधन, उद्यम सेटिंग्स का प्रबंधन, संगठनों के बीच नीति लागू करने** में सक्षम होते हैं। हालाँकि, वे **संगठन सेटिंग्स या सामग्री तक पहुँच नहीं सकते** जब तक कि उन्हें संगठन का मालिक नहीं बनाया जाता या संगठन-स्वामित्व वाली रिपॉजिटरी तक सीधी पहुँच नहीं दी जाती।
|
||||
- **Enterprise members**: आपके उद्यम द्वारा स्वामित्व वाले संगठनों के सदस्य भी **स्वचालित रूप से उद्यम के सदस्य** होते हैं।
|
||||
|
||||
### Organization Roles
|
||||
|
||||
In an organisation users can have different roles:
|
||||
एक संगठन में उपयोगकर्ताओं के पास विभिन्न भूमिकाएँ हो सकती हैं:
|
||||
|
||||
- **Organization owners**: Organization owners have **complete administrative access to your organization**. This role should be limited, but to no less than two people, in your organization.
|
||||
- **Organization members**: The **default**, non-administrative role for **people in an organization** is the organization member. By default, organization members **have a number of permissions**.
|
||||
- **Billing managers**: Billing managers are users who can **manage the billing settings for your organization**, such as payment information.
|
||||
- **Security Managers**: It's a role that organization owners can assign to any team in an organization. When applied, it gives every member of the team permissions to **manage security alerts and settings across your organization, as well as read permissions for all repositories** in the organization.
|
||||
- If your organization has a security team, you can use the security manager role to give members of the team the least access they need to the organization.
|
||||
- **Github App managers**: To allow additional users to **manage GitHub Apps owned by an organization**, an owner can grant them GitHub App manager permissions.
|
||||
- **Outside collaborators**: An outside collaborator is a person who has **access to one or more organization repositories but is not explicitly a member** of the organization.
|
||||
- **Organization owners**: संगठन के मालिकों के पास **आपके संगठन तक पूर्ण प्रशासनिक पहुँच** होती है। इस भूमिका को सीमित किया जाना चाहिए, लेकिन आपके संगठन में दो से कम लोगों के लिए नहीं।
|
||||
- **Organization members**: **डिफ़ॉल्ट**, गैर-प्रशासनिक भूमिका **संगठन में लोगों** के लिए संगठन सदस्य है। डिफ़ॉल्ट रूप से, संगठन के सदस्यों के पास **कई अनुमतियाँ** होती हैं।
|
||||
- **Billing managers**: बिलिंग प्रबंधक वे उपयोगकर्ता होते हैं जो **आपके संगठन के लिए बिलिंग सेटिंग्स का प्रबंधन** कर सकते हैं, जैसे भुगतान जानकारी।
|
||||
- **Security Managers**: यह एक भूमिका है जिसे संगठन के मालिक किसी भी टीम को सौंप सकते हैं। जब लागू किया जाता है, तो यह टीम के प्रत्येक सदस्य को **संगठन में सुरक्षा अलर्ट और सेटिंग्स का प्रबंधन करने, साथ ही सभी रिपॉजिटरी के लिए पढ़ने की अनुमतियाँ** देता है।
|
||||
- यदि आपके संगठन में एक सुरक्षा टीम है, तो आप सुरक्षा प्रबंधक भूमिका का उपयोग करके टीम के सदस्यों को संगठन तक पहुँच देने के लिए न्यूनतम पहुँच दे सकते हैं।
|
||||
- **Github App managers**: अतिरिक्त उपयोगकर्ताओं को **संगठन द्वारा स्वामित्व वाले GitHub Apps का प्रबंधन** करने की अनुमति देने के लिए, एक मालिक उन्हें GitHub App प्रबंधक अनुमतियाँ दे सकता है।
|
||||
- **Outside collaborators**: एक बाहरी सहयोगी वह व्यक्ति है जिसके पास **एक या अधिक संगठन रिपॉजिटरी तक पहुँच है लेकिन वह स्पष्ट रूप से संगठन का सदस्य नहीं है**।
|
||||
|
||||
You can **compare the permissions** of these roles in this table: [https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles)
|
||||
आप इन भूमिकाओं के अनुमतियों की **तुलना** इस तालिका में कर सकते हैं: [https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles)
|
||||
|
||||
### Members Privileges
|
||||
|
||||
In _https://github.com/organizations/\<org_name>/settings/member_privileges_ you can see the **permissions users will have just for being part of the organisation**.
|
||||
_https://github.com/organizations/\<org_name>/settings/member_privileges_ में आप देख सकते हैं कि **संगठन का हिस्सा होने के नाते उपयोगकर्ताओं के पास क्या अनुमतियाँ होंगी**।
|
||||
|
||||
The settings here configured will indicate the following permissions of members of the organisation:
|
||||
यहाँ कॉन्फ़िगर की गई सेटिंग्स संगठन के सदस्यों की निम्नलिखित अनुमतियों को इंगित करेंगी:
|
||||
|
||||
- Be admin, writer, reader or no permission over all the organisation repos.
|
||||
- If members can create private, internal or public repositories.
|
||||
- If forking of repositories is possible
|
||||
- If it's possible to invite outside collaborators
|
||||
- If public or private sites can be published
|
||||
- The permissions admins has over the repositories
|
||||
- If members can create new teams
|
||||
- सभी संगठन रिपॉजिटरी पर व्यवस्थापक, लेखक, पाठक या कोई अनुमति नहीं होना।
|
||||
- यदि सदस्यों को निजी, आंतरिक या सार्वजनिक रिपॉजिटरी बनाने की अनुमति है।
|
||||
- यदि रिपॉजिटरी का फोर्क करना संभव है।
|
||||
- यदि बाहरी सहयोगियों को आमंत्रित करना संभव है।
|
||||
- यदि सार्वजनिक या निजी साइटों को प्रकाशित किया जा सकता है।
|
||||
- रिपॉजिटरी पर व्यवस्थापकों के पास क्या अनुमतियाँ हैं।
|
||||
- यदि सदस्य नई टीमें बना सकते हैं।
|
||||
|
||||
### Repository Roles
|
||||
|
||||
By default repository roles are created:
|
||||
डिफ़ॉल्ट रूप से रिपॉजिटरी भूमिकाएँ बनाई जाती हैं:
|
||||
|
||||
- **Read**: Recommended for **non-code contributors** who want to view or discuss your project
|
||||
- **Triage**: Recommended for **contributors who need to proactively manage issues and pull requests** without write access
|
||||
- **Write**: Recommended for contributors who **actively push to your project**
|
||||
- **Maintain**: Recommended for **project managers who need to manage the repository** without access to sensitive or destructive actions
|
||||
- **Admin**: Recommended for people who need **full access to the project**, including sensitive and destructive actions like managing security or deleting a repository
|
||||
- **Read**: **गैर-कोड योगदानकर्ताओं** के लिए अनुशंसित जो आपके प्रोजेक्ट को देखना या चर्चा करना चाहते हैं।
|
||||
- **Triage**: **योगदानकर्ताओं के लिए अनुशंसित जिन्हें मुद्दों और पुल अनुरोधों का सक्रिय रूप से प्रबंधन करने की आवश्यकता होती है** बिना लिखने की पहुँच के।
|
||||
- **Write**: योगदानकर्ताओं के लिए अनुशंसित जो **सक्रिय रूप से आपके प्रोजेक्ट में योगदान करते हैं**।
|
||||
- **Maintain**: **प्रोजेक्ट प्रबंधकों के लिए अनुशंसित जिन्हें रिपॉजिटरी का प्रबंधन करने की आवश्यकता होती है** बिना संवेदनशील या विनाशकारी कार्यों की पहुँच के।
|
||||
- **Admin**: उन लोगों के लिए अनुशंसित जिन्हें **प्रोजेक्ट तक पूर्ण पहुँच** की आवश्यकता होती है, जिसमें सुरक्षा प्रबंधन या रिपॉजिटरी को हटाने जैसे संवेदनशील और विनाशकारी कार्य शामिल हैं।
|
||||
|
||||
You can **compare the permissions** of each role in this table [https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role)
|
||||
आप इस तालिका में प्रत्येक भूमिका के अनुमतियों की **तुलना** कर सकते हैं [https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role)
|
||||
|
||||
You can also **create your own roles** in _https://github.com/organizations/\<org_name>/settings/roles_
|
||||
आप _https://github.com/organizations/\<org_name>/settings/roles_ में **अपनी भूमिकाएँ भी बना सकते हैं**।
|
||||
|
||||
### Teams
|
||||
|
||||
You can **list the teams created in an organization** in _https://github.com/orgs/\<org_name>/teams_. Note that to see the teams which are children of other teams you need to access each parent team.
|
||||
आप _https://github.com/orgs/\<org_name>/teams_ में **एक संगठन में बनाई गई टीमों की सूची** देख सकते हैं। ध्यान दें कि अन्य टीमों के बच्चों को देखने के लिए आपको प्रत्येक माता टीम तक पहुँचने की आवश्यकता है।
|
||||
|
||||
### Users
|
||||
|
||||
The users of an organization can be **listed** in _https://github.com/orgs/\<org_name>/people._
|
||||
एक संगठन के उपयोगकर्ताओं को _https://github.com/orgs/\<org_name>/people_ में **सूचीबद्ध** किया जा सकता है।
|
||||
|
||||
In the information of each user you can see the **teams the user is member of**, and the **repos the user has access to**.
|
||||
प्रत्येक उपयोगकर्ता की जानकारी में आप देख सकते हैं कि **उपयोगकर्ता किस टीम का सदस्य है**, और **उपयोगकर्ता को किन रिपॉजिटरी तक पहुँच है**।
|
||||
|
||||
## Github Authentication
|
||||
|
||||
Github offers different ways to authenticate to your account and perform actions on your behalf.
|
||||
Github आपके खाते में प्रमाणित होने और आपकी ओर से क्रियाएँ करने के लिए विभिन्न तरीके प्रदान करता है।
|
||||
|
||||
### Web Access
|
||||
|
||||
Accessing **github.com** you can login using your **username and password** (and a **2FA potentially**).
|
||||
**github.com** पर पहुँचते समय आप अपने **उपयोगकर्ता नाम और पासवर्ड** (और संभवतः एक **2FA**) का उपयोग करके लॉगिन कर सकते हैं।
|
||||
|
||||
### **SSH Keys**
|
||||
|
||||
You can configure your account with one or several public keys allowing the related **private key to perform actions on your behalf.** [https://github.com/settings/keys](https://github.com/settings/keys)
|
||||
आप अपने खाते को एक या एक से अधिक सार्वजनिक कुंजियों के साथ कॉन्फ़िगर कर सकते हैं जिससे संबंधित **निजी कुंजी आपकी ओर से क्रियाएँ करने की अनुमति देती है।** [https://github.com/settings/keys](https://github.com/settings/keys)
|
||||
|
||||
#### **GPG Keys**
|
||||
|
||||
You **cannot impersonate the user with these keys** but if you don't use it it might be possible that you **get discover for sending commits without a signature**. Learn more about [vigilant mode here](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits#about-vigilant-mode).
|
||||
आप **इन कुंजियों के साथ उपयोगकर्ता का प्रतिनिधित्व नहीं कर सकते** लेकिन यदि आप इसका उपयोग नहीं करते हैं तो यह संभव हो सकता है कि आप **बिना हस्ताक्षर के कमिट भेजने के लिए खोजे जाएँ**। [यहाँ सतर्क मोड के बारे में अधिक जानें](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits#about-vigilant-mode)।
|
||||
|
||||
### **Personal Access Tokens**
|
||||
|
||||
You can generate personal access token to **give an application access to your account**. When creating a personal access token the **user** needs to **specify** the **permissions** to **token** will have. [https://github.com/settings/tokens](https://github.com/settings/tokens)
|
||||
आप **एक एप्लिकेशन को अपने खाते तक पहुँच देने के लिए व्यक्तिगत पहुँच टोकन उत्पन्न कर सकते हैं**। व्यक्तिगत पहुँच टोकन बनाते समय, **उपयोगकर्ता** को **अनुमतियाँ** निर्दिष्ट करने की आवश्यकता होती है जो **टोकन** के पास होंगी। [https://github.com/settings/tokens](https://github.com/settings/tokens)
|
||||
|
||||
### Oauth Applications
|
||||
|
||||
Oauth applications may ask you for permissions **to access part of your github information or to impersonate you** to perform some actions. A common example of this functionality is the **login with github button** you might find in some platforms.
|
||||
Oauth एप्लिकेशन आपसे अनुमतियाँ मांग सकते हैं **आपकी गिटहब जानकारी के एक भाग तक पहुँचने या आपको प्रतिनिधित्व करने के लिए** कुछ क्रियाएँ करने के लिए। इस कार्यक्षमता का एक सामान्य उदाहरण **गिटहब के साथ लॉगिन बटन** है जो आप कुछ प्लेटफार्मों पर पा सकते हैं।
|
||||
|
||||
- You can **create** your own **Oauth applications** in [https://github.com/settings/developers](https://github.com/settings/developers)
|
||||
- You can see all the **Oauth applications that has access to your account** in [https://github.com/settings/applications](https://github.com/settings/applications)
|
||||
- You can see the **scopes that Oauth Apps can ask for** in [https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps)
|
||||
- You can see third party access of applications in an **organization** in _https://github.com/organizations/\<org_name>/settings/oauth_application_policy_
|
||||
- आप [https://github.com/settings/developers](https://github.com/settings/developers) में अपनी **Oauth एप्लिकेशन** बना सकते हैं।
|
||||
- आप [https://github.com/settings/applications](https://github.com/settings/applications) में अपने खाते तक पहुँच रखने वाली सभी **Oauth एप्लिकेशन** देख सकते हैं।
|
||||
- आप [https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps) में **Oauth Apps के लिए पूछी जाने वाली स्कोप** देख सकते हैं।
|
||||
- आप _https://github.com/organizations/\<org_name>/settings/oauth_application_policy_ में एक **संगठन** में एप्लिकेशनों की तीसरे पक्ष की पहुँच देख सकते हैं।
|
||||
|
||||
Some **security recommendations**:
|
||||
कुछ **सुरक्षा सिफारिशें**:
|
||||
|
||||
- An **OAuth App** should always **act as the authenticated GitHub user across all of GitHub** (for example, when providing user notifications) and with access only to the specified scopes..
|
||||
- An OAuth App can be used as an identity provider by enabling a "Login with GitHub" for the authenticated user.
|
||||
- **Don't** build an **OAuth App** if you want your application to act on a **single repository**. With the `repo` OAuth scope, OAuth Apps can **act on \_all**\_\*\* of the authenticated user's repositorie\*\*s.
|
||||
- **Don't** build an OAuth App to act as an application for your **team or company**. OAuth Apps authenticate as a **single user**, so if one person creates an OAuth App for a company to use, and then they leave the company, no one else will have access to it.
|
||||
- **More** in [here](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-oauth-apps).
|
||||
- एक **OAuth App** को हमेशा **GitHub पर सभी GitHub उपयोगकर्ता के रूप में कार्य करना चाहिए** (उदाहरण के लिए, जब उपयोगकर्ता सूचनाएँ प्रदान करते हैं) और केवल निर्दिष्ट स्कोप तक पहुँच के साथ।
|
||||
- एक OAuth App को एक पहचान प्रदाता के रूप में उपयोग किया जा सकता है, जो प्रमाणित उपयोगकर्ता के लिए "GitHub के साथ लॉगिन" सक्षम करता है।
|
||||
- **नहीं** बनाएं एक **OAuth App** यदि आप चाहते हैं कि आपका एप्लिकेशन **एकल रिपॉजिटरी** पर कार्य करे। `repo` OAuth स्कोप के साथ, OAuth Apps **प्रमाणित उपयोगकर्ता के सभी रिपॉजिटरी पर कार्य कर सकते हैं**।
|
||||
- **नहीं** बनाएं एक OAuth App यदि आप अपने **टीम या कंपनी** के लिए एक एप्लिकेशन के रूप में कार्य करना चाहते हैं। OAuth Apps एक **एकल उपयोगकर्ता** के रूप में प्रमाणित होते हैं, इसलिए यदि एक व्यक्ति कंपनी के उपयोग के लिए एक OAuth App बनाता है, और फिर वह कंपनी छोड़ देता है, तो कोई और इसके लिए पहुँच नहीं रखेगा।
|
||||
- **अधिक** यहाँ [यहाँ](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-oauth-apps)।
|
||||
|
||||
### Github Applications
|
||||
|
||||
Github applications can ask for permissions to **access your github information or impersonate you** to perform specific actions over specific resources. In Github Apps you need to specify the repositories the app will have access to.
|
||||
Github एप्लिकेशन अनुमतियाँ मांग सकते हैं **आपकी गिटहब जानकारी तक पहुँचने या आपको प्रतिनिधित्व करने के लिए** कुछ विशिष्ट क्रियाएँ करने के लिए। Github Apps में आपको उन रिपॉजिटरी को निर्दिष्ट करना होगा जिन तक एप्लिकेशन की पहुँच होगी।
|
||||
|
||||
- To install a GitHub App, you must be an **organisation owner or have admin permissions** in a repository.
|
||||
- The GitHub App should **connect to a personal account or an organisation**.
|
||||
- You can create your own Github application in [https://github.com/settings/apps](https://github.com/settings/apps)
|
||||
- You can see all the **Github applications that has access to your account** in [https://github.com/settings/apps/authorizations](https://github.com/settings/apps/authorizations)
|
||||
- These are the **API Endpoints for Github Applications** [https://docs.github.com/en/rest/overview/endpoints-available-for-github-app](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps). Depending on the permissions of the App it will be able to access some of them
|
||||
- You can see installed apps in an **organization** in _https://github.com/organizations/\<org_name>/settings/installations_
|
||||
- एक GitHub App स्थापित करने के लिए, आपको **संगठन का मालिक या रिपॉजिटरी में व्यवस्थापक अनुमतियाँ** होनी चाहिए।
|
||||
- GitHub App को **एक व्यक्तिगत खाते या एक संगठन** से कनेक्ट करना चाहिए।
|
||||
- आप [https://github.com/settings/apps](https://github.com/settings/apps) में अपनी खुद की Github एप्लिकेशन बना सकते हैं।
|
||||
- आप [https://github.com/settings/apps/authorizations](https://github.com/settings/apps/authorizations) में अपने खाते तक पहुँच रखने वाली सभी **Github एप्लिकेशन** देख सकते हैं।
|
||||
- ये हैं **Github एप्लिकेशन के लिए API Endpoints** [https://docs.github.com/en/rest/overview/endpoints-available-for-github-app](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps)। एप्लिकेशन की अनुमतियों के आधार पर, यह उनमें से कुछ तक पहुँच प्राप्त कर सकेगा।
|
||||
- आप _https://github.com/organizations/\<org_name>/settings/installations_ में एक **संगठन** में स्थापित एप्लिकेशन देख सकते हैं।
|
||||
|
||||
Some security recommendations:
|
||||
कुछ सुरक्षा सिफारिशें:
|
||||
|
||||
- A GitHub App should **take actions independent of a user** (unless the app is using a [user-to-server](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) token). To keep user-to-server access tokens more secure, you can use access tokens that will expire after 8 hours, and a refresh token that can be exchanged for a new access token. For more information, see "[Refreshing user-to-server access tokens](https://docs.github.com/en/apps/building-github-apps/refreshing-user-to-server-access-tokens)."
|
||||
- Make sure the GitHub App integrates with **specific repositories**.
|
||||
- The GitHub App should **connect to a personal account or an organisation**.
|
||||
- Don't expect the GitHub App to know and do everything a user can.
|
||||
- **Don't use a GitHub App if you just need a "Login with GitHub" service**. But a GitHub App can use a [user identification flow](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps) to log users in _and_ do other things.
|
||||
- Don't build a GitHub App if you _only_ want to act as a GitHub user and do everything that user can do.
|
||||
- If you are using your app with GitHub Actions and want to modify workflow files, you must authenticate on behalf of the user with an OAuth token that includes the `workflow` scope. The user must have admin or write permission to the repository that contains the workflow file. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/en/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)."
|
||||
- **More** in [here](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-github-apps).
|
||||
- एक GitHub App को **एक उपयोगकर्ता से स्वतंत्र रूप से कार्य करना चाहिए** (जब तक एप्लिकेशन [उपयोगकर्ता-से-सरवर](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) टोकन का उपयोग नहीं कर रहा है)। उपयोगकर्ता-से-सरवर पहुँच टोकनों को अधिक सुरक्षित रखने के लिए, आप ऐसे पहुँच टोकन का उपयोग कर सकते हैं जो 8 घंटे बाद समाप्त हो जाएंगे, और एक रिफ्रेश टोकन जो नए पहुँच टोकन के लिए बदला जा सकता है। अधिक जानकारी के लिए, "[उपयोगकर्ता-से-सरवर पहुँच टोकनों को रिफ्रेश करना](https://docs.github.com/en/apps/building-github-apps/refreshing-user-to-server-access-tokens)" देखें।
|
||||
- सुनिश्चित करें कि GitHub App **विशिष्ट रिपॉजिटरी** के साथ एकीकृत है।
|
||||
- GitHub App को **एक व्यक्तिगत खाते या एक संगठन** से कनेक्ट करना चाहिए।
|
||||
- GitHub App से यह उम्मीद न करें कि वह सब कुछ जानता है और वह सब कुछ कर सकता है जो एक उपयोगकर्ता कर सकता है।
|
||||
- **यदि आपको केवल "GitHub के साथ लॉगिन" सेवा की आवश्यकता है तो GitHub App का उपयोग न करें**। लेकिन एक GitHub App एक [उपयोगकर्ता पहचान प्रवाह](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps) का उपयोग करके उपयोगकर्ताओं को लॉगिन कर सकता है _और_ अन्य चीजें कर सकता है।
|
||||
- यदि आप अपने एप्लिकेशन का उपयोग GitHub Actions के साथ कर रहे हैं और वर्कफ़्लो फ़ाइलों को संशोधित करना चाहते हैं, तो आपको उपयोगकर्ता की ओर से OAuth टोकन के साथ प्रमाणित होना चाहिए जिसमें `workflow` स्कोप शामिल है। उपयोगकर्ता को उस रिपॉजिटरी पर व्यवस्थापक या लिखने की अनुमति होनी चाहिए जिसमें वर्कफ़्लो फ़ाइल है। अधिक जानकारी के लिए, "[OAuth एप्लिकेशन के लिए स्कोप को समझना](https://docs.github.com/en/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)" देखें।
|
||||
- **अधिक** यहाँ [यहाँ](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-github-apps)।
|
||||
|
||||
### Github Actions
|
||||
|
||||
This **isn't a way to authenticate in github**, but a **malicious** Github Action could get **unauthorised access to github** and **depending** on the **privileges** given to the Action several **different attacks** could be done. See below for more information.
|
||||
यह **गिटहब में प्रमाणित होने का एक तरीका नहीं है**, लेकिन एक **दुर्भावनापूर्ण** Github Action को **गिटहब तक अनधिकृत पहुँच प्राप्त हो सकती है** और **अनुमतियों** के आधार पर जो Action को दी गई हैं, कई **विभिन्न हमले** किए जा सकते हैं। अधिक जानकारी के लिए नीचे देखें।
|
||||
|
||||
## Git Actions
|
||||
|
||||
Git actions allows to automate the **execution of code when an event happen**. Usually the code executed is **somehow related to the code of the repository** (maybe build a docker container or check that the PR doesn't contain secrets).
|
||||
Git actions **जब कोई घटना होती है तब कोड के निष्पादन को स्वचालित** करने की अनुमति देते हैं। आमतौर पर निष्पादित कोड **रिपॉजिटरी के कोड से किसी न किसी तरह संबंधित होता है** (शायद एक डॉकर कंटेनर बनाना या यह जांचना कि PR में कोई रहस्य नहीं है)।
|
||||
|
||||
### Configuration
|
||||
|
||||
In _https://github.com/organizations/\<org_name>/settings/actions_ it's possible to check the **configuration of the github actions** for the organization.
|
||||
_https://github.com/organizations/\<org_name>/settings/actions_ में आप संगठन के लिए **गिटहब क्रियाओं की कॉन्फ़िगरेशन** की जाँच कर सकते हैं।
|
||||
|
||||
It's possible to disallow the use of github actions completely, **allow all github actions**, or just allow certain actions.
|
||||
गिटहब क्रियाओं के उपयोग को पूरी तरह से अस्वीकार करना, **सभी गिटहब क्रियाओं की अनुमति देना**, या केवल कुछ क्रियाओं की अनुमति देना संभव है।
|
||||
|
||||
It's also possible to configure **who needs approval to run a Github Action** and the **permissions of the GITHUB_TOKEN** of a Github Action when it's run.
|
||||
यह भी संभव है कि **किसे Github Action चलाने के लिए अनुमोदन की आवश्यकता है** और जब Github Action चलाया जाता है तो **GITHUB_TOKEN की अनुमतियाँ** को कॉन्फ़िगर किया जा सके।
|
||||
|
||||
### Git Secrets
|
||||
|
||||
Github Action usually need some kind of secrets to interact with github or third party applications. To **avoid putting them in clear-text** in the repo, github allow to put them as **Secrets**.
|
||||
|
||||
These secrets can be configured **for the repo or for all the organization**. Then, in order for the **Action to be able to access the secret** you need to declare it like:
|
||||
Github Action आमतौर पर गिटहब या तीसरे पक्ष के एप्लिकेशनों के साथ बातचीत करने के लिए कुछ प्रकार के रहस्यों की आवश्यकता होती है। **उन्हें स्पष्ट पाठ में रखने से बचने के लिए**, गिटहब उन्हें **Secrets** के रूप में रखने की अनुमति देता है।
|
||||
|
||||
ये रहस्य **रिपॉजिटरी या सभी संगठन के लिए** कॉन्फ़िगर किए जा सकते हैं। फिर, **Action को रहस्य तक पहुँच प्राप्त करने के लिए** आपको इसे इस तरह घोषित करना होगा:
|
||||
```yaml
|
||||
steps:
|
||||
- name: Hello world action
|
||||
with: # Set the secret as an input
|
||||
super_secret:${{ secrets.SuperSecret }}
|
||||
env: # Or as an environment variable
|
||||
super_secret:${{ secrets.SuperSecret }}
|
||||
- name: Hello world action
|
||||
with: # Set the secret as an input
|
||||
super_secret:${{ secrets.SuperSecret }}
|
||||
env: # Or as an environment variable
|
||||
super_secret:${{ secrets.SuperSecret }}
|
||||
```
|
||||
|
||||
#### Example using Bash <a href="#example-using-bash" id="example-using-bash"></a>
|
||||
|
||||
#### Bash का उपयोग करते हुए उदाहरण <a href="#example-using-bash" id="example-using-bash"></a>
|
||||
```yaml
|
||||
steps:
|
||||
- shell: bash
|
||||
env: SUPER_SECRET:${{ secrets.SuperSecret }}
|
||||
run: |
|
||||
example-command "$SUPER_SECRET"
|
||||
- shell: bash
|
||||
env: SUPER_SECRET:${{ secrets.SuperSecret }}
|
||||
run: |
|
||||
example-command "$SUPER_SECRET"
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> Secrets **can only be accessed from the Github Actions** that have them declared.
|
||||
> Secrets **केवल उन Github Actions से एक्सेस किए जा सकते हैं** जिनमें उन्हें घोषित किया गया है।
|
||||
|
||||
> Once configured in the repo or the organizations **users of github won't be able to access them again**, they just will be able to **change them**.
|
||||
> एक बार जब उन्हें रेपो या संगठनों में कॉन्फ़िगर किया जाता है, तो **github के उपयोगकर्ता उन्हें फिर से एक्सेस नहीं कर पाएंगे**, वे केवल **उन्हें बदलने** में सक्षम होंगे।
|
||||
|
||||
Therefore, the **only way to steal github secrets is to be able to access the machine that is executing the Github Action** (in that scenario you will be able to access only the secrets declared for the Action).
|
||||
इसलिए, **github secrets चुराने का एकमात्र तरीका है कि आप उस मशीन तक पहुँच प्राप्त करें जो Github Action को निष्पादित कर रही है** (उस परिदृश्य में आप केवल Action के लिए घोषित किए गए secrets तक पहुँच प्राप्त कर पाएंगे)।
|
||||
|
||||
### Git Environments
|
||||
|
||||
Github allows to create **environments** where you can save **secrets**. Then, you can give the github action access to the secrets inside the environment with something like:
|
||||
|
||||
Github **पर्यावरण** बनाने की अनुमति देता है जहाँ आप **secrets** को सहेज सकते हैं। फिर, आप github action को पर्यावरण के अंदर secrets तक पहुँच देने के लिए कुछ इस तरह कर सकते हैं:
|
||||
```yaml
|
||||
jobs:
|
||||
deployment:
|
||||
runs-on: ubuntu-latest
|
||||
environment: env_name
|
||||
deployment:
|
||||
runs-on: ubuntu-latest
|
||||
environment: env_name
|
||||
```
|
||||
|
||||
You can configure an environment to be **accessed** by **all branches** (default), **only protected** branches or **specify** which branches can access it.\
|
||||
It can also set a **number of required reviews** before **executing** an **action** using an **environment** or **wait** some **time** before allowing deployments to proceed.
|
||||
|
||||
@@ -229,11 +222,11 @@ The **branch protections of a repository** can be found in _https://github.com/\
|
||||
Different protections can be applied to a branch (like to master):
|
||||
|
||||
- You can **require a PR before merging** (so you cannot directly merge code over the branch). If this is select different other protections can be in place:
|
||||
- **Require a number of approvals**. It's very common to require 1 or 2 more people to approve your PR so a single user isn't capable of merge code directly.
|
||||
- **Dismiss approvals when new commits are pushed**. If not, a user may approve legit code and then the user could add malicious code and merge it.
|
||||
- **Require reviews from Code Owners**. At least 1 code owner of the repo needs to approve the PR (so "random" users cannot approve it)
|
||||
- **Restrict who can dismiss pull request reviews.** You can specify people or teams allowed to dismiss pull request reviews.
|
||||
- **Allow specified actors to bypass pull request requirements**. These users will be able to bypass previous restrictions.
|
||||
- **Require a number of approvals**. It's very common to require 1 or 2 more people to approve your PR so a single user isn't capable of merge code directly.
|
||||
- **Dismiss approvals when new commits are pushed**. If not, a user may approve legit code and then the user could add malicious code and merge it.
|
||||
- **Require reviews from Code Owners**. At least 1 code owner of the repo needs to approve the PR (so "random" users cannot approve it)
|
||||
- **Restrict who can dismiss pull request reviews.** You can specify people or teams allowed to dismiss pull request reviews.
|
||||
- **Allow specified actors to bypass pull request requirements**. These users will be able to bypass previous restrictions.
|
||||
- **Require status checks to pass before merging.** Some checks needs to pass before being able to merge the commit (like a github action checking there isn't any cleartext secret).
|
||||
- **Require conversation resolution before merging**. All comments on the code needs to be resolved before the PR can be merged.
|
||||
- **Require signed commits**. The commits need to be signed.
|
||||
@@ -253,7 +246,3 @@ Different protections can be applied to a branch (like to master):
|
||||
- [https://docs.github.com/en/actions/security-guides/encrypted-secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user