Posts

Showing posts with the label security

What are good ways to prevent SQL injection? [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP What are good ways to prevent SQL injection? [duplicate] This question already has an answer here: I have to program an application management system for my OJT company. The front end will be done in C# and the back end in SQL. Now I have never done a project of this scope before; in school we had only basic lessons about SQL. Somehow our teacher completely failed to discuss SQL injections, something which I have only now come in contact with by reading about it on the net. So anyway my question is: how do you prevent SQL injections in C#? I vaguely think that it can be done by properly masking the text fields of the application so that it only accepts input in a specified format. For example: an e-mail textbox should be of the format "example@examplecompany.tld". Would this approach be sufficient? Or does .NET have pre-defined methods that handle stuff like this? Can I apply a filter to a textbox so it only accepts email-address format or a nam...

Change Named Pipe Access Permissions

Image
Clash Royale CLAN TAG #URR8PPP Change Named Pipe Access Permissions I have created a named pipe using System.IO.Pipes . It worked fine until I had to run the program in admin mode. When elevated, the client can no longer connect (client is not running elevated). If I run the client as administrator, it connects fine so it looks like a permissions issue. I've been researching how to fix this and have been unsuccessful (I find dealing with Windows security mind boggling). System.IO.Pipes The first thing I changed was opening the pipe with access rights: pipeServer = new NamedPipeServerStream(pipeName, PipeDirection.InOut, 1, PipeTransmissionMode.Message, PipeOptions.Asynchronous, 0x4000, 0x400, null, ...

Using runAsNonRoot in Kubernetes

Image
Clash Royale CLAN TAG #URR8PPP Using runAsNonRoot in Kubernetes We’ve been planning for a long time to introduce securityContext: runAsNonRoot: true as a requirement to our pod configurations for a while now. securityContext: runAsNonRoot: true Testing this today I’ve learnt that since v1.8.4 (I think) you also have to specify a particular UID for the user running the container, e.g runAsUser: 333 . v1.8.4 runAsUser: 333 This means we not only have to tell developers to ensure their containers don’t run as root, but also specify a specific UID that they should run as, which makes this significantly more problematic for us to introduce. Have I understood this correctly? What are others doing in this area? To leverage runAsNonRoot is it now required that Docker containers run with a specific and known UID? runAsNonRoot 2 Answers 2 The Kubernetes Pod SecurityContext provides two options runAsNonRoot...