How to protect sensitive data on CircleCi? - circleci

Where to store sencitive information like signing configs, api keys etc on Cicrle without adding them to git.
Normaly I dont upload such files to git repositories, but I dont see how can I use Circle without them

You would use private environment variables. This would be loaded into CircleCI via the webapp or API, and then injected into a running build. This way, sensitive information won't have to be stored in your repository.
Here's a doc on Environment Variables in CircleCI 1.0 and CircleCI 2.0.

Use environment variable. If you want to use file, encode it as base 64 string https://support.circleci.com/hc/en-us/articles/360003540393-How-to-insert-files-as-environment-variables-with-Base64
If you need to insert sensitive text-based documents or even small binary files into your project in secret it is possible to insert them as an environment variable by leveraging base64 encoding.
It seems CircleCI does not support sensitive file yet.

Related

Access environment variables in native code

My challenge is that I'm working on a public Flutter app and I don't want to expose my API keys in the source code. I'm specifically looking to inject the Google Maps API key into my AppDelegate.swift file.
Ideally I'd want to be able to pass this through with a .env file (and the then inject these keys as environment variables in CI/CD), but I'm also fine doing a --dart-define. I have not found any working example of how to get this working.
I'm able to get this working on the Android side of things without any issues.
You can save it as an plist dictionary, and add the reading code from the file. For example: https://stackoverflow.com/a/62916637/11798831
Also you could rename file by adding Bundle.main.path(forResource: "config", ofType: "env").object(...
You can do not commit it in the project, just keep it locally. Also add it as additional file in CI/CD.

How to access files on Ceph directly as URL

I need a storage system with the following requirements:
1. It should support data/service clustering
2. It should be open-source so that I can extend functionalities later if needed
3. It should support file system because I want to access some files as public url(direct access). So that I can store my scripts in these files and directly refer these files.
4. Supports some kind of authentication
5. I want it to be on premise (Not cloud).
Ceph seems to qualify all the criteria but does it support the public access of files just like a URL(Point 3) ? It has ability to generate temporary URLs though but I want permanent URLs for few files.
You could run Nextcloud and have your data volume (and database, if you feel so inclined) stored on the Ceph cluster. That's open-source, you can setup direct links to files including permanent links, and is authenticated.

Does SavedModelBundle loader support GCS path as export directory

Currently I am using a saved_model file stored on my local disk to read an inference graph and use it in servers. Unfortunately giving a GCS path doesn't work for SavedModelBundle.load api.
Tried providing GCS path for the file but did not work.
Is this even supported, if not how can i achieve this using the SavedModelBundle api because i have some production servers running on google cloud that i want to serve some tensor-flow graphs.
A recent commit inadvertently broke the ability to load files from GCS. This has been fixed and is available in github.

Encrypt external global properties file in Ready! API

In my project, we store DB passwords in an external Global Properties file and the project is there in git. We use jenkins to execute the builds.
In external global properties file, the password is stored in plain text format. I somehow want to encrypt the file or use any other means to secure it. And I should be able to use that password in scripts to access backend db.
could you please help me out with how do I go about it ? What are the ways?
Thanks

How to use github repo as like CDN server for uploading assets file?

I am learning ruby on rails. I am developing a rails 5 application.
I don't want to use amazon s3 service for containing my assets files.
I want to use github for serving my assets files as like CDN.
But I am facing a problem, I have dynamic file and image upload system.
So therefore, When I will upload my files and images, all files and images will be uploaded in a github repository (assume, I have a git repo named busket; so, all images and files will be uploaded in busket repo from my server and will serve all assets from rails application).
So, how can I make github as like CDN ? Please help me about this issue.
https://cdn.jsdelivr.net/gh/username/repository#master/file
username = name of the user of github
repository = name of github repo
file = actual name of the file
I feel that it would be a generally bad idea to upload images and general types of content files to GitHub for long terms storage. GitHub was designed to be a repository provider for Git, not as a NoSQL or other type of data store. Updating files in GitHub would require making a commit to a particular branch. Hence, every time you change an image file, it would require a new commit. This won't scale, because Git does not handle binary files well.
So if you need a long term data store for your image and content files, I would suggest looking into tools which were designed for that, such as Amazon's S3, Google Cloud Storage, and things similar to this.
1.) Encode image to base 64
ref: http://ruby-doc.org/stdlib-2.2.0/libdoc/base64/rdoc/Base64.html
2.) Make API call to github
ref: https://developer.github.com/v3/repos/contents/#create-a-file
This will upload and return the url of your stored image within github, store that in your database.
Although you stated you didn't want to use S3, the paperclip gem makes it very streamlined.
As mentioned by #Tim its generally a bad idea.
However if you still want to use Git as a File Server append
?raw=true
at the end of the URI.
For example
https://github.com/git/git/blob/master/ewah/bitmap.c?raw=true
would give you the contents of the file.

Resources