Use Azure Service Bus without 'direct' internet connection possible, SendVia? - azure

An Azure Service Bus/Queue question...
We have systems (SystemA) that have 'no' internet connection direclty, but can connect to another server (SystemB) via whatever ports we decide to open.
SystemB can connect to internet and Azure no problem.
But I can't see how to use SendVia so that I can say
SystemA, Send a Queue message Via SystemB.
(https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-transactions)
What would we install on SystemB... or is Send Via just for, well, I don't know what it's for if not this...
Would we have to roll our own solution for SystemA->SystemB part? Or am I missing somthing?
Thanks for any assistance.

Send-via is not what you think it is. It only can operate on the same namespace and connection.
or is Send Via just for, well, I don't know what it's for if not this...
The feature is intended for transactional processing of the incoming message with the dispatch of the outgoing messages.

Related

Communicating with a remote server via microsoft Teams

Scenario:
I have a remote server which is monitored (via DataDog) and sends out a warning when some anomaly is detected. This warning can be fetched via a webhook. Now I want to connect that webhook (https://docs.datadoghq.com/integrations/webhooks/) with MS Teams (probably via Bot), to receive a warning. Then I want to send a command back to the remote server to resolve the warning.
Technology:
MS Teams, Python flask/Django, remote server
Expected Results:
I can receive a warning from my remote server to MS Teams via a bot. Then send a command back to the remote server. My initial plan is doing this using Python Flask/Django but not tied to a specific language.
Environment:
Remote server is a LINUX based system. we have a internal network that is used within our company, so might need to resolve a firewall problem potentially (idk whole lot about it tho).
Things I have tried:
I just want to see if this is possible or not, so i havent coded up any. But I found some information relevant to our problem:
https://docs.datadoghq.com/integrations/webhooks/
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams
https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors
One last note, I am not also tied down to Teams bot. Our company also uses Azure Devops, so that is another resource I can use to realize the solution.
Btw, this question was posted on here but was told to post on MSDN, but I couldn't find an appropriate forum. Hence, I am posting on stack overflow instead
As you have limited requirements, you could achieve this without a bot.
MS Teams has income and outgoing webhooks. You could create a Incoming webhook inside a Teams channel. It provides an URL which you could use inside the monitoring remote server and POST the message in JSON format to the webhook url. It will be posted in teams channel like below
For sending message back to the server you need to configure the Outgoing webhook in the channel.

How to I manage messages of chat application when the application is offline

We are developing application for chatting.But when I am sending messages and if internet connectivity is gone how will I be able to send the messages like what's app do?
You have to use a message broker software like RabbitMQ (https://www.rabbitmq.com) to handle these kind of situations.
Off course, you can't really send messages offline, so what applications do is:
buffering/storing "sent" messages if there is no network available
check/await for network connection to be reestablished
Actually send messages when application reconnects
For achieving this, if you're looking mainly on chat, you can use some library/package/software (as for example RabbitMQ mentioned on #Badis Merabet answer).
If there is no prebuilt solution available for your use case or you want to develop you own solution, you may use PWAs. Here are some links:
General information on PWAs
Angular PWA docs
You may also check this answer for more information. The last link have a cookbook on an approach to implement it.

How to secure messaging system like RabbitMQ/MQTT for use in a mobile application?

Let's say I want to write a mobile chat application (just as an example).
How to receive only the messages meant for one client and don't let other clients receive messages which where not meant for them!?
Create a temp queue only known to the client? - Secure enough?
Encrypting the message with clients public key? - Own PKI needed!
Restrict access to queues based on some credentials the client sends with every request? - Every request needs to be authenticated!
...?
If a client sends a message to the outgoing queue, how to prevent other clients from reading the message directly out of the queue!?
Restricting access to write-only? - Don't know if this is possible...
Encrypting the message? - Own PKI needed!
...?
I hope my question/problem is clear and I'm really looking forward to hear your ideas and best practices!
Thanks in advance!
//edit: So using a temp queue for every client with encrypted messages might be a good choice. Or do you have any other ideas???
If you use RabbitMQ AMQP broker, then you can use Validated User-ID extension power, but you have to create separate users for each client.
Using per-client queue maybe a good choice, but you have to realize that it "security through obscurity" and it smells. But as you suggested, message encryption may fix that.
You can play with Access Control but you may find better to have some server application to handle complex user management things and use it api from clients for better user policies management.

Enumerating clients of a 389/Fedora Directory server

I have a Fedora Directory server that I need to shut down. In order to do so, I need to find a list of all clients currently authenticating to this server. Not being familiar with Fedora/389 Directory, I was wondering if there's an easy way to do that? My best option at this point seems to be to comb through the log files.
An LDAP-compliant server should send the unsolicited notification to clients about events transpiring between the client and server. The notification contains information that the client can use to take an action. Therefore, properly coded clients should not care about the server being shutdown. Clients that do not support the unsolicited notification should have that support added.
see also
LDAP: Programming Practices

IIS SMTP Message Inspection

Is there a way to peek or see a message before it hits the SMTP on IIS. This is not an Exchange Server, it's just running SMTP. I am trying to see if I can look at the message and then pass it to SMTP?
Thanks
Edit ~ Instead of adding another listner, I am wondering if there is a way to bind to the default SMTP listner and intercept the message then pass it on.
2nd Edit~ Ok, here is my problem. I have a spam filter in front of my exchange box, unfortunately (due to software design) the filter is limited when it comes to "Directory Harvesting Loookup". This is the process where the email addresses are checked if they exists in AD and the mail is dropped if they don't. My current filter drops the mail if one of the addresses does not exists in AD which is not good. I spoke with the vendor and there is nothing they can do at this time. I am looking put an app in front of this filter which would intercept (open, read, parse) the mail, validate the addresses, and then pass on the email to the filter for additional scanning. I'll then trun off this feature in their software. Don't get me wrong, their filter works great with this one exception which I must fix since I have tons of emails send to nonexistent users in my domain.
You can write your own Proxy SMTP service that you connect to to send messages. You can forward all messages directly to your actual SMTP service and pass all responses back. Then you can evesdrop on all these messages and deal with them accordingly.
Might be a bit overkill for what you're after but it's fairly simple to code as you dont need to know anything about the protocol as all you're being is a proxy.
If you're using .NET 2.0 then you can log SMTP sessions to a file:
How do I create a log file of the SMTP session? (System.Net.Mail)
Updated:
Take a look at this question:
Testing SMTP with .net (Stack Overflow)
From your edit:
"I am wondering if there is a way to bind to the default SMTP listener and intercept the message then pass it on?"
...and from your comment below:
"I am looking to inspect the actual message before the SMTP gets it."
I'm not sure if you fully understand the SMTP protocol. SMTP messages aren't just monolithic fire-and-forget entities. SMTP is session based and there is a conversation between client and server, of which, the message is just a part. The tracing method (linked to above) will record the entire exchange between client and server and does intercept the whole message before passing it on. The alternative, a proxy or mock server, will still require your application to engage in the SMTP client/server exchange. The closest solution to your requirement would be to use something like Papercut which is linked to in the answer above.
Kev
In .Net you can tell the SmtpClient to send email to a different folder than the SMTP service is monitoring. That way you could check each message, then move it to the real pickup folder. (See SmtpClient.PickupDirectory)
IIRC, you can still write up event sinks for the IIS SMTP service (even though it's not full blown exchange). It's been many years since I've done this, but you may want to google for "exchange event sink" to see if that helps.
Seems like a something like Ethereal will let you accomplish the sniffing portion of your request. Its not clear to me what you mean by "intercept" and "pass on". Do you want to filter some traffic or just delay traffic long enough for you to inspect before you pass it on, or both?

Resources