Repository: warp-tech/warpgate
Branch: main
Commit: 3d077a3726b8
Files: 510
Total size: 1.9 MB
Directory structure:
gitextract_u506bnuo/
├── .all-contributorsrc
├── .bumpversion.cfg
├── .cargo/
│ └── config.toml
├── .dockerignore
├── .flake8
├── .github/
│ ├── FUNDING.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── build.yml
│ ├── check-schema-compatibility.yml
│ ├── codeql.yml
│ ├── dependency-review.yml
│ ├── docker.yml
│ ├── reprotest.yml
│ ├── scorecard.yml
│ └── test.yml
├── .gitignore
├── .well-known/
│ └── funding-manifest-urls
├── Cargo.toml
├── Cranky.toml
├── Cross.toml
├── LICENSE
├── README.md
├── SECURITY.md
├── clippy.toml
├── config-schema.json
├── deny.toml
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── helm/
│ └── warpgate/
│ ├── .helmignore
│ ├── Chart.yaml
│ ├── templates/
│ │ ├── NOTES.txt
│ │ ├── _helpers.tpl
│ │ ├── configmap.yaml
│ │ ├── deployment.yaml
│ │ ├── httproute.yaml
│ │ ├── ingress.yaml
│ │ ├── pvc.yaml
│ │ ├── service.yaml
│ │ └── setup-job.yaml
│ └── values.yaml
├── justfile
├── rust-toolchain
├── rustfmt.toml
├── sonar-project.properties
├── tests/
│ ├── .gitignore
│ ├── Makefile
│ ├── __init__.py
│ ├── api_client.py
│ ├── certs/
│ │ ├── tls.certificate.pem
│ │ └── tls.key.pem
│ ├── conftest.py
│ ├── images/
│ │ ├── mysql-server/
│ │ │ ├── Dockerfile
│ │ │ └── init.sql
│ │ ├── postgres-server/
│ │ │ ├── Dockerfile
│ │ │ └── init.sql
│ │ └── ssh-server/
│ │ └── Dockerfile
│ ├── oidc-mock/
│ │ ├── clients-config.json
│ │ └── docker-compose.yml
│ ├── pyproject.toml
│ ├── run.sh
│ ├── ssh-keys/
│ │ ├── id_ed25519
│ │ ├── id_ed25519.pub
│ │ ├── id_rsa
│ │ ├── id_rsa.pub
│ │ └── wg/
│ │ ├── client-ed25519
│ │ ├── client-ed25519.pub
│ │ ├── client-rsa
│ │ ├── client-rsa.pub
│ │ ├── host-ed25519
│ │ ├── host-ed25519.pub
│ │ └── host-rsa
│ ├── test_api_auth.py
│ ├── test_http_basic.py
│ ├── test_http_common.py
│ ├── test_http_proto.py
│ ├── test_http_redirects.py
│ ├── test_http_user_auth_logout.py
│ ├── test_http_user_auth_oidc.py
│ ├── test_http_user_auth_otp.py
│ ├── test_http_user_auth_password.py
│ ├── test_http_user_auth_ticket.py
│ ├── test_http_websocket.py
│ ├── test_json_logs.py
│ ├── test_kubernetes_integration.py
│ ├── test_mysql_user_auth_password.py
│ ├── test_postgres_user_auth_in_browser.py
│ ├── test_postgres_user_auth_password.py
│ ├── test_ssh_client_auth_config.py
│ ├── test_ssh_proto.py
│ ├── test_ssh_target_selection.py
│ ├── test_ssh_user_auth_in_browser.py
│ ├── test_ssh_user_auth_otp.py
│ ├── test_ssh_user_auth_password.py
│ ├── test_ssh_user_auth_pubkey.py
│ ├── test_ssh_user_auth_ticket.py
│ └── util.py
├── warpgate/
│ ├── .gitignore
│ ├── Cargo.toml
│ └── src/
│ ├── commands/
│ │ ├── check.rs
│ │ ├── client_keys.rs
│ │ ├── common.rs
│ │ ├── create_user.rs
│ │ ├── healthcheck.rs
│ │ ├── mod.rs
│ │ ├── recover_access.rs
│ │ ├── run.rs
│ │ └── setup.rs
│ ├── config.rs
│ ├── logging.rs
│ └── main.rs
├── warpgate-admin/
│ ├── Cargo.toml
│ └── src/
│ ├── api/
│ │ ├── admin_roles.rs
│ │ ├── certificate_credentials.rs
│ │ ├── common.rs
│ │ ├── known_hosts_detail.rs
│ │ ├── known_hosts_list.rs
│ │ ├── ldap_servers.rs
│ │ ├── logs.rs
│ │ ├── mod.rs
│ │ ├── otp_credentials.rs
│ │ ├── pagination.rs
│ │ ├── parameters.rs
│ │ ├── password_credentials.rs
│ │ ├── public_key_credentials.rs
│ │ ├── recordings_detail.rs
│ │ ├── roles.rs
│ │ ├── sessions_detail.rs
│ │ ├── sessions_list.rs
│ │ ├── ssh_connection_test.rs
│ │ ├── ssh_keys.rs
│ │ ├── sso_credentials.rs
│ │ ├── target_groups.rs
│ │ ├── targets.rs
│ │ ├── tickets_detail.rs
│ │ ├── tickets_list.rs
│ │ └── users.rs
│ ├── lib.rs
│ └── main.rs
├── warpgate-ca/
│ ├── Cargo.toml
│ └── src/
│ ├── error.rs
│ └── lib.rs
├── warpgate-common/
│ ├── Cargo.toml
│ └── src/
│ ├── api.rs
│ ├── auth/
│ │ ├── cred.rs
│ │ ├── mod.rs
│ │ ├── policy.rs
│ │ ├── selector.rs
│ │ └── state.rs
│ ├── config/
│ │ ├── defaults.rs
│ │ ├── mod.rs
│ │ └── target.rs
│ ├── config_schema.rs
│ ├── consts.rs
│ ├── error.rs
│ ├── eventhub.rs
│ ├── helpers/
│ │ ├── fs.rs
│ │ ├── hash.rs
│ │ ├── locks.rs
│ │ ├── mod.rs
│ │ ├── otp.rs
│ │ ├── rng.rs
│ │ ├── serde_base64.rs
│ │ ├── serde_base64_secret.rs
│ │ └── websocket.rs
│ ├── http_headers.rs
│ ├── lib.rs
│ ├── state.rs
│ ├── try_macro.rs
│ ├── types/
│ │ ├── aliases.rs
│ │ ├── listen_endpoint.rs
│ │ ├── mod.rs
│ │ └── secret.rs
│ └── version.rs
├── warpgate-common-http/
│ ├── Cargo.toml
│ └── src/
│ ├── auth.rs
│ ├── lib.rs
│ └── logging.rs
├── warpgate-core/
│ ├── Cargo.toml
│ └── src/
│ ├── auth_state_store.rs
│ ├── config_providers/
│ │ ├── db.rs
│ │ └── mod.rs
│ ├── consts.rs
│ ├── data.rs
│ ├── db/
│ │ └── mod.rs
│ ├── lib.rs
│ ├── logging/
│ │ ├── database.rs
│ │ ├── json_console.rs
│ │ ├── layer.rs
│ │ ├── mod.rs
│ │ ├── socket.rs
│ │ └── values.rs
│ ├── protocols/
│ │ ├── handle.rs
│ │ └── mod.rs
│ ├── rate_limiting/
│ │ ├── limiter.rs
│ │ ├── mod.rs
│ │ ├── registry.rs
│ │ ├── shared_limiter.rs
│ │ ├── stack.rs
│ │ ├── stream.rs
│ │ └── swappable_cell.rs
│ ├── recordings/
│ │ ├── mod.rs
│ │ ├── terminal.rs
│ │ ├── traffic.rs
│ │ └── writer.rs
│ ├── services.rs
│ └── state.rs
├── warpgate-database-protocols/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── error.rs
│ ├── io/
│ │ ├── buf.rs
│ │ ├── buf_mut.rs
│ │ ├── buf_stream.rs
│ │ ├── decode.rs
│ │ ├── encode.rs
│ │ ├── mod.rs
│ │ └── write_and_flush.rs
│ ├── lib.rs
│ └── mysql/
│ ├── collation.rs
│ ├── io/
│ │ ├── buf.rs
│ │ ├── buf_mut.rs
│ │ └── mod.rs
│ ├── mod.rs
│ └── protocol/
│ ├── auth.rs
│ ├── capabilities.rs
│ ├── connect/
│ │ ├── auth_switch.rs
│ │ ├── handshake.rs
│ │ ├── handshake_response.rs
│ │ ├── mod.rs
│ │ └── ssl_request.rs
│ ├── mod.rs
│ ├── packet.rs
│ ├── response/
│ │ ├── eof.rs
│ │ ├── err.rs
│ │ ├── mod.rs
│ │ ├── ok.rs
│ │ └── status.rs
│ ├── row.rs
│ └── text/
│ ├── column.rs
│ ├── mod.rs
│ ├── ping.rs
│ ├── query.rs
│ └── quit.rs
├── warpgate-db-entities/
│ ├── Cargo.toml
│ └── src/
│ ├── AdminRole.rs
│ ├── ApiToken.rs
│ ├── CertificateCredential.rs
│ ├── CertificateRevocation.rs
│ ├── KnownHost.rs
│ ├── LdapServer.rs
│ ├── LogEntry.rs
│ ├── OtpCredential.rs
│ ├── Parameters.rs
│ ├── PasswordCredential.rs
│ ├── PublicKeyCredential.rs
│ ├── Recording.rs
│ ├── Role.rs
│ ├── Session.rs
│ ├── SsoCredential.rs
│ ├── Target.rs
│ ├── TargetGroup.rs
│ ├── TargetRoleAssignment.rs
│ ├── Ticket.rs
│ ├── User.rs
│ ├── UserAdminRoleAssignment.rs
│ ├── UserRoleAssignment.rs
│ └── lib.rs
├── warpgate-db-migrations/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── lib.rs
│ ├── m00001_create_ticket.rs
│ ├── m00002_create_session.rs
│ ├── m00003_create_recording.rs
│ ├── m00004_create_known_host.rs
│ ├── m00005_create_log_entry.rs
│ ├── m00006_add_session_protocol.rs
│ ├── m00007_targets_and_roles.rs
│ ├── m00008_users.rs
│ ├── m00009_credential_models.rs
│ ├── m00010_parameters.rs
│ ├── m00011_rsa_key_algos.rs
│ ├── m00012_add_openssh_public_key_label.rs
│ ├── m00013_add_openssh_public_key_dates.rs
│ ├── m00014_api_tokens.rs
│ ├── m00015_fix_public_key_dates.rs
│ ├── m00016_fix_public_key_length.rs
│ ├── m00017_descriptions.rs
│ ├── m00018_ticket_description.rs
│ ├── m00019_rate_limits.rs
│ ├── m00020_target_groups.rs
│ ├── m00021_ldap_server.rs
│ ├── m00022_user_ldap_link.rs
│ ├── m00023_ldap_username_attribute.rs
│ ├── m00024_ssh_key_attribute.rs
│ ├── m00025_ldap_uuid_attribute.rs
│ ├── m00026_ssh_client_auth.rs
│ ├── m00027_ca.rs
│ ├── m00028_certificate_credentials.rs
│ ├── m00029_certificate_revocation.rs
│ ├── m00030_add_recording_metadata.rs
│ ├── m00031_minimize_password_login.rs
│ ├── m00032_admin_roles.rs
│ └── main.rs
├── warpgate-ldap/
│ ├── Cargo.toml
│ └── src/
│ ├── connection.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── queries.rs
│ └── types.rs
├── warpgate-protocol-http/
│ ├── Cargo.toml
│ └── src/
│ ├── api/
│ │ ├── api_tokens.rs
│ │ ├── auth.rs
│ │ ├── common.rs
│ │ ├── credentials.rs
│ │ ├── info.rs
│ │ ├── mod.rs
│ │ ├── sso_provider_detail.rs
│ │ ├── sso_provider_list.rs
│ │ └── targets_list.rs
│ ├── catchall.rs
│ ├── common.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── main.rs
│ ├── middleware/
│ │ ├── cookie_host.rs
│ │ ├── mod.rs
│ │ └── ticket.rs
│ ├── proxy.rs
│ ├── session.rs
│ └── session_handle.rs
├── warpgate-protocol-kubernetes/
│ ├── Cargo.toml
│ └── src/
│ ├── correlator.rs
│ ├── lib.rs
│ ├── recording.rs
│ ├── server/
│ │ ├── auth.rs
│ │ ├── client_certs.rs
│ │ ├── handlers.rs
│ │ └── mod.rs
│ └── session_handle.rs
├── warpgate-protocol-mysql/
│ ├── Cargo.toml
│ └── src/
│ ├── client.rs
│ ├── common.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── session.rs
│ ├── session_handle.rs
│ └── stream.rs
├── warpgate-protocol-postgres/
│ ├── Cargo.toml
│ └── src/
│ ├── client.rs
│ ├── common.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── session.rs
│ ├── session_handle.rs
│ └── stream.rs
├── warpgate-protocol-ssh/
│ ├── Cargo.toml
│ └── src/
│ ├── client/
│ │ ├── channel_direct_tcpip.rs
│ │ ├── channel_session.rs
│ │ ├── error.rs
│ │ ├── handler.rs
│ │ └── mod.rs
│ ├── common.rs
│ ├── compat.rs
│ ├── keys.rs
│ ├── known_hosts.rs
│ ├── lib.rs
│ └── server/
│ ├── channel_writer.rs
│ ├── mod.rs
│ ├── russh_handler.rs
│ ├── service_output.rs
│ ├── session.rs
│ └── session_handle.rs
├── warpgate-sso/
│ ├── Cargo.toml
│ └── src/
│ ├── config.rs
│ ├── error.rs
│ ├── google_groups.rs
│ ├── lib.rs
│ ├── request.rs
│ ├── response.rs
│ └── sso.rs
├── warpgate-tls/
│ ├── Cargo.toml
│ └── src/
│ ├── cert.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── maybe_tls_stream.rs
│ ├── mode.rs
│ ├── rustls_helpers.rs
│ └── rustls_root_certs.rs
└── warpgate-web/
├── .editorconfig
├── .gitignore
├── Cargo.toml
├── eslint.config.mjs
├── openapitools.json
├── package.json
├── src/
│ ├── admin/
│ │ ├── App.svelte
│ │ ├── AuthPolicyEditor.svelte
│ │ ├── CertificateCredentialModal.svelte
│ │ ├── CreateOtpModal.svelte
│ │ ├── CreatePasswordModal.svelte
│ │ ├── CredentialEditor.svelte
│ │ ├── Home.svelte
│ │ ├── KubernetesRecording.svelte
│ │ ├── Log.svelte
│ │ ├── LogViewer.svelte
│ │ ├── PublicKeyCredentialModal.svelte
│ │ ├── Recording.svelte
│ │ ├── RelativeDate.svelte
│ │ ├── Session.svelte
│ │ ├── SsoCredentialModal.svelte
│ │ ├── TlsConfiguration.svelte
│ │ ├── config/
│ │ │ ├── AccessRole.svelte
│ │ │ ├── AccessRoles.svelte
│ │ │ ├── AdminRole.svelte
│ │ │ ├── AdminRolePermissionsBadge.svelte
│ │ │ ├── AdminRoles.svelte
│ │ │ ├── Config.svelte
│ │ │ ├── CreateAdminRole.svelte
│ │ │ ├── CreateRole.svelte
│ │ │ ├── CreateTicket.svelte
│ │ │ ├── CreateUser.svelte
│ │ │ ├── Parameters.svelte
│ │ │ ├── SSHKeys.svelte
│ │ │ ├── Tickets.svelte
│ │ │ ├── User.svelte
│ │ │ ├── Users.svelte
│ │ │ ├── ldap/
│ │ │ │ ├── CreateLdapServer.svelte
│ │ │ │ ├── LdapConnectionFields.svelte
│ │ │ │ ├── LdapServer.svelte
│ │ │ │ ├── LdapServers.svelte
│ │ │ │ ├── LdapUserBrowser.svelte
│ │ │ │ └── common.ts
│ │ │ ├── target-groups/
│ │ │ │ ├── CreateTargetGroup.svelte
│ │ │ │ ├── TargetGroup.svelte
│ │ │ │ ├── TargetGroups.svelte
│ │ │ │ └── common.ts
│ │ │ └── targets/
│ │ │ ├── ChooseTargetKind.svelte
│ │ │ ├── CreateTarget.svelte
│ │ │ ├── Target.svelte
│ │ │ ├── Targets.svelte
│ │ │ └── ssh/
│ │ │ ├── KeyChecker.svelte
│ │ │ ├── KeyCheckerResult.svelte
│ │ │ └── Options.svelte
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── lib/
│ │ │ ├── PermissionGate.svelte
│ │ │ ├── api.ts
│ │ │ ├── openapi-schema.json
│ │ │ ├── store.ts
│ │ │ └── time.ts
│ │ └── player/
│ │ └── TerminalRecordingPlayer.svelte
│ ├── common/
│ │ ├── AsyncButton.svelte
│ │ ├── AuthBar.svelte
│ │ ├── Brand.svelte
│ │ ├── ConnectionInstructions.svelte
│ │ ├── CopyButton.svelte
│ │ ├── CredentialUsedStateBadge.svelte
│ │ ├── DelayedSpinner.svelte
│ │ ├── EmptyState.svelte
│ │ ├── GettingStarted.svelte
│ │ ├── GroupColorCircle.svelte
│ │ ├── InfoBox.svelte
│ │ ├── ItemList.svelte
│ │ ├── Loadable.svelte
│ │ ├── NavListItem.svelte
│ │ ├── Pagination.svelte
│ │ ├── RadioButton.svelte
│ │ ├── RateLimitInput.svelte
│ │ ├── ThemeSwitcher.svelte
│ │ ├── autosave.ts
│ │ ├── errors.ts
│ │ ├── helpers.ts
│ │ ├── protocols.ts
│ │ ├── recordings.ts
│ │ └── sveltestrap-s5-ports/
│ │ ├── Alert.svelte
│ │ ├── Badge.svelte
│ │ ├── ModalHeader.svelte
│ │ ├── Tooltip.svelte
│ │ └── _sveltestrapUtils.ts
│ ├── embed/
│ │ ├── EmbeddedUI.svelte
│ │ └── index.ts
│ ├── gateway/
│ │ ├── ApiTokenManager.svelte
│ │ ├── App.svelte
│ │ ├── CreateApiTokenModal.svelte
│ │ ├── CredentialManager.svelte
│ │ ├── Login.svelte
│ │ ├── OutOfBandAuth.svelte
│ │ ├── Profile.svelte
│ │ ├── ProfileApiTokens.svelte
│ │ ├── ProfileCredentials.svelte
│ │ ├── TargetList.svelte
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── lib/
│ │ │ ├── api.ts
│ │ │ ├── openapi-schema.json
│ │ │ ├── shellEscape.ts
│ │ │ └── store.ts
│ │ └── login.ts
│ ├── lib.rs
│ ├── theme/
│ │ ├── _theme.scss
│ │ ├── fonts.css
│ │ ├── index.ts
│ │ ├── theme.dark.scss
│ │ ├── theme.light.scss
│ │ ├── vars.common.scss
│ │ ├── vars.dark.scss
│ │ └── vars.light.scss
│ └── vite-env.d.ts
├── svelte.config.js
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .all-contributorsrc
================================================
{
"projectName": "warpgate",
"projectOwner": "warp-tech",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "none",
"contributors": [
{
"login": "Eugeny",
"name": "Eugeny",
"avatar_url": "https://avatars.githubusercontent.com/u/161476?v=4",
"profile": "https://github.com/Eugeny",
"contributions": [
"code"
]
},
{
"login": "heywoodlh",
"name": "Spencer Heywood",
"avatar_url": "https://avatars.githubusercontent.com/u/18178614?v=4",
"profile": "https://the-empire.systems/",
"contributions": [
"code"
]
},
{
"login": "apiening",
"name": "Andreas Piening",
"avatar_url": "https://avatars.githubusercontent.com/u/2064875?v=4",
"profile": "https://github.com/apiening",
"contributions": [
"code"
]
},
{
"login": "Gurkengewuerz",
"name": "Niklas",
"avatar_url": "https://avatars.githubusercontent.com/u/10966337?v=4",
"profile": "https://github.com/Gurkengewuerz",
"contributions": [
"code"
]
},
{
"login": "notnooblord",
"name": "Nooblord",
"avatar_url": "https://avatars.githubusercontent.com/u/11678665?v=4",
"profile": "https://github.com/notnooblord",
"contributions": [
"code"
]
},
{
"login": "SheaSmith",
"name": "Shea Smith",
"avatar_url": "https://avatars.githubusercontent.com/u/51303984?v=4",
"profile": "https://shea.nz/",
"contributions": [
"code"
]
},
{
"login": "samtoxie",
"name": "samtoxie",
"avatar_url": "https://avatars.githubusercontent.com/u/7732658?v=4",
"profile": "https://github.com/samtoxie",
"contributions": [
"code"
]
},
{
"login": "pfoundation",
"name": "P Foundation",
"avatar_url": "https://avatars.githubusercontent.com/u/80860929?v=4",
"profile": "https://p.foundation/",
"contributions": [
"financial"
]
},
{
"login": "alairock",
"name": "Skyler Lewis",
"avatar_url": "https://avatars.githubusercontent.com/u/1480236?v=4",
"profile": "http://sixteenink.com",
"contributions": [
"code"
]
},
{
"login": "MohammedNoureldin",
"name": "Mohammed Noureldin",
"avatar_url": "https://avatars.githubusercontent.com/u/14913147?v=4",
"profile": "http://www.mohammednoureldin.com",
"contributions": [
"code"
]
},
{
"login": "mrmm",
"name": "Mourad Maatoug",
"avatar_url": "https://avatars.githubusercontent.com/u/796467?v=4",
"profile": "https://github.com/mrmm",
"contributions": [
"code"
]
},
{
"login": "justinforlenza",
"name": "Justin",
"avatar_url": "https://avatars.githubusercontent.com/u/11709872?v=4",
"profile": "http://justinforlenza.dev",
"contributions": [
"code"
]
},
{
"login": "liebermantodd",
"name": "liebermantodd",
"avatar_url": "https://avatars.githubusercontent.com/u/12155811?v=4",
"profile": "https://github.com/liebermantodd",
"contributions": [
"code"
]
},
{
"login": "cvhariharan",
"name": "Hariharan",
"avatar_url": "https://avatars.githubusercontent.com/u/14965074?v=4",
"profile": "https://blog.trieoflogs.com",
"contributions": [
"code"
]
},
{
"login": "solidassassin",
"name": "Rokas Krivaitis",
"avatar_url": "https://avatars.githubusercontent.com/u/47082246?v=4",
"profile": "https://github.com/solidassassin",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"commitType": "docs"
}
================================================
FILE: .bumpversion.cfg
================================================
[bumpversion]
current_version = 0.22.0-beta.2
commit = True
tag = True
[bumpversion:file:warpgate/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-admin/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-ca/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-common/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-common-http/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-core/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-database-protocols/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-db-entities/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-db-migrations/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-protocol-kubernetes/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-ldap/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-protocol-http/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-protocol-mysql/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-protocol-postgres/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-protocol-ssh/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-tls/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-sso/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:warpgate-web/Cargo.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
================================================
FILE: .cargo/config.toml
================================================
# https://github.com/rust-lang/cargo/issues/5376#issuecomment-2163350032
[target.'cfg(all())']
rustflags = [
"--cfg", "tokio_unstable",
"-Zremap-cwd-prefix=/reproducible-cwd",
"--remap-path-prefix=$HOME=/reproducible-home",
"--remap-path-prefix=$PWD=/reproducible-pwd",
]
================================================
FILE: .dockerignore
================================================
data*
cdx
dhap-heap.json
.pytest_cache
# Generated by Cargo
# will have compiled files and executables
target
*/target
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
temp
host_key*
.vscode
# ---
data
config.*.yaml
config.yaml
warpgate-web/dist
warpgate-web/node_modules
warpgate-web/src/admin/lib/api-client/
warpgate-web/src/gateway/lib/api-client/
================================================
FILE: .flake8
================================================
[flake8]
ignore=E501,D103,C901,D203,W504,S607,S603,S404,S606,S322,S410,S320,B010
exclude = .git,__pycache__,help,static,misc,locale,templates,tests,deployment,migrations,elements/ai/scripts
max-complexity = 40
builtins = _
per-file-ignores = scripts/*:T001,E402
select = C,E,F,W,B,B902
================================================
FILE: .github/FUNDING.yml
================================================
github: eugeny
open_collective: tabby
ko_fi: eugeny
================================================
FILE: .github/dependabot.yml
================================================
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
labels: ["type/deps"]
#open-pull-requests-limit: 25
schedule:
interval: "daily"
groups:
version-bumps:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: "npm"
directory: "/warpgate-web"
labels: ["type/deps"]
#open-pull-requests-limit: 25
groups:
version-bumps:
applies-to: version-updates
update-types:
- minor
- patch
schedule:
interval: "daily"
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: docker
directory: /docker
schedule:
interval: daily
================================================
FILE: .github/workflows/build.yml
================================================
name: Build
permissions:
contents: read
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
include:
- arch: x86_64-linux
target: x86_64-unknown-linux-gnu
os: ubuntu-22.04 # older image for glibc compatibility
cyclonedx-build: cyclonedx-linux-x64
cargo-cross: false
- arch: arm64-linux
target: aarch64-unknown-linux-gnu
os: ubuntu-22.04-arm # older image for glibc compatibility
cyclonedx-build: cyclonedx-linux-arm64
cargo-cross: false
- arch: x86_64-macos
target: x86_64-apple-darwin
os: macos-latest
cyclonedx-build: cyclonedx-osx-x64
cargo-cross: false
- arch: arm64-macos
target: aarch64-apple-darwin
os: macos-latest
cyclonedx-build: cyclonedx-osx-arm64
cargo-cross: true
fail-fast: false
name: Build (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
steps:
- if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y libssl-dev pkg-config
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: recursive
- uses: rlespinasse/github-slug-action@9e7def61550737ba68c62d34a32dd31792e3f429
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
key: "build"
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: 24
- name: Install tools
run: |
cargo install --locked just
cargo install --locked cargo-deny@0.18.9
cargo install --locked cargo-cyclonedx@^0.5
rm -rf ~/.cargo/registry
- name: Install CycloneDX
run: |
mkdir cdx
wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.27.2/${{ matrix.cyclonedx-build }} -O cyclonedx
chmod +x cyclonedx
- name: Install CycloneDX-npm
run: |
cd /
npm i -g @cyclonedx/cyclonedx-npm@4.1.2
- name: cargo-deny
run: |
cargo deny --version
cargo deny check
- name: Install admin UI deps
run: |
just npm ci
- name: Build admin UI
run: |
just npm run build
- name: Generate admin UI BOM
run: |
just npm prune
cd warpgate-web && NODE_ENV=dev cyclonedx-npm --output-format xml > ../cdx/admin-ui.cdx.xml
- name: Build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: build
use-cross: ${{ matrix.cargo-cross }}
args: --all-features --release --target ${{ matrix.target }}
env:
ENV SOURCE_DATE_EPOCH: "0" # for rust-embed determinism
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd"
CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd"
CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd"
- name: Generate Rust BOM
run: |
cargo cyclonedx --all-features
mv warpgate*/*.cdx.xml cdx/
- name: Merge BOMs
run: ./cyclonedx merge --input-files cdx/* --input-format xml --output-format xml > cdx.xml
- name: Attest build
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26
if: startsWith(github.ref, 'refs/tags/v')
with:
subject-path: target/${{ matrix.target }}/release/warpgate
- name: Upload artifact
uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50
with:
name: warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}
path: target/${{ matrix.target }}/release/warpgate
- name: Upload SBOM
uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50
with:
name: warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}.cdx.xml
path: cdx.xml
- name: Rename artifacts
run: |
mkdir dist
mv target/${{ matrix.target }}/release/warpgate dist/warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}
mv cdx.xml dist/warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}.cdx.xml
- name: Upload release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
generate_release_notes: true
files: dist/*
token: ${{ secrets.GITHUB_TOKEN }}
config-schema:
name: Config schema check
runs-on: ubuntu-24.04
steps:
- name: Setup
run: |
sudo apt update
sudo apt install --no-install-recommends -y libssl-dev pkg-config
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: recursive
- name: Install tools
run: |
cargo install --locked just
- name: Ensure there are no changes in config schema
run: |
mkdir warpgate-web/dist
just config-schema
git diff --exit-code config-schema.json
================================================
FILE: .github/workflows/check-schema-compatibility.yml
================================================
name: Check API Schema Compatibility
on: [pull_request]
permissions:
contents: read
jobs:
check-schema-compatibility:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: Install just
run: |
cargo install just
- name: Install npm dependencies
run: |
cd warpgate-web && npm ci
- name: Generate API schema files
run: |
mkdir warpgate-web/dist
just openapi-all
- name: Checkout main branch to compare
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: main
path: main-branch
- name: Check admin API
run: |
docker run --rm -t -v $(pwd):/specs:ro tufin/oasdiff breaking -f githubactions --fail-on WARN /specs/main-branch/warpgate-web/src/admin/lib/openapi-schema.json /specs/warpgate-web/src/admin/lib/openapi-schema.json
- name: Check gateway API
run: |
docker run --rm -t -v $(pwd):/specs:ro tufin/oasdiff breaking -f githubactions --fail-on WARN /specs/main-branch/warpgate-web/src/gateway/lib/openapi-schema.json /specs/warpgate-web/src/gateway/lib/openapi-schema.json
================================================
FILE: .github/workflows/codeql.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
permissions:
contents: read
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '19 11 * * 0'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: rust
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/dependency-review.yml
================================================
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Reqest, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: 'Dependency Review'
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48
================================================
FILE: .github/workflows/docker.yml
================================================
name: Docker
permissions: read-all
on:
schedule:
- cron: '25 12 * * *'
push:
branches: [ '**' ]
tags: [ 'v*.*.*' ] # Publish semver tags as releases.
pull_request:
branches: [ '**' ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: warp-tech/warpgate
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
include:
- os: ubuntu-24.04
docker-platform: linux/amd64
matrix-id: amd64
- os: ubuntu-24.04-arm
docker-platform: linux/arm64
matrix-id: arm64
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: recursive
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build Docker image without pushing
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
id: build-no-push
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
file: docker/Dockerfile
context: .
push: false
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.docker-platform }}
cache-from: type=gha,scope=build-${{ matrix.docker-platform }}
- name: Build and push Docker image
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
id: build
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
file: docker/Dockerfile
context: .
push: true
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.docker-platform }}
cache-from: type=gha,scope=build-${{ matrix.docker-platform }}
cache-to: type=gha,scope=build-${{ matrix.docker-platform }}
outputs: type=image,"name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}",push-by-digest=true,name-canonical=true,push=true
# Provenance attestations generates an unknown/unknown platform layer
# that causes issues, see #1255
attests: ''
provenance: false
- name: Export digest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: digests-${{ matrix.matrix-id }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- name: Download digests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,prefix=branch-
type=ref,event=pr,prefix=pr-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=schedule
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
================================================
FILE: .github/workflows/reprotest.yml
================================================
name: Reproducibility test
permissions:
contents: read
on: workflow_dispatch
jobs:
reprotest:
name: Reproducibility test
runs-on: ubuntu-24.04
steps:
- name: Setup
run: |
sudo apt update
sudo apt install --no-install-recommends -y libssl-dev pkg-config disorderfs faketime locales-all reprotest diffoscope
test -c /dev/fuse || mknod -m 666 /dev/fuse c 10 229
test -f /etc/mtab || ln -s ../proc/self/mounts /etc/mtab
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo sh -s -- -y
echo "/root/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: recursive
- name: Install tools
run: |
sudo env "PATH=$PATH" cargo install --locked just
- name: Reprotest
run: |
sudo ulimit -n 999999
sudo env "PATH=$PATH" reprotest -vv --min-cpus=99999 --vary=environment,build_path,kernel,aslr,num_cpus,-time,-user_group,fileordering,domain_host,home,locales,exec_path,timezone,umask --build-command 'just npm ci; just npm run build; SOURCE_DATE_EPOCH=0 cargo build --all-features --release' . target/release/warpgate
================================================
FILE: .github/workflows/scorecard.yml
================================================
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '42 9 * * 6'
push:
branches: [ "main" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
# file_mode: git
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
with:
sarif_file: results.sarif
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: recursive
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: 24
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
key: "test"
- name: Install build deps
run: |
sudo apt-get install openssh-client expect
cargo install --locked just
# Pin cargo-llvm-cov to 0.6.15 because versions 0.6.16+ depend on ruzstd 0.8.x which uses
# the unstable `unsigned_is_multiple_of` feature not available in nightly-2025-01-01
cargo install --locked cargo-llvm-cov@0.6.15
cargo clean
rustup component add llvm-tools-preview
- name: Build UI
run: |
just npm ci
just openapi
just npm run openapi:tests-sdk
just npm run build
- name: Build images
working-directory: tests
run: |
make all
- name: Install deps
working-directory: tests
run: |
sudo apt update
sudo apt install -y gnome-keyring kubectl
pip3 install keyring==24 poetry==1.8.3
poetry install
- name: Run
working-directory: tests
run: |
TIMEOUT=120 poetry run ./run.sh
cargo llvm-cov report --lcov > coverage.lcov
- name: Upload coverage
uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50
with:
name: coverage.lcov
path: tests/coverage.lcov
- name: Upload coverage (HTML)
uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50
with:
name: coverage-html
path: target/llvm-cov/html
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9
if: ${{ env.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
================================================
FILE: .gitignore
================================================
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
temp
host_key*
.vscode
# ---
data
data-*
config.*.yaml
config.yaml
__pycache__
.pytest_cache
dhat-heap.json
# IntelliJ based IDEs
.idea/
/.data/
cdx.xml
*.cdx.xml
================================================
FILE: .well-known/funding-manifest-urls
================================================
https://null.page/funding.json
================================================
FILE: Cargo.toml
================================================
# cargo-features = ["profile-rustflags"]
[workspace]
members = [
"warpgate",
"warpgate-admin",
"warpgate-common",
"warpgate-common-http",
"warpgate-tls",
"warpgate-core",
"warpgate-db-migrations",
"warpgate-db-entities",
"warpgate-database-protocols",
"warpgate-ldap",
"warpgate-protocol-http",
"warpgate-protocol-kubernetes",
"warpgate-protocol-mysql",
"warpgate-protocol-postgres",
"warpgate-protocol-ssh",
"warpgate-sso",
"warpgate-web",
]
default-members = ["warpgate"]
resolver = "2"
[workspace.dependencies]
anyhow = { version = "1.0", default-features = false, features = ["std"] }
bytes = { version = "1.4", default-features = false }
data-encoding = { version = "2.3", default-features = false, features = ["alloc", "std"] }
serde = { version = "1.0", features = ["derive"], default-features = false }
serde_json = { version = "1.0", default-features = false }
russh = { version = "0.58.0", features = ["des", "rsa", "aws-lc-rs"], default-features = false }
futures = { version = "0.3", default-features = false }
tokio-stream = { version = "0.1.17", features = ["net"], default-features = false }
tokio-rustls = { version = "0.26", default-features = false }
enum_dispatch = { version = "0.3.13", default-features = false }
rustls = { version = "0.23", default-features = false, features = ["tls12"] }
sqlx = { version = "0.8", features = ["tls-rustls-aws-lc-rs"], default-features = false }
sea-orm = { version = "1.0", default-features = false, features = ["runtime-tokio", "macros"] }
sea-orm-migration = { version = "1.0", default-features = false, features = [
"cli",
] }
poem = { version = "3.1", features = [
"cookie",
"session",
"anyhow",
"websocket",
"rustls",
"embed",
"server",
], default-features = false }
hex = { version = "0.4", default-features = false }
poem-openapi = { version = "5.1", features = [
"stoplight-elements",
"chrono",
"uuid",
"static-files",
"cookie",
], default-features = false }
password-hash = { version = "0.5", features = ["std"], default-features = false }
delegate = { version = "0.13", default-features = false }
tracing = { version = "0.1", default-features = false }
schemars = { version = "0.9.0", default-features = false, features = ["derive", "std"] }
ldap3 = { version = "0.12", default-features = false, features = ["tls-rustls-aws-lc-rs"] }
rustls-pki-types = { version = "1.13", default-features = false, features = ["alloc", "std"] }
thiserror = { version = "2", default-features = false }
rand = { version = "0.8", default-features = false }
rand_chacha = { version = "0.3", default-features = false }
rand_core = { version = "0.6", features = ["std"], default-features = false }
dialoguer = { version = "0.11", default-features = false, features = ["editor", "password"] }
tokio = { version = "1.20", features = ["tracing", "signal", "macros", "rt-multi-thread", "io-util"], default-features = false }
governor = { version = "0.10.0", default-features = false, features = ["std", "quanta", "jitter"] }
rcgen = { version = "0.13", features = ["zeroize", "crypto", "aws_lc_rs", "pem", "x509-parser"], default-features = false }
x509-parser = "0.17.0"
uuid = { version = "1.3", features = ["v4", "serde"], default-features = false }
reqwest = { version = "0.13", features = [
"http2", # required for connecting to targets behind AWS ELB
"rustls-no-provider",
"stream",
"gzip",
], default-features = false }
reqwest_12 = { package = "reqwest", version = "0.12", features = [
"http2",
"rustls-tls-native-roots-no-provider",
"stream",
"gzip",
], default-features = false } # separate copy to control features on openidconnect->oauth2->reqwest
regex = { version = "1.6", default-features = false, features = ["std"] }
tokio-tungstenite = { version = "0.27", features = ["rustls-tls-native-roots", "connect"], default-features = false }
reqwest-websocket = "0.6.0"
[profile.release]
lto = true
panic = "abort"
strip = "debuginfo"
[profile.coverage]
inherits = "dev"
# rustflags = ["-Cinstrument-coverage"]
================================================
FILE: Cranky.toml
================================================
deny = [
"unsafe_code",
"clippy::unwrap_used",
"clippy::expect_used",
"clippy::panic",
"clippy::indexing_slicing",
"clippy::dbg_macro",
]
allow = [
"clippy::result_large_err",
]
================================================
FILE: Cross.toml
================================================
[target.x86_64-unknown-linux-gnu]
pre-build = ["apt-get update && apt-get install --assume-yes libz-dev"]
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2022 Warpgate contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
---
Warpgate is a smart & fully transparent SSH, HTTPS, Kubernetes, MySQL, PostgreSQL bastion host that doesn't require a client app or an SSH wrapper.
* Set it up in your DMZ, add user accounts and easily assign them to specific hosts and URLs within the network.
* Warpgate will record every session for you to view (live) and replay later through a built-in admin web UI.
* Not a jump host - forwards connection straight to the target in a way that's fully transparent to the client.
* Native 2FA and SSO support (TOTP & OpenID Connect)
* Single binary with no dependencies.
* Written in 100% safe Rust.
Supported by:
## Getting started & downloads
* See the [Getting started](https://warpgate.null.page/getting-started/) docs page (or [Getting started on Docker](https://warpgate.null.page/getting-started-on-docker/)).
* [Release / beta binaries](https://github.com/warp-tech/warpgate/releases)
* [Nightly builds](https://nightly.link/warp-tech/warpgate/workflows/build/main)
## How is Warpgate different from a jump host / VPN / Teleport?
| Warpgate | SSH jump host | VPN | Teleport |
|-|-|-|-|
| ✅ **Precise 1:1 assignment between users and services** | (Usually) full access to the network behind the jump host | (Usually) full access to the network | ✅ **Precise 1:1 assignment between users and services** |
| ✅ **No custom client needed** | Jump host config needed | ✅ **No custom client needed** | Custom client required |
| ✅ **2FA out of the box** | 🟡 2FA possible with additional PAM plugins | 🟡 Depends on the provider | ✅ **2FA out of the box** |
| ✅ **SSO out of the box** | 🟡 SSO possible with additional PAM plugins | 🟡 Depends on the provider | Paid |
| ✅ **Command-level audit** | 🟡 Connection-level audit on the jump host, no secure audit on the target if root access is given | No secure audit on the target if root access is given | ✅ **Command-level audit** |
| ✅ **Full session recording** | No secure recording possible on the target if root access is given | No secure recording possible on the target if root access is given | ✅ **Full session recording** |
| ✅ **Non-interactive connections** | 🟡 Non-interactive connections are possible if the clients supports jump hosts natively | ✅ **Non-interactive connections** | Non-interactive connections require using an SSH client wrapper or running a tunnel |
| ✅ **Self-hosted, you own the data** | ✅ **Self-hosted, you own the data** | 🟡 Depends on the provider | SaaS |
## Reporting security issues
Please use GitHub's [vulnerability reporting system](https://github.com/warp-tech/warpgate/security/policy).
## Project Status
The project is ready for production.
## How it works
Warpgate is a service that you deploy on the bastion/DMZ host, which will accept SSH, HTTPS, Kubernetes, MySQL and PostgreSQL connections and provide an (optional) web admin UI.
Run `warpgate setup` to interactively generate a config file, including port bindings. See [Getting started](https://warpgate.null.page/getting-started/) for details.
It receives connections with specifically formatted credentials, authenticates the user locally, connects to the target itself, and then connects both parties together while (optionally) recording the session.
When connecting through HTTPS, Warpgate presents a selection of available targets, and will then proxy all traffic in a session to the selected target. You can switch between targets at any time.
You manage the target and user lists and assign them to each other through the admin UI, and the session history is stored in an SQLite database (default: in `/var/lib/warpgate`).
You can also use the admin web interface to view the live session list, review session recordings, logs and more.
## Contributing / building from source
* You'll need Rust, NodeJS and NPM
* Clone the repo
* [Just](https://github.com/casey/just) is used to run tasks - install it: `cargo install just`
* Install the admin UI deps: `just npm install`
* Build the frontend: `just npm run build`
* Build Warpgate: `cargo build` (optionally `--release`)
The binary is in `target/{debug|release}`.
### Tech stack
* Rust 🦀
* HTTP: `poem-web`
* Database: SQLite via `sea-orm` + `sqlx`
* SSH: `russh`
* Typescript
* Svelte
* Bootstrap
### Backend API
* Warpgate admin and user facing APIs use autogenerated OpenAPI schemas and SDKs. To update the SDKs after changing the query/response structures, run `just openapi-all`.
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):